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

Function init_ports

dpdk/app/test/test_event_eth_rx_adapter.c:185–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185static int
186init_ports(int num_ports)
187{
188 uint16_t portid;
189 int retval;
190
191 struct rte_mempool *ptr = rte_mempool_lookup("packet_pool");
192
193 if (ptr == NULL)
194 default_params.mp = rte_pktmbuf_pool_create("packet_pool",
195 NB_MBUFS,
196 MBUF_CACHE_SIZE,
197 MBUF_PRIV_SIZE,
198 RTE_MBUF_DEFAULT_BUF_SIZE,
199 rte_socket_id());
200 else
201 default_params.mp = ptr;
202
203 if (!default_params.mp)
204 return -ENOMEM;
205
206 RTE_ETH_FOREACH_DEV(portid) {
207 retval = port_init(portid, default_params.mp);
208 if (retval)
209 return retval;
210 }
211
212 return 0;
213}
214
215static int
216testsuite_setup(void)

Callers 2

testsuite_setupFunction · 0.70

Calls 4

rte_mempool_lookupFunction · 0.85
rte_pktmbuf_pool_createFunction · 0.85
rte_socket_idFunction · 0.85
port_initFunction · 0.70

Tested by

no test coverage detected