mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
ixgbe: Fix a bug in setting VF VLAN via PF
The PF driver does not check if the administrator has already set a VF VLAN via the PF driver before setting the new VLAN. This results in the following scenario: A) Administrator sets VF <n> to VLAN 100 B) Administrator sets VF <x> to VLAN 100 C) Administrator sets VF <n> to VLAN 200 D) The VF <n> driver continues to be able to receive traffic on VLAN 100 because the VLVFB pool enable bit for that VF was left set instead of being cleared as it should be. This fix ensures that the old VLAN filter for VF <n> is first removed and the pool bit enable for VF <n> is cleared so that it no longer receives traffic on VLAN 100. Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f9d40f6a99
commit
026ac67741
1 changed files with 6 additions and 0 deletions
|
@ -1049,6 +1049,12 @@ int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos)
|
|||
if ((vf >= adapter->num_vfs) || (vlan > 4095) || (qos > 7))
|
||||
return -EINVAL;
|
||||
if (vlan || qos) {
|
||||
if (adapter->vfinfo[vf].pf_vlan)
|
||||
err = ixgbe_set_vf_vlan(adapter, false,
|
||||
adapter->vfinfo[vf].pf_vlan,
|
||||
vf);
|
||||
if (err)
|
||||
goto out;
|
||||
err = ixgbe_set_vf_vlan(adapter, true, vlan, vf);
|
||||
if (err)
|
||||
goto out;
|
||||
|
|
Loading…
Reference in a new issue