summaryrefslogtreecommitdiffstats
path: root/test/test_ipsec_esp.py
AgeCommit message (Expand)AuthorFilesLines
2020-01-04ipsec: Targeted unit testingNeale Ranns1-2/+5
2019-12-23ipsec: Test and fix IPSec worker hand-offNeale Ranns1-1/+9
2019-11-08ipsec: remove dedicated IPSec tunnelsNeale Ranns1-1/+2
2019-10-18ipsec: make tests support python3Ole Troan1-8/+8
2019-09-18tests: split up the long running IPSec tests into separate classesAndrew Yourtchenko1-82/+398
2019-08-27ipsec: Fix NULL encryption algorithmNeale Ranns1-0/+8
2019-08-16ipsec: fix missed IPSEC_INTEG_ALG_MD5_96Dmitry Vakhrushev1-3/+3
2019-07-31tests: Split IPSec ESP into parameterized tests per engineNeale Ranns1-65/+60
2019-07-24ipsec: GCM, Anti-replay and ESN fixessNeale Ranns1-0/+8
2019-07-10tests: Re-enable ipsec tests on ARMjuraj.linkes1-3/+3
2019-06-18ipsec: ipsec-tun protectNeale Ranns1-5/+11
2019-06-18fib: fib api updatesNeale Ranns1-2/+1
2019-05-20openssl plugin 3des routine iv_len fixVladimir Ratnikov1-2/+10
2019-04-17IPSEC: Pass the algorithm salt (used in GCM) over the APINeale Ranns1-11/+24
2019-04-17crypto-ipsecmb: enable GCMNeale Ranns1-1/+0
2019-04-16IPSEC: support GCM in ESPNeale Ranns1-14/+46
2019-04-11IPSEC: ESP with ESN tests and fixesNeale Ranns1-9/+12
2019-04-11IPSEC-MB: Use random & non-repeating IV (VPP-1642)Neale Ranns1-1/+1
2019-04-11Tests: Refactor tearDown show command logging, add lifecycle markers.Paul Vinciguerra1-2/+3
2019-04-10crypto: Intel IPSEC-MB engineNeale Ranns1-2/+2
2019-04-10IPSEC: for each engine and algorithm testsNeale Ranns1-186/+307
2019-04-10Tests Cleanup: Fix missing calls to setUpClass/tearDownClass.Paul Vinciguerra1-0/+17
2019-03-28Typos. A bunch of typos I've been collecting.Paul Vinciguerra1-2/+2
2019-03-21IPSEC: Mutli-tunnel testsNeale Ranns1-12/+7
2019-02-28TEST: IPSEC NAT-T with UDP headerNeale Ranns1-135/+197
2019-02-18IPSEC: move SA counters into the stats segmentNeale Ranns1-22/+26
2019-02-05IPSEC: SPD counters in the stats sgementNeale Ranns1-9/+13
2019-01-31IPSEC: API modernisationNeale Ranns1-8/+19
2019-01-29make test: remove generic importsKlement Sekera1-1/+2
2019-01-25IPSEC: tests use opbject registryNeale Ranns1-228/+106
2019-01-24IPSEC Tests: to per-test setup and tearDownNeale Ranns1-99/+240
2018-12-02IPSEC-AH: anti-replay testingNeale Ranns1-2/+5
2018-11-15ipsec: infra for selecting backendsKlement Sekera1-1/+8
2018-10-03ipsec: add missing ipv6 ah code & ipv6 testsKlement Sekera1-75/+100
2018-06-24Revert "Revert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums""Klement Sekera1-291/+113
2018-06-22Revert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums"Ole Troan1-113/+291
2018-06-21ipsec: VPP-1316 calculate IP/TCP/UDP inner checksumsKlement Sekera1-291/+113
2018-05-09ipsec: support UDP encap/decap for NAT traversalKlement Sekera1-6/+6
2018-04-17make test: ipsec test cleanupKlement Sekera1-6/+4
2017-12-15ESP_AH_test_automation_scripts rev1“mystarrocks”1-0/+341
n>path, 1); vec_validate (sp->occupancy, 0); return 0; } /* * slist_search_internal */ static inline clib_slist_search_result_t slist_search_internal (clib_slist_t * sp, void *key, int need_full_path) { int level, comp_result; clib_slist_elt_t *search_elt, *head_elt; sp->ncompares = 0; /* * index 0 is the magic listhead element which is * lexically lighter than / to the left of every element */ search_elt = head_elt = pool_elt_at_index (sp->elts, 0); /* * Initial negotiating position, only the head_elt is * lighter than the supplied key */ memset (sp->path, 0, vec_len (head_elt->n.nexts) * sizeof (u32)); /* Walk the fastest lane first */ level = vec_len (head_elt->n.nexts) - 1; _vec_len (sp->path) = level + 1; while (1) { u32 next_index_this_level; clib_slist_elt_t *prefetch_elt; /* * Prefetching the next element at this level makes a measurable * difference, but doesn't fix the dependent read stall problem */ prefetch_elt = sp->elts + clib_slist_get_next_at_level (search_elt, level); CLIB_PREFETCH (prefetch_elt, CLIB_CACHE_LINE_BYTES, READ); /* Compare the key with the current element */ comp_result = (search_elt == head_elt) ? 1 : sp->compare (key, search_elt->user_pool_index); sp->ncompares++; /* key "lighter" than this element */ if (comp_result < 0) { /* * Back up to previous item on this list * and search the next finer-grained list * starting there. */ search_elt = pool_elt_at_index (sp->elts, sp->path[level]); next_list: if (level > 0) { level--; continue; } else { return CLIB_SLIST_NO_MATCH; } } /* Match */ if (comp_result == 0) { /* * If we're trying to delete an element, we need to * track down all of the elements which point at it. * Otherwise, don't bother with it */ if (need_full_path && level > 0) { search_elt = pool_elt_at_index (sp->elts, sp->path[level]); level--; continue; } level = vec_len (head_elt->n.nexts); sp->path[level] = search_elt - sp->elts; _vec_len (sp->path) = level + 1; return CLIB_SLIST_MATCH; } /* * comp_result positive, key is to the right of * this element */ sp->path[level] = search_elt - sp->elts; /* Out of list at this level? */ next_index_this_level = clib_slist_get_next_at_level (search_elt, level); if (next_index_this_level == (u32) ~ 0) goto next_list; /* No, try the next element */ search_elt = pool_elt_at_index (sp->elts, next_index_this_level); } return 0; /* notreached */ } u32 clib_slist_search (clib_slist_t * sp, void *key, u32 * ncompares) { clib_slist_search_result_t rv; rv = slist_search_internal (sp, key, 0 /* dont need full path */ ); if (rv == CLIB_SLIST_MATCH) { clib_slist_elt_t *elt; elt = pool_elt_at_index (sp->elts, sp->path[vec_len (sp->path) - 1]); if (ncompares) *ncompares = sp->ncompares; return elt->user_pool_index; } return (u32) ~ 0; } void clib_slist_add (clib_slist_t * sp, void *key, u32 user_pool_index) { clib_slist_elt_t *new_elt; clib_slist_search_result_t search_result; int level; search_result = slist_search_internal (sp, key, 0 /* don't need full path */ ); /* Special case: key exists, just replace user_pool_index */ if (PREDICT_FALSE (search_result == CLIB_SLIST_MATCH)) { clib_slist_elt_t *elt; elt = pool_elt_at_index (sp->elts, sp->path[0]); elt->user_pool_index = user_pool_index; return; } pool_get (sp->elts, new_elt); new_elt->n.nexts = 0; new_elt->user_pool_index = user_pool_index; /* sp->path lists elements to the left of key, by level */ for (level = 0; level < vec_len (sp->path); level++) { clib_slist_elt_t *prev_elt_this_level; u32 prev_elt_next_index_this_level; /* Add to list at the current level */ prev_elt_this_level = pool_elt_at_index (sp->elts, sp->path[level]); prev_elt_next_index_this_level = clib_slist_get_next_at_level (prev_elt_this_level, level); clib_slist_set_next_at_level (new_elt, prev_elt_next_index_this_level, level); clib_slist_set_next_at_level (prev_elt_this_level, new_elt - sp->elts, level); sp->occupancy[level]++; /* Randomly add to the next-higher level */ if (random_f64 (&sp->seed) > sp->branching_factor) break; } { /* Time to add a new ply? */ clib_slist_elt_t *head_elt = pool_elt_at_index (sp->elts, 0); int top_level = vec_len (head_elt->n.nexts) - 1; if (((f64) sp->occupancy[top_level]) * sp->branching_factor > 1.0) { vec_add1 (sp->occupancy, 0); vec_add1 (head_elt->n.nexts, (u32) ~ 0); /* full match case returns n+1 items */ vec_validate (sp->path, vec_len (head_elt->n.nexts)); } } } clib_slist_search_result_t clib_slist_del (clib_slist_t * sp, void *key) { clib_slist_search_result_t search_result; clib_slist_elt_t *del_elt; int level; search_result = slist_search_internal (sp, key, 1 /* need full path */ ); if (PREDICT_FALSE (search_result == CLIB_SLIST_NO_MATCH)) return search_result; del_elt = pool_elt_at_index (sp->elts, sp->path[vec_len (sp->path) - 1]); ASSERT (vec_len (sp->path) > 1); for (level = 0; level < vec_len (sp->path) - 1; level++) { clib_slist_elt_t *path_elt; u32 path_elt_next_index; path_elt = pool_elt_at_index (sp->elts, sp->path[level]); path_elt_next_index = clib_slist_get_next_at_level (path_elt, level); /* Splice the item out of the list if it's adjacent to the victim */ if (path_elt_next_index == del_elt - sp->elts) { sp->occupancy[level]--; path_elt_next_index = clib_slist_get_next_at_level (del_elt, level); clib_slist_set_next_at_level (path_elt, path_elt_next_index, level); } } /* If this element is on more than two lists it has a vector of nexts */ if (!(del_elt->n.next0[0] & 1)) vec_free (del_elt->n.nexts); pool_put (sp->elts, del_elt); return CLIB_SLIST_MATCH; } u8 * format_slist (u8 * s, va_list * args) { clib_slist_t *sl = va_arg (*args, clib_slist_t *); int verbose = va_arg (*args, int); int i; clib_slist_elt_t *head_elt, *elt; s = format (s, "slist 0x%x, %u items, branching_factor %.2f\n", sl, sl->occupancy ? sl->occupancy[0] : 0, sl->branching_factor); if (pool_elts (sl->elts) == 0) return s; head_elt = pool_elt_at_index (sl->elts, 0); for (i = 0; i < vec_len (head_elt->n.nexts); i++) { s = format (s, "level %d: %d elts\n", i, sl->occupancy ? sl->occupancy[i] : 0); if (verbose && head_elt->n.nexts[i] != (u32) ~ 0) { elt = pool_elt_at_index (sl->elts, head_elt->n.nexts[i]); while (elt) { u32 next_index; s = format (s, "%U(%d) ", sl->format_user_element, elt->user_pool_index, elt - sl->elts); next_index = clib_slist_get_next_at_level (elt, i); ASSERT (next_index != 0x7fffffff); if (next_index == (u32) ~ 0) break; else elt = pool_elt_at_index (sl->elts, next_index); } } s = format (s, "\n"); } return s; } /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */