dpdk: add ENIC PMD patch to untag default vlan 74/18474/2
authorHyong Youb Kim <hyonkim@cisco.com>
Thu, 21 Mar 2019 15:21:26 +0000 (08:21 -0700)
committerDamjan Marion <dmarion@me.com>
Fri, 22 Mar 2019 12:59:49 +0000 (12:59 +0000)
The ingress vlan rewrite mode affects the vlan header of ingress
packet. The enic driver currently uses the 'passthrough' mode, which
leaves the vlan header intact. As all packets in UCS network are
tagged, this default mode leads to tagged ingress packets in the
following cases where VPP expects untagged packets.

1. Trunk-mode vNIC on UCS standalone server.
A remote device sends an untagged packet to the server. This packet is
ultimately tagged with vlan 0 as it reaches the driver, and VPP sees
an ingress packet tagged with vlan 0.

2. Access-mode vNIC on UCS blade or standalone server.
A remote device sends a packet on the vNIC's default vlan (e.g. 200)
to the server. This tag is untouched, and VPP sees an ingress packet
tagged with the default vlan (e.g. 200).

In both cases, VPP expects to see untagged packets. To work around the
issue, VPP currently enables vlan stripping on VIC interfaces, which
breaks vlan sub-interface features.

To avoid the current workaround, use the "untag default vlan" rewrite
mode. With this mode, the VIC adapter removes the vlan header if it
matches the default vlan. In the cases described above, VPP would see
untagged packets. Packets tagged with non-default vlan (e.g. non-0 for
case 1 and non-200 for case 2) are received with their tags intact, so
VPP sees tagged packets as expected.

The driver currently has no programmatic way to change the rewrite
mode after rte_eal_init. So use this patch to change the mode for the
time being.

Change-Id: Iff6408275363ed52d6016e7516d745214d6b30d4
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
build/external/patches/dpdk_19.02/0001-net-enic-untag-default-vlan-by-default.patch [new file with mode: 0644]

diff --git a/build/external/patches/dpdk_19.02/0001-net-enic-untag-default-vlan-by-default.patch b/build/external/patches/dpdk_19.02/0001-net-enic-untag-default-vlan-by-default.patch
new file mode 100644 (file)
index 0000000..5c6610e
--- /dev/null
@@ -0,0 +1,31 @@
+From 85ce89273a8e67375713e154fa84f6da0c7d0bcf Mon Sep 17 00:00:00 2001
+From: Hyong Youb Kim <hyonkim@cisco.com>
+Date: Wed, 20 Mar 2019 00:00:20 -0700
+Subject: [PATCH] net/enic: untag default vlan by default
+
+The current default ingress vlan rewrite mode 'passthrough' is not
+suitable for VPP, as it leads to ingress packets tagged with vlan 0
+(trunk-mode vNIC) or native vlan (access-mode vNIC). Change the
+default to "untag default vlan" to remove these unwanted tags.
+
+Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
+---
+ drivers/net/enic/enic_ethdev.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
+index 8d14d8ac7..87d5c76cb 100644
+--- a/drivers/net/enic/enic_ethdev.c
++++ b/drivers/net/enic/enic_ethdev.c
+@@ -1125,7 +1125,7 @@ static int enic_check_devargs(struct rte_eth_dev *dev)
+       enic->disable_overlay = false;
+       enic->enable_avx2_rx = false;
+-      enic->ig_vlan_rewrite_mode = IG_VLAN_REWRITE_MODE_PASS_THRU;
++      enic->ig_vlan_rewrite_mode = IG_VLAN_REWRITE_MODE_UNTAG_DEFAULT_VLAN;
+       if (!dev->device->devargs)
+               return 0;
+       kvlist = rte_kvargs_parse(dev->device->devargs->args, valid_keys);
+-- 
+2.16.2
+