Skip to contentSkip to conversation

korina: adjust headroom for new skb's also

PATCH Applied Phil Sutter 3 participants 9 messages Jan 15, 2009 – Jan 20, 2009 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH 1/1 korina: set dev field of allocated socketbufs

I'm not sure if this is necessary, but the original driver did it and apparently also many other drivers do it, so it should not be completely wrong to do it.

---
 drivers/net/korina.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/korina.c +2 -0
index 75010ca..56b4db2 100644
@@ -419,6 +419,7 @@ static int korina_rx(struct net_device *dev, int limit)
 			/* 16 bit align */
 			skb_reserve(skb_new, 2);
 
+			skb_new->dev = dev;
 			lp->rx_skb[lp->rx_next_done] = skb_new;
 		}
 
@@ -763,6 +764,7 @@ static void korina_alloc_ring(struct net_device *dev)
 		if (!skb)
 			break;
 		skb_reserve(skb, 2);
+		skb->dev = dev;
 		lp->rx_skb[i] = skb;
 		lp->rd_ring[i].control = DMA_DESC_IOD |
 				DMA_COUNT(KORINA_RBSIZE);
Signature · 1 line
1.5.6.4
Acked-by on v1 1/1
#4 lore raw

Re: [PATCH] korina: set dev field of allocated socketbufs

Le Thursday 15 January 2009 23:29:58 Phil Sutter, vous avez écrit :

Quoted 5 lines

I'm not sure if this is necessary, but the original driver did it and apparently also many other drivers do it, so it should not be completely wrong to do it.

Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------
maintainer
#5 lore raw

Re: [PATCH] korina: set dev field of allocated socketbufs

From: Florian Fainelli <[email protected]>
Date: Mon, 19 Jan 2009 22:08:00 +0100

Quoted 8 lines

Le Thursday 15 January 2009 23:29:58 Phil Sutter, vous avez écrit :

Quoted 5 lines

I'm not sure if this is necessary, but the original driver did it and apparently also many other drivers do it, so it should not be completely wrong to do it.

The eth_type_trans() call does the 'skb->dev = dev;' assignment for you.

Not applied.

#6 lore raw

PATCH 1/1 korina: drop leftover assignment

In reply to a message not in the archive

As the assigned value is being overwritten shortly after, it can be dropped and so the whole variable definition moved to the start of the function.

---
 drivers/net/korina.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/korina.c +1 -2
index 60ae7bf..75010ca 100644
@@ -743,6 +743,7 @@ static struct ethtool_ops netdev_ethtool_ops = {
 static void korina_alloc_ring(struct net_device *dev)
 {
 	struct korina_private *lp = netdev_priv(dev);
+	struct sk_buff *skb;
 	int i;
 
 	/* Initialize the transmit descriptors */
@@ -758,8 +759,6 @@ static void korina_alloc_ring(struct net_device *dev)
 
 	/* Initialize the receive descriptors */
 	for (i = 0; i < KORINA_NUM_RDS; i++) {
-		struct sk_buff *skb = lp->rx_skb[i];
-
 		skb = dev_alloc_skb(KORINA_RBSIZE + 2);
 		if (!skb)
 			break;
Signature · 1 line
1.5.6.4
Acked-by on v1 1/1
#7 lore raw

Re: [PATCH] korina: drop leftover assignment

Le Thursday 15 January 2009 23:29:57 Phil Sutter, vous avez écrit :

Quoted 5 lines

As the assigned value is being overwritten shortly after, it can be dropped and so the whole variable definition moved to the start of the function.

Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------
maintainer Applied
#8 lore raw

Re: [PATCH] korina: drop leftover assignment

From: Florian Fainelli <[email protected]>
Date: Mon, 19 Jan 2009 22:07:01 +0100

Quoted 8 lines

Le Thursday 15 January 2009 23:29:57 Phil Sutter, vous avez écrit :

Quoted 5 lines

As the assigned value is being overwritten shortly after, it can be dropped and so the whole variable definition moved to the start of the function.

Applied.

#9 lore raw

PATCH 1/1 korina: adjust headroom for new skb's also

In reply to a message not in the archive

This is copy and paste from the original driver. As skb_reserve() is also called within korina_alloc_ring() when initially allocating the receive descriptors, the same should be done when allocating new space after passing an skb to upper layers.

---
 drivers/net/korina.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/korina.c +3 -0
index 67fbdf4..60ae7bf 100644
@@ -416,6 +416,9 @@ static int korina_rx(struct net_device *dev, int limit)
 			if (devcs & ETH_RX_MP)
 				dev->stats.multicast++;
 
+			/* 16 bit align */
+			skb_reserve(skb_new, 2);
+
 			lp->rx_skb[lp->rx_next_done] = skb_new;
 		}
 
Signature · 1 line
1.5.6.4
Acked-by on v1 1/1
#10 lore raw

Le Thursday 15 January 2009 23:29:56 Phil Sutter, vous avez écrit :

Quoted 6 lines

This is copy and paste from the original driver. As skb_reserve() is also called within korina_alloc_ring() when initially allocating the receive descriptors, the same should be done when allocating new space after passing an skb to upper layers.

Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------
maintainer Applied
#11 lore raw

From: Florian Fainelli <[email protected]>
Date: Mon, 19 Jan 2009 22:07:45 +0100

Quoted 9 lines

Le Thursday 15 January 2009 23:29:56 Phil Sutter, vous avez écrit :

Quoted 6 lines

This is copy and paste from the original driver. As skb_reserve() is also called within korina_alloc_ring() when initially allocating the receive descriptors, the same should be done when allocating new space after passing an skb to upper layers.

Applied.