igb: handle vlan types with checker enabled
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Fri, 26 Mar 2021 00:38:28 +0000 (17:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 07:44:41 +0000 (09:44 +0200)
commit66d593aa3aea4dc2ed81d7b73caba9fd59b883ef
treea5c132c932a60e5dc0bcc6062fc824612b9245b5
parentffb865715a0fe32700bf854d1dc840fc2cafcc0a
igb: handle vlan types with checker enabled

[ Upstream commit c7cbfb028b95360403d579c47aaaeef1ff140964 ]

The sparse build (C=2) finds some issues with how the driver
dealt with the (very difficult) hardware that in some generations
uses little-endian, and in others uses big endian, for the VLAN
field. The code as written picks __le16 as a type and for some
hardware revisions we override it to __be16 as done in this
patch. This impacted the VF driver as well so fix it there too.

Also change the vlan_tci assignment to override the sparse
warning without changing functionality.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Dave Switzer <david.switzer@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/igbvf/netdev.c