netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Florian Westphal <fw@strlen.de>, netdev@vger.kernel.org
Subject: Re: [PATCH 2/2] net: ip, ipv6: handle gso skbs in forwarding path
Date: Sun, 26 Jan 2014 10:22:28 +0100	[thread overview]
Message-ID: <20140126092228.GF24041@breakpoint.cc> (raw)
In-Reply-To: <1390700277.27806.72.camel@edumazet-glaptop2.roam.corp.google.com>

Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > +static bool ip_exceeds_mtu(const struct sk_buff *skb, unsigned int mtu)
> > +{
> > +	unsigned len;
> > +
> > +	if (skb->local_df)
> > +		return false;
> > +	len = skb_is_gso(skb) ? skb_gso_network_seglen(skb) : skb->len;
> > +
> > +	return len > mtu;
> 
> The function should avoid extra computation/tests for small packets.
> 
> if (skb->len <= mtu || skb->local_df)
> 	return false;

Good idea!  Will change it as per your suggestion.

> if (skb_is_gso(skb) && skb_gso_network_seglen(skb) <= mtu)
> 	return false;
> 
> return true;
> 
> > +}
> > +
> > +/* called if GSO skb needs to be fragmented on forward.  */
> > +static int ip_forward_finish_gso(struct sk_buff *skb)
> > +{
> > +	struct sk_buff *segs = skb_gso_segment(skb, 0);
> 
> 0 is very pessimistic.
> 
> Have you tried :
> 
> netdev_features_t features = netif_skb_features(skb); 
> struct sk_buff *segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);

No.  I'll see if this works for me, then include it in V2.

Thanks Eric.

  reply	other threads:[~2014-01-26  9:22 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-25 22:48 [PATCH 0/2] Fix handling of GRO skbs in forwarding path Florian Westphal
2014-01-25 22:48 ` [PATCH 1/2] net: add and use skb_gso_transport_seglen() Florian Westphal
2014-01-26  1:28   ` Eric Dumazet
2014-01-26  9:19     ` Florian Westphal
2014-01-25 22:48 ` [PATCH 2/2] net: ip, ipv6: handle gso skbs in forwarding path Florian Westphal
2014-01-26  1:37   ` Eric Dumazet
2014-01-26  9:22     ` Florian Westphal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-01-27  8:22 [PATCH 1/2] net: add and use skb_gso_transport_seglen() Florian Westphal
2014-01-27  8:22 ` [PATCH 2/2] net: ip, ipv6: handle gso skbs in forwarding path Florian Westphal
2014-01-27  8:34   ` David Miller
2014-01-27  8:36     ` Florian Westphal
2014-01-27 18:22   ` Eric Dumazet
2014-01-27 20:58     ` David Miller
2014-01-27 21:08       ` David Miller
2014-01-28  0:27     ` Hannes Frederic Sowa
2014-01-28  9:12       ` Florian Westphal
2014-01-29 10:53       ` Florian Westphal
2014-01-29 11:04         ` Hannes Frederic Sowa
2014-01-28  8:57     ` Florian Westphal
2014-01-28 16:34       ` Eric Dumazet
2014-01-28 17:15         ` Florian Westphal
2014-01-28 17:30           ` Eric Dumazet
2014-01-28 17:37             ` Florian Westphal
2014-01-29 11:00         ` Florian Westphal
2014-02-09  2:55         ` Herbert Xu
2014-02-10 12:23           ` Florian Westphal
2014-02-10 12:31             ` Herbert Xu
2014-02-10 12:43               ` Florian Westphal
2014-02-10 12:50                 ` Herbert Xu
2014-02-10 13:08                   ` Eric Dumazet
2014-02-10 13:15                 ` Eric Dumazet
2014-02-10 13:12               ` Eric Dumazet
2014-02-22  9:33 [PATCH stable 3.4.y 0/2] gso/gro forwarding changeset Florian Westphal
2014-02-22  9:33 ` [PATCH 2/2] net: ip, ipv6: handle gso skbs in forwarding path Florian Westphal

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=20140126092228.GF24041@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).