summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat
AgeCommit message (Expand)AuthorFilesLines
2020-08-13nat: remove non-error error countersKlement Sekera16-507/+585
2020-08-06misc: harmonize namesDave Barach2-9/+10
2020-07-28nat: limit resource consumption when out of portsKlement Sekera1-2/+7
2020-07-23nat: fix port number selectionElias Rudberg2-6/+6
2020-07-15nat: add prefetching to in2out_ed/out2in_edKlement Sekera2-2/+27
2020-07-02nat: nat66 to pluginOle Troan14-480/+607
2020-06-27nat: replace speculative buffer enqueue modelKlement Sekera5-2278/+2107
2020-06-25nat: avoid division by zeroKlement Sekera1-1/+8
2020-06-24nat: deterministic: disallow invalid configKlement Sekera2-5/+20
2020-06-23nat: fix broken testKlement Sekera1-2/+14
2020-06-22nat: set buf error if can't create userKlement Sekera4-27/+9
2020-06-19nat: remove unused codeKlement Sekera2-47/+0
2020-06-17nat: print hash table parameters in CLIKlement Sekera1-2/+13
2020-06-17nat: add more trex test scriptsKlement Sekera3-0/+206
2020-06-16nat: improve outside port selection & perfKlement Sekera4-87/+110
2020-06-11nat: properly scale out2in-ed hash on initKlement Sekera1-1/+3
2020-06-11nat: simplify bihash buckets/mem configKlement Sekera8-31/+95
2020-06-10nat: optimize prefetchingKlement Sekera6-18/+18
2020-06-08nat: more long read after short write optimizationKlement Sekera15-1060/+1051
2020-06-04nat: fix coverity warningKlement Sekera1-1/+1
2020-06-04nat: fixed input validationFilip Varga7-21/+22
2020-06-04nat: add tracing for nat44-hairpinningKlement Sekera3-15/+84
2020-06-03nat: refactor mss_clamping to not depend on snat_main_tOle Troan9-68/+83
2020-06-01nat: update ip4-udp src port for checksum == 0 pktsDave Barach1-3/+6
2020-05-27nat: fix regarding vm arg for vlib_time_now callElias Rudberg1-1/+2
2020-05-22nat: fix dslite session port allocationVladimir Ratnikov1-4/+4
2020-05-22nat: output fib index fixFilip Varga1-69/+47
2020-05-15misc: removed executable bits from source filesRay Kinsella4-0/+0
2020-05-14nat: unhide testsKlement Sekera1-5/+5
2020-05-14nat: "users" dump for ED-NATKlement Sekera3-0/+170
2020-05-14nat: remove unused codeKlement Sekera2-3/+0
2020-05-14nat: ED: store both thread&session idx in hashKlement Sekera9-197/+315
2020-05-14nat: fix segv if out of ports in ed modeAlexander Chernavin2-1/+47
2020-05-13nat: fix broken buildKlement Sekera1-1/+1
2020-05-13nat: fix LRU blocked by inactive sessionKlement Sekera10-161/+391
2020-05-13nat: perf improvement - replace branchy codeKlement Sekera32-451/+401
2020-05-13nat: handoff next node feature fixFilip Varga7-47/+159
2020-05-08docs: fix merge damage in nat.hDave Wallace1-4/+0
2020-05-08nat: fix per thread data vlib_main_t usage take 2Ole Troan7-42/+32
2020-05-07nat: remove duplicate line of codeKlement Sekera1-1/+0
2020-05-07nat: fix per thread data vlib_main_t usageFilip Varga9-75/+97
2020-05-06docs: clean up make docs jobPaul Vinciguerra5-9/+29
2020-05-06nat: ipfix logging vlib_mains[thread_index] bugfixElias Rudberg1-16/+16
2020-05-06nat: enable force session cleanupFilip Varga6-142/+236
2020-05-06nat: fix coverity warningKlement Sekera1-19/+5
2020-05-05nat: remove unused codeKlement Sekera1-27/+0
2020-05-04nat: per vrf session limitsFilip Varga9-29/+310
2020-05-03tests: vpp_interface remove deprecated packed propertiesPaul Vinciguerra1-12/+14
2020-04-28nat: remove unused codeKlement Sekera1-9/+0
2020-04-27nat: improve perf - long read after short writeKlement Sekera7-363/+424
an> 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: */