diff --git a/test/zcrx.c b/test/zcrx.c index 55c4c2bb1..e39463137 100644 --- a/test/zcrx.c +++ b/test/zcrx.c @@ -23,7 +23,7 @@ static unsigned int ifidx, rxq; #define AREA_PAGES 132 #define PAGE_SIZE 4096 #define AREA_SZ AREA_PAGES * PAGE_SIZE -#define RQ_ENTRIES 64 +#define RQ_ENTRIES 128 /* this is one more than the # of free pages after filling hw rxq */ #define LOOP_COUNT 5 #define DEV_ENV_VAR "NETIF" @@ -49,7 +49,7 @@ static int probe_zcrx(void *area) struct io_uring_zcrx_ifq_reg reg = { .if_idx = ifidx, .if_rxq = rxq, - .rq_entries = 8, + .rq_entries = RQ_ENTRIES, .area_ptr = (__u64)(unsigned long)&area_reg, }; struct io_uring ring; @@ -105,7 +105,7 @@ static int test_invalid_if(void *area) struct io_uring_zcrx_ifq_reg reg = { .if_idx = -1, .if_rxq = rxq, - .rq_entries = 8, + .rq_entries = RQ_ENTRIES, .area_ptr = (__u64)(unsigned long)&area_reg, }; @@ -137,7 +137,7 @@ static int test_invalid_ifq_collision(void *area) struct io_uring_zcrx_ifq_reg reg = { .if_idx = ifidx, .if_rxq = rxq, - .rq_entries = 8, + .rq_entries = RQ_ENTRIES, .area_ptr = (__u64)(unsigned long)&area_reg, }; int ret; @@ -207,14 +207,14 @@ static int test_rq_setup(void *area) return T_EXIT_FAIL; } - reg.rq_entries = 7; + reg.rq_entries = RQ_ENTRIES - 1; ret = try_register_ifq(®); if (ret != 0) { fprintf(stderr, "ifq registration failed %i\n", ret); return T_EXIT_FAIL; } - if (reg.rq_entries == 7) { + if (reg.rq_entries == RQ_ENTRIES - 1) { fprintf(stderr, "registered non pow2 refill entries %i\n", reg.rq_entries); return T_EXIT_FAIL; @@ -570,7 +570,7 @@ static void refill_garbage(struct recv_data *rd, uint64_t area_token) rqe->off += AREA_SZ; i++; - for (; i < RQ_ENTRIES; i++) { + for (; i < rq_ring->ring_entries; i++) { rqe = get_refill_entry(rq_ring); rqe->off = ((uint64_t)1 << IORING_ZCRX_AREA_SHIFT) - 1; }