l2: remove unused l3 packet type discovery in l2 path 39/3939/2
authorDamjan Marion <damarion@cisco.com>
Wed, 23 Nov 2016 22:26:47 +0000 (23:26 +0100)
committerJohn Lo <loj@cisco.com>
Thu, 24 Nov 2016 03:50:06 +0000 (03:50 +0000)
This costs significant amount of cycles and it is not
used by anybody.

Change-Id: I42a0306aa7c254292621bdaa09b736421662d540
Signed-off-by: Damjan Marion <damarion@cisco.com>
vnet/vnet/l2/l2_input.c
vnet/vnet/l2/l2_input.h

index 9515250..dfb7bce 100644 (file)
@@ -159,45 +159,8 @@ classify_and_dispatch (vlib_main_t * vm,
   h0 = vlib_buffer_get_current (b0);
   l3h0 = (u8 *) h0 + vnet_buffer (b0)->l2.l2_len;
 
-  /*
-   * Determine L3 packet type. Only need to check the common types.
-   * Used to filter out features that don't apply to common packets.
-   */
   ethertype = clib_net_to_host_u16 (get_u16 (l3h0 - 2));
-  if (ethertype == ETHERNET_TYPE_IP4)
-    {
-      protocol = ((ip4_header_t *) l3h0)->protocol;
-      if ((protocol == IP_PROTOCOL_UDP) || (protocol == IP_PROTOCOL_TCP))
-       {
-         feat_mask = IP_UDP_TCP_FEAT_MASK;
-       }
-      else
-       {
-         feat_mask = IP4_FEAT_MASK;
-       }
-    }
-  else if (ethertype == ETHERNET_TYPE_IP6)
-    {
-      protocol = ((ip6_header_t *) l3h0)->protocol;
-      /* Don't bother checking for extension headers for now */
-      if ((protocol == IP_PROTOCOL_UDP) || (protocol == IP_PROTOCOL_TCP))
-       {
-         feat_mask = IP_UDP_TCP_FEAT_MASK;
-       }
-      else
-       {
-         feat_mask = IP6_FEAT_MASK;
-       }
-    }
-  else if (ethertype == ETHERNET_TYPE_MPLS_UNICAST)
-    {
-      feat_mask = IP6_FEAT_MASK;
-    }
-  else
-    {
-      /* allow all features */
-      feat_mask = ~0;
-    }
+  feat_mask = ~0;
 
   /* determine layer2 kind for stat and mask */
   mcast_dmac = ethernet_address_cast (h0->dst_address);
index b4e90af..f3fada6 100644 (file)
@@ -95,7 +95,6 @@ l2input_bd_config_from_index (l2input_main_t * l2im, u32 bd_index)
 #define foreach_l2input_feat                    \
  _(DROP,          "feature-bitmap-drop")        \
  _(XCONNECT,      "l2-output")                  \
- _(IPIW,          "feature-bitmap-drop")        \
  _(FLOOD,         "l2-flood")                   \
  _(ARP_TERM,      "arp-term-l2bd")              \
  _(UU_FLOOD,      "l2-flood")                   \
@@ -104,17 +103,7 @@ l2input_bd_config_from_index (l2input_main_t * l2im, u32 bd_index)
  _(LEARN,         "l2-learn")                   \
  _(VTR,           "l2-input-vtr")               \
  _(VPATH,         "vpath-input-l2")             \
- _(CTRL_PKT,      "feature-bitmap-drop")        \
- _(L2PT,          "feature-bitmap-drop")        \
- _(IGMP_SNOOP,    "feature-bitmap-drop")        \
- _(MLD_SNOOP,     "feature-bitmap-drop")        \
- _(DHCP_SNOOP,    "feature-bitmap-drop")        \
- _(DAI,           "feature-bitmap-drop")        \
- _(IPSG,          "feature-bitmap-drop")        \
  _(ACL,           "l2-input-acl")               \
- _(QOS,           "feature-bitmap-drop")        \
- _(CFM,           "feature-bitmap-drop")        \
- _(SPAN,          "feature-bitmap-drop")        \
  _(POLICER_CLAS,  "l2-policer-classify")       \
  _(INPUT_CLASSIFY, "l2-input-classify")
 
@@ -175,35 +164,6 @@ bd_feature_arp_term (l2_bridge_domain_t * bd_config)
 
 /** Masks for eliminating features that do not apply to a packet */
 
-#define IP4_FEAT_MASK  ~(L2INPUT_FEAT_CTRL_PKT    | \
-                         L2INPUT_FEAT_MLD_SNOOP   | \
-                         L2INPUT_FEAT_L2PT        | \
-                         L2INPUT_FEAT_CFM         | \
-                        L2INPUT_FEAT_DAI)
-
-#define IP6_FEAT_MASK  ~(L2INPUT_FEAT_CTRL_PKT    | \
-                         L2INPUT_FEAT_IGMP_SNOOP  | \
-                         L2INPUT_FEAT_L2PT        | \
-                         L2INPUT_FEAT_CFM         | \
-                         L2INPUT_FEAT_DAI)
-
-#define IP_UDP_TCP_FEAT_MASK  ~(L2INPUT_FEAT_CTRL_PKT   | \
-                                L2INPUT_FEAT_L2PT       | \
-                                L2INPUT_FEAT_IGMP_SNOOP | \
-                                L2INPUT_FEAT_MLD_SNOOP  | \
-                                L2INPUT_FEAT_DHCP_SNOOP | \
-                                L2INPUT_FEAT_CFM        | \
-                                L2INPUT_FEAT_DAI)
-
-#define MPLS_FEAT_MASK  ~(L2INPUT_FEAT_CTRL_PKT   | \
-                          L2INPUT_FEAT_L2PT       | \
-                          L2INPUT_FEAT_IGMP_SNOOP | \
-                          L2INPUT_FEAT_MLD_SNOOP  | \
-                          L2INPUT_FEAT_DHCP_SNOOP | \
-                          L2INPUT_FEAT_CFM        | \
-                          L2INPUT_FEAT_DAI)
-
-
 /** Get a pointer to the config for the given interface */
 l2_input_config_t *l2input_intf_config (u32 sw_if_index);