summaryrefslogtreecommitdiff
path: root/drivers/net/mvneta/mvneta_ethdev.c
diff options
context:
space:
mode:
authorAndrew Rybchenko <arybchenko@solarflare.com>2019-09-14 12:37:24 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-07 15:00:54 +0200
commit9039c8125730adfd46b8c891e7f205eb4ac43c67 (patch)
tree855654d3b01ae9b27d47c520637881cc2a09d8a8 /drivers/net/mvneta/mvneta_ethdev.c
parentae9f487f2ea463eac4424d7ca19bcb18a9287906 (diff)
downloaddpdk-9039c8125730adfd46b8c891e7f205eb4ac43c67.zip
dpdk-9039c8125730adfd46b8c891e7f205eb4ac43c67.tar.gz
dpdk-9039c8125730adfd46b8c891e7f205eb4ac43c67.tar.xz
ethdev: change promiscuous callbacks to return status
Enabling/disabling of promiscuous mode is not always successful and it should be taken into account to be able to handle it properly. When correct return status is unclear from driver code, -EAGAIN is used. Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Matan Azrad <matan@mellanox.com> Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
Diffstat (limited to 'drivers/net/mvneta/mvneta_ethdev.c')
-rw-r--r--drivers/net/mvneta/mvneta_ethdev.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index 3ba0ac7..1090af0 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -534,25 +534,30 @@ mvneta_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
*
* @param dev
* Pointer to Ethernet device structure.
+ *
+ * @return
+ * always 0
*/
-static void
+static int
mvneta_promiscuous_enable(struct rte_eth_dev *dev)
{
struct mvneta_priv *priv = dev->data->dev_private;
int ret, en;
if (!priv->ppio)
- return;
+ return 0;
neta_ppio_get_promisc(priv->ppio, &en);
if (en) {
MVNETA_LOG(INFO, "Promiscuous already enabled");
- return;
+ return 0;
}
ret = neta_ppio_set_promisc(priv->ppio, 1);
if (ret)
MVNETA_LOG(ERR, "Failed to enable promiscuous mode");
+
+ return 0;
}
/**
@@ -560,25 +565,30 @@ mvneta_promiscuous_enable(struct rte_eth_dev *dev)
*
* @param dev
* Pointer to Ethernet device structure.
+ *
+ * @return
+ * always 0
*/
-static void
+static int
mvneta_promiscuous_disable(struct rte_eth_dev *dev)
{
struct mvneta_priv *priv = dev->data->dev_private;
int ret, en;
if (!priv->ppio)
- return;
+ return 0;
neta_ppio_get_promisc(priv->ppio, &en);
if (!en) {
MVNETA_LOG(INFO, "Promiscuous already disabled");
- return;
+ return 0;
}
ret = neta_ppio_set_promisc(priv->ppio, 0);
if (ret)
MVNETA_LOG(ERR, "Failed to disable promiscuous mode");
+
+ return 0;
}
/**