diff options
| author | Pavel Begunkov <asml.silence@gmail.com> | 2026-02-14 22:20:47 +0000 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2026-03-04 07:21:43 -0500 |
| commit | 18afaff077b46655a8eb6fd7f6de1b81327be577 (patch) | |
| tree | 4240b44a98ac78b6a38411880b95ceabb418a178 /io_uring | |
| parent | ef075c1464ac9047e2cf7d23cb020bfd0b8e4b60 (diff) | |
io_uring/zcrx: fix post open error handling
[ Upstream commit 5d540e4508950c674d6feef1d95463d039bbf4f5 ]
Closing a queue doesn't guarantee that all associated page pools are
terminated right away, let the refcounting do the work instead of
releasing the zcrx ctx directly.
Cc: stable@vger.kernel.org
Fixes: e0793de24a9f6 ("io_uring/zcrx: set pp memory provider for an rx queue")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'io_uring')
| -rw-r--r-- | io_uring/zcrx.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index b133c85793c9..84e37900c068 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -515,9 +515,6 @@ static void io_close_queue(struct io_zcrx_ifq *ifq) .mp_priv = ifq, }; - if (ifq->if_rxq == -1) - return; - scoped_guard(mutex, &ifq->pp_lock) { netdev = ifq->netdev; netdev_tracker = ifq->netdev_tracker; @@ -525,7 +522,8 @@ static void io_close_queue(struct io_zcrx_ifq *ifq) } if (netdev) { - net_mp_close_rxq(netdev, ifq->if_rxq, &p); + if (ifq->if_rxq != -1) + net_mp_close_rxq(netdev, ifq->if_rxq, &p); netdev_put(netdev, &netdev_tracker); } ifq->if_rxq = -1; @@ -833,13 +831,12 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx, } return 0; netdev_put_unlock: - netdev_put(ifq->netdev, &ifq->netdev_tracker); netdev_unlock(ifq->netdev); err: scoped_guard(mutex, &ctx->mmap_lock) xa_erase(&ctx->zcrx_ctxs, id); ifq_free: - io_zcrx_ifq_free(ifq); + zcrx_unregister(ifq); return ret; } |
