[dpdk-dev] [PATCH v3 2/3] net/mlx5: use Netlink to enable promisc / all multicast mode

Shahaf Shuler shahafs at mellanox.com
Thu Mar 22 08:36:08 CET 2018


Wednesday, March 21, 2018 3:40 PM, Nelio Laranjeiro:
 
> VF devices are not able to receive promisc or allmulti traffic unless it fully
> requests it though Netlink.  This will cause the request to be processed by
> the PF which will handle the request and enable it.
> 
> This requires the VF to be trusted by the PF.
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
> ---
>  drivers/net/mlx5/mlx5_nl.c     | 94
> ++++++++++++++++++++++++++++++++++++++++++
>  drivers/net/mlx5/mlx5_rxmode.c |  8 ++++
>  2 files changed, 102 insertions(+)


[...]

> diff --git a/drivers/net/mlx5/mlx5_rxmode.c
> b/drivers/net/mlx5/mlx5_rxmode.c index e43a4b030..c1c0f21c7 100644
> --- a/drivers/net/mlx5/mlx5_rxmode.c
> +++ b/drivers/net/mlx5/mlx5_rxmode.c
> @@ -35,6 +35,8 @@ 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)
>  		DRV_LOG(ERR, "port %u cannot enable promiscuous mode:
> %s", @@ -53,6 +55,8 @@ 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);

Same comment: What if the DPDK process is terminated ungracefully?


More information about the dev mailing list