net/mlx5: add ConnectX6-DX device ID
[dpdk.git] / drivers / net / iavf / iavf_ethdev.c
index e1c4261..eebc49a 100644 (file)
@@ -45,8 +45,8 @@ static int iavf_dev_stats_get(struct rte_eth_dev *dev,
 static int iavf_dev_stats_reset(struct rte_eth_dev *dev);
 static int iavf_dev_promiscuous_enable(struct rte_eth_dev *dev);
 static int iavf_dev_promiscuous_disable(struct rte_eth_dev *dev);
-static void iavf_dev_allmulticast_enable(struct rte_eth_dev *dev);
-static void iavf_dev_allmulticast_disable(struct rte_eth_dev *dev);
+static int iavf_dev_allmulticast_enable(struct rte_eth_dev *dev);
+static int iavf_dev_allmulticast_disable(struct rte_eth_dev *dev);
 static int iavf_dev_add_mac_addr(struct rte_eth_dev *dev,
                                struct rte_ether_addr *addr,
                                uint32_t index,
@@ -76,6 +76,16 @@ static int iavf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,
 int iavf_logtype_init;
 int iavf_logtype_driver;
 
+#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+int iavf_logtype_rx;
+#endif
+#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+int iavf_logtype_tx;
+#endif
+#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
+int iavf_logtype_tx_free;
+#endif
+
 static const struct rte_pci_id pci_id_iavf_map[] = {
        { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_ADAPTIVE_VF) },
        { .vendor_id = 0, /* sentinel */ },
@@ -131,16 +141,11 @@ iavf_dev_configure(struct rte_eth_dev *dev)
        struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
 
        ad->rx_bulk_alloc_allowed = true;
-#ifdef RTE_LIBRTE_IAVF_INC_VECTOR
        /* Initialize to TRUE. If any of Rx queues doesn't meet the
         * vector Rx/Tx preconditions, it will be reset.
         */
        ad->rx_vec_allowed = true;
        ad->tx_vec_allowed = true;
-#else
-       ad->rx_vec_allowed = false;
-       ad->tx_vec_allowed = false;
-#endif
 
        /* Vlan stripping setting */
        if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
@@ -674,7 +679,7 @@ iavf_dev_promiscuous_disable(struct rte_eth_dev *dev)
        return ret;
 }
 
-static void
+static int
 iavf_dev_allmulticast_enable(struct rte_eth_dev *dev)
 {
        struct iavf_adapter *adapter =
@@ -683,14 +688,18 @@ iavf_dev_allmulticast_enable(struct rte_eth_dev *dev)
        int ret;
 
        if (vf->promisc_multicast_enabled)
-               return;
+               return 0;
 
        ret = iavf_config_promisc(adapter, vf->promisc_unicast_enabled, TRUE);
        if (!ret)
                vf->promisc_multicast_enabled = TRUE;
+       else
+               ret = -EAGAIN;
+
+       return ret;
 }
 
-static void
+static int
 iavf_dev_allmulticast_disable(struct rte_eth_dev *dev)
 {
        struct iavf_adapter *adapter =
@@ -699,11 +708,15 @@ iavf_dev_allmulticast_disable(struct rte_eth_dev *dev)
        int ret;
 
        if (!vf->promisc_multicast_enabled)
-               return;
+               return 0;
 
        ret = iavf_config_promisc(adapter, vf->promisc_unicast_enabled, FALSE);
        if (!ret)
                vf->promisc_multicast_enabled = FALSE;
+       else
+               ret = -EAGAIN;
+
+       return ret;
 }
 
 static int
@@ -1432,6 +1445,24 @@ RTE_INIT(iavf_init_log)
        iavf_logtype_driver = rte_log_register("pmd.net.iavf.driver");
        if (iavf_logtype_driver >= 0)
                rte_log_set_level(iavf_logtype_driver, RTE_LOG_NOTICE);
+
+#ifdef RTE_LIBRTE_IAVF_DEBUG_RX
+       iavf_logtype_rx = rte_log_register("pmd.net.iavf.rx");
+       if (iavf_logtype_rx >= 0)
+               rte_log_set_level(iavf_logtype_rx, RTE_LOG_DEBUG);
+#endif
+
+#ifdef RTE_LIBRTE_IAVF_DEBUG_TX
+       iavf_logtype_tx = rte_log_register("pmd.net.iavf.tx");
+       if (iavf_logtype_tx >= 0)
+               rte_log_set_level(iavf_logtype_tx, RTE_LOG_DEBUG);
+#endif
+
+#ifdef RTE_LIBRTE_IAVF_DEBUG_TX_FREE
+       iavf_logtype_tx_free = rte_log_register("pmd.net.iavf.tx_free");
+       if (iavf_logtype_tx_free >= 0)
+               rte_log_set_level(iavf_logtype_tx_free, RTE_LOG_DEBUG);
+#endif
 }
 
 /* memory func for base code */