From: Steffen Klassert <steffen.klassert@secunet.com>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: Netdev <netdev@vger.kernel.org>,
Eric Dumazet <eric.dumazet@gmail.com>,
Alexander Duyck <alexander.h.duyck@intel.com>,
Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Subject: Re: [PATCH net-next v1] gso: Support partial splitting at the frag_list pointer
Date: Mon, 29 Aug 2016 14:00:34 +0200 [thread overview]
Message-ID: <20160829120034.GY3735@gauss.secunet.com> (raw)
In-Reply-To: <CAKgT0UdoGQf6ZS2Ew4nuZdx5C5w-Z=P0HQZDxejrE67Fwen++w@mail.gmail.com>
On Thu, Aug 25, 2016 at 09:02:33AM -0700, Alexander Duyck wrote:
> On Thu, Aug 25, 2016 at 4:00 AM, Steffen Klassert
> > +
> > + skb_walk_frags(head_skb, segs) {
> > + len -= segs->len;
> > + }
>
> One thought I had is that you may want to add a check here to make
> certain that the skb frags have a headlen of 0. If they don't you
> would probably need to bail.
Why do you think we need this check? Is it because the assumption that
all excluding the last skb have the same size might be wrong in this
case?
> >
> > + gso_partial = !!(skb_shinfo(segs)->gso_type & SKB_GSO_PARTIAL);
> > +
> > outer_hlen = skb_tnl_header_len(skb);
> > udp_offset = outer_hlen - tnl_hlen;
> > skb = segs;
> > @@ -117,7 +119,7 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
> > * will be using a length value equal to only one MSS sized
> > * segment instead of the entire frame.
> > */
> > - if (skb_is_gso(skb)) {
> > + if (skb_is_gso(skb) && gso_partial) {
> > uh->len = htons(skb_shinfo(skb)->gso_size +
> > SKB_GSO_CB(skb)->data_offset +
> > skb->head - (unsigned char *)uh);
>
> It might be worth while to reverse these checks. You can probably
> save a few cycles if you check for gso_partial first and then
> skb_is_gso instead of the current ordering.
Maybe we can even remove the skb_is_gso check, the gso_partial
check should be sufficient.
next prev parent reply other threads:[~2016-08-29 12:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-23 5:20 [PATCH net-next v1] gso: Support partial splitting at the frag_list pointer Steffen Klassert
2016-08-23 14:47 ` Alexander Duyck
2016-08-24 9:32 ` Steffen Klassert
2016-08-24 16:27 ` Alexander Duyck
2016-08-24 17:25 ` Marcelo Ricardo Leitner
2016-08-25 7:31 ` Steffen Klassert
2016-08-25 12:17 ` Marcelo Ricardo Leitner
2016-08-29 12:02 ` Steffen Klassert
2016-08-25 11:00 ` Steffen Klassert
2016-08-25 12:38 ` Marcelo Ricardo Leitner
2016-08-25 16:02 ` Alexander Duyck
2016-08-29 12:00 ` Steffen Klassert [this message]
2016-08-26 20:36 ` Shmulik Ladkani
2016-08-26 20:45 ` Alexander Duyck
2016-08-27 7:47 ` Shmulik Ladkani
2016-08-26 20:59 ` Alexander Duyck
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=20160829120034.GY3735@gauss.secunet.com \
--to=steffen.klassert@secunet.com \
--cc=alexander.duyck@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=eric.dumazet@gmail.com \
--cc=marcelo.leitner@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).