summaryrefslogtreecommitdiffstats
path: root/src/scripts
AgeCommit message (Expand)AuthorFilesLines
2020-11-09ipsec: fix outer table id lookup in ipsec tun scriptBenoît Ganne1-1/+1
2020-11-06ipsec: add support for tx-table-id in cli + exampleBenoît Ganne1-0/+72
2020-10-08pg: Choose the input interface from the stream's rxNeale Ranns1-1/+1
2020-10-08gre: MPLS over GRE does not select correct fixup functionNeale Ranns1-0/+53
2020-09-23build: fix fts.py to run on debian-9/python3.5Dave Wallace1-15/+16
2020-09-22build: allow for rc3/rc4 style tagsAndrew Yourtchenko1-1/+1
2020-08-18build: add explicit commit to rc1, rc2 builds, and add ".0" to post-non-dot-r...Andrew Yourtchenko1-4/+16
2020-06-17build: multiple yaml file supportDave Barach1-2/+2
2020-05-13ipsec: Support 4o6 and 6o4 for SPD tunnel mode SAsNeale Ranns1-0/+55
2020-05-06misc: fts add support for non-ascii author names in yamlPaul Vinciguerra1-2/+2
2020-03-18pg: update packet generator test scriptsShivaShankarK23-46/+46
2020-01-09misc: feature tracking markdown improvementsOle Troan1-26/+142
2020-01-04misc: fix feature.yamlOle Troan1-4/+10
2020-01-03nat: add feature.yamlOle Troan1-3/+15
2019-12-17build: Allow to override build date with SOURCE_DATE_EPOCHBernhard M. Wiedemann1-3/+8
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto2-2/+2
2019-11-05docs: fix issues with src/scripts/fts.pyPaul Vinciguerra1-15/+20
2019-06-18ipsec: ipsec-tun protectNeale Ranns1-0/+71
2019-06-12tcp: add cc stats plotting toolsFlorin Coras2-0/+231
2019-05-31tools: FEATURE.yaml meta-data infrastructureOle Troan1-0/+131
2019-04-30crypto: enforce per-alg crypto key lengthBenoît Ganne1-2/+2
2019-03-26Convert GRE nodes to new buffer APIs and multiarchBenoît Ganne2-0/+124
2019-03-26Simplify adjacency rewrite codeBenoît Ganne1-0/+67
2019-03-04IPSEC: script to bounce IPSEC traffic through a pipe to test encrypt and decrpytNeale Ranns1-0/+66
2019-02-20pg: remove no-recycle optionDamjan Marion39-77/+0
2019-01-29cmake: fix out-of-git-tree buildDamjan Marion1-1/+1
2019-01-20Rework of debian packagingDamjan Marion1-0/+37
2018-08-17CMake as an alternative to autotools (experimental)Damjan Marion1-0/+28
2018-06-15NAT44: endpoint dependent mode (VPP-1273)Matus Fabian2-1/+49
2018-03-12License text cleanupDave Barach1-0/+13
2017-12-13NAT64: multi-thread support (VPP-891)Matus Fabian2-0/+86
2017-10-30Remove old Python vppctl scriptChris Luke1-134/+0
2017-10-16udp: refactor udp codeFlorin Coras2-25/+72
2017-08-23NAT: Rename snat plugin to nat (VPP-955)Matus Fabian4-10/+10
2017-08-04SNAT: fix address and port allocation for multiple worker threads (VPP-925)Matus Fabian1-5/+12
2017-05-09Add support for tcp/session buffer chainsFlorin Coras1-2/+17
2017-05-05First commit SR MPLSPablo Camarillo7-118/+11
2017-04-19Fix "make dist" to include version number, docouple it from rpm packagingDamjan Marion1-8/+4
2017-04-13Session layer refactoringFlorin Coras1-1/+2
2017-03-13VPP-659 Improve tcp/session debugging and testingFlorin Coras1-0/+4
2017-03-10VPP-659 TCP improvementsFlorin Coras3-3/+28
2017-03-07DHCP Multiple Servers (VPP-602, VPP-605)Neale Ranns1-1/+2
2017-03-07CGN: Deterministic NAT (VPP-623)Matus Fabian1-0/+108
2017-03-04Cleanup URI code and TCP bugfixingFlorin Coras2-0/+66
2017-03-01VPP-598: tcp stack initial commitDave Barach5-8/+91
2017-02-28vlib: add buffer cloning supportDamjan Marion1-8/+11
2017-02-21dhcp: multiple additionsNeale Ranns1-0/+21
2017-02-02Fix SR multicast post mfib commitNeale Ranns1-0/+58
2017-01-27IP Multicast FIB (mfib)Neale Ranns1-0/+22
2017-01-27Add multi-vpp support back into pythonic vppctlEd Warnicke1-7/+20
\ u64 deadline = tm->deadline; \ do \ { \ for (counter = 0; counter < vec_len (tm->key_add_del_sequence); \ ++counter) \ { \ u64 idx = tm->key_add_del_sequence[counter]; \ u8 op = tm->key_op_sequence[counter]; \ if (op) \ { \ ++nadds; \ } \ else \ { \ ++ndels; \ } \ guts; \ if (clib_cpu_time_now () > deadline) \ { \ break; \ } \ } \ } \ while (clib_cpu_time_now () < deadline); \ tm->nadds = nadds; \ tm->ndels = ndels; \ return NULL; \ } /* *INDENT-OFF* */ w_thread (b, { BVT (clib_bihash_kv) kv; kv.key = tm->keys[idx]; kv.value = *hash_get (tm->key_hash, kv.key); BV (clib_bihash_add_del) (&tm->bh, &kv, op); }); /* *INDENT-ON* */ /* *INDENT-OFF* */ w_thread (c, { CVT (clib_cuckoo_kv) kv; kv.key = tm->keys[idx]; kv.value = *hash_get (tm->key_hash, kv.key); CV (clib_cuckoo_add_del) (&tm->ch, &kv, op); }); /* *INDENT-ON* */ #define r_thread(x, guts) \ void *x##reader_thread (void *v) \ { \ thread_data_t *data = v; \ thread_id = data->thread_idx; \ test_main_t *tm = data->tm; \ uword thread_idx = data->thread_idx; \ u64 *idx; \ uword nlookups = 0; \ u64 deadline = tm->deadline; \ do \ { \ vec_foreach (idx, tm->key_search_sequence[thread_idx]) \ { \ guts; \ ++nlookups; \ if (clib_cpu_time_now () > deadline) \ { \ break; \ } \ } \ } \ while (clib_cpu_time_now () < deadline); \ data->nlookups = nlookups; \ return NULL; \ } /* *INDENT-OFF* */ r_thread (c, { CVT (clib_cuckoo_kv) kv; kv.key = tm->keys[*idx]; kv.value = *hash_get (tm->key_hash, kv.key); CV (clib_cuckoo_search) (&tm->ch, &kv, &kv); }); /* *INDENT-ON* */ /* *INDENT-OFF* */ r_thread (b, { BVT (clib_bihash_kv) kv; kv.key = tm->keys[*idx]; kv.value = *hash_get (tm->key_hash, kv.key); BV (clib_bihash_search) (&tm->bh, &kv, &kv); }); /* *INDENT-ON* */ #define run_threads(x) \ do \ { \ \ before = clib_time_now (&tm->clib_time); \ tm->deadline = clib_cpu_time_now () + \ tm->runtime * tm->clib_time.clocks_per_second; \ fformat (stdout, #x "-> Start threads..., runtime is %llu second(s)\n", \ (long long unsigned)tm->runtime); \ \ /* \ fformat (stdout, #x "-> Writer thread only...\n"); \ if (0 != \ pthread_create (&tm->x##writer_thread, NULL, x##writer_thread, tm)) \ { \ perror ("pthread_create()"); \ abort (); \ } \ \ if (0 != pthread_join (tm->x##writer_thread, NULL)) \ { \ perror ("pthread_join()"); \ abort (); \ } \ \ delta = clib_time_now (&tm->clib_time) - before; \ fformat (stdout, #x "-> %wu adds, %wu dels in %.6f seconds\n", \ tm->nadds, tm->ndels, delta); \ tm->nadds = 0; \ tm->ndels = 0; \ */ \ \ fformat (stdout, #x "-> Writer + %d readers\n", tm->nthreads); \ before = clib_time_now (&tm->clib_time); \ tm->deadline = clib_cpu_time_now () + \ tm->runtime * tm->clib_time.clocks_per_second; \ if (0 != \ pthread_create (&tm->x##writer_thread, NULL, x##writer_thread, tm)) \ { \ perror ("pthread_create()"); \ abort (); \ } \ \ for (i = 0; i < tm->nthreads; i++) \ { \ tm->rthread_data[i].nlookups = 0; \ if (0 != pthread_create (&tm->x##reader_threads[i], NULL, \ x##reader_thread, &tm->rthread_data[i])) \ { \ perror ("pthread_create()"); \ abort (); \ } \ } \ \ if (0 != pthread_join (tm->x##writer_thread, NULL)) \ { \ perror ("pthread_join()"); \ abort (); \ } \ \ for (i = 0; i < tm->nthreads; i++) \ { \ if (0 != pthread_join (tm->x##reader_threads[i], NULL)) \ { \ perror ("pthread_join()"); \ abort (); \ } \ } \ \ delta = clib_time_now (&tm->clib_time) - before; \ \ total_searches = 0; \ for (i = 0; i < tm->nthreads; ++i) \ { \ u64 nlookups = tm->rthread_data[i].nlookups; \ fformat (stdout, #x "-> Thread #%d: %u searches\n", i, nlookups); \ total_searches += nlookups; \ } \ \ if (delta > 0) \ { \ ops = (tm->nadds + tm->ndels) / (f64)delta; \ fformat (stdout, #x "-> %.f add/dels per second\n", ops); \ sps = ((f64)total_searches) / delta; \ fformat (stdout, #x "-> %.f searches per second\n", sps); \ } \ \ fformat (stdout, \ #x "-> %wu adds, %wu dels, %lld searches in %.6f seconds\n", \ tm->nadds, tm->ndels, total_searches, delta); \ } \ while (0); static void cb (CVT (clib_cuckoo) * h, void *ctx) { fformat (stdout, "Garbage callback called...\n"); } static clib_error_t * test_cuckoo_bihash (test_main_t * tm) { int i; uword *p; uword total_searches; f64 before, delta; f64 ops = 0, sps = 0; f64 bops = 0, bsps = 0; f64 cops = 0, csps = 0; CVT (clib_cuckoo) * ch; BVT (clib_bihash) * bh; ch = &tm->ch; bh = &tm->bh; CV (clib_cuckoo_init) (ch, "test", 1, cb, NULL); BV (clib_bihash_init) (bh, (char *) "test", tm->nbuckets, 256 << 20); fformat (stdout, "Pick %lld unique %s keys...\n", tm->nitems, tm->non_random_keys ? "non-random" : "random"); for (i = 0; i < tm->nitems; i++) { u64 rndkey; if (tm->non_random_keys == 0) { again: rndkey = random_u64 (&tm->seed); p = hash_get (tm->key_hash, rndkey); if (p) goto again; } else rndkey = (u64) (i + 1) << 16; hash_set (tm->key_hash, rndkey, i + 1); vec_add1 (tm->keys, rndkey); int j; for (j = 0; j < tm->nthreads; ++j) { u64 *x = tm->key_search_sequence[j]; vec_add1 (x, random_u64 (&tm->seed) % tm->nitems); tm->key_search_sequence[j] = x; } vec_add1 (tm->key_add_del_sequence, random_u64 (&tm->seed) % tm->nitems); vec_add1 (tm->key_op_sequence, (rndkey % 10 < 8) ? 1 : 0); } int thread_counter = 0; tm->wthread_data.tm = tm; tm->wthread_data.thread_idx = thread_counter; for (i = 0; i < tm->nthreads; ++i) { tm->rthread_data[i].tm = tm; tm->rthread_data[i].thread_idx = thread_counter; tm->rthread_data[i].nlookups = 0; ++thread_counter; } int iter; for (iter = 0; iter < tm->search_iter; ++iter) { fformat (stdout, "Bihash test #%d\n", iter); run_threads (b); bops = ops; bsps = sps; fformat (stdout, "%U", BV (format_bihash), bh, 0); fformat (stdout, "Cuckoo test #%d\n", iter); run_threads (c); cops = ops; csps = sps; fformat (stdout, "%U", CV (format_cuckoo), ch, 0); fformat (stdout, "Bihash add/del speed is %.2f%% of cuckoo add/del speed\n", bops / cops * 100); fformat (stdout, "Bihash search speed is %.2f%% of cuckoo search speed\n", bsps / csps * 100); } return 0; } clib_error_t * test_cuckoo_bihash_main (test_main_t * tm) { unformat_input_t *i = tm->input; clib_error_t *error; while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { if (unformat (i, "seed %u", &tm->seed)) ; else if (unformat (i, "nbuckets %d", &tm->nbuckets)) ; else if (unformat (i, "non-random-keys")) tm->non_random_keys = 1; else if (unformat (i, "nitems %d", &tm->nitems)) ; else if (unformat (i, "search_iter %d", &tm->search_iter)) ; else if (unformat (i, "verbose %d", &tm->verbose)) ; else if (unformat (i, "runtime %d", &tm->runtime)) ; else if (unformat (i, "nthreads %d", &tm->nthreads)) ; else if (unformat (i, "verbose")) tm->verbose = 1; else return clib_error_return (0, "unknown input '%U'", format_unformat_error, i); } error = test_cuckoo_bihash (tm); return error; } #ifdef CLIB_UNIX int main (int argc, char *argv[]) { unformat_input_t i; clib_error_t *error; test_main_t *tm = &test_main; clib_memset (&test_main, 0, sizeof (test_main)); clib_mem_init (0, 3ULL << 30); tm->input = &i; tm->seed = 0xdeaddabe; tm->nbuckets = 2; tm->nitems = 5; tm->verbose = 1; tm->nthreads = 1; clib_time_init (&tm->clib_time); tm->runtime = 1; tm->search_iter = 1; tm->key_hash = hash_create (0, sizeof (uword)); unformat_init_command_line (&i, argv); error = test_cuckoo_bihash_main (tm); unformat_free (&i); if (error) { clib_error_report (error); return 1; } return 0; } #endif /* CLIB_UNIX */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */