ethdev: change promiscuous callbacks to return status
[dpdk.git] / drivers / net / iavf / iavf_ethdev.c
index 99b1f43..22a88c8 100644 (file)
@@ -43,8 +43,8 @@ static const uint32_t *iavf_dev_supported_ptypes_get(struct rte_eth_dev *dev);
 static int iavf_dev_stats_get(struct rte_eth_dev *dev,
                             struct rte_eth_stats *stats);
 static void iavf_dev_stats_reset(struct rte_eth_dev *dev);
-static void iavf_dev_promiscuous_enable(struct rte_eth_dev *dev);
-static void iavf_dev_promiscuous_disable(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_add_mac_addr(struct rte_eth_dev *dev,
@@ -634,7 +634,7 @@ iavf_dev_link_update(struct rte_eth_dev *dev,
        return 0;
 }
 
-static void
+static int
 iavf_dev_promiscuous_enable(struct rte_eth_dev *dev)
 {
        struct iavf_adapter *adapter =
@@ -643,14 +643,18 @@ iavf_dev_promiscuous_enable(struct rte_eth_dev *dev)
        int ret;
 
        if (vf->promisc_unicast_enabled)
-               return;
+               return 0;
 
        ret = iavf_config_promisc(adapter, TRUE, vf->promisc_multicast_enabled);
        if (!ret)
                vf->promisc_unicast_enabled = TRUE;
+       else
+               ret = -EAGAIN;
+
+       return ret;
 }
 
-static void
+static int
 iavf_dev_promiscuous_disable(struct rte_eth_dev *dev)
 {
        struct iavf_adapter *adapter =
@@ -659,11 +663,15 @@ iavf_dev_promiscuous_disable(struct rte_eth_dev *dev)
        int ret;
 
        if (!vf->promisc_unicast_enabled)
-               return;
+               return 0;
 
        ret = iavf_config_promisc(adapter, FALSE, vf->promisc_multicast_enabled);
        if (!ret)
                vf->promisc_unicast_enabled = FALSE;
+       else
+               ret = -EAGAIN;
+
+       return ret;
 }
 
 static void