mbox series

[v6,bpf,00/11] net: bpf_xdp_adjust_tail() and Intel mbuf fixes

Message ID 20240124191602.566724-1-maciej.fijalkowski@intel.com (mailing list archive)
Headers show
Series net: bpf_xdp_adjust_tail() and Intel mbuf fixes | expand

Message

Maciej Fijalkowski Jan. 24, 2024, 7:15 p.m. UTC
Hey,

after a break followed by dealing with sickness, here is a v6 that makes
bpf_xdp_adjust_tail() actually usable for ZC drivers that support XDP
multi-buffer. Since v4 I tried also using bpf_xdp_adjust_tail() with
positive offset which exposed yet another issues, which can be observed
by increased commit count when compared to v3.

John, in the end I think we should remove handling
MEM_TYPE_XSK_BUFF_POOL from __xdp_return(), but it is out of the scope
for fixes set, IMHO.

Thanks,
Maciej

v6:
- add acks [Magnus]
- fix spelling mistakes [Magnus]
- avoid touching xdp_buff in xp_alloc_{reused,new_from_fq}() [Magnus]
- s/shrink_data/bpf_xdp_shrink_data [Jakub]
- remove __shrink_data() [Jakub]
- check retvals from __xdp_rxq_info_reg() [Magnus]

v5:
- pick correct version of patch 5 [Simon]
- elaborate a bit more on what patch 2 fixes

v4:
- do not clear frags flag when deleting tail; xsk_buff_pool now does
  that
- skip some NULL tests for xsk_buff_get_tail [Martin, John]
- address problems around registering xdp_rxq_info
- fix bpf_xdp_frags_increase_tail() for ZC mbuf

v3:
- add acks
- s/xsk_buff_tail_del/xsk_buff_del_tail
- address i40e as well (thanks Tirthendu)

v2:
- fix !CONFIG_XDP_SOCKETS builds
- add reviewed-by tag to patch 3


Maciej Fijalkowski (10):
  xsk: recycle buffer in case Rx queue was full
  xsk: make xsk_buff_pool responsible for clearing xdp_buff::flags
  xsk: fix usage of multi-buffer BPF helpers for ZC XDP
  ice: work on pre-XDP prog frag count
  ice: remove redundant xdp_rxq_info registration
  intel: xsk: initialize skb_frag_t::bv_offset in ZC drivers
  ice: update xdp_rxq_info::frag_size for ZC enabled Rx queue
  xdp: reflect tail increase for MEM_TYPE_XSK_BUFF_POOL
  i40e: set xdp_rxq_info::frag_size
  i40e: update xdp_rxq_info::frag_size for ZC enabled Rx queue

Tirthendu Sarkar (1):
  i40e: handle multi-buffer packets that are shrunk by xdp prog

 drivers/net/ethernet/intel/i40e/i40e_main.c   | 47 ++++++++++++------
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 49 +++++++++----------
 drivers/net/ethernet/intel/i40e/i40e_xsk.c    |  4 +-
 drivers/net/ethernet/intel/ice/ice_base.c     | 37 ++++++++------
 drivers/net/ethernet/intel/ice/ice_txrx.c     | 19 ++++---
 drivers/net/ethernet/intel/ice/ice_txrx.h     |  1 +
 drivers/net/ethernet/intel/ice/ice_txrx_lib.h | 31 ++++++++----
 drivers/net/ethernet/intel/ice/ice_xsk.c      |  4 +-
 include/net/xdp_sock_drv.h                    | 27 ++++++++++
 net/core/filter.c                             | 44 ++++++++++++++---
 net/xdp/xsk.c                                 | 12 +++--
 net/xdp/xsk_buff_pool.c                       |  1 +
 12 files changed, 187 insertions(+), 89 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Jan. 25, 2024, 12:40 a.m. UTC | #1
Hello:

This series was applied to bpf/bpf.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Wed, 24 Jan 2024 20:15:51 +0100 you wrote:
> Hey,
> 
> after a break followed by dealing with sickness, here is a v6 that makes
> bpf_xdp_adjust_tail() actually usable for ZC drivers that support XDP
> multi-buffer. Since v4 I tried also using bpf_xdp_adjust_tail() with
> positive offset which exposed yet another issues, which can be observed
> by increased commit count when compared to v3.
> 
> [...]

Here is the summary with links:
  - [v6,bpf,01/11] xsk: recycle buffer in case Rx queue was full
    https://git.kernel.org/bpf/bpf/c/269009893146
  - [v6,bpf,02/11] xsk: make xsk_buff_pool responsible for clearing xdp_buff::flags
    https://git.kernel.org/bpf/bpf/c/f7f6aa8e2438
  - [v6,bpf,03/11] xsk: fix usage of multi-buffer BPF helpers for ZC XDP
    https://git.kernel.org/bpf/bpf/c/c5114710c8ce
  - [v6,bpf,04/11] ice: work on pre-XDP prog frag count
    https://git.kernel.org/bpf/bpf/c/ad2047cf5d93
  - [v6,bpf,05/11] i40e: handle multi-buffer packets that are shrunk by xdp prog
    https://git.kernel.org/bpf/bpf/c/83014323c642
  - [v6,bpf,06/11] ice: remove redundant xdp_rxq_info registration
    https://git.kernel.org/bpf/bpf/c/2ee788c06493
  - [v6,bpf,07/11] intel: xsk: initialize skb_frag_t::bv_offset in ZC drivers
    https://git.kernel.org/bpf/bpf/c/290779905d09
  - [v6,bpf,08/11] ice: update xdp_rxq_info::frag_size for ZC enabled Rx queue
    https://git.kernel.org/bpf/bpf/c/3de38c871742
  - [v6,bpf,09/11] xdp: reflect tail increase for MEM_TYPE_XSK_BUFF_POOL
    https://git.kernel.org/bpf/bpf/c/fbadd83a612c
  - [v6,bpf,10/11] i40e: set xdp_rxq_info::frag_size
    https://git.kernel.org/bpf/bpf/c/a045d2f2d03d
  - [v6,bpf,11/11] i40e: update xdp_rxq_info::frag_size for ZC enabled Rx queue
    https://git.kernel.org/bpf/bpf/c/0cbb08707c93

You are awesome, thank you!