Debugging a General Protection Fault in the i40e driver when adding a VLAN
to a VF, I added a ton of dev_info() calls to print out data and determine
some of the code flow. I am using the Intel SR-IOV CNI (
https://github.com/intel/sriov-cni/ and
https://github.com/intel/sriov-network-device-plugin) to created and delete
pods with SR-IOV VFs attached to containers.

I think there is an issue on how the VLAN, the QoS and the vlanprio
(vlanprio = vlan_id | (qos << I40E_VLAN_PRIORITY_SHIFT) are handled in the
i40e driver.

When a VLAN is added, a call is made to i40e_ndo_set_vf_port_vlan() in
i40e_virtchnl_pf.c. Input to the function includes a VLAN (lets say 200)
and a QoS value (lets say 1). The VLAN is at some point added
the mac_filter_hash. When the function exits, the value in the
mac_filter_hash ends up as 8392 (which is the vlanprio). Here is
a dev_err() message I added at the beginning and end of
i40e_ndo_set_vf_port_vlan(), just before returning. The last log is a loop
through the mac_filter_hash. The VLAN in the hash is 8392.
  [  +0.032191] i40e 0000:01:00.1: BILLY: i40e_ndo_set_vf_port_vlan() ENTER
- vf_id=0 VLAN=200 qos=1 vlanprio=8392 (0x20c8)
  :
  [  +0.000921] i40e 0000:01:00.1:   BILLY - i40e_ndo_set_vf_port_vlan() -
EXIT: vid 200: f=0000000073750ac4  VLANID=8392  State=2
next=00000000ce90cad7 pprev=00000000949c824a prev=0000000073750ac4

The issue is throughout the code, the f->vlan (which is the VLAN in
mac_filter_hash) is treated as VLAN Id. So if it is vlanprio, range checks
fail because the priority is not masked off. For example:
  if (f->vlan < 0 || f->vlan > I40E_MAX_VLANID)

So when time to delete the VLAN, by passing VLAN 0 to
i40e_ndo_set_vf_port_vlan(), it is not deleted. Same log on a delete:
  [Sep17 10:19] i40e 0000:01:00.1: BILLY: ENTER - vf_id=0 VLAN=0 qos=0
vlanprio=0 (0x0000)
  :
  [  +0.000384] i40e 0000:01:00.1:   BILLY - i40e_ndo_set_vf_port_vlan -
EXIT: vid 0: f=000000001221c957  VLANID=0  State=2 next=0000000073750ac4
pprev=00000000949c824a prev=000000001221c957
  [  +0.000018] i40e 0000:01:00.1:   BILLY - i40e_ndo_set_vf_port_vlan -
EXIT: vid 0: f=0000000073750ac4  VLANID=8392  State=2 next=00000000ce90cad7
pprev=000000001221c957 prev=0000000073750ac4

System Details:
Running Fedora 29 on baremetal (DELL R630), kernel 5.2.11-100.fc29.x86_64

$ ethtool -i eno1
driver: i40e
version: 2.9.21
firmware-version: 6.80 0x80003d71 18.8.9
expansion-rom-version:
bus-info: 0000:01:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes

Let me know what other details I can provide.

Thanks,
Billy McFall

_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to