Re: [RFC PATCH v3 10/20] io_uring: setup ZC for an Rx queue when registering an ifq

Jens Axboe
2023-12-20T16:06:29Z

On 12/19/23 2:03 PM, David Wei wrote:
> From: David Wei <davidhwei@meta.com>
>
> This patch sets up ZC for an Rx queue in a net device when an ifq is
> registered with io_uring. The Rx queue is specified in the registration
> struct.
>
> For now since there is only one ifq, its destruction is implicit during
> io_uring cleanup.
>
> Signed-off-by: David Wei <dw@davidwei.uk>
> ---
> io_uring/zc_rx.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 43 insertions(+), 2 deletions(-)
>
> diff --git a/io_uring/zc_rx.c b/io_uring/zc_rx.c
> index 7e3e6f6d446b..259e08a34ab2 100644
> --- a/io_uring/zc_rx.c
> +++ b/io_uring/zc_rx.c
> @@ -4,6 +4,7 @@
> #include <linux/errno.h>
> #include <linux/mm.h>
> #include <linux/io_uring.h>
> +#include <linux/netdevice.h>
>
> #include <uapi/linux/io_uring.h>
>
> @@ -11,6 +12,34 @@
> #include "kbuf.h"
> #include "zc_rx.h"
>
> +typedef int (*bpf_op_t)(struct net_device *dev, struct netdev_bpf *bpf);

Let's get rid of this, since it isn't even typedef'ed on the networking
side. Doesn't really buy us anything, and it's only used once anyway.

--
Jens Axboe