diff options
author | Mohamad Haj Yahia | 2016-05-03 16:14:04 +0200 |
---|---|---|
committer | David S. Miller | 2016-05-04 20:04:49 +0200 |
commit | 1edc57e2b3d3bf8672bb1553dbd541cc94f54937 (patch) | |
tree | 0e1b42ca6fa9b263db4d97e84b86c45cf1f0893f /drivers/net/ethernet/mellanox/mlx5/core/en_main.c | |
parent | net/mlx5: E-Switch, Implement promiscuous rx modes vf request handling (diff) | |
download | kernel-qcow2-linux-1edc57e2b3d3bf8672bb1553dbd541cc94f54937.tar.gz kernel-qcow2-linux-1edc57e2b3d3bf8672bb1553dbd541cc94f54937.tar.xz kernel-qcow2-linux-1edc57e2b3d3bf8672bb1553dbd541cc94f54937.zip |
net/mlx5: E-Switch, Implement trust vf ndo
- Add support to configure trusted vf attribute through trust_vf_ndo.
- Upon VF trust setting change we update vport context to refresh
allmulti/promisc or any trusted vf attributes that we didn't trust the
VF for before.
- Lock the eswitch state lock on vport event in order to synchronise the
vport context updates , this will prevent contention with vport trust
setting change which will trigger vport mac list update.
Signed-off-by: Mohamad Haj Yahia <mohamad@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en_main.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 5d0911315189..1c70e518b5c5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -2446,6 +2446,13 @@ static int mlx5e_set_vf_spoofchk(struct net_device *dev, int vf, bool setting) return mlx5_eswitch_set_vport_spoofchk(mdev->priv.eswitch, vf + 1, setting); } +static int mlx5e_set_vf_trust(struct net_device *dev, int vf, bool setting) +{ + struct mlx5e_priv *priv = netdev_priv(dev); + struct mlx5_core_dev *mdev = priv->mdev; + + return mlx5_eswitch_set_vport_trust(mdev->priv.eswitch, vf + 1, setting); +} static int mlx5_vport_link2ifla(u8 esw_link) { switch (esw_link) { @@ -2616,6 +2623,7 @@ static const struct net_device_ops mlx5e_netdev_ops_sriov = { .ndo_set_vf_mac = mlx5e_set_vf_mac, .ndo_set_vf_vlan = mlx5e_set_vf_vlan, .ndo_set_vf_spoofchk = mlx5e_set_vf_spoofchk, + .ndo_set_vf_trust = mlx5e_set_vf_trust, .ndo_get_vf_config = mlx5e_get_vf_config, .ndo_set_vf_link_state = mlx5e_set_vf_link_state, .ndo_get_vf_stats = mlx5e_get_vf_stats, |