[PATCH] net: lpc_eth: no need to reserve 8 extra bytes in rx skb

Subsystems: arm/lpc32xx soc support, networking drivers, the rest

STALE5242d

5 messages, 3 authors, 2012-04-04 · open the first message on its own page

[PATCH] net: lpc_eth: no need to reserve 8 extra bytes in rx skb

From: Eric Dumazet <hidden>
Date: 2012-04-03 22:02:18

Probably a leftover from ancient code...

Signed-off-by: Eric Dumazet <redacted>
Cc: Roland Stigge <redacted>
---
This was mentioned in one of my review but ignored/lost.

 drivers/net/ethernet/nxp/lpc_eth.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index 6dfc26d..d3469d8 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -990,10 +990,10 @@ static int __lpc_handle_recv(struct net_device *ndev, int budget)
 			ndev->stats.rx_errors++;
 		} else {
 			/* Packet is good */
-			skb = dev_alloc_skb(len + 8);
-			if (!skb)
+			skb = dev_alloc_skb(len);
+			if (!skb) {
 				ndev->stats.rx_dropped++;
-			else {
+			} else {
 				prdbuf = skb_put(skb, len);
 
 				/* Copy packet from buffer */

Re: [PATCH] net: lpc_eth: no need to reserve 8 extra bytes in rx skb

From: Roland Stigge <hidden>
Date: 2012-04-03 22:54:29

Hi Eric,

On 04/04/12 00:02, Eric Dumazet wrote:
Probably a leftover from ancient code...
...
quoted hunk
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -990,10 +990,10 @@ static int __lpc_handle_recv(struct net_device *ndev, int budget)
 			ndev->stats.rx_errors++;
 		} else {
 			/* Packet is good */
-			skb = dev_alloc_skb(len + 8);
-			if (!skb)
+			skb = dev_alloc_skb(len);
I remember this issue from the discussion, a note from Ben Hutchings
actually, where there was a further "skb_reserve(skb, 8);" in the "else"
case below. Looks like I only removed the skb_reserve().

Can't find this review from you - I hope there are no other issues left?
(Was I on CC?)
+			if (!skb) {
 				ndev->stats.rx_dropped++;
-			else {
+			} else {
Why add curly braces around a single statement?

Thanks,

Roland

Re: [PATCH] net: lpc_eth: no need to reserve 8 extra bytes in rx skb

From: David Miller <davem@davemloft.net>
Date: 2012-04-03 22:59:19

From: Roland Stigge <redacted>
Date: Wed, 04 Apr 2012 00:54:19 +0200
Why add curly braces around a single statement?
Because that's how we roll for else statements homie, see CodingStyle

Re: [PATCH] net: lpc_eth: no need to reserve 8 extra bytes in rx skb

From: Roland Stigge <hidden>
Date: 2012-04-03 23:42:19

On 04/04/12 00:58, David Miller wrote:
quoted
Why add curly braces around a single statement?
Because that's how we roll for else statements homie, see CodingStyle
Oops :-) sorry you two!

Thanks,

Roland

Re: [PATCH] net: lpc_eth: no need to reserve 8 extra bytes in rx skb

From: David Miller <davem@davemloft.net>
Date: 2012-04-04 22:10:12

From: Eric Dumazet <redacted>
Date: Wed, 04 Apr 2012 00:02:11 +0200
Probably a leftover from ancient code...

Signed-off-by: Eric Dumazet <redacted>
Cc: Roland Stigge <redacted>
Applied to net-next, thanks Eric.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help