net/dpaa2: advertise link status as driver flag
authorHemant Agrawal <hemant.agrawal@nxp.com>
Fri, 8 Dec 2017 05:21:17 +0000 (10:51 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
drivers/bus/fslmc/rte_fslmc.h
drivers/net/dpaa2/dpaa2_ethdev.c

index 4d0dab3..1524df8 100644 (file)
@@ -36,6 +36,10 @@ extern "C" {
 
 #define FSLMC_OBJECT_MAX_LEN 32   /**< Length of each device on bus */
 
+
+/** Device driver supports link state interrupt */
+#define RTE_DPAA2_DRV_INTR_LSC 0x0008
+
 /** Device driver supports IOVA as VA */
 #define RTE_DPAA2_DRV_IOVA_AS_VA 0X0040
 
index 3feada1..a982242 100644 (file)
@@ -1846,7 +1846,6 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
        }
 
        eth_dev->dev_ops = &dpaa2_ethdev_ops;
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
 
        eth_dev->rx_pkt_burst = dpaa2_dev_prefetch_rx;
        eth_dev->tx_pkt_burst = dpaa2_dev_tx;
@@ -1950,6 +1949,9 @@ rte_dpaa2_probe(struct rte_dpaa2_driver *dpaa2_drv,
        dpaa2_dev->eth_dev = eth_dev;
        eth_dev->data->rx_mbuf_alloc_failed = 0;
 
+       if (dpaa2_drv->drv_flags & RTE_DPAA2_DRV_INTR_LSC)
+               eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
+
        /* Invoke PMD device initialization function */
        diag = dpaa2_dev_init(eth_dev);
        if (diag == 0)
@@ -1977,7 +1979,7 @@ rte_dpaa2_remove(struct rte_dpaa2_device *dpaa2_dev)
 }
 
 static struct rte_dpaa2_driver rte_dpaa2_pmd = {
-       .drv_flags = RTE_DPAA2_DRV_IOVA_AS_VA,
+       .drv_flags = RTE_DPAA2_DRV_INTR_LSC | RTE_DPAA2_DRV_IOVA_AS_VA,
        .drv_type = DPAA2_ETH,
        .probe = rte_dpaa2_probe,
        .remove = rte_dpaa2_remove,