All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: smsc911x: fix RX FIFO fastforwarding when dropping packets
@ 2012-04-12  9:07 Will Deacon
  2012-04-12  9:20 ` Eric Dumazet
  0 siblings, 1 reply; 11+ messages in thread
From: Will Deacon @ 2012-04-12  9:07 UTC (permalink / raw)
  To: netdev; +Cc: Will Deacon, Steve Glendinning

The SMSC911x ethernet controller provides a mechanism for quickly
skipping to the start of the next frame in the receive FIFO, however
the current code passes the number of words to a function that expects
the number of bytes. This can corrupt the FIFO head in the case that
the fastforward mechanism is not used.

This patch fixes the callers of smsc911x_rx_fastforward to pass the
correct data size.

Cc: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 drivers/net/ethernet/smsc/smsc911x.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 4a69710..b5599bc 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -1228,7 +1228,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
 				  "Discarding packet with error bit set");
 			/* Packet has an error, discard it and continue with
 			 * the next */
-			smsc911x_rx_fastforward(pdata, pktwords);
+			smsc911x_rx_fastforward(pdata, pktlength);
 			dev->stats.rx_dropped++;
 			continue;
 		}
@@ -1238,7 +1238,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
 			SMSC_WARN(pdata, rx_err,
 				  "Unable to allocate skb for rx packet");
 			/* Drop the packet and stop this polling iteration */
-			smsc911x_rx_fastforward(pdata, pktwords);
+			smsc911x_rx_fastforward(pdata, pktlength);
 			dev->stats.rx_dropped++;
 			break;
 		}
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-04-13 18:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12  9:07 [PATCH] net: smsc911x: fix RX FIFO fastforwarding when dropping packets Will Deacon
2012-04-12  9:20 ` Eric Dumazet
2012-04-12 12:53   ` Will Deacon
2012-04-12 13:06     ` Eric Dumazet
2012-04-12 13:47       ` Will Deacon
2012-04-12 14:01         ` Eric Dumazet
2012-04-12 15:54           ` Will Deacon
2012-04-12 16:08             ` Eric Dumazet
2012-04-12 17:03               ` Will Deacon
2012-04-12 17:41                 ` Eric Dumazet
2012-04-13 18:08                 ` David Miller

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.