[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57738de1-5a11-053f-c24c-e886a51367fc@kernel.dk>
Date: Thu, 18 May 2023 19:30:16 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Stefan Roesch <shr@...kernel.io>, io-uring@...r.kernel.org,
kernel-team@...com
Cc: ammarfaizi2@...weeb.org, netdev@...r.kernel.org, kuba@...nel.org,
olivier@...llion01.com
Subject: Re: [PATCH v13 6/7] io_uring: add register/unregister napi function
On 5/18/23 3:17?PM, Stefan Roesch wrote:
> diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
> index f06175b36b41..66e4591fbe2b 100644
> --- a/io_uring/io_uring.c
> +++ b/io_uring/io_uring.c
> @@ -4405,6 +4405,15 @@ static int __io_uring_register(struct io_ring_ctx *ctx, unsigned opcode,
> break;
> ret = io_register_file_alloc_range(ctx, arg);
> break;
> + case IORING_REGISTER_NAPI:
> + ret = -EINVAL;
> + if (!arg)
> + break;
> + ret = io_register_napi(ctx, arg);
> + break;
> + case IORING_UNREGISTER_NAPI:
> + ret = io_unregister_napi(ctx, arg);
> + break;
> default:
> ret = -EINVAL;
To match most of the others here in terms of behavior, I think this
should be:
case IORING_REGISTER_NAPI:
ret = -EINVAL;
if (!arg || nr_args != 1)
break;
ret = io_register_napi(ctx, arg);
break;
case IORING_UNREGISTER_NAPI:
ret = -EINVAL;
if (nr_args != 1)
break;
ret = io_unregister_napi(ctx, arg);
break;
Apart from that, looks good.
--
Jens Axboe
Powered by blists - more mailing lists