netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Network Development <netdev@vger.kernel.org>,
	Willem de Bruijn <willemb@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>
Subject: Re: [PATCH RFC 0/3] Support fraglist GRO/GSO
Date: Sun, 23 Dec 2018 20:15:40 -0500	[thread overview]
Message-ID: <CAF=yD-KO4sNS4+GYdUTooJyzpuQZYpStkCg8sBC5GSWxV8+q5w@mail.gmail.com> (raw)
In-Reply-To: <20181221075334.9000-1-steffen.klassert@secunet.com>

On Fri, Dec 21, 2018 at 10:23 AM Steffen Klassert
<steffen.klassert@secunet.com> wrote:
>
> This patchset adds support to do GRO/GSO by chaining packets
> of the same flow at the SKB frag_list pointer. This avoids
> the overhead to merge payloads into one big packet, and
> on the other end, if GSO is needed it avoids the overhead
> of splitting the big packet back to the native form.
>
> Patch 1 prepares GSO to handle fraglist GSO packets.
> Patch 2 adds the core infrastructure to do fraglist
> GRO/GSO. Patch 3 enables IPv4 UDP to use fraglist
> GRO/GSO if no GRO supported socket is found.
>
> I have only forwarding performance measurements so far:
>
> I used used my IPsec forwarding test setup for this:
>
>            ------------         ------------
>         -->| router 1 |-------->| router 2 |--
>         |  ------------         ------------  |
>         |                                     |
>         |       --------------------          |
>         --------|Spirent Testcenter|<----------
>                 --------------------
>
> net-next (December 10th):
>
> Single stream UDP frame size 1460 Bytes: 1.341.700 fps (15.67 Gbps).
>
> ----------------------------------------------------------------------
>
> net-next (December 10th) + hack to enable forwarding for standard UDP GRO:
>
> Single stream UDP frame size 1460 Bytes: 1.651.200 fps (19.28 Gbps).
>
> ----------------------------------------------------------------------
>
> net-next (December 10th) + fraglist UDP GRO/GSO:
>
> Single stream UDP frame size 1460 Bytes: 2.742.500 fps (32.03 Gbps).

That's an impressive speed-up over regular UDP GRO. Definitely worth
looking into more, then.

Sorry for the delay. I still haven't parsed everything yet, but a few
high level questions and comments.

This sounds similar to GSO_BY_FRAGS as used by SCTP. Can perhaps reuse
that or deduplicate a bit. It is nice that this uses a separate
skb_segment_list function; skb_segment is arguably too complex as is
already.

This requires UDP GSO to always be enabled, similar to TCP GSO (as of
commit "tcp: switch to GSO being always on").

I would prefer to split the patch that adds UDP GRO on the forwarding
path into one that enables it for existing GRO (the hack you refer to
above) and a second one to optionally convert to listified processing.

Ideally, we can use existing segmentation on paths where hardware UDP
LSO is supported. I'm not quite sure how to decide between the two
yet. Worst case, perhaps globally use listified forwarding unless any
device is registered with hardware offload, then use regular
segmentation.

For both existing UDP GRO and listified, we should verify that this is
not a potential DoS vector before enabling by default.

A few smaller questions, not necessarily exhaustive (or all sensible ;)
- 1/3
  - do gso handlers never return the original skb currently?
- 2/3
  - did you mean CHECKSUM_PARTIAL?
  - are all those assignments really needed, given that nskb was
    already a fully formed udp packet with just its skb->data moved?
  - calls skb_needs_linearize on the first of the segments in the list only?
- 3/3
   - after pskb_may_pull must reload all ptrs into the data (uh)
   - there are some differences in preparation before the skb is
     passed to skb_gro_receive_list vs skb_gro_receive. Is this
     really needed? They should be interchangeable?

  parent reply	other threads:[~2018-12-24  1:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21  7:53 [PATCH RFC 0/3] Support fraglist GRO/GSO Steffen Klassert
2018-12-21  7:53 ` [PATCH RFC 1/3] net: Prepare GSO return values for fraglist GSO Steffen Klassert
2019-01-08 13:53   ` Paolo Abeni
2019-01-14 12:53     ` Steffen Klassert
2018-12-21  7:53 ` [PATCH RFC 2/3] net: Support GRO/GSO fraglist chaining Steffen Klassert
2018-12-21  7:53 ` [PATCH RFC 3/3] udp: Support UDP fraglist GRO/GSO Steffen Klassert
2019-01-08 15:00   ` Paolo Abeni
2019-01-25  7:58     ` Steffen Klassert
2019-01-26  9:36       ` Paolo Abeni
2019-01-28  8:09         ` Steffen Klassert
2018-12-24  1:15 ` Willem de Bruijn [this message]
2018-12-26 13:09   ` [PATCH RFC 0/3] Support " Marcelo Ricardo Leitner
2019-01-14 12:50   ` Steffen Klassert
2019-01-14 17:09     ` Willem de Bruijn
2019-01-25  8:14       ` Steffen Klassert
2019-01-25 13:57         ` Willem de Bruijn
2019-01-28  7:51           ` Steffen Klassert
2019-01-28 16:46             ` Willem de Bruijn

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='CAF=yD-KO4sNS4+GYdUTooJyzpuQZYpStkCg8sBC5GSWxV8+q5w@mail.gmail.com' \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=steffen.klassert@secunet.com \
    --cc=willemb@google.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;
as well as URLs for NNTP newsgroup(s).