net/sfc: add Rx descriptor wait timeout
[dpdk.git] / drivers / net / mlx5 / mlx5_rxmode.c
index 0c1e9eb..80824bc 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright 2015 6WIND S.A.
- * Copyright 2015 Mellanox.
+ * Copyright 2015 Mellanox Technologies, Ltd
  */
 
 #include <stddef.h>
@@ -35,10 +35,12 @@ mlx5_promiscuous_enable(struct rte_eth_dev *dev)
        int ret;
 
        dev->data->promiscuous = 1;
+       if (((struct priv *)dev->data->dev_private)->config.vf)
+               mlx5_nl_promisc(dev, 1);
        ret = mlx5_traffic_restart(dev);
        if (ret)
-               ERROR("%p cannot enable promiscuous mode: %s", (void *)dev,
-                     strerror(rte_errno));
+               DRV_LOG(ERR, "port %u cannot enable promiscuous mode: %s",
+                       dev->data->port_id, strerror(rte_errno));
 }
 
 /**
@@ -53,10 +55,12 @@ mlx5_promiscuous_disable(struct rte_eth_dev *dev)
        int ret;
 
        dev->data->promiscuous = 0;
+       if (((struct priv *)dev->data->dev_private)->config.vf)
+               mlx5_nl_promisc(dev, 0);
        ret = mlx5_traffic_restart(dev);
        if (ret)
-               ERROR("%p cannot disable promiscuous mode: %s", (void *)dev,
-                     strerror(rte_errno));
+               DRV_LOG(ERR, "port %u cannot disable promiscuous mode: %s",
+                       dev->data->port_id, strerror(rte_errno));
 }
 
 /**
@@ -71,10 +75,12 @@ mlx5_allmulticast_enable(struct rte_eth_dev *dev)
        int ret;
 
        dev->data->all_multicast = 1;
+       if (((struct priv *)dev->data->dev_private)->config.vf)
+               mlx5_nl_allmulti(dev, 1);
        ret = mlx5_traffic_restart(dev);
        if (ret)
-               ERROR("%p cannot enable allmulicast mode: %s", (void *)dev,
-                     strerror(rte_errno));
+               DRV_LOG(ERR, "port %u cannot enable allmulicast mode: %s",
+                       dev->data->port_id, strerror(rte_errno));
 }
 
 /**
@@ -89,8 +95,10 @@ mlx5_allmulticast_disable(struct rte_eth_dev *dev)
        int ret;
 
        dev->data->all_multicast = 0;
+       if (((struct priv *)dev->data->dev_private)->config.vf)
+               mlx5_nl_allmulti(dev, 0);
        ret = mlx5_traffic_restart(dev);
        if (ret)
-               ERROR("%p cannot disable allmulicast mode: %s", (void *)dev,
-                     strerror(rte_errno));
+               DRV_LOG(ERR, "port %u cannot disable allmulicast mode: %s",
+                       dev->data->port_id, strerror(rte_errno));
 }