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

Function eth_dev_stop

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

* This function gets called when the current port gets stopped. * Is the only place for us to close all the tx streams dumpers. * If not called the dumpers will be flushed within each tx burst. */

Source from the content-addressed store, hash-verified

678 * If not called the dumpers will be flushed within each tx burst.
679 */
680static int
681eth_dev_stop(struct rte_eth_dev *dev)
682{
683 unsigned int i;
684 struct pmd_internals *internals = dev->data->dev_private;
685 struct pmd_process_private *pp = dev->process_private;
686
687 /* Special iface case. Single pcap is open and shared between tx/rx. */
688 if (internals->single_iface) {
689 queue_missed_stat_on_stop_update(dev, 0);
690 if (pp->tx_pcap[0] != NULL) {
691 pcap_close(pp->tx_pcap[0]);
692 pp->tx_pcap[0] = NULL;
693 pp->rx_pcap[0] = NULL;
694 }
695 goto status_down;
696 }
697
698 for (i = 0; i < dev->data->nb_tx_queues; i++) {
699 if (pp->tx_dumper[i] != NULL) {
700 pcap_dump_close(pp->tx_dumper[i]);
701 pp->tx_dumper[i] = NULL;
702 }
703
704 if (pp->tx_pcap[i] != NULL) {
705 pcap_close(pp->tx_pcap[i]);
706 pp->tx_pcap[i] = NULL;
707 }
708 }
709
710 for (i = 0; i < dev->data->nb_rx_queues; i++) {
711 if (pp->rx_pcap[i] != NULL) {
712 queue_missed_stat_on_stop_update(dev, i);
713 pcap_close(pp->rx_pcap[i]);
714 pp->rx_pcap[i] = NULL;
715 }
716 }
717
718status_down:
719 for (i = 0; i < dev->data->nb_rx_queues; i++)
720 dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
721
722 for (i = 0; i < dev->data->nb_tx_queues; i++)
723 dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
724
725 dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN;
726
727 return 0;
728}
729
730static int
731eth_dev_configure(struct rte_eth_dev *dev __rte_unused)

Callers 1

eth_dev_closeFunction · 0.70

Calls 1

Tested by

no test coverage detected