net/fm10k: redefine link status semantics
[dpdk.git] / drivers / net / fm10k / fm10k_ethdev.c
index 15ea2a5..2587696 100644 (file)
@@ -1256,14 +1256,17 @@ static int
 fm10k_link_update(struct rte_eth_dev *dev,
        __rte_unused int wait_to_complete)
 {
+       struct fm10k_dev_info *dev_info =
+               FM10K_DEV_PRIVATE_TO_INFO(dev->data->dev_private);
        PMD_INIT_FUNC_TRACE();
 
-       /* The host-interface link is always up.  The speed is ~50Gbps per Gen3
-        * x8 PCIe interface. For now, we leave the speed undefined since there
-        * is no 50Gbps Ethernet. */
+       /* The speed is ~50Gbps per Gen3 x8 PCIe interface. For now, we
+        * leave the speed undefined since there is no 50Gbps Ethernet.
+        */
        dev->data->dev_link.link_speed  = 0;
        dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
-       dev->data->dev_link.link_status = ETH_LINK_UP;
+       dev->data->dev_link.link_status =
+               dev_info->sm_down ? ETH_LINK_DOWN : ETH_LINK_UP;
 
        return 0;
 }
@@ -1346,7 +1349,7 @@ fm10k_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
        return FM10K_NB_XSTATS;
 }
 
-static void
+static int
 fm10k_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 {
        uint64_t ipackets, opackets, ibytes, obytes;
@@ -1376,6 +1379,7 @@ fm10k_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
        stats->opackets = opackets;
        stats->ibytes = ibytes;
        stats->obytes = obytes;
+       return 0;
 }
 
 static void
@@ -3142,7 +3146,8 @@ static const struct rte_pci_id pci_id_fm10k_map[] = {
 
 static struct rte_pci_driver rte_pmd_fm10k = {
        .id_table = pci_id_fm10k_map,
-       .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+       .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
+                    RTE_PCI_DRV_IOVA_AS_VA,
        .probe = eth_fm10k_pci_probe,
        .remove = eth_fm10k_pci_remove,
 };