printf("enqueue 1 obj\n");
ret = rte_ring_sp_enqueue_burst(r, cur_src, 1, NULL);
cur_src += 1;
- if ((ret & RTE_RING_SZ_MASK) != 1)
+ if (ret != 1)
goto fail;
printf("enqueue 2 objs\n");
ret = rte_ring_sp_enqueue_burst(r, cur_src, 2, NULL);
cur_src += 2;
- if ((ret & RTE_RING_SZ_MASK) != 2)
+ if (ret != 2)
goto fail;
printf("enqueue MAX_BULK objs\n");
ret = rte_ring_sp_enqueue_burst(r, cur_src, MAX_BULK, NULL);
cur_src += MAX_BULK;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK)
+ if (ret != MAX_BULK)
goto fail;
printf("dequeue 1 obj\n");
ret = rte_ring_sc_dequeue_burst(r, cur_dst, 1, NULL);
cur_dst += 1;
- if ((ret & RTE_RING_SZ_MASK) != 1)
+ if (ret != 1)
goto fail;
printf("dequeue 2 objs\n");
ret = rte_ring_sc_dequeue_burst(r, cur_dst, 2, NULL);
cur_dst += 2;
- if ((ret & RTE_RING_SZ_MASK) != 2)
+ if (ret != 2)
goto fail;
printf("dequeue MAX_BULK objs\n");
ret = rte_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK, NULL);
cur_dst += MAX_BULK;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK)
+ if (ret != MAX_BULK)
goto fail;
/* check data */
for (i = 0; i< (RING_SIZE/MAX_BULK - 1); i++) {
ret = rte_ring_sp_enqueue_burst(r, cur_src, MAX_BULK, NULL);
cur_src += MAX_BULK;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK) {
+ if (ret != MAX_BULK)
goto fail;
- }
}
printf("Enqueue 2 objects, free entries = MAX_BULK - 2 \n");
ret = rte_ring_sp_enqueue_burst(r, cur_src, 2, NULL);
cur_src += 2;
- if ((ret & RTE_RING_SZ_MASK) != 2)
+ if (ret != 2)
goto fail;
printf("Enqueue the remaining entries = MAX_BULK - 2 \n");
/* Always one free entry left */
ret = rte_ring_sp_enqueue_burst(r, cur_src, MAX_BULK, NULL);
cur_src += MAX_BULK - 3;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK - 3)
+ if (ret != MAX_BULK - 3)
goto fail;
printf("Test if ring is full \n");
printf("Test enqueue for a full entry \n");
ret = rte_ring_sp_enqueue_burst(r, cur_src, MAX_BULK, NULL);
- if ((ret & RTE_RING_SZ_MASK) != 0)
+ if (ret != 0)
goto fail;
printf("Test dequeue without enough objects \n");
for (i = 0; i<RING_SIZE/MAX_BULK - 1; i++) {
ret = rte_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK, NULL);
cur_dst += MAX_BULK;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK)
+ if (ret != MAX_BULK)
goto fail;
}
/* Available memory space for the exact MAX_BULK entries */
ret = rte_ring_sc_dequeue_burst(r, cur_dst, 2, NULL);
cur_dst += 2;
- if ((ret & RTE_RING_SZ_MASK) != 2)
+ if (ret != 2)
goto fail;
ret = rte_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK, NULL);
cur_dst += MAX_BULK - 3;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK - 3)
+ if (ret != MAX_BULK - 3)
goto fail;
printf("Test if ring is empty \n");
printf("enqueue 1 obj\n");
ret = rte_ring_mp_enqueue_burst(r, cur_src, 1, NULL);
cur_src += 1;
- if ((ret & RTE_RING_SZ_MASK) != 1)
+ if (ret != 1)
goto fail;
printf("enqueue 2 objs\n");
ret = rte_ring_mp_enqueue_burst(r, cur_src, 2, NULL);
cur_src += 2;
- if ((ret & RTE_RING_SZ_MASK) != 2)
+ if (ret != 2)
goto fail;
printf("enqueue MAX_BULK objs\n");
ret = rte_ring_mp_enqueue_burst(r, cur_src, MAX_BULK, NULL);
cur_src += MAX_BULK;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK)
+ if (ret != MAX_BULK)
goto fail;
printf("dequeue 1 obj\n");
ret = rte_ring_mc_dequeue_burst(r, cur_dst, 1, NULL);
cur_dst += 1;
- if ((ret & RTE_RING_SZ_MASK) != 1)
+ if (ret != 1)
goto fail;
printf("dequeue 2 objs\n");
ret = rte_ring_mc_dequeue_burst(r, cur_dst, 2, NULL);
cur_dst += 2;
- if ((ret & RTE_RING_SZ_MASK) != 2)
+ if (ret != 2)
goto fail;
printf("dequeue MAX_BULK objs\n");
ret = rte_ring_mc_dequeue_burst(r, cur_dst, MAX_BULK, NULL);
cur_dst += MAX_BULK;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK)
+ if (ret != MAX_BULK)
goto fail;
/* check data */
for (i = 0; i<RING_SIZE/MAX_BULK; i++) {
ret = rte_ring_mp_enqueue_burst(r, cur_src, MAX_BULK, NULL);
cur_src += MAX_BULK;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK)
+ if (ret != MAX_BULK)
goto fail;
ret = rte_ring_mc_dequeue_burst(r, cur_dst, MAX_BULK, NULL);
cur_dst += MAX_BULK;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK)
+ if (ret != MAX_BULK)
goto fail;
}
for (i = 0; i<RING_SIZE/MAX_BULK - 1; i++) {
ret = rte_ring_mp_enqueue_burst(r, cur_src, MAX_BULK, NULL);
cur_src += MAX_BULK;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK)
+ if (ret != MAX_BULK)
goto fail;
}
/* Available memory space for the exact MAX_BULK objects */
ret = rte_ring_mp_enqueue_burst(r, cur_src, 2, NULL);
cur_src += 2;
- if ((ret & RTE_RING_SZ_MASK) != 2)
+ if (ret != 2)
goto fail;
ret = rte_ring_mp_enqueue_burst(r, cur_src, MAX_BULK, NULL);
cur_src += MAX_BULK - 3;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK - 3)
+ if (ret != MAX_BULK - 3)
goto fail;
for (i = 0; i<RING_SIZE/MAX_BULK - 1; i++) {
ret = rte_ring_mc_dequeue_burst(r, cur_dst, MAX_BULK, NULL);
cur_dst += MAX_BULK;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK)
+ if (ret != MAX_BULK)
goto fail;
}
/* Available objects - the exact MAX_BULK */
ret = rte_ring_mc_dequeue_burst(r, cur_dst, 2, NULL);
cur_dst += 2;
- if ((ret & RTE_RING_SZ_MASK) != 2)
+ if (ret != 2)
goto fail;
ret = rte_ring_mc_dequeue_burst(r, cur_dst, MAX_BULK, NULL);
cur_dst += MAX_BULK - 3;
- if ((ret & RTE_RING_SZ_MASK) != MAX_BULK - 3)
+ if (ret != MAX_BULK - 3)
goto fail;
/* check data */
ret = rte_ring_enqueue_burst(r, cur_src, 2, NULL);
cur_src += 2;
- if ((ret & RTE_RING_SZ_MASK) != 2)
+ if (ret != 2)
goto fail;
ret = rte_ring_dequeue_burst(r, cur_dst, 2, NULL);
/* Covering the ring burst operation */
ret = rte_ring_enqueue_burst(rp, obj, 2, NULL);
- if ((ret & RTE_RING_SZ_MASK) != 2) {
+ if (ret != 2) {
printf("test_ring_basic_ex: rte_ring_enqueue_burst fails \n");
goto fail_test;
}