summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/intelx.h
diff options
context:
space:
mode:
authorMichael Brown2016-07-11 18:14:14 +0200
committerMichael Brown2016-07-12 10:14:41 +0200
commitdb3443608fe32fffb4f6ad467bfc035a824bff52 (patch)
treef8a2d65147e484ec8eeabc4b2c86d35ac6534119 /src/drivers/net/intelx.h
parent[ipv4] Send gratuitous ARPs whenever a new IPv4 address is applied (diff)
downloadipxe-db3443608fe32fffb4f6ad467bfc035a824bff52.tar.gz
ipxe-db3443608fe32fffb4f6ad467bfc035a824bff52.tar.xz
ipxe-db3443608fe32fffb4f6ad467bfc035a824bff52.zip
[intel] Strip spurious VLAN tags received by virtual function NICs
The physical function may be configured to transparently insert a VLAN tag into all transmitted packets. Unfortunately, it does not equivalently strip this same VLAN tag from all received packets. This behaviour may be observed in some Amazon EC2 instances with Enhanced Networking enabled: transmissions work as expected but all packets received by iPXE appear to have a spurious VLAN tag. We can configure the receive queue to strip VLAN tags via the RXDCTL.VME bit. We need to find out from the PF driver whether or not we should do so. There exists a "get queue configuration" mailbox message which contains a field labelled IXGBE_VF_TRANS_VLAN in the Linux driver. A comment in the Linux PF driver describes this field as "notify VF of need for VLAN tag stripping, and correct queue". It will be filled with a non-zero value if the PF is enforcing the use of a single VLAN tag. It will also be filled with a non-zero value if the PF is using multiple traffic classes. The Linux VF driver seems to treat this field as being simply the number of traffic classes, and gives it no VLAN-related interpretation. The Linux VF driver instead handles the VLAN tag stripping by simply assuming that any unrecognised VLAN tag ought to be silently dropped. We choose to strip and ignore the VLAN tag if the IXGBE_VF_TRANS_VLAN field has a non-zero value. Reported-by: Leonid Vasetsky <leonidv@velostrata.com> Tested-by: Leonid Vasetsky <leonidv@velostrata.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/intelx.h')
-rw-r--r--src/drivers/net/intelx.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/net/intelx.h b/src/drivers/net/intelx.h
index 6383dfca..d7f3b78e 100644
--- a/src/drivers/net/intelx.h
+++ b/src/drivers/net/intelx.h
@@ -71,6 +71,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
/** Receive Descriptor register block */
#define INTELX_RD 0x01000UL
+/** Receive Descriptor Control Register */
+#define INTELX_RXDCTL_VME 0x40000000UL /**< Strip VLAN tag */
+
/** Split Receive Control Register */
#define INTELX_SRRCTL 0x02100UL
#define INTELX_SRRCTL_BSIZE(kb) ( (kb) << 0 ) /**< Receive buffer size */