bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 00/10] xsk: stop softirq processing on full XSK Rx queue
@ 2022-04-05 11:06 Maciej Fijalkowski
  2022-04-05 11:06 ` [PATCH bpf-next 01/10] xsk: improve xdp_do_redirect() error codes Maciej Fijalkowski
                   ` (10 more replies)
  0 siblings, 11 replies; 30+ messages in thread
From: Maciej Fijalkowski @ 2022-04-05 11:06 UTC (permalink / raw)
  To: bpf, ast, daniel, magnus.karlsson, bjorn
  Cc: netdev, brouer, maximmi, alexandr.lobakin, Maciej Fijalkowski

Hi!

This is a revival of Bjorn's idea [0] to break NAPI loop when XSK Rx
queue gets full which in turn makes it impossible to keep on
successfully producing descriptors to XSK Rx ring. By breaking out of
the driver side immediately we will give the user space opportunity for
consuming descriptors from XSK Rx ring and therefore provide room in the
ring so that HW Rx -> XSK Rx redirection can be done.

Maxim asked and Jesper agreed on simplifying Bjorn's original API used
for detecting the event of interest, so let's just simply check for
-ENOBUFS within Intel's ZC drivers after an attempt to redirect a buffer
to XSK Rx. No real need for redirect API extension.

One might ask why it is still relevant even after having proper busy
poll support in place - here is the justification.

For xdpsock that was:
- run for l2fwd scenario,
- app/driver processing took place on the same core in busy poll
  with 2048 budget,
- HW ring sizes Tx 256, Rx 2048,

this work improved throughput by 78% and reduced Rx queue full statistic
bump by 99%.

For testing ice, make sure that you have [1] present on your side.

This set, besides the work described above, also carries also
improvements around return codes in various XSK paths and lastly a minor
optimization for xskq_cons_has_entries(), a helper that might be used
when XSK Rx batching would make it to the kernel.

Thanks!
MF

[0]: https://lore.kernel.org/bpf/20200904135332.60259-1-bjorn.topel@gmail.com/
[1]: https://lore.kernel.org/netdev/20220317175727.340251-1-maciej.fijalkowski@intel.com/

Björn Töpel (1):
  xsk: improve xdp_do_redirect() error codes

Maciej Fijalkowski (9):
  xsk: diversify return codes in xsk_rcv_check()
  ice: xsk: terminate NAPI when XSK Rx queue gets full
  i40e: xsk: terminate NAPI when XSK Rx queue gets full
  ixgbe: xsk: terminate NAPI when XSK Rx queue gets full
  ice: xsk: diversify return values from xsk_wakeup call paths
  i40e: xsk: diversify return values from xsk_wakeup call paths
  ixgbe: xsk: diversify return values from xsk_wakeup call paths
  ice: xsk: avoid refilling single Rx descriptors
  xsk: drop ternary operator from xskq_cons_has_entries

 .../ethernet/intel/i40e/i40e_txrx_common.h    |  1 +
 drivers/net/ethernet/intel/i40e/i40e_xsk.c    | 27 +++++++++------
 drivers/net/ethernet/intel/ice/ice_txrx.h     |  1 +
 drivers/net/ethernet/intel/ice/ice_xsk.c      | 34 ++++++++++++-------
 .../ethernet/intel/ixgbe/ixgbe_txrx_common.h  |  1 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c  | 29 ++++++++++------
 net/xdp/xsk.c                                 |  4 +--
 net/xdp/xsk_queue.h                           |  4 +--
 8 files changed, 64 insertions(+), 37 deletions(-)

-- 
2.33.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2022-04-13 15:26 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05 11:06 [PATCH bpf-next 00/10] xsk: stop softirq processing on full XSK Rx queue Maciej Fijalkowski
2022-04-05 11:06 ` [PATCH bpf-next 01/10] xsk: improve xdp_do_redirect() error codes Maciej Fijalkowski
2022-04-05 12:18   ` Jesper Dangaard Brouer
2022-04-05 11:06 ` [PATCH bpf-next 02/10] xsk: diversify return codes in xsk_rcv_check() Maciej Fijalkowski
2022-04-05 13:00   ` Jesper Dangaard Brouer
2022-04-05 13:35     ` Maciej Fijalkowski
2022-04-05 11:06 ` [PATCH bpf-next 03/10] ice: xsk: terminate NAPI when XSK Rx queue gets full Maciej Fijalkowski
2022-04-05 11:34   ` Alexander Lobakin
2022-04-05 12:02     ` Maciej Fijalkowski
2022-04-05 11:06 ` [PATCH bpf-next 04/10] i40e: " Maciej Fijalkowski
2022-04-05 13:04   ` Jesper Dangaard Brouer
2022-04-06 16:04     ` Maciej Fijalkowski
2022-04-05 11:06 ` [PATCH bpf-next 05/10] ixgbe: " Maciej Fijalkowski
2022-04-05 12:36   ` Jesper Dangaard Brouer
2022-04-05 13:52     ` Maciej Fijalkowski
2022-04-05 11:06 ` [PATCH bpf-next 06/10] ice: xsk: diversify return values from xsk_wakeup call paths Maciej Fijalkowski
2022-04-05 11:06 ` [PATCH bpf-next 07/10] i40e: " Maciej Fijalkowski
2022-04-05 11:06 ` [PATCH bpf-next 08/10] ixgbe: " Maciej Fijalkowski
2022-04-05 11:06 ` [PATCH bpf-next 09/10] ice: xsk: avoid refilling single Rx descriptors Maciej Fijalkowski
2022-04-05 11:06 ` [PATCH bpf-next 10/10] xsk: drop ternary operator from xskq_cons_has_entries Maciej Fijalkowski
2022-04-07 10:49 ` [PATCH bpf-next 00/10] xsk: stop softirq processing on full XSK Rx queue Maxim Mikityanskiy
2022-04-08  9:08   ` Maciej Fijalkowski
2022-04-08 12:48     ` Maxim Mikityanskiy
2022-04-08 18:17       ` Jakub Kicinski
2022-04-11 15:46         ` Maciej Fijalkowski
2022-04-11 17:07           ` Jakub Kicinski
2022-04-11 15:35       ` Maciej Fijalkowski
2022-04-13 10:40         ` Maxim Mikityanskiy
2022-04-13 15:12           ` Magnus Karlsson
2022-04-13 15:26             ` Maciej Fijalkowski

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).