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

Function eth_dev_start

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

Source from the content-addressed store, hash-verified

605}
606
607static int
608eth_dev_start(struct rte_eth_dev *dev)
609{
610 unsigned int i;
611 struct pmd_internals *internals = dev->data->dev_private;
612 struct pmd_process_private *pp = dev->process_private;
613 struct pcap_tx_queue *tx;
614 struct pcap_rx_queue *rx;
615
616 /* Special iface case. Single pcap is open and shared between tx/rx. */
617 if (internals->single_iface) {
618 tx = &internals->tx_queue[0];
619 rx = &internals->rx_queue[0];
620
621 if (!pp->tx_pcap[0] &&
622 strcmp(tx->type, ETH_PCAP_IFACE_ARG) == 0) {
623 if (open_single_iface(tx->name, &pp->tx_pcap[0]) < 0)
624 return -1;
625 pp->rx_pcap[0] = pp->tx_pcap[0];
626 }
627
628 goto status_up;
629 }
630
631 /* If not open already, open tx pcaps/dumpers */
632 for (i = 0; i < dev->data->nb_tx_queues; i++) {
633 tx = &internals->tx_queue[i];
634
635 if (!pp->tx_dumper[i] &&
636 strcmp(tx->type, ETH_PCAP_TX_PCAP_ARG) == 0) {
637 if (open_single_tx_pcap(tx->name,
638 &pp->tx_dumper[i]) < 0)
639 return -1;
640 } else if (!pp->tx_pcap[i] &&
641 strcmp(tx->type, ETH_PCAP_TX_IFACE_ARG) == 0) {
642 if (open_single_iface(tx->name, &pp->tx_pcap[i]) < 0)
643 return -1;
644 }
645 }
646
647 /* If not open already, open rx pcaps */
648 for (i = 0; i < dev->data->nb_rx_queues; i++) {
649 rx = &internals->rx_queue[i];
650
651 if (pp->rx_pcap[i] != NULL)
652 continue;
653
654 if (strcmp(rx->type, ETH_PCAP_RX_PCAP_ARG) == 0) {
655 if (open_single_rx_pcap(rx->name, &pp->rx_pcap[i]) < 0)
656 return -1;
657 } else if (strcmp(rx->type, ETH_PCAP_RX_IFACE_ARG) == 0) {
658 if (open_single_iface(rx->name, &pp->rx_pcap[i]) < 0)
659 return -1;
660 }
661 }
662
663status_up:
664 for (i = 0; i < dev->data->nb_rx_queues; i++)

Callers

nothing calls this directly

Calls 4

strcmpFunction · 0.85
open_single_ifaceFunction · 0.85
open_single_tx_pcapFunction · 0.85
open_single_rx_pcapFunction · 0.85

Tested by

no test coverage detected