Get cycle counts for dequeuing from an empty ring. Should be 2 or 3 cycles */
| 30 | |
| 31 | /* Get cycle counts for dequeuing from an empty ring. Should be 2 or 3 cycles */ |
| 32 | static void |
| 33 | test_empty_dequeue(void) |
| 34 | { |
| 35 | const unsigned iter_shift = 26; |
| 36 | const unsigned iterations = 1 << iter_shift; |
| 37 | unsigned i = 0; |
| 38 | void *burst[MAX_BURST]; |
| 39 | |
| 40 | const uint64_t sc_start = rte_rdtsc(); |
| 41 | for (i = 0; i < iterations; i++) |
| 42 | rte_ring_sc_dequeue_bulk(r, burst, bulk_sizes[0], NULL); |
| 43 | const uint64_t sc_end = rte_rdtsc(); |
| 44 | |
| 45 | const uint64_t eth_start = rte_rdtsc(); |
| 46 | for (i = 0; i < iterations; i++) |
| 47 | rte_eth_rx_burst(ring_ethdev_port, 0, (void *)burst, |
| 48 | bulk_sizes[0]); |
| 49 | const uint64_t eth_end = rte_rdtsc(); |
| 50 | |
| 51 | printf("Ring empty dequeue : %.1F\n", |
| 52 | (double)(sc_end - sc_start) / iterations); |
| 53 | printf("Ethdev empty dequeue: %.1F\n", |
| 54 | (double)(eth_end - eth_start) / iterations); |
| 55 | } |
| 56 | |
| 57 | /* |
| 58 | * Test function that determines how long an enqueue + dequeue of a single item |
no test coverage detected