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

Function eth_from_pcaps_common

dpdk/drivers/net/pcap/pcap_ethdev.c:1285–1322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1283}
1284
1285static int
1286eth_from_pcaps_common(struct rte_vdev_device *vdev,
1287 struct pmd_devargs_all *devargs_all,
1288 struct pmd_internals **internals, struct rte_eth_dev **eth_dev)
1289{
1290 struct pmd_process_private *pp;
1291 struct pmd_devargs *rx_queues = &devargs_all->rx_queues;
1292 struct pmd_devargs *tx_queues = &devargs_all->tx_queues;
1293 const unsigned int nb_rx_queues = rx_queues->num_of_queue;
1294 const unsigned int nb_tx_queues = tx_queues->num_of_queue;
1295 unsigned int i;
1296
1297 if (pmd_init_internals(vdev, nb_rx_queues, nb_tx_queues, internals,
1298 eth_dev) < 0)
1299 return -1;
1300
1301 pp = (*eth_dev)->process_private;
1302 for (i = 0; i < nb_rx_queues; i++) {
1303 struct pcap_rx_queue *rx = &(*internals)->rx_queue[i];
1304 struct devargs_queue *queue = &rx_queues->queue[i];
1305
1306 pp->rx_pcap[i] = queue->pcap;
1307 strlcpy(rx->name, queue->name, sizeof(rx->name));
1308 strlcpy(rx->type, queue->type, sizeof(rx->type));
1309 }
1310
1311 for (i = 0; i < nb_tx_queues; i++) {
1312 struct pcap_tx_queue *tx = &(*internals)->tx_queue[i];
1313 struct devargs_queue *queue = &tx_queues->queue[i];
1314
1315 pp->tx_dumper[i] = queue->dumper;
1316 pp->tx_pcap[i] = queue->pcap;
1317 strlcpy(tx->name, queue->name, sizeof(tx->name));
1318 strlcpy(tx->type, queue->type, sizeof(tx->type));
1319 }
1320
1321 return 0;
1322}
1323
1324static int
1325eth_from_pcaps(struct rte_vdev_device *vdev,

Callers 1

eth_from_pcapsFunction · 0.85

Calls 2

pmd_init_internalsFunction · 0.85
strlcpyFunction · 0.50

Tested by

no test coverage detected