X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fmlx5%2Fmlx5_rxmode.c;h=d5077db0dbb9abdb19ad6a77ce9478ecc8bf59eb;hb=07517400c4740397477153910edee38268294031;hp=8cc5667a49b13a040e07f2f80fd3d98c8c270697;hpb=0f99970b4adc943264df0487904d340124765e68;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c index 8cc5667a49..d5077db0db 100644 --- a/drivers/net/mlx5/mlx5_rxmode.c +++ b/drivers/net/mlx5/mlx5_rxmode.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright 2015 6WIND S.A. - * Copyright 2015 Mellanox. + * Copyright 2015 Mellanox Technologies, Ltd */ #include @@ -32,13 +32,23 @@ void mlx5_promiscuous_enable(struct rte_eth_dev *dev) { + struct mlx5_priv *priv = dev->data->dev_private; int ret; dev->data->promiscuous = 1; + if (priv->isolated) { + DRV_LOG(WARNING, + "port %u cannot enable promiscuous mode" + " in flow isolation mode", + dev->data->port_id); + return; + } + if (priv->config.vf) + mlx5_nl_promisc(dev, 1); ret = mlx5_traffic_restart(dev); if (ret) - ERROR("port %u cannot enable promiscuous mode: %s", - dev->data->port_id, strerror(rte_errno)); + DRV_LOG(ERR, "port %u cannot enable promiscuous mode: %s", + dev->data->port_id, strerror(rte_errno)); } /** @@ -50,13 +60,16 @@ mlx5_promiscuous_enable(struct rte_eth_dev *dev) void mlx5_promiscuous_disable(struct rte_eth_dev *dev) { + struct mlx5_priv *priv = dev->data->dev_private; int ret; dev->data->promiscuous = 0; + if (priv->config.vf) + mlx5_nl_promisc(dev, 0); ret = mlx5_traffic_restart(dev); if (ret) - ERROR("port %u cannot disable promiscuous mode: %s", - dev->data->port_id, strerror(rte_errno)); + DRV_LOG(ERR, "port %u cannot disable promiscuous mode: %s", + dev->data->port_id, strerror(rte_errno)); } /** @@ -68,13 +81,23 @@ mlx5_promiscuous_disable(struct rte_eth_dev *dev) void mlx5_allmulticast_enable(struct rte_eth_dev *dev) { + struct mlx5_priv *priv = dev->data->dev_private; int ret; dev->data->all_multicast = 1; + if (priv->isolated) { + DRV_LOG(WARNING, + "port %u cannot enable allmulticast mode" + " in flow isolation mode", + dev->data->port_id); + return; + } + if (priv->config.vf) + mlx5_nl_allmulti(dev, 1); ret = mlx5_traffic_restart(dev); if (ret) - ERROR("port %u cannot enable allmulicast mode: %s", - dev->data->port_id, strerror(rte_errno)); + DRV_LOG(ERR, "port %u cannot enable allmulicast mode: %s", + dev->data->port_id, strerror(rte_errno)); } /** @@ -86,11 +109,14 @@ mlx5_allmulticast_enable(struct rte_eth_dev *dev) void mlx5_allmulticast_disable(struct rte_eth_dev *dev) { + struct mlx5_priv *priv = dev->data->dev_private; int ret; dev->data->all_multicast = 0; + if (priv->config.vf) + mlx5_nl_allmulti(dev, 0); ret = mlx5_traffic_restart(dev); if (ret) - ERROR("port %u cannot disable allmulicast mode: %s", - dev->data->port_id, strerror(rte_errno)); + DRV_LOG(ERR, "port %u cannot disable allmulicast mode: %s", + dev->data->port_id, strerror(rte_errno)); }