diff options
author | Piotr Bronowski <piotrx.bronowski@intel.com> | 2022-07-08 12:45:05 +0000 |
---|---|---|
committer | Fan Zhang <roy.fan.zhang@intel.com> | 2022-07-15 12:45:19 +0000 |
commit | 86f8208af43efaa71b8e1c0a5ff86fc233456d9d (patch) | |
tree | 18feadc95586f549325f2a1872492caa9ad32df0 /src/vnet/ipsec/ipsec_spd_fp_lookup.h | |
parent | 963e9b583b7fa7c26efc7acee2449069057b93d7 (diff) |
ipsec: fast path outbound policy matching implementation for ipv6
With this patch fast path for ipv6 policy lookup is enabled.
This impelentation scales and outperforms original implementation when
the number of defined flows is higher thatn 100k.
Type: feature
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I9364b5b8db4fc708790d48c538add272c7cea400
Diffstat (limited to 'src/vnet/ipsec/ipsec_spd_fp_lookup.h')
-rw-r--r-- | src/vnet/ipsec/ipsec_spd_fp_lookup.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/vnet/ipsec/ipsec_spd_fp_lookup.h b/src/vnet/ipsec/ipsec_spd_fp_lookup.h index 571a4b82fd2..912e18a3f8a 100644 --- a/src/vnet/ipsec/ipsec_spd_fp_lookup.h +++ b/src/vnet/ipsec/ipsec_spd_fp_lookup.h @@ -128,7 +128,7 @@ ipsec_fp_ip6_out_policy_match_n (void *spd_fp, ipsec_fp_5tuple_t *tuples, u64 *pkey, *pmatch, *pmask; ipsec_main_t *im = &ipsec_main; ipsec_spd_fp_t *pspd_fp = (ipsec_spd_fp_t *) spd_fp; - u32 *mask_type_ids = pspd_fp->fp_mask_types[IPSEC_SPD_POLICY_IP4_OUTBOUND]; + u32 *mask_type_ids = pspd_fp->fp_mask_types[IPSEC_SPD_POLICY_IP6_OUTBOUND]; /*clear the list of matched policies pointers */ clib_memset (policies, 0, n * sizeof (*policies)); @@ -140,16 +140,15 @@ ipsec_fp_ip6_out_policy_match_n (void *spd_fp, ipsec_fp_5tuple_t *tuples, { mte = im->fp_mask_types + *mti; - pmatch = (u64 *) match; - pmask = (u64 *) &mte->mask; + pmatch = (u64 *) &match->ip6_laddr; + pmask = (u64 *) &mte->mask.ip6_laddr; pkey = (u64 *) kv.key; *pkey++ = *pmatch++ & *pmask++; *pkey++ = *pmatch++ & *pmask++; *pkey++ = *pmatch++ & *pmask++; *pkey++ = *pmatch++ & *pmask++; - *pkey++ = *pmatch++ & *pmask++; - *pkey++ = *pmatch++ & *pmask++; + *pkey = *pmatch & *pmask; int res = clib_bihash_search_inline_2_40_8 ( &pspd_fp->fp_ip6_lookup_hash, &kv, &result); |