[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53f1284c-6298-4b55-b7e8-9d480148ec5b@kernel.dk>
Date: Wed, 9 Oct 2024 12:42:20 -0600
From: Jens Axboe <axboe@...nel.dk>
To: David Wei <dw@...idwei.uk>, io-uring@...r.kernel.org,
netdev@...r.kernel.org
Cc: Pavel Begunkov <asml.silence@...il.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jesper Dangaard Brouer <hawk@...nel.org>, David Ahern <dsahern@...nel.org>,
Mina Almasry <almasrymina@...gle.com>
Subject: Re: [PATCH v1 14/15] io_uring/zcrx: set pp memory provider for an rx
queue
On 10/7/24 4:16 PM, David Wei wrote:
> From: David Wei <davidhwei@...a.com>
>
> Set the page pool memory provider for the rx queue configured for zero copy to
> io_uring. Then the rx queue is reset using netdev_rx_queue_restart() and netdev
> core + page pool will take care of filling the rx queue from the io_uring zero
> copy memory provider.
>
> For now, there is only one ifq so its destruction happens implicitly during
> io_uring cleanup.
Bit wide...
> @@ -237,15 +309,20 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
> reg.offsets.tail = offsetof(struct io_uring, tail);
>
> if (copy_to_user(arg, ®, sizeof(reg))) {
> + io_close_zc_rxq(ifq);
> ret = -EFAULT;
> goto err;
> }
> if (copy_to_user(u64_to_user_ptr(reg.area_ptr), &area, sizeof(area))) {
> + io_close_zc_rxq(ifq);
> ret = -EFAULT;
> goto err;
> }
> ctx->ifq = ifq;
> return 0;
Not added in this patch, but since I was looking at rtnl lock coverage,
it's OK to potentially fault while holding this lock? I'm assuming it
is, as I can't imagine any faulting needing to grab it. Not even from
nbd ;-)
Looks fine to me.
--
Jens Axboe
Powered by blists - more mailing lists