MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_empty_dequeue

Function test_empty_dequeue

dpdk/app/test/test_pmd_ring_perf.c:32–55  ·  view source on GitHub ↗

Get cycle counts for dequeuing from an empty ring. Should be 2 or 3 cycles */

Source from the content-addressed store, hash-verified

30
31/* Get cycle counts for dequeuing from an empty ring. Should be 2 or 3 cycles */
32static void
33test_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

Callers 1

test_ring_pmd_perfFunction · 0.70

Calls 4

rte_ring_sc_dequeue_bulkFunction · 0.85
rte_eth_rx_burstFunction · 0.85
rte_rdtscFunction · 0.50
printfFunction · 0.50

Tested by

no test coverage detected