All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: "Samudrala\, Sridhar" <sridhar.samudrala@intel.com>,
	magnus.karlsson@intel.com, bjorn.topel@intel.com,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org, maciej.fijalkowski@intel.com,
	tom.herbert@intel.com
Subject: Re: [PATCH bpf-next 0/5] Add support for SKIP_BPF flag for AF_XDP sockets
Date: Thu, 15 Aug 2019 19:11:11 +0200	[thread overview]
Message-ID: <87ftm2wdzk.fsf@toke.dk> (raw)
In-Reply-To: <b9423054-247e-8b57-ea59-42368f60ea1e@intel.com>

"Samudrala, Sridhar" <sridhar.samudrala@intel.com> writes:

> On 8/15/2019 4:12 AM, Toke Høiland-Jørgensen wrote:
>> Sridhar Samudrala <sridhar.samudrala@intel.com> writes:
>> 
>>> This patch series introduces XDP_SKIP_BPF flag that can be specified
>>> during the bind() call of an AF_XDP socket to skip calling the BPF
>>> program in the receive path and pass the buffer directly to the socket.
>>>
>>> When a single AF_XDP socket is associated with a queue and a HW
>>> filter is used to redirect the packets and the app is interested in
>>> receiving all the packets on that queue, we don't need an additional
>>> BPF program to do further filtering or lookup/redirect to a socket.
>>>
>>> Here are some performance numbers collected on
>>>    - 2 socket 28 core Intel(R) Xeon(R) Platinum 8180 CPU @ 2.50GHz
>>>    - Intel 40Gb Ethernet NIC (i40e)
>>>
>>> All tests use 2 cores and the results are in Mpps.
>>>
>>> turbo on (default)
>>> ---------------------------------------------	
>>>                        no-skip-bpf    skip-bpf
>>> ---------------------------------------------	
>>> rxdrop zerocopy           21.9         38.5
>>> l2fwd  zerocopy           17.0         20.5
>>> rxdrop copy               11.1         13.3
>>> l2fwd  copy                1.9          2.0
>>>
>>> no turbo :  echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
>>> ---------------------------------------------	
>>>                        no-skip-bpf    skip-bpf
>>> ---------------------------------------------	
>>> rxdrop zerocopy           15.4         29.0
>>> l2fwd  zerocopy           11.8         18.2
>>> rxdrop copy                8.2         10.5
>>> l2fwd  copy                1.7          1.7
>>> ---------------------------------------------
>> 
>> You're getting this performance boost by adding more code in the fast
>> path for every XDP program; so what's the performance impact of that for
>> cases where we do run an eBPF program?
>
> The no-skip-bpf results are pretty close to what i see before the 
> patches are applied. As umem is cached in rx_ring for zerocopy the 
> overhead is much smaller compared to the copy scenario where i am 
> currently calling xdp_get_umem_from_qid().

I meant more for other XDP programs; what is the performance impact of
XDP_DROP, for instance?

>> Also, this is basically a special-casing of a particular deployment
>> scenario. Without a way to control RX queue assignment and traffic
>> steering, you're basically hard-coding a particular app's takeover of
>> the network interface; I'm not sure that is such a good idea...
>
> Yes. This is mainly targeted for application that create 1 AF_XDP
> socket per RX queue and can use a HW filter (via ethtool or TC flower)
> to redirect the packets to a queue or a group of queues.

Yeah, and I'd prefer it if the handling of this to be unified somehow...

-Toke

WARNING: multiple messages have this Message-ID (diff)
From: Toke =?unknown-8bit?q?H=C3=B8iland-J=C3=B8rgensen?= <toke@redhat.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH bpf-next 0/5] Add support for SKIP_BPF flag for AF_XDP sockets
Date: Thu, 15 Aug 2019 19:11:11 +0200	[thread overview]
Message-ID: <87ftm2wdzk.fsf@toke.dk> (raw)
In-Reply-To: <b9423054-247e-8b57-ea59-42368f60ea1e@intel.com>

"Samudrala, Sridhar" <sridhar.samudrala@intel.com> writes:

> On 8/15/2019 4:12 AM, Toke H?iland-J?rgensen wrote:
>> Sridhar Samudrala <sridhar.samudrala@intel.com> writes:
>> 
>>> This patch series introduces XDP_SKIP_BPF flag that can be specified
>>> during the bind() call of an AF_XDP socket to skip calling the BPF
>>> program in the receive path and pass the buffer directly to the socket.
>>>
>>> When a single AF_XDP socket is associated with a queue and a HW
>>> filter is used to redirect the packets and the app is interested in
>>> receiving all the packets on that queue, we don't need an additional
>>> BPF program to do further filtering or lookup/redirect to a socket.
>>>
>>> Here are some performance numbers collected on
>>>    - 2 socket 28 core Intel(R) Xeon(R) Platinum 8180 CPU @ 2.50GHz
>>>    - Intel 40Gb Ethernet NIC (i40e)
>>>
>>> All tests use 2 cores and the results are in Mpps.
>>>
>>> turbo on (default)
>>> ---------------------------------------------	
>>>                        no-skip-bpf    skip-bpf
>>> ---------------------------------------------	
>>> rxdrop zerocopy           21.9         38.5
>>> l2fwd  zerocopy           17.0         20.5
>>> rxdrop copy               11.1         13.3
>>> l2fwd  copy                1.9          2.0
>>>
>>> no turbo :  echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
>>> ---------------------------------------------	
>>>                        no-skip-bpf    skip-bpf
>>> ---------------------------------------------	
>>> rxdrop zerocopy           15.4         29.0
>>> l2fwd  zerocopy           11.8         18.2
>>> rxdrop copy                8.2         10.5
>>> l2fwd  copy                1.7          1.7
>>> ---------------------------------------------
>> 
>> You're getting this performance boost by adding more code in the fast
>> path for every XDP program; so what's the performance impact of that for
>> cases where we do run an eBPF program?
>
> The no-skip-bpf results are pretty close to what i see before the 
> patches are applied. As umem is cached in rx_ring for zerocopy the 
> overhead is much smaller compared to the copy scenario where i am 
> currently calling xdp_get_umem_from_qid().

I meant more for other XDP programs; what is the performance impact of
XDP_DROP, for instance?

>> Also, this is basically a special-casing of a particular deployment
>> scenario. Without a way to control RX queue assignment and traffic
>> steering, you're basically hard-coding a particular app's takeover of
>> the network interface; I'm not sure that is such a good idea...
>
> Yes. This is mainly targeted for application that create 1 AF_XDP
> socket per RX queue and can use a HW filter (via ethtool or TC flower)
> to redirect the packets to a queue or a group of queues.

Yeah, and I'd prefer it if the handling of this to be unified somehow...

-Toke

  reply	other threads:[~2019-08-15 17:11 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15  3:46 [PATCH bpf-next 0/5] Add support for SKIP_BPF flag for AF_XDP sockets Sridhar Samudrala
2019-08-15  3:46 ` [Intel-wired-lan] " Sridhar Samudrala
2019-08-15  3:46 ` [PATCH bpf-next 1/5] xsk: Convert bool 'zc' field in struct xdp_umem to a u32 bitmap Sridhar Samudrala
2019-08-15  3:46   ` [Intel-wired-lan] " Sridhar Samudrala
2019-08-15  3:46 ` [PATCH bpf-next 2/5] xsk: Introduce XDP_SKIP_BPF bind option Sridhar Samudrala
2019-08-15  3:46   ` [Intel-wired-lan] " Sridhar Samudrala
2019-08-15  3:46 ` [PATCH bpf-next 3/5] i40e: Enable XDP_SKIP_BPF option for AF_XDP sockets Sridhar Samudrala
2019-08-15  3:46   ` [Intel-wired-lan] " Sridhar Samudrala
2019-08-16  9:21   ` kbuild test robot
2019-08-16  9:21     ` [Intel-wired-lan] " kbuild test robot
2019-08-15  3:46 ` [PATCH bpf-next 4/5] ixgbe: " Sridhar Samudrala
2019-08-15  3:46   ` [Intel-wired-lan] " Sridhar Samudrala
2019-08-15  3:46 ` [PATCH bpf-next 5/5] xdpsock_user: Add skip_bpf option Sridhar Samudrala
2019-08-15  3:46   ` [Intel-wired-lan] " Sridhar Samudrala
2019-08-15 11:12 ` [PATCH bpf-next 0/5] Add support for SKIP_BPF flag for AF_XDP sockets Toke Høiland-Jørgensen
2019-08-15 11:12   ` [Intel-wired-lan] " Toke =?unknown-8bit?q?H=C3=B8iland-J=C3=B8rgensen?=
2019-08-15 16:25   ` Samudrala, Sridhar
2019-08-15 16:25     ` [Intel-wired-lan] " Samudrala, Sridhar
2019-08-15 17:11     ` Toke Høiland-Jørgensen [this message]
2019-08-15 17:11       ` Toke =?unknown-8bit?q?H=C3=B8iland-J=C3=B8rgensen?=
2019-08-16  6:12       ` Samudrala, Sridhar
2019-08-16  6:12         ` [Intel-wired-lan] " Samudrala, Sridhar
2019-08-15 12:51 ` Björn Töpel
2019-08-15 12:51   ` [Intel-wired-lan] " =?unknown-8bit?q?Bj=C3=B6rn_T=C3=B6pel?=
2019-08-15 16:46   ` Samudrala, Sridhar
2019-08-15 16:46     ` [Intel-wired-lan] " Samudrala, Sridhar
2019-08-16 13:32     ` Björn Töpel
2019-08-16 13:32       ` =?unknown-8bit?q?Bj=C3=B6rn_T=C3=B6pel?=
2019-08-16 22:08       ` Jonathan Lemon
2019-08-16 22:08         ` Jonathan Lemon
2019-08-19  7:39         ` Björn Töpel
2019-08-19  7:39           ` =?unknown-8bit?q?Bj=C3=B6rn_T=C3=B6pel?=
2019-08-15 19:28 ` Jakub Kicinski
2019-08-15 19:28   ` [Intel-wired-lan] " Jakub Kicinski
2019-08-16  6:25   ` Samudrala, Sridhar
2019-08-16  6:25     ` [Intel-wired-lan] " Samudrala, Sridhar

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=87ftm2wdzk.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=bjorn.topel@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sridhar.samudrala@intel.com \
    --cc=tom.herbert@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.