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

Function eth_from_pcaps

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

Source from the content-addressed store, hash-verified

1322}
1323
1324static int
1325eth_from_pcaps(struct rte_vdev_device *vdev,
1326 struct pmd_devargs_all *devargs_all)
1327{
1328 struct pmd_internals *internals = NULL;
1329 struct rte_eth_dev *eth_dev = NULL;
1330 struct pmd_devargs *rx_queues = &devargs_all->rx_queues;
1331 int single_iface = devargs_all->single_iface;
1332 unsigned int infinite_rx = devargs_all->infinite_rx;
1333 int ret;
1334
1335 ret = eth_from_pcaps_common(vdev, devargs_all, &internals, &eth_dev);
1336
1337 if (ret < 0)
1338 return ret;
1339
1340 /* store weather we are using a single interface for rx/tx or not */
1341 internals->single_iface = single_iface;
1342
1343 if (single_iface) {
1344 internals->if_index =
1345 osdep_iface_index_get(rx_queues->queue[0].name);
1346
1347 /* phy_mac arg is applied only if "iface" devarg is provided */
1348 if (rx_queues->phy_mac) {
1349 if (eth_pcap_update_mac(rx_queues->queue[0].name,
1350 eth_dev, vdev->device.numa_node) == 0)
1351 internals->phy_mac = 1;
1352 }
1353 }
1354
1355 internals->infinite_rx = infinite_rx;
1356 /* Assign rx ops. */
1357 if (infinite_rx)
1358 eth_dev->rx_pkt_burst = eth_pcap_rx_infinite;
1359 else if (devargs_all->is_rx_pcap || devargs_all->is_rx_iface ||
1360 single_iface)
1361 eth_dev->rx_pkt_burst = eth_pcap_rx;
1362 else
1363 eth_dev->rx_pkt_burst = eth_null_rx;
1364
1365 /* Assign tx ops. */
1366 if (devargs_all->is_tx_pcap)
1367 eth_dev->tx_pkt_burst = eth_pcap_tx_dumper;
1368 else if (devargs_all->is_tx_iface || single_iface)
1369 eth_dev->tx_pkt_burst = eth_pcap_tx;
1370 else
1371 eth_dev->tx_pkt_burst = eth_tx_drop;
1372
1373 rte_eth_dev_probing_finish(eth_dev);
1374 return 0;
1375}
1376
1377static void
1378eth_release_pcaps(struct pmd_devargs *pcaps,

Callers 1

pmd_pcap_probeFunction · 0.85

Calls 4

eth_from_pcaps_commonFunction · 0.85
eth_pcap_update_macFunction · 0.85
osdep_iface_index_getFunction · 0.70

Tested by

no test coverage detected