1
0
Fork 0
alistair23-linux/drivers/net/ethernet/intel
Alexander Duyck ab3a3b7b0c ixgbe: Fix bugs in ixgbe_clear_vf_vlans()
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>
2015-12-29 19:16:08 -08:00
..
e1000 e1000: Elementary checkpatch warnings and checks removed 2015-12-12 23:13:52 -08:00
e1000e e1000e: Fix msi-x interrupt automask 2015-12-14 20:19:47 -08:00
fm10k fm10k: IS_ENABLED() is not appropriate for boolean kconfig option 2015-12-22 05:23:17 -08:00
i40e Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-12-17 22:08:28 -05:00
i40evf Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-12-17 22:08:28 -05:00
igb sctp: Rename NETIF_F_SCTP_CSUM to NETIF_F_SCTP_CRC 2015-12-15 16:49:58 -05:00
igbvf drivers/net/intel: use napi_complete_done() 2015-10-16 04:33:46 -07:00
ixgb drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
ixgbe ixgbe: Fix bugs in ixgbe_clear_vf_vlans() 2015-12-29 19:16:08 -08:00
ixgbevf ixgbevf: minor cleanups for ixgbevf_set_itr() 2015-12-29 19:16:05 -08:00
Kconfig i40e: Kernel dependency update for i40e to support geneve offload 2015-12-16 10:58:56 -05:00
Makefile fm10k: Add skeletal frame for Intel(R) FM10000 Ethernet Switch Host Interface Driver 2014-09-23 03:59:13 -07:00
e100.c e100: Release skb when DMA mapping is failed in e100_xmit_prepare 2015-08-18 14:06:05 -07:00