* [PATCH] macb: restore wrap bit when performing underrun cleanup
@ 2011-08-04 8:11 Tord Andersson
2011-08-04 8:43 ` David Miller
2011-08-04 8:58 ` Nicolas Ferre
0 siblings, 2 replies; 3+ messages in thread
From: Tord Andersson @ 2011-08-04 8:11 UTC (permalink / raw)
To: nicolas.ferre; +Cc: netdev, linux-kernel, Tord Andersson
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 <tord.andersson@endian.se>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] macb: restore wrap bit when performing underrun cleanup
2011-08-04 8:11 [PATCH] macb: restore wrap bit when performing underrun cleanup Tord Andersson
@ 2011-08-04 8:43 ` David Miller
2011-08-04 8:58 ` Nicolas Ferre
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2011-08-04 8:43 UTC (permalink / raw)
To: tord.andersson; +Cc: nicolas.ferre, netdev, linux-kernel
From: Tord Andersson <tord.andersson@endian.se>
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 <tord.andersson@endian.se>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] macb: restore wrap bit when performing underrun cleanup
2011-08-04 8:11 [PATCH] macb: restore wrap bit when performing underrun cleanup Tord Andersson
2011-08-04 8:43 ` David Miller
@ 2011-08-04 8:58 ` Nicolas Ferre
1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Ferre @ 2011-08-04 8:58 UTC (permalink / raw)
To: Tord Andersson, netdev; +Cc: linux-kernel
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<tord.andersson@endian.se>
Thanks for fixing this.
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-08-04 8:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-04 8:11 [PATCH] macb: restore wrap bit when performing underrun cleanup Tord Andersson
2011-08-04 8:43 ` David Miller
2011-08-04 8:58 ` Nicolas Ferre
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.