Re: [PATCH v3 bpf-next 17/22] selftests/xsk: add basic multi-buffer test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 05, 2023 at 04:44:28PM +0200, Maciej Fijalkowski wrote:
> From: Magnus Karlsson <magnus.karlsson@xxxxxxxxx>
> 
> 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@xxxxxxxxx>
> ---
>  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,
>  };




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux