Commit 48f253d6 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe
Browse files

io_uring/zcrx: warn on alloc with non-empty pp cache



Page pool ensures the cache is empty before asking to refill it. Warn if
the assumption is violated.

Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://patch.msgid.link/9c9792d6e65f3780d57ff83b6334d341ed9a5f29.1774261953.git.asml.silence@gmail.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 7df542a6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1075,8 +1075,8 @@ static netmem_ref io_pp_zc_alloc_netmems(struct page_pool *pp, gfp_t gfp)
	struct io_zcrx_ifq *ifq = io_pp_to_ifq(pp);

	/* pp should already be ensuring that */
	if (unlikely(pp->alloc.count))
		goto out_return;
	if (WARN_ON_ONCE(pp->alloc.count))
		return 0;

	io_zcrx_ring_refill(pp, ifq);
	if (likely(pp->alloc.count))