X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fgtpu%2Fgtpu_decap.c;h=d52ccc0219c051cb0970eaa721031336610f5dc5;hb=7a40133d3355463368085c14f9fc4b4fd22d549a;hp=b0be32ec12a42ebca887072f3175ce9b73854b86;hpb=ef486b1545d892f9f0e0d35e7e57cb0ca04d7ff7;p=vpp.git diff --git a/src/plugins/gtpu/gtpu_decap.c b/src/plugins/gtpu/gtpu_decap.c index b0be32ec12a..d52ccc0219c 100644 --- a/src/plugins/gtpu/gtpu_decap.c +++ b/src/plugins/gtpu/gtpu_decap.c @@ -1,7 +1,7 @@ /* * decap.c: gtpu tunnel decap packet processing * - * Copyright (c) 2013 Cisco and/or its affiliates. + * Copyright (c) 2017 Intel and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -213,7 +213,7 @@ gtpu_input (vlib_main_t * vm, tunnel_index0 = last_tunnel_index; t0 = pool_elt_at_index (gtm->tunnels, tunnel_index0); - /* Validate GTPU tunnel encap-fib index agaist packet */ + /* Validate GTPU tunnel encap-fib index against packet */ if (PREDICT_FALSE (validate_gtpu_fib (b0, t0, is_ip4) == 0)) { error0 = GTPU_ERROR_NO_SUCH_TUNNEL; @@ -263,7 +263,7 @@ gtpu_input (vlib_main_t * vm, tunnel_index0 = last_tunnel_index; t0 = pool_elt_at_index (gtm->tunnels, tunnel_index0); - /* Validate GTPU tunnel encap-fib index agaist packet */ + /* Validate GTPU tunnel encap-fib index against packet */ if (PREDICT_FALSE (validate_gtpu_fib (b0, t0, is_ip4) == 0)) { error0 = GTPU_ERROR_NO_SUCH_TUNNEL; @@ -387,7 +387,7 @@ gtpu_input (vlib_main_t * vm, tunnel_index1 = last_tunnel_index; t1 = pool_elt_at_index (gtm->tunnels, tunnel_index1); - /* Validate GTPU tunnel encap-fib index agaist packet */ + /* Validate GTPU tunnel encap-fib index against packet */ if (PREDICT_FALSE (validate_gtpu_fib (b1, t1, is_ip4) == 0)) { error1 = GTPU_ERROR_NO_SUCH_TUNNEL; @@ -439,7 +439,7 @@ gtpu_input (vlib_main_t * vm, tunnel_index1 = last_tunnel_index; t1 = pool_elt_at_index (gtm->tunnels, tunnel_index1); - /* Validate GTPU tunnel encap-fib index agaist packet */ + /* Validate GTPU tunnel encap-fib index against packet */ if (PREDICT_FALSE (validate_gtpu_fib (b1, t1, is_ip4) == 0)) { error1 = GTPU_ERROR_NO_SUCH_TUNNEL; @@ -616,7 +616,7 @@ gtpu_input (vlib_main_t * vm, tunnel_index0 = last_tunnel_index; t0 = pool_elt_at_index (gtm->tunnels, tunnel_index0); - /* Validate GTPU tunnel encap-fib index agaist packet */ + /* Validate GTPU tunnel encap-fib index against packet */ if (PREDICT_FALSE (validate_gtpu_fib (b0, t0, is_ip4) == 0)) { error0 = GTPU_ERROR_NO_SUCH_TUNNEL; @@ -666,7 +666,7 @@ gtpu_input (vlib_main_t * vm, tunnel_index0 = last_tunnel_index; t0 = pool_elt_at_index (gtm->tunnels, tunnel_index0); - /* Validate GTPU tunnel encap-fib index agaist packet */ + /* Validate GTPU tunnel encap-fib index against packet */ if (PREDICT_FALSE (validate_gtpu_fib (b0, t0, is_ip4) == 0)) { error0 = GTPU_ERROR_NO_SUCH_TUNNEL; @@ -933,8 +933,8 @@ ip_gtpu_bypass_inline (vlib_main_t * vm, } /* Setup packet for next IP feature */ - vnet_feature_next(vnet_buffer(b0)->sw_if_index[VLIB_RX], &next0, b0); - vnet_feature_next(vnet_buffer(b1)->sw_if_index[VLIB_RX], &next1, b1); + vnet_feature_next(&next0, b0); + vnet_feature_next(&next1, b1); if (is_ip4) { @@ -982,7 +982,7 @@ ip_gtpu_bypass_inline (vlib_main_t * vm, } flags0 = b0->flags; - good_udp0 = (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0; + good_udp0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0; /* Don't verify UDP checksum for packets with explicit zero checksum. */ good_udp0 |= udp0->checksum == 0; @@ -998,14 +998,14 @@ ip_gtpu_bypass_inline (vlib_main_t * vm, /* Verify UDP checksum */ if (PREDICT_FALSE (!good_udp0)) { - if ((flags0 & IP_BUFFER_L4_CHECKSUM_COMPUTED) == 0) + if ((flags0 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0) { if (is_ip4) flags0 = ip4_tcp_udp_validate_checksum (vm, b0); else flags0 = ip6_tcp_udp_icmp_validate_checksum (vm, b0); good_udp0 = - (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0; + (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0; } } @@ -1064,7 +1064,7 @@ ip_gtpu_bypass_inline (vlib_main_t * vm, } flags1 = b1->flags; - good_udp1 = (flags1 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0; + good_udp1 = (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0; /* Don't verify UDP checksum for packets with explicit zero checksum. */ good_udp1 |= udp1->checksum == 0; @@ -1080,14 +1080,14 @@ ip_gtpu_bypass_inline (vlib_main_t * vm, /* Verify UDP checksum */ if (PREDICT_FALSE (!good_udp1)) { - if ((flags1 & IP_BUFFER_L4_CHECKSUM_COMPUTED) == 0) + if ((flags1 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0) { if (is_ip4) flags1 = ip4_tcp_udp_validate_checksum (vm, b1); else flags1 = ip6_tcp_udp_icmp_validate_checksum (vm, b1); good_udp1 = - (flags1 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0; + (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0; } } @@ -1141,7 +1141,7 @@ ip_gtpu_bypass_inline (vlib_main_t * vm, ip60 = vlib_buffer_get_current (b0); /* Setup packet for next IP feature */ - vnet_feature_next(vnet_buffer(b0)->sw_if_index[VLIB_RX], &next0, b0); + vnet_feature_next(&next0, b0); if (is_ip4) /* Treat IP4 frag packets as "experimental" protocol for now @@ -1182,7 +1182,7 @@ ip_gtpu_bypass_inline (vlib_main_t * vm, } flags0 = b0->flags; - good_udp0 = (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0; + good_udp0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0; /* Don't verify UDP checksum for packets with explicit zero checksum. */ good_udp0 |= udp0->checksum == 0; @@ -1198,14 +1198,14 @@ ip_gtpu_bypass_inline (vlib_main_t * vm, /* Verify UDP checksum */ if (PREDICT_FALSE (!good_udp0)) { - if ((flags0 & IP_BUFFER_L4_CHECKSUM_COMPUTED) == 0) + if ((flags0 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0) { if (is_ip4) flags0 = ip4_tcp_udp_validate_checksum (vm, b0); else flags0 = ip6_tcp_udp_icmp_validate_checksum (vm, b0); good_udp0 = - (flags0 & IP_BUFFER_L4_CHECKSUM_CORRECT) != 0; + (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0; } }