Skip to contentSkip to conversation

net: smsc911x: fix RX FIFO fastforwarding when dropping packets

PATCH Applied Will Deacon 3 participants 11 messages Apr 12, 2012 – Apr 13, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: smsc911x: fix RX FIFO fastforwarding when dropping packets

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 <[email protected]>
---
 drivers/net/ethernet/smsc/smsc911x.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/smsc/smsc911x.c +2 -2
index 4a69710..b5599bc 100644
@@ -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;
 		}
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 29 lines · Will Deacon

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 <[email protected]>
---
 drivers/net/ethernet/smsc/smsc911x.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/smsc/smsc911x.c +1 -1
index 4a69710..b5599bc 100644
@@ -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;
 		}

drivers/net/ethernet/smsc/smsc911x.c static int smsc911x_poll(struct napi_struct *napi, int budget) · line 1244

Quoted 8 lines
drivers/net/ethernet/smsc/smsc911x.c +1 -1
@@ -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;
 		}

Hum, looking at this driver, I see wrong code in lines 1246/1247

skb->data = skb->head;
skb_reset_tail_pointer(skb);

I suspect its hiding a buffer overflow bug or something.

netdev_alloc_skb() reserved NET_SKB_PAD bytes. A driver should not un-reserve this headroom, or some networking setups can be very slow.

So

pdata->ops->rx_readfifo(pdata,

	(unsigned int *)skb->head, pktwords);

also should be fixed to use skb->data instead.

#2 lore raw

Hi Eric,

Thanks for taking a look.

Quoted 14 lines · Eric Dumazet
Quoted 13 lines · Will Deacon
drivers/net/ethernet/smsc/smsc911x.c +1 -1
index 4a69710..b5599bc 100644
@@ -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;
 		}

[...]

Quoted 6 lines

Hum, looking at this driver, I see wrong code in lines 1246/1247

skb->data = skb->head;
skb_reset_tail_pointer(skb);

I suspect its hiding a buffer overflow bug or something.

Yes, you're right.

Quoted 9 lines

netdev_alloc_skb() reserved NET_SKB_PAD bytes. A driver should not un-reserve this headroom, or some networking setups can be very slow.

So

pdata->ops->rx_readfifo(pdata,

	(unsigned int *)skb->head, pktwords);

also should be fixed to use skb->data instead.

Right, this seems to do the trick (and can replace my original patch by actually passing in the number of words to the fastforward function). I'm not sure whether the skb_trim is really required, but it makes the data format slightly clearer.

It would be nice to get some input from Steve, but his email address seems to be bouncing at the moment.

Will

drivers/net/ethernet/smsc/smsc911x.c +9 -13
index 4a69710..3f43c24 100644
@@ -1166,10 +1166,8 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat)
 
 /* Quickly dumps bad packets */
 static void
-smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes)
+smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktwords)
 {
-       unsigned int pktwords = (pktbytes + NET_IP_ALIGN + 3) >> 2;
-
        if (likely(pktwords >= 4)) {
                unsigned int timeout = 500;
                unsigned int val;
@@ -1233,7 +1231,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
                        continue;
                }
 
-               skb = netdev_alloc_skb(dev, pktlength + NET_IP_ALIGN);
+               skb = netdev_alloc_skb(dev, pktwords << 2);
                if (unlikely(!skb)) {
                        SMSC_WARN(pdata, rx_err,
                                  "Unable to allocate skb for rx packet");
@@ -1243,21 +1241,19 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
                        break;
                }
 
-               skb->data = skb->head;
-               skb_reset_tail_pointer(skb);
-
-               /* Align IP on 16B boundary */
-               skb_reserve(skb, NET_IP_ALIGN);
-               skb_put(skb, pktlength - 4);
+               skb_put(skb, pktwords << 2);
                pdata->ops->rx_readfifo(pdata,
-                                (unsigned int *)skb->head, pktwords);
+                                (unsigned int *)skb->data, pktwords);
+               skb_pull(skb, NET_IP_ALIGN);
+               skb_trim(skb, pktlength);
+
                skb->protocol = eth_type_trans(skb, dev);
                skb_checksum_none_assert(skb);
                netif_receive_skb(skb);
 
                /* Update counters */
                dev->stats.rx_packets++;
-               dev->stats.rx_bytes += (pktlength - 4);
+               dev->stats.rx_bytes += pktlength;
        }
 
        /* Return total received packets */
@@ -1565,7 +1561,7 @@ static int smsc911x_open(struct net_device *dev)
        smsc911x_reg_write(pdata, FIFO_INT, temp);
 
        /* set RX Data offset to 2 bytes for alignment */
-       smsc911x_reg_write(pdata, RX_CFG, (2 << 8));
+       smsc911x_reg_write(pdata, RX_CFG, (NET_IP_ALIGN << 8));
 
        /* enable NAPI polling before enabling RX interrupts */
        napi_enable(&pdata->napi);
#3 lore raw
Quoted 78 lines · Will Deacon

Hi Eric,

Thanks for taking a look.

Quoted 14 lines · Eric Dumazet
Quoted 13 lines · Will Deacon
drivers/net/ethernet/smsc/smsc911x.c +1 -1
index 4a69710..b5599bc 100644
@@ -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;
 		}

[...]

Quoted 6 lines

Hum, looking at this driver, I see wrong code in lines 1246/1247

skb->data = skb->head;
skb_reset_tail_pointer(skb);

I suspect its hiding a buffer overflow bug or something.

Yes, you're right.

Quoted 9 lines

netdev_alloc_skb() reserved NET_SKB_PAD bytes. A driver should not un-reserve this headroom, or some networking setups can be very slow.

So

pdata->ops->rx_readfifo(pdata,

	(unsigned int *)skb->head, pktwords);

also should be fixed to use skb->data instead.

Right, this seems to do the trick (and can replace my original patch by actually passing in the number of words to the fastforward function). I'm not sure whether the skb_trim is really required, but it makes the data format slightly clearer.

It would be nice to get some input from Steve, but his email address seems to be bouncing at the moment.

Will

drivers/net/ethernet/smsc/smsc911x.c +2 -4
index 4a69710..3f43c24 100644
@@ -1166,10 +1166,8 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat)
 
 /* Quickly dumps bad packets */
 static void
-smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes)
+smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktwords)
 {
-       unsigned int pktwords = (pktbytes + NET_IP_ALIGN + 3) >> 2;
-
        if (likely(pktwords >= 4)) {
                unsigned int timeout = 500;
                unsigned int val;
@@ -1233,7 +1231,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
                        continue;
                }
 
-               skb = netdev_alloc_skb(dev, pktlength + NET_IP_ALIGN);
+               skb = netdev_alloc_skb(dev, pktwords << 2);
                if (unlikely(!skb)) {
                        SMSC_WARN(pdata, rx_err,
                                  "Unable to allocate skb for rx packet");

drivers/net/ethernet/smsc/smsc911x.c static int smsc911x_poll(struct napi_struct *napi, int budget) · line 1244

Quoted 10 lines
drivers/net/ethernet/smsc/smsc911x.c +1 -6
@@ -1243,21 +1241,19 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
                        break;
                }
 
-               skb->data = skb->head;
-               skb_reset_tail_pointer(skb);
-
-               /* Align IP on 16B boundary */
-               skb_reserve(skb, NET_IP_ALIGN);
-               skb_put(skb, pktlength - 4);
+               skb_put(skb, pktwords << 2);

You could remove this line and do it after skb_reserve() ?

drivers/net/ethernet/smsc/smsc911x.c static int smsc911x_poll(struct napi_struct *napi, int budget) · line 1247

Quoted 4 lines
drivers/net/ethernet/smsc/smsc911x.c +2 -1
                pdata->ops->rx_readfifo(pdata,
-                                (unsigned int *)skb->head, pktwords);
+                                (unsigned int *)skb->data, pktwords);
+               skb_pull(skb, NET_IP_ALIGN);
		skb_reserve(skb, NET_IP_ALIGN);
		skb_put(skb, pktlength - 4);

drivers/net/ethernet/smsc/smsc911x.c static int smsc911x_poll(struct napi_struct *napi, int budget) · line 1248

Quoted 1 line
drivers/net/ethernet/smsc/smsc911x.c +1 -0
+               skb_trim(skb, pktlength);

and remove this skb_trim()

drivers/net/ethernet/smsc/smsc911x.c static int smsc911x_poll(struct napi_struct *napi, int budget) · line 1256

Quoted 9 lines
drivers/net/ethernet/smsc/smsc911x.c +2 -1
+
                skb->protocol = eth_type_trans(skb, dev);
                skb_checksum_none_assert(skb);
                netif_receive_skb(skb);
 
                /* Update counters */
                dev->stats.rx_packets++;
-               dev->stats.rx_bytes += (pktlength - 4);
+               dev->stats.rx_bytes += pktlength;

Some drivers account for the FCS, some dont, I guess you can leave the
line as is

drivers/net/ethernet/smsc/smsc911x.c static int smsc911x_open(struct net_device *dev) · line 1564

Quoted 9 lines
drivers/net/ethernet/smsc/smsc911x.c +1 -1
        }
 
        /* Return total received packets */
@@ -1565,7 +1561,7 @@ static int smsc911x_open(struct net_device *dev)
        smsc911x_reg_write(pdata, FIFO_INT, temp);
 
        /* set RX Data offset to 2 bytes for alignment */
-       smsc911x_reg_write(pdata, RX_CFG, (2 << 8));
+       smsc911x_reg_write(pdata, RX_CFG, (NET_IP_ALIGN << 8));
	Good ;)

drivers/net/ethernet/smsc/smsc911x.c static int smsc911x_open(struct net_device *dev)

Quoted 4 lines
drivers/net/ethernet/smsc/smsc911x.c +0 -0
        /* enable NAPI polling before enabling RX interrupts */
        napi_enable(&pdata->napi);
 

Thanks

#4 lore raw
Quoted 6 lines · Eric Dumazet
Quoted 5 lines · Will Deacon
drivers/net/ethernet/smsc/smsc911x.c +0 -0
index 4a69710..3f43c24 100644
@@ -1166,10 +1166,8 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat)

[...]

Quoted 8 lines

drivers/net/ethernet/smsc/smsc911x.c static int smsc911x_poll(struct napi_struct *napi, int budget) · line 1244

Quoted 7 lines
drivers/net/ethernet/smsc/smsc911x.c +1 -6
-               skb->data = skb->head;
-               skb_reset_tail_pointer(skb);
-
-               /* Align IP on 16B boundary */
-               skb_reserve(skb, NET_IP_ALIGN);
-               skb_put(skb, pktlength - 4);
+               skb_put(skb, pktwords << 2);
Quoted 8 lines

You could remove this line and do it after skb_reserve() ?

drivers/net/ethernet/smsc/smsc911x.c static int smsc911x_poll(struct napi_struct *napi, int budget) · line 1247

Quoted 4 lines
                pdata->ops->rx_readfifo(pdata,
drivers/net/ethernet/smsc/smsc911x.c +2 -1
-                                (unsigned int *)skb->head, pktwords);
+                                (unsigned int *)skb->data, pktwords);
+               skb_pull(skb, NET_IP_ALIGN);
		skb_reserve(skb, NET_IP_ALIGN);

I don't think we want an skb_reserve at all, since the hardware shifts the data in the RX FIFO, meaning that we will read two bytes of 0 anyway before valid data.

Quoted 1 line
		skb_put(skb, pktlength - 4);

I can move the put here if you like, but we need to use pktwords << 2 to make sure that we read the leading and trailing zeroes inserted by the hardware.

Quoted 3 lines
Quoted 1 line

+ skb_trim(skb, pktlength);

and remove this skb_trim()

Can do, just thought it might help illustrate that we might have some padding at the end.

Quoted 7 lines

drivers/net/ethernet/smsc/smsc911x.c static int smsc911x_poll(struct napi_struct *napi, int budget) · line 1256

Quoted 4 lines
                /* Update counters */
                dev->stats.rx_packets++;
drivers/net/ethernet/smsc/smsc911x.c +1 -1
-               dev->stats.rx_bytes += (pktlength - 4);
+               dev->stats.rx_bytes += pktlength;

Some drivers account for the FCS, some dont, I guess you can leave the
line as is

Sure.

Thanks for the comments,

Will

#5 lore raw
Quoted 10 lines · Will Deacon

I don't think we want an skb_reserve at all, since the hardware shifts the data in the RX FIFO, meaning that we will read two bytes of 0 anyway before valid data.

Quoted 1 line
		skb_put(skb, pktlength - 4);

I can move the put here if you like, but we need to use pktwords << 2 to make sure that we read the leading and trailing zeroes inserted by the hardware.

before calling linux stack, you'll have to skip those 2 bytes.

This is skb_reserve() purpose.

#6 lore raw
Quoted 9 lines · Eric Dumazet
Quoted 7 lines · Will Deacon

I don't think we want an skb_reserve at all, since the hardware shifts the data in the RX FIFO, meaning that we will read two bytes of 0 anyway before valid data.

Quoted 1 line
		skb_put(skb, pktlength - 4);
Quoted 7 lines
Quoted 3 lines

I can move the put here if you like, but we need to use pktwords << 2 to make sure that we read the leading and trailing zeroes inserted by the hardware.

before calling linux stack, you'll have to skip those 2 bytes.

This is skb_reserve() purpose.

Gotcha, so I can lose the pull too. Here's an updated patch with log, thanks for the help.

Will

Author: Will Deacon <[email protected]>
Date:   Thu Apr 12 13:54:17 2012 +0100

net: smsc911x: fix skb handling in receive path

The SMSC911x driver resets the ->head, ->data and ->tail pointers in the skb on the reset path in order to avoid buffer overflow due to packet padding performed by the hardware.

This patch fixes the receive path so that the skb pointers are fixed up after the data has been read from the device, The error path is also fixed to use number of words consistently and prevent erroneous FIFO fastforwarding when skipping over bad data.

drivers/net/ethernet/smsc/smsc911x.c +5 -9
index 4a69710..5aa2dbe 100644
@@ -1166,10 +1166,8 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat)
 
 /* Quickly dumps bad packets */
 static void
-smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes)
+smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktwords)
 {
-	unsigned int pktwords = (pktbytes + NET_IP_ALIGN + 3) >> 2;
-
 	if (likely(pktwords >= 4)) {
 		unsigned int timeout = 500;
 		unsigned int val;
@@ -1233,7 +1231,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
 			continue;
 		}
 
-		skb = netdev_alloc_skb(dev, pktlength + NET_IP_ALIGN);
+		skb = netdev_alloc_skb(dev, pktwords << 2);
 		if (unlikely(!skb)) {
 			SMSC_WARN(pdata, rx_err,
 				  "Unable to allocate skb for rx packet");
@@ -1243,14 +1241,12 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
 			break;
 		}
 
-		skb->data = skb->head;
-		skb_reset_tail_pointer(skb);
+		pdata->ops->rx_readfifo(pdata,
+				 (unsigned int *)skb->data, pktwords);
 
 		/* Align IP on 16B boundary */
 		skb_reserve(skb, NET_IP_ALIGN);
 		skb_put(skb, pktlength - 4);
-		pdata->ops->rx_readfifo(pdata,
-				 (unsigned int *)skb->head, pktwords);
 		skb->protocol = eth_type_trans(skb, dev);
 		skb_checksum_none_assert(skb);
 		netif_receive_skb(skb);
@@ -1565,7 +1561,7 @@ static int smsc911x_open(struct net_device *dev)
 	smsc911x_reg_write(pdata, FIFO_INT, temp);
 
 	/* set RX Data offset to 2 bytes for alignment */
-	smsc911x_reg_write(pdata, RX_CFG, (2 << 8));
+	smsc911x_reg_write(pdata, RX_CFG, (NET_IP_ALIGN << 8));
 
 	/* enable NAPI polling before enabling RX interrupts */
 	napi_enable(&pdata->napi);
#7 lore raw
Quoted 65 lines · Will Deacon

Gotcha, so I can lose the pull too. Here's an updated patch with log, thanks for the help.

Will

Author: Will Deacon <[email protected]>
Date:   Thu Apr 12 13:54:17 2012 +0100

net: smsc911x: fix skb handling in receive path

The SMSC911x driver resets the ->head, ->data and ->tail pointers in the skb on the reset path in order to avoid buffer overflow due to packet padding performed by the hardware.

This patch fixes the receive path so that the skb pointers are fixed up after the data has been read from the device, The error path is also fixed to use number of words consistently and prevent erroneous FIFO fastforwarding when skipping over bad data.

drivers/net/ethernet/smsc/smsc911x.c +4 -8
index 4a69710..5aa2dbe 100644
@@ -1166,10 +1166,8 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat)
 
 /* Quickly dumps bad packets */
 static void
-smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes)
+smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktwords)
 {
-	unsigned int pktwords = (pktbytes + NET_IP_ALIGN + 3) >> 2;
-
 	if (likely(pktwords >= 4)) {
 		unsigned int timeout = 500;
 		unsigned int val;
@@ -1233,7 +1231,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
 			continue;
 		}
 
-		skb = netdev_alloc_skb(dev, pktlength + NET_IP_ALIGN);
+		skb = netdev_alloc_skb(dev, pktwords << 2);
 		if (unlikely(!skb)) {
 			SMSC_WARN(pdata, rx_err,
 				  "Unable to allocate skb for rx packet");
@@ -1243,14 +1241,12 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
 			break;
 		}
 
-		skb->data = skb->head;
-		skb_reset_tail_pointer(skb);
+		pdata->ops->rx_readfifo(pdata,
+				 (unsigned int *)skb->data, pktwords);
 
 		/* Align IP on 16B boundary */
 		skb_reserve(skb, NET_IP_ALIGN);
 		skb_put(skb, pktlength - 4);
-		pdata->ops->rx_readfifo(pdata,
-				 (unsigned int *)skb->head, pktwords);
 		skb->protocol = eth_type_trans(skb, dev);
 		skb_checksum_none_assert(skb);
 		netif_receive_skb(skb);

drivers/net/ethernet/smsc/smsc911x.c static int smsc911x_open(struct net_device *dev) · line 1567

Quoted 8 lines
drivers/net/ethernet/smsc/smsc911x.c +1 -1
@@ -1565,7 +1561,7 @@ static int smsc911x_open(struct net_device *dev)
 	smsc911x_reg_write(pdata, FIFO_INT, temp);
 
 	/* set RX Data offset to 2 bytes for alignment */
-	smsc911x_reg_write(pdata, RX_CFG, (2 << 8));
+	smsc911x_reg_write(pdata, RX_CFG, (NET_IP_ALIGN << 8));
 
 	/* enable NAPI polling before enabling RX interrupts */
 	napi_enable(&pdata->napi);

Seems fine to me

#8 lore raw
Quoted 13 lines · Eric Dumazet
Quoted 12 lines · Will Deacon

net: smsc911x: fix skb handling in receive path

The SMSC911x driver resets the ->head, ->data and ->tail pointers in the skb on the reset path in order to avoid buffer overflow due to packet padding performed by the hardware.

This patch fixes the receive path so that the skb pointers are fixed up after the data has been read from the device, The error path is also fixed to use number of words consistently and prevent erroneous FIFO fastforwarding when skipping over bad data.

[...]

Quoted 3 lines

Seems fine to me

Thanks, Eric. Given that Steve's email doesn't appear to be working, can somebody else pick this up please?

Cheers,

Will

#9 lore raw
Quoted 4 lines · Will Deacon
Quoted 1 line

Thanks, Eric. Given that Steve's email doesn't appear to be working, can somebody else pick this up please?

It seems trivial enough, you tested it, and I reviewed it.

I believe David can apply it safely.

Thanks

maintainer Applied
#10 lore raw
In reply to Will Deacon

From: Will Deacon <[email protected]>
Date: Thu, 12 Apr 2012 18:03:50 +0100

Quoted 15 lines · Eric Dumazet
Quoted 7 lines · Will Deacon
Quoted 6 lines

net: smsc911x: fix skb handling in receive path

The SMSC911x driver resets the ->head, ->data and ->tail pointers in the skb on the reset path in order to avoid buffer overflow due to packet padding performed by the hardware.

Quoted 6 lines
Quoted 6 lines

This patch fixes the receive path so that the skb pointers are fixed up after the data has been read from the device, The error path is also fixed to use number of words consistently and prevent erroneous FIFO fastforwarding when skipping over bad data.

Quoted 8 lines

[...]

Quoted 3 lines

Seems fine to me

Thanks, Eric. Given that Steve's email doesn't appear to be working, can somebody else pick this up please?

Applied, thanks.