public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH iouring] io_uring/zcrx: don't set rx_page_size when not requested
@ 2026-02-27 17:07 Jakub Kicinski
  2026-02-27 19:23 ` Pavel Begunkov
  2026-02-27 19:33 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2026-02-27 17:07 UTC (permalink / raw)
  To: axboe; +Cc: Jakub Kicinski, asml.silence, io-uring, netdev

The rx_buf_len parameter was recently added to the Rx zero-copy
implementation. The expectation is that when not set system will
maintain previous behavior and use the default buffer size (PAGE_SIZE).

This works correctly at the iouring level, but we don't preserve
the same "zero means default" semantics when registering the memory
provider on the netdev. mp_param.rx_page_size is unconditionally
set to PAGE_SIZE. This causes __net_mp_open_rxq() to check for
QCFG_RX_PAGE_SIZE support in the driver, and return -EOPNOTSUPP
for drivers that don't advertise it -- even though the user never
asked for large buffers.

Only set mp_param.rx_page_size when rx_buf_len was explicitly provided,
so that the default page size path works on all zcrx-capable drivers.
mlx5 and fbnic only support 4kB pages in the current release.

Fixes: 795663b4d160 ("io_uring/zcrx: implement large rx buffer support")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: asml.silence@gmail.com
CC: axboe@kernel.dk
CC: io-uring@vger.kernel.org
CC: netdev@vger.kernel.org
---
 io_uring/zcrx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index 28150c6578e3..594220c8eb7e 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -833,7 +833,8 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
 	if (ret)
 		goto netdev_put_unlock;
 
-	mp_param.rx_page_size = 1U << ifq->niov_shift;
+	if (reg.rx_buf_len)
+		mp_param.rx_page_size = 1U << ifq->niov_shift;
 	mp_param.mp_ops = &io_uring_pp_zc_ops;
 	mp_param.mp_priv = ifq;
 	ret = __net_mp_open_rxq(ifq->netdev, reg.if_rxq, &mp_param, NULL);
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iouring] io_uring/zcrx: don't set rx_page_size when not requested
  2026-02-27 17:07 [PATCH iouring] io_uring/zcrx: don't set rx_page_size when not requested Jakub Kicinski
@ 2026-02-27 19:23 ` Pavel Begunkov
  2026-02-27 19:33 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Begunkov @ 2026-02-27 19:23 UTC (permalink / raw)
  To: Jakub Kicinski, axboe; +Cc: io-uring, netdev

On 2/27/26 17:07, Jakub Kicinski wrote:
> The rx_buf_len parameter was recently added to the Rx zero-copy
> implementation. The expectation is that when not set system will
> maintain previous behavior and use the default buffer size (PAGE_SIZE).
> 
> This works correctly at the iouring level, but we don't preserve
> the same "zero means default" semantics when registering the memory
> provider on the netdev. mp_param.rx_page_size is unconditionally
> set to PAGE_SIZE. This causes __net_mp_open_rxq() to check for
> QCFG_RX_PAGE_SIZE support in the driver, and return -EOPNOTSUPP
> for drivers that don't advertise it -- even though the user never
> asked for large buffers.
> 
> Only set mp_param.rx_page_size when rx_buf_len was explicitly provided,
> so that the default page size path works on all zcrx-capable drivers.
> mlx5 and fbnic only support 4kB pages in the current release.

Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>

Jens, can you take it into io_uring-7.0?

-- 
Pavel Begunkov


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH iouring] io_uring/zcrx: don't set rx_page_size when not requested
  2026-02-27 17:07 [PATCH iouring] io_uring/zcrx: don't set rx_page_size when not requested Jakub Kicinski
  2026-02-27 19:23 ` Pavel Begunkov
@ 2026-02-27 19:33 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2026-02-27 19:33 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: asml.silence, io-uring, netdev


On Fri, 27 Feb 2026 09:07:45 -0800, Jakub Kicinski wrote:
> The rx_buf_len parameter was recently added to the Rx zero-copy
> implementation. The expectation is that when not set system will
> maintain previous behavior and use the default buffer size (PAGE_SIZE).
> 
> This works correctly at the iouring level, but we don't preserve
> the same "zero means default" semantics when registering the memory
> provider on the netdev. mp_param.rx_page_size is unconditionally
> set to PAGE_SIZE. This causes __net_mp_open_rxq() to check for
> QCFG_RX_PAGE_SIZE support in the driver, and return -EOPNOTSUPP
> for drivers that don't advertise it -- even though the user never
> asked for large buffers.
> 
> [...]

Applied, thanks!

[1/1] io_uring/zcrx: don't set rx_page_size when not requested
      commit: 3d17d76d1ffb139a7492317b196ee03c8eabc9dc

Best regards,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-27 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 17:07 [PATCH iouring] io_uring/zcrx: don't set rx_page_size when not requested Jakub Kicinski
2026-02-27 19:23 ` Pavel Begunkov
2026-02-27 19:33 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox