MCPcopy Index your code
hub / github.com/F-Stack/f-stack / test_setup

Function test_setup

dpdk/app/test/test_pcapng.c:115–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115static int
116test_setup(void)
117{
118 port_id = rte_eth_dev_count_avail();
119
120 /* Make a dummy null device to snoop on */
121 if (rte_vdev_init(null_dev, NULL) != 0) {
122 fprintf(stderr, "Failed to create vdev '%s'\n", null_dev);
123 goto fail;
124 }
125
126 /* Make a pool for cloned packets */
127 mp = rte_pktmbuf_pool_create_by_ops("pcapng_test_pool",
128 MAX_BURST * 32, 0, 0,
129 rte_pcapng_mbuf_size(pkt_len) + 128,
130 SOCKET_ID_ANY, "ring_mp_sc");
131 if (mp == NULL) {
132 fprintf(stderr, "Cannot create mempool\n");
133 goto fail;
134 }
135
136 return 0;
137
138fail:
139 rte_vdev_uninit(null_dev);
140 rte_mempool_free(mp);
141 return -1;
142}
143
144static int
145fill_pcapng_file(rte_pcapng_t *pcapng, unsigned int num_packets)

Callers

nothing calls this directly

Calls 6

rte_eth_dev_count_availFunction · 0.85
rte_vdev_initFunction · 0.85
rte_pcapng_mbuf_sizeFunction · 0.85
rte_vdev_uninitFunction · 0.85
rte_mempool_freeFunction · 0.85

Tested by

no test coverage detected