netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] korina: adjust headroom for new skb's also
       [not found] <1232058598-15811-1-git-send-email-n0-1@freewrt.org>
@ 2009-01-15 22:29 ` Phil Sutter
  2009-01-19 21:07   ` Florian Fainelli
       [not found] ` <1232058598-15811-2-git-send-email-n0-1@freewrt.org>
  1 sibling, 1 reply; 9+ messages in thread
From: Phil Sutter @ 2009-01-15 22:29 UTC (permalink / raw)
  To: netdev; +Cc: davem, jeff, florian

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.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
---
 drivers/net/korina.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/korina.c b/drivers/net/korina.c
index 67fbdf4..60ae7bf 100644
--- a/drivers/net/korina.c
+++ b/drivers/net/korina.c
@@ -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;
 		}
 
-- 
1.5.6.4


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

* [PATCH] korina: drop leftover assignment
       [not found] ` <1232058598-15811-2-git-send-email-n0-1@freewrt.org>
@ 2009-01-15 22:29   ` Phil Sutter
  2009-01-19 21:07     ` Florian Fainelli
       [not found]   ` <1232058598-15811-3-git-send-email-n0-1@freewrt.org>
  1 sibling, 1 reply; 9+ messages in thread
From: Phil Sutter @ 2009-01-15 22:29 UTC (permalink / raw)
  To: netdev; +Cc: davem, jeff, florian

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.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
---
 drivers/net/korina.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/korina.c b/drivers/net/korina.c
index 60ae7bf..75010ca 100644
--- a/drivers/net/korina.c
+++ b/drivers/net/korina.c
@@ -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;
-- 
1.5.6.4


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

* [PATCH] korina: set dev field of allocated socketbufs
       [not found]   ` <1232058598-15811-3-git-send-email-n0-1@freewrt.org>
@ 2009-01-15 22:29     ` Phil Sutter
  2009-01-19 21:08       ` Florian Fainelli
  0 siblings, 1 reply; 9+ messages in thread
From: Phil Sutter @ 2009-01-15 22:29 UTC (permalink / raw)
  To: netdev; +Cc: davem, jeff, florian

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.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
---
 drivers/net/korina.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/korina.c b/drivers/net/korina.c
index 75010ca..56b4db2 100644
--- a/drivers/net/korina.c
+++ b/drivers/net/korina.c
@@ -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);
-- 
1.5.6.4


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

* Re: [PATCH] korina: drop leftover assignment
  2009-01-15 22:29   ` [PATCH] korina: drop leftover assignment Phil Sutter
@ 2009-01-19 21:07     ` Florian Fainelli
  2009-01-20  0:23       ` David Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Florian Fainelli @ 2009-01-19 21:07 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netdev, davem, jeff

Le Thursday 15 January 2009 23:29:57 Phil Sutter, vous avez écrit :
> 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.
>
> Signed-off-by: Phil Sutter <n0-1@freewrt.org>

Acked-by: Florian Fainelli <florian@openwrt.org>
-- 
Best regards, Florian Fainelli
Email : florian@openwrt.org
http://openwrt.org
-------------------------------

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

* Re: [PATCH] korina: adjust headroom for new skb's also
  2009-01-15 22:29 ` [PATCH] korina: adjust headroom for new skb's also Phil Sutter
@ 2009-01-19 21:07   ` Florian Fainelli
  2009-01-20  0:23     ` David Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Florian Fainelli @ 2009-01-19 21:07 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netdev, davem, jeff

Le Thursday 15 January 2009 23:29:56 Phil Sutter, vous avez écrit :
> 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.
>
> Signed-off-by: Phil Sutter <n0-1@freewrt.org>

Acked-by: Florian Fainelli <florian@openwrt.org>
-- 
Best regards, Florian Fainelli
Email : florian@openwrt.org
http://openwrt.org
-------------------------------

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

* Re: [PATCH] korina: set dev field of allocated socketbufs
  2009-01-15 22:29     ` [PATCH] korina: set dev field of allocated socketbufs Phil Sutter
@ 2009-01-19 21:08       ` Florian Fainelli
  2009-01-20  0:24         ` David Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Florian Fainelli @ 2009-01-19 21:08 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netdev, davem, jeff

Le Thursday 15 January 2009 23:29:58 Phil Sutter, vous avez écrit :
> 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.
>
> Signed-off-by: Phil Sutter <n0-1@freewrt.org>

Acked-by: Florian Fainelli <florian@openwrt.org>
-- 
Best regards, Florian Fainelli
Email : florian@openwrt.org
http://openwrt.org
-------------------------------

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

* Re: [PATCH] korina: drop leftover assignment
  2009-01-19 21:07     ` Florian Fainelli
@ 2009-01-20  0:23       ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2009-01-20  0:23 UTC (permalink / raw)
  To: florian; +Cc: n0-1, netdev, jeff

From: Florian Fainelli <florian@openwrt.org>
Date: Mon, 19 Jan 2009 22:07:01 +0100

> Le Thursday 15 January 2009 23:29:57 Phil Sutter, vous avez écrit :
> > 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.
> >
> > Signed-off-by: Phil Sutter <n0-1@freewrt.org>
> 
> Acked-by: Florian Fainelli <florian@openwrt.org>

Applied.

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

* Re: [PATCH] korina: adjust headroom for new skb's also
  2009-01-19 21:07   ` Florian Fainelli
@ 2009-01-20  0:23     ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2009-01-20  0:23 UTC (permalink / raw)
  To: florian; +Cc: n0-1, netdev, jeff

From: Florian Fainelli <florian@openwrt.org>
Date: Mon, 19 Jan 2009 22:07:45 +0100

> Le Thursday 15 January 2009 23:29:56 Phil Sutter, vous avez écrit :
> > 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.
> >
> > Signed-off-by: Phil Sutter <n0-1@freewrt.org>
> 
> Acked-by: Florian Fainelli <florian@openwrt.org>

Applied.

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

* Re: [PATCH] korina: set dev field of allocated socketbufs
  2009-01-19 21:08       ` Florian Fainelli
@ 2009-01-20  0:24         ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2009-01-20  0:24 UTC (permalink / raw)
  To: florian; +Cc: n0-1, netdev, jeff

From: Florian Fainelli <florian@openwrt.org>
Date: Mon, 19 Jan 2009 22:08:00 +0100

> Le Thursday 15 January 2009 23:29:58 Phil Sutter, vous avez écrit :
> > 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.
> >
> > Signed-off-by: Phil Sutter <n0-1@freewrt.org>
> 
> Acked-by: Florian Fainelli <florian@openwrt.org>

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

Not applied.

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

end of thread, other threads:[~2009-01-20  0:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1232058598-15811-1-git-send-email-n0-1@freewrt.org>
2009-01-15 22:29 ` [PATCH] korina: adjust headroom for new skb's also Phil Sutter
2009-01-19 21:07   ` Florian Fainelli
2009-01-20  0:23     ` David Miller
     [not found] ` <1232058598-15811-2-git-send-email-n0-1@freewrt.org>
2009-01-15 22:29   ` [PATCH] korina: drop leftover assignment Phil Sutter
2009-01-19 21:07     ` Florian Fainelli
2009-01-20  0:23       ` David Miller
     [not found]   ` <1232058598-15811-3-git-send-email-n0-1@freewrt.org>
2009-01-15 22:29     ` [PATCH] korina: set dev field of allocated socketbufs Phil Sutter
2009-01-19 21:08       ` Florian Fainelli
2009-01-20  0:24         ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).