lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 5 Jun 2023 22:17:08 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
Cc: bpf@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
	andrii@...nel.org, netdev@...r.kernel.org,
	magnus.karlsson@...el.com, bjorn@...nel.org,
	tirthendu.sarkar@...el.com
Subject: Re: [PATCH v3 bpf-next 17/22] selftests/xsk: add basic multi-buffer
 test

On Mon, Jun 05, 2023 at 04:44:28PM +0200, Maciej Fijalkowski wrote:
> From: Magnus Karlsson <magnus.karlsson@...el.com>
> 
> Add the first basic multi-buffer test that sends a stream of 9K
> packets and validates that they are received at the other end. In
> order to enable sending and receiving multi-buffer packets, code that
> sets the MTU is introduced as well as modifications to the XDP
> programs so that they signal that they are multi-buffer enabled.
> 
> Signed-off-by: Magnus Karlsson <magnus.karlsson@...el.com>
> ---
>  tools/include/uapi/linux/if_xdp.h             |   6 +
>  tools/include/uapi/linux/netdev.h             |   3 +-
>  .../selftests/bpf/progs/xsk_xdp_progs.c       |   4 +-
>  tools/testing/selftests/bpf/xsk.c             | 136 +++++++++++++++++-
>  tools/testing/selftests/bpf/xsk.h             |   2 +
>  tools/testing/selftests/bpf/xskxceiver.c      |  67 +++++++++
>  tools/testing/selftests/bpf/xskxceiver.h      |   6 +
>  7 files changed, 220 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/include/uapi/linux/if_xdp.h b/tools/include/uapi/linux/if_xdp.h
> index 80245f5b4dd7..73a47da885dc 100644
> --- a/tools/include/uapi/linux/if_xdp.h
> +++ b/tools/include/uapi/linux/if_xdp.h
> @@ -25,6 +25,12 @@
>   * application.
>   */
>  #define XDP_USE_NEED_WAKEUP (1 << 3)
> +/* By setting this option, userspace application indicates that it can
> + * handle multiple descriptors per packet thus enabling xsk core to split
> + * multi-buffer XDP frames into multiple Rx descriptors. Without this set
> + * such frames will be dropped by xsk.
> + */
> +#define XDP_USE_SG     (1 << 4)
>  
>  /* Flags for xsk_umem_config flags */
>  #define XDP_UMEM_UNALIGNED_CHUNK_FLAG (1 << 0)
> diff --git a/tools/include/uapi/linux/netdev.h b/tools/include/uapi/linux/netdev.h
> index 639524b59930..c1e59bfbae41 100644
> --- a/tools/include/uapi/linux/netdev.h
> +++ b/tools/include/uapi/linux/netdev.h
> @@ -33,8 +33,9 @@ enum netdev_xdp_act {
>  	NETDEV_XDP_ACT_HW_OFFLOAD = 16,
>  	NETDEV_XDP_ACT_RX_SG = 32,
>  	NETDEV_XDP_ACT_NDO_XMIT_SG = 64,
> +	NETDEV_XDP_ACT_ZC_SG = 128,

Hi Maciej,

a minor nit from my side: NETDEV_XDP_ACT_ZC_SG was not added to the kernel
doc a few lines further above

> -	NETDEV_XDP_ACT_MASK = 127,
> +	NETDEV_XDP_ACT_MASK = 255,
>  };

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ