From: Steffen Klassert <steffen.klassert@secunet.com>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: Netdev <netdev@vger.kernel.org>,
Alexander Duyck <alexander.h.duyck@intel.com>,
Eric Dumazet <eric.dumazet@gmail.com>,
"Marcelo Ricardo Leitner" <marcelo.leitner@gmail.com>
Subject: Re: [PATCH net-next v3] gso: Support partial splitting at the frag_list pointer
Date: Thu, 8 Sep 2016 13:27:09 +0200 [thread overview]
Message-ID: <20160908112708.GS31137@gauss.secunet.com> (raw)
In-Reply-To: <CAKgT0UftBBfe08rcHr_Z95TtDLkBq4zz_0xchn5GMpkwKs1P=Q@mail.gmail.com>
On Mon, Sep 05, 2016 at 10:30:44AM -0700, Alexander Duyck wrote:
> On Mon, Sep 5, 2016 at 3:47 AM, Steffen Klassert
> <steffen.klassert@secunet.com> wrote:
> > Since commit 8a29111c7 ("net: gro: allow to build full sized skb")
> > gro may build buffers with a frag_list. This can hurt forwarding
> > because most NICs can't offload such packets, they need to be
> > segmented in software. This patch splits buffers with a frag_list
> > at the frag_list pointer into buffers that can be TSO offloaded.
> >
> > Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
> > ---
> >
> > Changes since v1:
> >
> > - Use the assumption that all buffers in the chain excluding the last
> > containing the same amount of data.
> >
> > - Simplify some checks against gso partial.
> >
> > - Fix the generation of IP IDs.
> >
> > Changes since v2:
> >
> > - Merge common code of gso partial and frag_list pointer splitting.
> >
> > net/core/skbuff.c | 50 +++++++++++++++++++++++++++++++++++++++-----------
> > net/ipv4/af_inet.c | 14 ++++++++++----
> > net/ipv4/gre_offload.c | 6 ++++--
> > net/ipv4/tcp_offload.c | 13 +++++++------
> > net/ipv4/udp_offload.c | 6 ++++--
> > net/ipv6/ip6_offload.c | 5 ++++-
> > 6 files changed, 68 insertions(+), 26 deletions(-)
> >
> > diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> > index 3864b4b6..f754d47 100644
> > --- a/net/core/skbuff.c
> > +++ b/net/core/skbuff.c
> > @@ -3078,11 +3078,30 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
> > sg = !!(features & NETIF_F_SG);
> > csum = !!can_checksum_protocol(features, proto);
> >
> > - /* GSO partial only requires that we trim off any excess that
> > - * doesn't fit into an MSS sized block, so take care of that
> > - * now.
> > - */
> > - if (sg && csum && (features & NETIF_F_GSO_PARTIAL)) {
> > + if (sg && csum && (mss != GSO_BY_FRAGS)) {
> > + if (!(features & NETIF_F_GSO_PARTIAL)) {
> > + if (list_skb &&
> > + net_gso_ok(features, skb_shinfo(head_skb)->gso_type)) {
>
> The testing logic here is a bit off.
Yes, apparently :-/
>
> You need to prevent us from doing the partial_segs bit below if
> NETIF_F_GSO_PARTIAL is not set and if your list_skb or net_gso_ok
> tests fail. Since as you pointed out we shouldn't ever be trying to
> perform GSO_PARTIAL on a frame that has a frag_list, what you might do
> is something like:
> if (!list_skb || !net_gso_ok(...))
> goto normal;
>
> That way we don't setup partial_segs unless we are actually using it.
Will do that.
> > +
> > + if (tail->len < gso_size)
>
> You might swap this around and just setup gso_segs on > gso_size,
> either that or this needs to be "<=" instead of just "<";
Ok, I'll use "<=".
prev parent reply other threads:[~2016-09-08 11:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-05 10:47 [PATCH net-next v3] gso: Support partial splitting at the frag_list pointer Steffen Klassert
2016-09-05 17:30 ` Alexander Duyck
2016-09-08 11:27 ` Steffen Klassert [this message]
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=20160908112708.GS31137@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).