]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
ice: Account for port VLAN in VF max packet size calculation
authorBrett Creeley <brett.creeley@intel.com>
Thu, 17 Sep 2020 20:13:38 +0000 (13:13 -0700)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 15 Mar 2021 14:09:33 +0000 (15:09 +0100)
commitfd1562b797ed238cacc56c0d762b6ef81d115b28
tree2e41c42a56395a5564aeb574b81e523f1274fc13
parent70e42a45c5d82667bc8a5702fc76134874b83fd7
ice: Account for port VLAN in VF max packet size calculation

[ Upstream commit a6aa7c8f998f4afddd73410aa043dad38162ce9e ]

Currently if an AVF driver doesn't account for the possibility of a
port VLAN when determining its max packet size then packets at MTU will
be dropped. It is not the VF driver's responsibility to account for a
port VLAN so fix this. To fix this, do the following:

1. Add a function that determines the max packet size a VF is allowed by
   using the port's max packet size and whether the VF is in a port
   VLAN. If a port VLAN is configured then a VF's max packet size will
   always be the port's max packet size minus VLAN_HLEN. Otherwise it
   will be the port's max packet size.

2. Use this function to verify the max packet size from the VF.

3. If there is a port VLAN configured then add 4 bytes (VLAN_HLEN) to
   the VF's max packet size configuration.

Also, the VIRTCHNL_OP_GET_VF_RESOURCES message provides the capability
to communicate a VF's max packet size. Use the new function for this
purpose.

Fixes: 1071a8358a28 ("ice: Implement virtchnl commands for AVF support")
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c