ethdev: promote sibling iterators to stable
[dpdk.git] / drivers / net / octeontx2 / otx2_ethdev.c
index 0a420c1..75d4cab 100644 (file)
@@ -42,7 +42,8 @@ nix_get_tx_offload_capa(struct otx2_eth_dev *dev)
 
 static const struct otx2_dev_ops otx2_dev_ops = {
        .link_status_update = otx2_eth_dev_link_status_update,
-       .ptp_info_update = otx2_eth_dev_ptp_info_update
+       .ptp_info_update = otx2_eth_dev_ptp_info_update,
+       .link_status_get = otx2_eth_dev_link_status_get,
 };
 
 static int
@@ -2170,6 +2171,7 @@ otx2_nix_dev_stop(struct rte_eth_dev *eth_dev)
        struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);
        struct rte_mbuf *rx_pkts[32];
        struct otx2_eth_rxq *rxq;
+       struct rte_eth_link link;
        int count, i, j, rc;
 
        nix_lf_switch_header_type_enable(dev, false);
@@ -2195,6 +2197,10 @@ otx2_nix_dev_stop(struct rte_eth_dev *eth_dev)
        for (i = 0; i < eth_dev->data->nb_tx_queues; i++)
                otx2_nix_tx_queue_stop(eth_dev, i);
 
+       /* Bring down link status internally */
+       memset(&link, 0, sizeof(link));
+       rte_eth_linkstatus_set(eth_dev, &link);
+
        return 0;
 }
 
@@ -2635,6 +2641,11 @@ otx2_eth_dev_uninit(struct rte_eth_dev *eth_dev, bool mbox_close)
 
        nix_cgx_stop_link_event(dev);
 
+       /* Unregister the dev ops, this is required to stop VFs from
+        * receiving link status updates on exit path.
+        */
+       dev->ops = NULL;
+
        /* Free up SQs */
        for (i = 0; i < eth_dev->data->nb_tx_queues; i++) {
                otx2_nix_tx_queue_release(eth_dev->data->tx_queues[i]);