Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194769
b: refs/heads/master
c: 50849d7
h: refs/heads/master
i:
  194767: 8018f66
v: v3
  • Loading branch information
Tom Herbert authored and David S. Miller committed May 6, 2010
1 parent cde0289 commit 2a1040f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9ed318d546a29d7a591dbe648fd1a2efe3be1180
refs/heads/master: 50849d792b97c546c45a6652a16ba9be7d635c69
57 changes: 23 additions & 34 deletions trunk/drivers/net/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,26 +548,23 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
rx_desc = E1000_RX_DESC(*rx_ring, i);
rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);

if (unlikely(!(i & (E1000_RX_BUFFER_WRITE - 1)))) {
/*
* Force memory writes to complete before letting h/w
* know there are new descriptors to fetch. (Only
* applicable for weak-ordered memory model archs,
* such as IA-64).
*/
wmb();
writel(i, adapter->hw.hw_addr + rx_ring->tail);
}
i++;
if (i == rx_ring->count)
i = 0;
buffer_info = &rx_ring->buffer_info[i];
}

if (rx_ring->next_to_use != i) {
rx_ring->next_to_use = i;
if (i-- == 0)
i = (rx_ring->count - 1);

/*
* Force memory writes to complete before letting h/w
* know there are new descriptors to fetch. (Only
* applicable for weak-ordered memory model archs,
* such as IA-64).
*/
wmb();
writel(i, adapter->hw.hw_addr + rx_ring->tail);
}
rx_ring->next_to_use = i;
}

/**
Expand Down Expand Up @@ -649,33 +646,25 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,

rx_desc->read.buffer_addr[0] = cpu_to_le64(buffer_info->dma);

if (unlikely(!(i & (E1000_RX_BUFFER_WRITE - 1)))) {
/*
* Force memory writes to complete before letting h/w
* know there are new descriptors to fetch. (Only
* applicable for weak-ordered memory model archs,
* such as IA-64).
*/
wmb();
writel(i<<1, adapter->hw.hw_addr + rx_ring->tail);
}

i++;
if (i == rx_ring->count)
i = 0;
buffer_info = &rx_ring->buffer_info[i];
}

no_buffers:
if (rx_ring->next_to_use != i) {
rx_ring->next_to_use = i;

if (!(i--))
i = (rx_ring->count - 1);

/*
* Force memory writes to complete before letting h/w
* know there are new descriptors to fetch. (Only
* applicable for weak-ordered memory model archs,
* such as IA-64).
*/
wmb();
/*
* Hardware increments by 16 bytes, but packet split
* descriptors are 32 bytes...so we increment tail
* twice as much.
*/
writel(i<<1, adapter->hw.hw_addr + rx_ring->tail);
}
rx_ring->next_to_use = i;
}

/**
Expand Down

0 comments on commit 2a1040f

Please sign in to comment.