X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fip%2Fip6.h;h=ab17f662198702f5bc2c588c20dd973cbef9f18e;hb=7c03ed47d5acfa39820f9553999caa01cf47dba4;hp=aef2445441351315d395990ea825543d3761b123;hpb=178cf493d009995b28fdf220f04c98860ff79a9b;p=vpp.git diff --git a/src/vnet/ip/ip6.h b/src/vnet/ip/ip6.h index aef24454413..ab17f662198 100644 --- a/src/vnet/ip/ip6.h +++ b/src/vnet/ip/ip6.h @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -78,17 +79,14 @@ typedef struct typedef struct ip6_mfib_t { + /* required for pool_get_aligned. */ + CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); + /* Table ID (hash key) for this FIB. */ u32 table_id; /* Index into FIB vector. */ u32 index; - - /* - * Pointer to the top of a radix tree. - * This cannot be realloc'd, hence it cannot be inlined with this table - */ - struct radix_node_head *rhead; } ip6_mfib_t; struct ip6_main_t; @@ -143,7 +141,7 @@ typedef enum ip6_fib_table_instance_type_t_ typedef struct ip6_fib_table_instance_t_ { /* The hash table */ - BVT (clib_bihash) ip6_hash; + clib_bihash_24_8_t ip6_hash; /* bitmap / refcounts / vector of mask widths to search */ uword *non_empty_dst_address_length_bitmap; @@ -151,6 +149,20 @@ typedef struct ip6_fib_table_instance_t_ i32 dst_address_length_refcounts[129]; } ip6_fib_table_instance_t; +/** + * A represenation of a single IP6 mfib table + */ +typedef struct ip6_mfib_table_instance_t_ +{ + /* The hash table */ + clib_bihash_40_8_t ip6_mhash; + + /* bitmap / refcounts / vector of mask widths to search */ + uword *non_empty_dst_address_length_bitmap; + u16 *prefix_lengths_in_search_order; + i32 dst_address_length_refcounts[257]; +} ip6_mfib_table_instance_t; + typedef struct ip6_main_t { /** @@ -158,6 +170,11 @@ typedef struct ip6_main_t */ ip6_fib_table_instance_t ip6_table[IP6_FIB_NUM_TABLES]; + /** + * the single MFIB table + */ + ip6_mfib_table_instance_t ip6_mtable; + ip_lookup_main_t lookup_main; /* Pool of FIBs. */ @@ -468,7 +485,6 @@ ip6_compute_flow_hash (const ip6_header_t * ip, a = (flow_hash_config & IP_FLOW_HASH_REVERSE_SRC_DST) ? t2 : t1; b = (flow_hash_config & IP_FLOW_HASH_REVERSE_SRC_DST) ? t1 : t2; - b ^= (flow_hash_config & IP_FLOW_HASH_PROTO) ? protocol : 0; t1 = is_tcp_udp ? tcp->src : 0; t2 = is_tcp_udp ? tcp->dst : 0; @@ -476,6 +492,23 @@ ip6_compute_flow_hash (const ip6_header_t * ip, t1 = (flow_hash_config & IP_FLOW_HASH_SRC_PORT) ? t1 : 0; t2 = (flow_hash_config & IP_FLOW_HASH_DST_PORT) ? t2 : 0; + if (flow_hash_config & IP_FLOW_HASH_SYMMETRIC) + { + if (b < a) + { + c = a; + a = b; + b = c; + } + if (t2 < t1) + { + t2 += t1; + t1 = t2 - t1; + t2 = t2 - t1; + } + } + + b ^= (flow_hash_config & IP_FLOW_HASH_PROTO) ? protocol : 0; c = (flow_hash_config & IP_FLOW_HASH_REVERSE_SRC_DST) ? ((t1 << 16) | t2) : ((t2 << 16) | t1);