dpdk: remove vlan-strip offload code 22/34822/2
authorFilip Varga <fivarga@cisco.com>
Fri, 12 Nov 2021 16:22:11 +0000 (17:22 +0100)
committerOle Tr�an <otroan@employees.org>
Wed, 5 Jan 2022 10:45:06 +0000 (10:45 +0000)
This code was actually never working. It was just used as workaround for
Cisco ENIC issue with tagged default vlan frames.
Today Cisco ENIC provides solution to this problem with devargs flags...

Change-Id: Ia8284274117cb200bf6c7f7911d945d5a093d878
Type: refactor
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/plugins/dpdk/device/dpdk.h
src/plugins/dpdk/device/init.c
src/vpp/conf/startup.conf

index 64a2330..8522ff0 100644 (file)
@@ -261,10 +261,6 @@ typedef struct
   dpdk_device_addr_type_t dev_addr_type;
   u8 *name;
   u8 is_blacklisted;
-  u8 vlan_strip_offload;
-#define DPDK_DEVICE_VLAN_STRIP_DEFAULT 0
-#define DPDK_DEVICE_VLAN_STRIP_OFF 1
-#define DPDK_DEVICE_VLAN_STRIP_ON  2
 
 #define _(x) uword x;
     foreach_dpdk_device_config_item
index 3dbee38..5d34a94 100644 (file)
@@ -249,7 +249,6 @@ dpdk_lib_init (dpdk_main_t * dm)
   RTE_ETH_FOREACH_DEV(i)
     {
       u8 addr[6];
-      int vlan_off;
       struct rte_eth_dev_info dev_info;
       struct rte_pci_device *pci_dev;
       struct rte_vmbus_device *vmbus_dev;
@@ -890,52 +889,6 @@ dpdk_lib_init (dpdk_main_t * dm)
                       format_dpdk_device_name, i,
                       format_dpdk_device_errors, xd);
 
-      /*
-       * 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.
-       */
-
-        vlan_off = rte_eth_dev_get_vlan_offload (xd->port_id);
-        if (devconf->vlan_strip_offload == DPDK_DEVICE_VLAN_STRIP_ON)
-          {
-            vlan_off |= ETH_VLAN_STRIP_OFFLOAD;
-            if (rte_eth_dev_set_vlan_offload (xd->port_id, vlan_off) >= 0)
-              dpdk_log_info ("VLAN strip enabled for interface\n");
-            else
-              dpdk_log_warn ("VLAN strip cannot be supported by interface\n");
-            xd->port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
-          }
-        else
-          {
-            if (vlan_off & ETH_VLAN_STRIP_OFFLOAD)
-              {
-               vlan_off &= ~ETH_VLAN_STRIP_OFFLOAD;
-               if (rte_eth_dev_set_vlan_offload (xd->port_id, vlan_off) >= 0)
-                 dpdk_log_warn ("set VLAN offload failed\n");
-              }
-            xd->port_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
-          }
-
         if (hi)
           hi->max_packet_bytes = xd->port_conf.rxmode.max_rx_pkt_len
             - sizeof (ethernet_header_t);
@@ -1315,10 +1268,6 @@ dpdk_device_config (dpdk_config_main_t *conf, void *addr,
          if (error)
            break;
        }
-      else if (unformat (input, "vlan-strip-offload off"))
-       devconf->vlan_strip_offload = DPDK_DEVICE_VLAN_STRIP_OFF;
-      else if (unformat (input, "vlan-strip-offload on"))
-       devconf->vlan_strip_offload = DPDK_DEVICE_VLAN_STRIP_ON;
       else if (unformat (input, "tso on"))
        {
          devconf->tso = DPDK_DEVICE_TSO_ON;
@@ -1649,9 +1598,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
     /* default per-device config items */
     foreach_dpdk_device_config_item
 
-      /* copy vlan_strip config from default device */
-      _ (vlan_strip_offload)
-
       /* copy tso config from default device */
       _ (tso)
 
index a879db3..52c9433 100644 (file)
@@ -125,10 +125,6 @@ cpu {
                # num-rx-desc 512
                # num-tx-desc 512
 
-               ## VLAN strip offload mode for interface
-               ## Default is off
-               # vlan-strip-offload on
-
                ## TCP Segment Offload
                ## Default is off
                ## To enable TSO, 'enable-tcp-udp-checksum' must be set