dpdk: do not enable VLAN stripping on Cisco VIC adapters by default 75/18475/2
authorHyong Youb Kim <hyonkim@cisco.com>
Thu, 21 Mar 2019 15:33:28 +0000 (08:33 -0700)
committerDamjan Marion <dmarion@me.com>
Fri, 22 Mar 2019 13:04:39 +0000 (13:04 +0000)
With the following local patch, VIC adapters remove default vlan tags
from ingress packets. So, it is no longer necessary to enable VLAN
stripping by default. This change also allows VLAN sub interfaces to
work with VIC adapters.

patches/dpdk_19.02/0001-net-enic-untag-default-vlan-by-default.patch

Change-Id: I2e7d62c62120c351c27d827d90de4a8335efa044
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
src/plugins/dpdk/device/init.c

index 1a7792b..eaeda32 100644 (file)
@@ -695,19 +695,30 @@ dpdk_lib_init (dpdk_main_t * dm)
        }
 
       /*
-       * For cisco VIC vNIC, set default to VLAN strip enabled, unless
-       * specified otherwise in the startup config.
-       * For other NICs default to VLAN strip disabled, unless specified
+       * A note on Cisco VIC (PMD_ENIC) and VLAN:
+       *
+       * With Cisco VIC vNIC, every ingress packet is tagged. On a
+       * trunk vNIC (C series "standalone" server), packets on no VLAN
+       * are tagged with vlan 0. On an access vNIC (standalone or B
+       * series "blade" server), packets on the default/native VLAN
+       * are tagged with that vNIC's VLAN. VPP expects these packets
+       * to be untagged, and previously enabled VLAN strip on VIC by
+       * default. But it also broke vlan sub-interfaces.
+       *
+       * The VIC adapter has "untag default vlan" ingress VLAN rewrite
+       * mode, which removes tags from these packets. VPP now includes
+       * a local patch for the enic driver to use this untag mode, so
+       * enabling vlan stripping is no longer needed. In future, the
+       * driver + dpdk will have an API to set the mode after
+       * rte_eal_init. Then, this note and local patch will be
+       * removed.
+       */
+
+      /*
+       * VLAN stripping: default to VLAN strip disabled, unless specified
        * otherwise in the startup config.
        */
-      if (xd->pmd == VNET_DPDK_PMD_ENIC)
-       {
-         if (devconf->vlan_strip_offload != DPDK_DEVICE_VLAN_STRIP_OFF)
-           vlan_strip = 1;     /* remove vlan tag from VIC port by default */
-         else
-           dpdk_log_warn ("VLAN strip disabled for interface\n");
-       }
-      else if (devconf->vlan_strip_offload == DPDK_DEVICE_VLAN_STRIP_ON)
+      if (devconf->vlan_strip_offload == DPDK_DEVICE_VLAN_STRIP_ON)
        vlan_strip = 1;
 
       if (vlan_strip)