]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
ixgbe: Fix bugs in ixgbe_clear_vf_vlans()
authorAlexander Duyck <aduyck@mirantis.com>
Wed, 23 Dec 2015 17:00:35 +0000 (09:00 -0800)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 29 Feb 2016 15:56:55 +0000 (08:56 -0700)
commit3db3dc343da65013782e0986f08caf7623481ade
tree5e109c6fccd9977ba03f852bed393a4000cfcc1f
parented6a5ea5f6547eb320cb889c12097765535386b8
ixgbe: Fix bugs in ixgbe_clear_vf_vlans()

BugLink: http://bugs.launchpad.net/bugs/1536473
When I had rewritten the code for ixgbe_clear_vf_vlans() it looks like I
had transitioned back and forth between using word as an offset and using
word as a register offset.  As a result I honestly don't see how the code
was working before other than the fact that resetting the VLANs on the VF
like didn't do much to clear them.

Another issue found is that the mask was using a divide instead of a
modulus.  As a result the mask bit was incorrectly being set to either bit
0 or 1 based on the value of the VF being tested.  As a result the wrong
VFs were having their VLANs cleared if they were enabled.

I have updated the code so that word represents the offset in the array.
This way we can use the modulus and xor operations and they will make sense
instead of being performed on a 4 byte aligned value.

I replaced the statement "(word % 2) ^ 1" with "~word % 2" in order to
reduce the line length as the line exceeded 80 characters with the register
name inserted.  The two should be equivalent so the change should be safe.

Reported-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ab3a3b7b0cf88021376d565c526aa27b1e105148)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c