mbox series

[v2,bpf-next,0/6] xsk: struct diet and cleanups

Message ID 20241007122458.282590-1-maciej.fijalkowski@intel.com (mailing list archive)
Headers show
Series xsk: struct diet and cleanups | expand

Message

Maciej Fijalkowski Oct. 7, 2024, 12:24 p.m. UTC
Hi all,

this modest work brings back size of xdp_buff_xsk back to two cache
lines which in turn improves performance. Interestingly I was able to
observe on ice with HW rings sized to 512 around 12% better performance
when running xdpsock in l2fwd scenario. First three patches are behind
this. Other setups were not that impressive, I believe results may vary
based on the underlying CPU. Bottom line is that shrinking this struct
takes off a bit of work from CPU's shoulders.

Other three patches are rather cleanups.

Thanks,
Maciej

v1->v2:
* fix build issues on patch 1 (Daniel, CI)
* be smarter about xsk_buff_pool layout in patch 4 (Vadim)

Maciej Fijalkowski (6):
  xsk: get rid of xdp_buff_xsk::xskb_list_node
  xsk: s/free_list_node/list_node
  xsk: get rid of xdp_buff_xsk::orig_addr
  xsk: carry a copy of xdp_zc_max_segs within xsk_buff_pool
  xsk: wrap duplicated code to function
  xsk: use xsk_buff_pool directly for cq functions

 include/net/xdp_sock_drv.h  | 14 +++++-----
 include/net/xsk_buff_pool.h | 23 +++++++++-------
 net/xdp/xsk.c               | 38 +++++++++++++-------------
 net/xdp/xsk_buff_pool.c     | 54 ++++++++++++++++++++-----------------
 net/xdp/xsk_queue.h         |  2 +-
 5 files changed, 69 insertions(+), 62 deletions(-)

Comments

Magnus Karlsson Oct. 8, 2024, 10:31 a.m. UTC | #1
On Mon, 7 Oct 2024 at 14:27, Maciej Fijalkowski
<maciej.fijalkowski@intel.com> wrote:
>
> Hi all,
>
> this modest work brings back size of xdp_buff_xsk back to two cache
> lines which in turn improves performance. Interestingly I was able to
> observe on ice with HW rings sized to 512 around 12% better performance
> when running xdpsock in l2fwd scenario. First three patches are behind
> this. Other setups were not that impressive, I believe results may vary
> based on the underlying CPU. Bottom line is that shrinking this struct
> takes off a bit of work from CPU's shoulders.
>
> Other three patches are rather cleanups.
>
> Thanks,
> Maciej

Thanks for these improvements Maciej.

For the series:
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>

> v1->v2:
> * fix build issues on patch 1 (Daniel, CI)
> * be smarter about xsk_buff_pool layout in patch 4 (Vadim)
>
> Maciej Fijalkowski (6):
>   xsk: get rid of xdp_buff_xsk::xskb_list_node
>   xsk: s/free_list_node/list_node
>   xsk: get rid of xdp_buff_xsk::orig_addr
>   xsk: carry a copy of xdp_zc_max_segs within xsk_buff_pool
>   xsk: wrap duplicated code to function
>   xsk: use xsk_buff_pool directly for cq functions
>
>  include/net/xdp_sock_drv.h  | 14 +++++-----
>  include/net/xsk_buff_pool.h | 23 +++++++++-------
>  net/xdp/xsk.c               | 38 +++++++++++++-------------
>  net/xdp/xsk_buff_pool.c     | 54 ++++++++++++++++++++-----------------
>  net/xdp/xsk_queue.h         |  2 +-
>  5 files changed, 69 insertions(+), 62 deletions(-)
>
> --
> 2.34.1
>
>
patchwork-bot+netdevbpf@kernel.org Oct. 14, 2024, 3:30 p.m. UTC | #2
Hello:

This series was applied to bpf/bpf-next.git (net)
by Daniel Borkmann <daniel@iogearbox.net>:

On Mon,  7 Oct 2024 14:24:52 +0200 you wrote:
> Hi all,
> 
> this modest work brings back size of xdp_buff_xsk back to two cache
> lines which in turn improves performance. Interestingly I was able to
> observe on ice with HW rings sized to 512 around 12% better performance
> when running xdpsock in l2fwd scenario. First three patches are behind
> this. Other setups were not that impressive, I believe results may vary
> based on the underlying CPU. Bottom line is that shrinking this struct
> takes off a bit of work from CPU's shoulders.
> 
> [...]

Here is the summary with links:
  - [v2,bpf-next,1/6] xsk: get rid of xdp_buff_xsk::xskb_list_node
    https://git.kernel.org/bpf/bpf-next/c/b692bf9a7543
  - [v2,bpf-next,2/6] xsk: s/free_list_node/list_node
    https://git.kernel.org/bpf/bpf-next/c/30ec2c1baaea
  - [v2,bpf-next,3/6] xsk: get rid of xdp_buff_xsk::orig_addr
    https://git.kernel.org/bpf/bpf-next/c/bea14124bacb
  - [v2,bpf-next,4/6] xsk: carry a copy of xdp_zc_max_segs within xsk_buff_pool
    https://git.kernel.org/bpf/bpf-next/c/6e126872191d
  - [v2,bpf-next,5/6] xsk: wrap duplicated code to function
    https://git.kernel.org/bpf/bpf-next/c/1d10b2bed2d4
  - [v2,bpf-next,6/6] xsk: use xsk_buff_pool directly for cq functions
    https://git.kernel.org/bpf/bpf-next/c/e6c4047f5122

You are awesome, thank you!