X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fip%2Fip6_inlines.h;h=4a2b91b9ec961fb7c783090134a2cc2645e318cf;hb=755e3aa54f663b93d5c0a4be034aef954f22dbb1;hp=9c2be60b2676d93df40cf4c2d8c94a7d394cf7ff;hpb=03092c1982468ff6ffe260b0215f910d4c486b04;p=vpp.git diff --git a/src/vnet/ip/ip6_inlines.h b/src/vnet/ip/ip6_inlines.h index 9c2be60b267..4a2b91b9ec9 100644 --- a/src/vnet/ip/ip6_inlines.h +++ b/src/vnet/ip/ip6_inlines.h @@ -50,14 +50,16 @@ ip6_compute_flow_hash (const ip6_header_t * ip, flow_hash_config_t flow_hash_config) { tcp_header_t *tcp; + udp_header_t *udp = (void *) (ip + 1); + gtpv1u_header_t *gtpu = (void *) (udp + 1); u64 a, b, c; u64 t1, t2; + u32 t3; uword is_tcp_udp = 0; + uword is_udp = ip->protocol == IP_PROTOCOL_UDP; u8 protocol = ip->protocol; - if (PREDICT_TRUE - ((ip->protocol == IP_PROTOCOL_TCP) - || (ip->protocol == IP_PROTOCOL_UDP))) + if (PREDICT_TRUE ((ip->protocol == IP_PROTOCOL_TCP) || is_udp)) { is_tcp_udp = 1; tcp = (void *) (ip + 1); @@ -113,7 +115,13 @@ ip6_compute_flow_hash (const ip6_header_t * ip, ((flow_hash_config & IP_FLOW_HASH_FL) ? ip6_flow_label_network_order (ip) : 0); c ^= t1; - + if (PREDICT_TRUE (is_udp) && + PREDICT_FALSE ((flow_hash_config & IP_FLOW_HASH_GTPV1_TEID) && + udp->dst_port == GTPV1_PORT_BE)) + { + t3 = gtpu->teid; + a ^= t3; + } hash_mix64 (a, b, c); return (u32) c; }