[PATCH] macb: restore wrap bit when performing underrun cleanup

Subsystems: networking drivers, the rest

STALE5548d

3 messages, 3 authors, 2011-08-04 · open the first message on its own page

[PATCH] macb: restore wrap bit when performing underrun cleanup

From: Tord Andersson <hidden>
Date: 2011-08-04 08:34:52

When TX underrun occurs, a cleanup is performed that marks all buffers as used. As a side effect it also clears the wrap bit in the last buffer. This patch will restore the wrap bit.

Signed-off-by: Tord Andersson <redacted>
---
 drivers/net/macb.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 0fcdc25..dc4e305 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -322,6 +322,9 @@ static void macb_tx(struct macb *bp)
 		for (i = 0; i < TX_RING_SIZE; i++)
 			bp->tx_ring[i].ctrl = MACB_BIT(TX_USED);
 
+		/* Add wrap bit */
+		bp->tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP);
+
 		/* free transmit buffer in upper layer*/
 		for (tail = bp->tx_tail; tail != head; tail = NEXT_TX(tail)) {
 			struct ring_info *rp = &bp->tx_skb[tail];
-- 
1.5.4.3

Re: [PATCH] macb: restore wrap bit when performing underrun cleanup

From: David Miller <davem@davemloft.net>
Date: 2011-08-04 08:44:08

From: Tord Andersson <redacted>
Date: Thu,  4 Aug 2011 10:11:47 +0200
When TX underrun occurs, a cleanup is performed that marks all buffers as used. As a side effect it also clears the wrap bit in the last buffer. This patch will restore the wrap bit.

Signed-off-by: Tord Andersson <redacted>
Applied.

Re: [PATCH] macb: restore wrap bit when performing underrun cleanup

From: Nicolas Ferre <hidden>
Date: 2011-08-04 08:59:07

On 08/04/2011 09:11 AM, Tord Andersson wrote:
When TX underrun occurs, a cleanup is performed that marks all buffers as used. As a side effect it also clears the wrap bit in the last buffer. This patch will restore the wrap bit.

Signed-off-by: Tord Andersson<redacted>
Thanks for fixing this.

Acked-by: Nicolas Ferre <redacted>
quoted hunk
---
  drivers/net/macb.c |    3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 0fcdc25..dc4e305 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -322,6 +322,9 @@ static void macb_tx(struct macb *bp)
  		for (i = 0; i<  TX_RING_SIZE; i++)
  			bp->tx_ring[i].ctrl = MACB_BIT(TX_USED);

+		/* Add wrap bit */
+		bp->tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP);
+
  		/* free transmit buffer in upper layer*/
  		for (tail = bp->tx_tail; tail != head; tail = NEXT_TX(tail)) {
  			struct ring_info *rp =&bp->tx_skb[tail];

-- 
Nicolas Ferre
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help