diff options
author | Damjan Marion <damarion@cisco.com> | 2016-11-23 23:26:47 +0100 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2016-11-24 03:50:06 +0000 |
commit | 4c6b34f742d7478f8f8f862c05a33ba43b2c8699 (patch) | |
tree | 3a20f0f2d844f8be5ee06fd80ed172ef5fefc41c /vnet/vnet/l2/l2_input.c | |
parent | e0a2d1796a043001dcb97f9a2a870f7f9d82f44c (diff) |
l2: remove unused l3 packet type discovery in l2 path
This costs significant amount of cycles and it is not
used by anybody.
Change-Id: I42a0306aa7c254292621bdaa09b736421662d540
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vnet/vnet/l2/l2_input.c')
-rw-r--r-- | vnet/vnet/l2/l2_input.c | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/vnet/vnet/l2/l2_input.c b/vnet/vnet/l2/l2_input.c index 9515250decf..dfb7bce2f36 100644 --- a/vnet/vnet/l2/l2_input.c +++ b/vnet/vnet/l2/l2_input.c @@ -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); |