ethdev: make stats and xstats reset callbacks return int
[dpdk.git] / drivers / net / dpaa2 / dpaa2_ethdev.c
index dd6a78f..363208c 100644 (file)
@@ -243,7 +243,7 @@ dpaa2_fw_version_get(struct rte_eth_dev *dev,
                return 0;
 }
 
-static void
+static int
 dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
        struct dpaa2_dev_priv *priv = dev->data->dev_private;
@@ -269,6 +269,8 @@ dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
        dev_info->max_vfs = 0;
        dev_info->max_vmdq_pools = ETH_16_POOLS;
        dev_info->flow_type_rss_offloads = DPAA2_RSS_OFFLOAD_ALL;
+
+       return 0;
 }
 
 static int
@@ -985,7 +987,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev)
        rte_eth_linkstatus_set(dev, &link);
 }
 
-static void
+static int
 dpaa2_dev_promiscuous_enable(
                struct rte_eth_dev *dev)
 {
@@ -997,7 +999,7 @@ dpaa2_dev_promiscuous_enable(
 
        if (dpni == NULL) {
                DPAA2_PMD_ERR("dpni is NULL");
-               return;
+               return -ENODEV;
        }
 
        ret = dpni_set_unicast_promisc(dpni, CMD_PRI_LOW, priv->token, true);
@@ -1007,9 +1009,11 @@ dpaa2_dev_promiscuous_enable(
        ret = dpni_set_multicast_promisc(dpni, CMD_PRI_LOW, priv->token, true);
        if (ret < 0)
                DPAA2_PMD_ERR("Unable to enable M promisc mode %d", ret);
+
+       return ret;
 }
 
-static void
+static int
 dpaa2_dev_promiscuous_disable(
                struct rte_eth_dev *dev)
 {
@@ -1021,7 +1025,7 @@ dpaa2_dev_promiscuous_disable(
 
        if (dpni == NULL) {
                DPAA2_PMD_ERR("dpni is NULL");
-               return;
+               return -ENODEV;
        }
 
        ret = dpni_set_unicast_promisc(dpni, CMD_PRI_LOW, priv->token, false);
@@ -1035,6 +1039,8 @@ dpaa2_dev_promiscuous_disable(
                        DPAA2_PMD_ERR("Unable to disable M promisc mode %d",
                                      ret);
        }
+
+       return ret;
 }
 
 static void
@@ -1423,12 +1429,12 @@ dpaa2_xstats_get_names_by_id(
        return limit;
 }
 
-static void
+static int
 dpaa2_dev_stats_reset(struct rte_eth_dev *dev)
 {
        struct dpaa2_dev_priv *priv = dev->data->dev_private;
        struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;
-       int32_t  retcode;
+       int retcode;
        int i;
        struct dpaa2_queue *dpaa2_q;
 
@@ -1436,7 +1442,7 @@ dpaa2_dev_stats_reset(struct rte_eth_dev *dev)
 
        if (dpni == NULL) {
                DPAA2_PMD_ERR("dpni is NULL");
-               return;
+               return -EINVAL;
        }
 
        retcode =  dpni_reset_statistics(dpni, CMD_PRI_LOW, priv->token);
@@ -1456,11 +1462,11 @@ dpaa2_dev_stats_reset(struct rte_eth_dev *dev)
                        dpaa2_q->tx_pkts = 0;
        }
 
-       return;
+       return 0;
 
 error:
        DPAA2_PMD_ERR("Operation not completed:Error Code = %d", retcode);
-       return;
+       return retcode;
 };
 
 /* return 0 means link status changed, -1 means not changed */