Skip to contentSkip to conversation

selftests: io_uring/zcrx: Use PAGE_SIZE for ring refill alignment

PATCH In review Haiyue Wang 2 participants 2 messages Apr 19, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: io_uring/zcrx: Use PAGE_SIZE for ring refill alignment

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

---
 tools/testing/selftests/drivers/net/hw/iou-zcrx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/drivers/net/hw/iou-zcrx.c +1 -1
index c26b4180eddd..b9f6eb43400a 100644
@@ -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)
Signature · 1 line
2.49.0
maintainer
#1 lore raw
Quoted 4 lines · 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

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

Signature · 1 line
Jens Axboe