public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David Miller <davem@davemloft.net>,
	jesse@nicira.com, horms@verge.net.au, netdev@vger.kernel.org,
	xeb@mail.ru
Subject: Re: [PATCH] GRE: Use IS_ERR_OR_NULL in gre_gso_segment
Date: Thu, 25 Apr 2013 06:58:34 -0700	[thread overview]
Message-ID: <1366898314.8964.135.camel@edumazet-glaptop> (raw)
In-Reply-To: <20130425091151.GA27681@gondor.apana.org.au>

On Thu, 2013-04-25 at 17:11 +0800, Herbert Xu wrote:

> In any case, returning an error in this case makes little sense
> because when we return NULL it is precisely because the packet is
> well-formed and ready for direct processing by the hardware which
> will perform GSO instead of us.
> 
> The reason this dichotomy exists is because we've reused the
> normal software GSO path to do header verification for hardware
> GSO.
> 

OK, then current code is fine. Comments will save future 'cleanups'.

diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c
index d2d5a99..ddf72eb 100644
--- a/net/ipv4/gre.c
+++ b/net/ipv4/gre.c
@@ -168,7 +168,11 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
 	/* segment inner packet. */
 	enc_features = skb->dev->hw_enc_features & netif_skb_features(skb);
 	segs = skb_mac_gso_segment(skb, enc_features);
-	if (!segs || IS_ERR(segs))
+	/* if no segmentation is needed, we're done */
+	if (!segs)
+		goto out;
+	/* if an error happened during segmentation, we're done */
+	if (IS_ERR(segs))
 		goto out;
 
 	skb = segs;

  reply	other threads:[~2013-04-25 13:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19  6:48 [PATCH] GRE: Use IS_ERR_OR_NULL in gre_gso_segment Simon Horman
2013-04-19 10:24 ` Eric Dumazet
2013-04-19 18:28   ` David Miller
2013-04-22  1:35     ` Simon Horman
2013-04-22  1:44       ` David Miller
2013-04-22  2:13         ` Simon Horman
2013-04-23  7:50           ` Simon Horman
2013-04-23 20:47             ` Jesse Gross
2013-04-25  8:46               ` Herbert Xu
2013-04-25  9:01                 ` David Miller
2013-04-25  9:03                   ` Herbert Xu
2013-04-25  9:11                     ` Herbert Xu
2013-04-25 13:58                       ` Eric Dumazet [this message]
2013-04-26  3:38                         ` Herbert Xu

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=1366898314.8964.135.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@verge.net.au \
    --cc=jesse@nicira.com \
    --cc=netdev@vger.kernel.org \
    --cc=xeb@mail.ru \
    /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