public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] selftests: io_uring/zcrx: Use PAGE_SIZE for ring refill alignment
@ 2025-04-19  9:57 Haiyue Wang
  2025-04-19 12:53 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Haiyue Wang @ 2025-04-19  9:57 UTC (permalink / raw)
  To: io-uring; +Cc: Haiyue Wang

According to the 'Create refill ring' section in [1], use the macro
PAGE_SIZE instead of 4096 hard code number.

[1]: https://www.kernel.org/doc/html/latest/networking/iou-zcrx.html

Signed-off-by: Haiyue Wang <haiyuewa@163.com>
---
 tools/testing/selftests/drivers/net/hw/iou-zcrx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c
index c26b4180eddd..b9f6eb43400a 100644
--- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c
+++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c
@@ -115,7 +115,7 @@ static inline size_t get_refill_ring_size(unsigned int rq_entries)
 	ring_size = rq_entries * sizeof(struct io_uring_zcrx_rqe);
 	/* add space for the header (head/tail/etc.) */
 	ring_size += PAGE_SIZE;
-	return ALIGN_UP(ring_size, 4096);
+	return ALIGN_UP(ring_size, PAGE_SIZE);
 }
 
 static void setup_zcrx(struct io_uring *ring)
-- 
2.49.0


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

* Re: [PATCH v1] selftests: io_uring/zcrx: Use PAGE_SIZE for ring refill alignment
  2025-04-19  9:57 [PATCH v1] selftests: io_uring/zcrx: Use PAGE_SIZE for ring refill alignment Haiyue Wang
@ 2025-04-19 12:53 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2025-04-19 12:53 UTC (permalink / raw)
  To: Haiyue Wang, io-uring

On 4/19/25 3:57 AM, Haiyue Wang wrote:
> According to the 'Create refill ring' section in [1], use the macro
> PAGE_SIZE instead of 4096 hard code number.
> 
> [1]: https://www.kernel.org/doc/html/latest/networking/iou-zcrx.html

Same here, should use a runtime query to get it. This is not like
in-kernel code where PAGE_SIZE can indeed be used.

-- 
Jens Axboe


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

end of thread, other threads:[~2025-04-19 12:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-19  9:57 [PATCH v1] selftests: io_uring/zcrx: Use PAGE_SIZE for ring refill alignment Haiyue Wang
2025-04-19 12:53 ` Jens Axboe

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