public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jarek Poplawski <jarkao2@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	shemminger@vyatta.com, herbert@gondor.apana.org.au,
	netdev@vger.kernel.org
Subject: Re: [PATCH] sky2: don't do GRO on second port
Date: Thu, 02 Sep 2010 12:41:45 +0200	[thread overview]
Message-ID: <1283424105.2454.311.camel@edumazet-laptop> (raw)
In-Reply-To: <20100902095502.GA8775@ff.dom.local>

Le jeudi 02 septembre 2010 à 09:55 +0000, Jarek Poplawski a écrit :

> 
> Exactly, but there is no "a single napi --> device mapping". And sky2
> uses the same model. So, there is only a question of cost of this test,
> and a question of probability of gro errors on collisions without such
> a test in normal use. (And if gro can never do such errors for other
> reasons?)

Two vlans might carry packets in different domains, with a clash of IP
space and TCP flows. Even with a probability of 0.000000001%, we cannot
ever merge two packets of different domains. Really !

napi->dev is not used in GRO path, as mentioned earlier,
but in napi_get_frags(), while not needed.

To make this very clear, I suggest following patch :

[PATCH net-next-2.6] gro: remove use of napi->dev

Only use of napi->dev in GRO stack is the one found in napi_get_frags()

We can remove it and use a plain dev_alloc_skb() call.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 net/core/dev.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index d8c43e7..607057a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3248,9 +3248,11 @@ struct sk_buff *napi_get_frags(struct napi_struct *napi)
 	struct sk_buff *skb = napi->skb;
 
 	if (!skb) {
-		skb = netdev_alloc_skb_ip_align(napi->dev, GRO_MAX_HEAD);
-		if (skb)
+		skb = dev_alloc_skb(GRO_MAX_HEAD + NET_IP_ALIGN);
+		if (skb) {
+			skb_reserve(skb, NET_IP_ALIGN);
 			napi->skb = skb;
+		}
 	}
 	return skb;
 }



  reply	other threads:[~2010-09-02 10:41 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-27 20:50 [PATCH] net: Fix vlan_gro_frags vs netpoll and bonding paths Jarek Poplawski
2010-08-28  0:13 ` Herbert Xu
2010-08-28  9:44   ` Jarek Poplawski
2010-08-28 10:54     ` [RFC] gro: Is it ok to share a single napi from several devs ? Eric Dumazet
2010-08-28 14:31       ` Jarek Poplawski
2010-08-28 14:48         ` Eric Dumazet
2010-08-28 15:16           ` Jarek Poplawski
2010-08-28 17:14           ` Stephen Hemminger
2010-08-28 21:41             ` David Miller
2010-08-28 22:31               ` Stephen Hemminger
2010-08-28 22:33                 ` David Miller
2010-08-29  9:59               ` Jarek Poplawski
2010-08-29 17:06                 ` David Miller
2010-08-29 18:39                   ` Eric Dumazet
2010-08-30  6:42                     ` Jarek Poplawski
2010-08-30 15:57                       ` Stephen Hemminger
2010-08-30 16:50                         ` David Miller
2010-08-30 17:51                           ` [PATCH] sky2: don't do GRO on second port Stephen Hemminger
2010-08-30 19:09                             ` Jarek Poplawski
2010-09-01 21:51                               ` David Miller
2010-09-01 21:55                                 ` Stephen Hemminger
2010-09-02  9:18                                   ` Jarek Poplawski
2010-09-02 12:53                                     ` Jarek Poplawski
2010-09-02 16:30                                       ` David Miller
2010-09-02 16:48                                         ` Jarek Poplawski
2010-09-02  8:33                                 ` Jarek Poplawski
2010-09-02  9:31                                   ` Eric Dumazet
2010-09-02  9:55                                     ` Jarek Poplawski
2010-09-02 10:41                                       ` Eric Dumazet [this message]
2010-09-02 11:02                                         ` Jarek Poplawski
2010-09-02 12:09                                           ` Eric Dumazet
2010-09-02 12:28                                             ` Jarek Poplawski
2010-09-02 17:08                                         ` David Miller
2010-09-02 21:26                                         ` Herbert Xu
2010-09-03  5:23                                           ` Eric Dumazet
2010-09-02  9:32                                   ` Jarek Poplawski
2010-08-30 18:36                           ` [RFC] gro: Is it ok to share a single napi from several devs ? Jarek Poplawski
2010-08-30 19:59                             ` [RFC] netpoll: " Eric Dumazet
2010-08-30 20:12                               ` Stephen Hemminger
2010-08-30 20:19                                 ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283424105.2454.311.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=jarkao2@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox