Bug 209581 - igb vf driver does not correctly handle vlan tag
Summary: igb vf driver does not correctly handle vlan tag
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.3-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-net mailing list
URL:
Keywords: IntelNetworking
Depends on:
Blocks:
 
Reported: 2016-05-17 16:13 UTC by Long Hoang
Modified: 2018-05-12 14:03 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Long Hoang 2016-05-17 16:13:14 UTC
Intel 82576 support transparent vlan which will automaticaly tag and untag packet at the vf before leave or reach the guest. Currently, FreeBSD igb driver does not correctly handle the vlan tag. Packet inbound still have the vlan tag. Linux and Windows does not have this problem.

This is very similar to the problem with ixgb (Intel 82599) driver.
https://reviews.freebsd.org/D4788
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202983#c4


For the root cause:
It seem that VLAN stripping will depend on RXDCTL.VME flag that the
guest driver need to set. And FreeBSD driver does not set it so
FreeBSD guest will still see the VLAN tag. They only mention intel
82599 (ixgb/ixgbe) but I check intel 82576 datasheet and the similar
flag is CTRL.VME. But the 82576 sr-iov driver guide mention the
VMOLR.STRVLAN flag (?)

https://access.redhat.com/solutions/1126973
http://www.intel.com/content/dam/www/public/us/en/documents/datasheets/82576eb-gigabit-ethernet-controller-datasheet.pdf
http://www.intel.com/content/dam/doc/design-guide/82576-sr-iov-driver-companion-guide.pdf
Comment 1 Ed Maste freebsd_committer 2016-06-22 14:27:56 UTC
Can you confirm that this is actually running on an arm64 (64-bit ARM) platform, or otherwise update the Hardware description?
Comment 2 ingenium 2017-03-06 22:32:48 UTC
Has there been any update on this? It is also affecting me. I can supply any additional information that's needed.
Comment 3 ingenium 2017-03-06 23:11:57 UTC
(In reply to ingenium from comment #2)
It looks like there may be a newer version of the Intel driver? Is it possible it contains the necessary fixes? https://downloadcenter.intel.com/download/15815/Intel-Network-Adapter-Driver-for-82575-6-and-82580-based-Gigabit-Network-Connections-under-FreeBSD-
Comment 4 Kaho Toshikazu 2017-03-09 08:57:55 UTC
(In reply to ingenium from comment #3)
Please try a patch for 11-stable. I don't test it.
This functionality seems to be dropped from 12-current's iflib if_em.c.

Index: sys/dev/e1000/if_igb.c
===================================================================
--- sys/dev/e1000/if_igb.c	(revision 314587)
+++ sys/dev/e1000/if_igb.c	(working copy)
@@ -5327,7 +5327,6 @@
 	if (adapter->vf_ifp) {
 		e1000_rlpml_set_vf(hw,
 		    adapter->max_frame_size + VLAN_TAG_SIZE);
-		return;
 	}
 
 	reg = E1000_READ_REG(hw, E1000_CTRL);
Comment 5 ingenium 2017-03-15 20:09:08 UTC
(In reply to Kaho Toshikazu from comment #4)
I'm not sure that I follow? Are you suggesting simply deleting that line from 10.3 and it may allow vlan tags to not be stripped?
Comment 6 Kaho Toshikazu 2017-03-16 01:13:40 UTC
(In reply to ingenium from comment #5)
> Are you suggesting simply deleting that line from 10.3 and it may allow
> vlan tags to not be stripped?

Yes. I don't know that the code setting the vlan filter table(VFTA) is
correct or not, but this line inhibits a VFTA generation.
Comment 7 Dieter 2018-05-12 14:03:11 UTC
Looks like I'm having a similar issue with an Intel i350 NIC.
I.e. packets from outside the NIC to a VF make it, even with VLAN tags.
But packets from within the NIC (i.e. VF - VF or PF - VF) with VLAN tags don't make it!
I'm experiencing the issue with pfsense 2.4.3, which is freebsd based (FreeBSD 11.1-RELEASE-p7).

Will the patch you mentioned be in the next freebsd release?