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

Function run_pdump_client_tests

dpdk/app/test/test_pdump.c:46–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46int
47run_pdump_client_tests(void)
48{
49 int flags = RTE_PDUMP_FLAG_TX, ret = 0, itr;
50 char deviceid[] = "net_ring_net_ringa";
51 struct rte_ring *ring_client;
52 struct rte_mempool *mp = NULL;
53 struct rte_eth_dev *eth_dev = NULL;
54 char poolname[] = "mbuf_pool_client";
55
56 ret = test_get_mempool(&mp, poolname);
57 if (ret < 0)
58 return -1;
59 mp->flags = 0x0000;
60 ring_client = rte_ring_create("SR0", RING_SIZE, rte_socket_id(), 0);
61 if (ring_client == NULL) {
62 printf("rte_ring_create SR0 failed");
63 return -1;
64 }
65
66 eth_dev = rte_eth_dev_attach_secondary(deviceid);
67 if (!eth_dev) {
68 printf("Failed to probe %s", deviceid);
69 return -1;
70 }
71 rte_eth_dev_probing_finish(eth_dev);
72
73 printf("\n***** flags = RTE_PDUMP_FLAG_TX *****\n");
74
75 for (itr = 0; itr < NUM_ITR; itr++) {
76 ret = rte_pdump_enable(portid, QUEUE_ID, flags, ring_client,
77 mp, NULL);
78 if (ret < 0) {
79 printf("rte_pdump_enable failed\n");
80 return -1;
81 }
82 printf("pdump_enable success\n");
83
84 ret = rte_pdump_disable(portid, QUEUE_ID, flags);
85 if (ret < 0) {
86 printf("rte_pdump_disable failed\n");
87 return -1;
88 }
89 printf("pdump_disable success\n");
90
91 ret = rte_pdump_enable_by_deviceid(deviceid, QUEUE_ID, flags,
92 ring_client, mp, NULL);
93 if (ret < 0) {
94 printf("rte_pdump_enable_by_deviceid failed\n");
95 return -1;
96 }
97 printf("pdump_enable_by_deviceid success\n");
98
99 ret = rte_pdump_disable_by_deviceid(deviceid, QUEUE_ID, flags);
100 if (ret < 0) {
101 printf("rte_pdump_disable_by_deviceid failed\n");
102 return -1;
103 }

Callers 1

test_pdumpFunction · 0.85

Calls 12

test_get_mempoolFunction · 0.85
rte_ring_createFunction · 0.85
rte_socket_idFunction · 0.85
rte_pdump_enableFunction · 0.85
rte_pdump_disableFunction · 0.85
test_ring_freeFunction · 0.85
test_mp_freeFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected