aboutsummaryrefslogtreecommitdiffstats
path: root/extras/scripts
AgeCommit message (Expand)AuthorFilesLines
2024-08-07tests: update scapy to version 2.4.5Dave Wallace1-7/+12
2024-04-02misc: in crcchecker.py, don't check for uncommitted changes in CIDave Wallace1-7/+9
2024-03-13misc: fix the static vppctl buildAndrew Yourtchenko1-0/+2
2022-09-20misc: experimental script to get the list of the reviewers for a commitAndrew Yourtchenko1-0/+240
2022-05-10tests: replace pycodestyle with blackKlement Sekera2-105/+125
2022-03-24build: exclude dlmalloc.[ch] from checkstyle verificationDave Wallace1-1/+5
2022-03-22build: remove clang-format-10Dave Wallace1-1/+1
2022-03-22build: fix clang-format-diff[.py] detectionKlement Sekera1-1/+4
2021-11-15misc: vppctl - remove the dependency on vppinfraAndrew Yourtchenko1-16/+4
2021-11-10misc: update extras/scripts/lsnetDamjan Marion1-16/+47
2021-11-09build: install clang-format-11Dave Wallace1-0/+2
2021-10-13docs: convert extras doc md->rstNathan Skrzypczak1-0/+67
2021-05-12misc: change VFIO group ownership and permissions in vfctl scriptDamjan Marion1-0/+4
2021-04-30misc: experimental configure scriptDamjan Marion1-28/+0
2021-04-28vppinfra: don't fail if config.h is missing, fallback to defaults insteadDamjan Marion1-7/+0
2021-04-27build: Makefile cleanupDamjan Marion1-0/+1
2021-04-18vppinfra: remove linux/syscall.hDamjan Marion1-2/+0
2021-04-07misc: add build_static_vppctl.shDamjan Marion1-0/+36
2021-03-23misc: allow explicitelly setting CLANG_FORMAT_VERDamjan Marion1-1/+1
2021-03-16misc: fix checkstyle on fedoraRay Kinsella1-3/+51
2021-03-15misc: finish removing deprecated cop APIDave Barach1-4/+7
2021-03-05api: crchcecker ignore version < 1.0.0 and outside of src directoryOle Troan2-93/+174
2021-01-15misc: checkstyle ignore .patch files in trailing whitespace checkNeale Ranns1-1/+1
2020-12-18misc: migrate from GNU indent to clang-formatDamjan Marion1-0/+90
2020-12-15api: crchcecker ignore version < 1.0.0 and outside of src directoryOle Tr�an2-171/+93
2020-12-15api: crchcecker ignore version < 1.0.0 and outside of src directoryOle Troan2-93/+171
2020-10-24build: add compile_commands.json cleanup scriptDamjan Marion1-0/+28
2020-09-23vppapigen: crcchecker: harmonize the in_progress markingAndrew Yourtchenko2-6/+44
2020-09-16vppapigen: crcchecker: report in-progress messagesAndrew Yourtchenko1-0/+6
2020-09-16vppapigen: crcchecker: report deprecated messagesAndrew Yourtchenko1-5/+15
2020-08-11vppapigen: add support for empty optionsOle Troan1-1/+1
2020-06-21vpp_config: Updates for 20.05John DeNisco1-1/+1
2020-05-19vppapigen: handle new api file for crcchekcerOle Troan1-0/+11
2020-05-09vppapigen: api crc checkerOle Troan2-0/+343
2020-02-05misc: add new type for commit messageMohsin Kazmi1-1/+1
2020-01-03build: Fix Subject-line feature list extractionJon Loeliger1-1/+2
2019-11-15build: make checkstyle-* targets and cleanupDave Wallace1-0/+3
2019-10-09docs: Add macos build documentationNathan Skrzypczak2-0/+91
2019-07-09misc: extras update list_api_changes.py to PY3Paul Vinciguerra1-11/+14
2019-07-05misc: allow second ':' in commit messageDamjan Marion1-1/+1
2019-06-25build: fix error messages in check_commit_msg.shDave Barach1-4/+3
2019-06-14misc: Update MAINTAINERS to include interface commonNeale Ranns1-1/+1
2019-06-12misc: add check_commit_msg.sh scriptDamjan Marion1-0/+50
2019-04-18Extras: Fix list_api_changes script for 19.08Dave Wallace1-2/+2
2019-01-31Update version (19.01) for API changes scriptAndrew Yourtchenko1-2/+2
2019-01-31extras: vfctl script - bind VF to vfio-pci after VF is createdDamjan Marion1-0/+10
2018-10-26extras/scripts: update vfctl scriptDamjan Marion1-1/+3
2018-10-18Update version (18.10) for API changes scriptMarco Varlese1-2/+2
2018-07-30Update Release Notes for 18.07 ReleaseEd Warnicke1-2/+2
2018-06-10add script for virtual function create/show/removeDamjan Marion1-0/+132
="p">) + 1, c->config_string_heap_handle); /* First element in heap points back to pool index. */ d = vec_elt_at_index (cm->config_string_heap, c->config_string_heap_index); d[0] = c->index; clib_memcpy (d + 1, config_string, vec_bytes (config_string)); hash_set_mem (cm->config_string_hash, config_string, c->index); c->reference_count = 0; /* will be incremented by caller. */ } return c; } void vnet_config_init (vlib_main_t * vm, vnet_config_main_t * cm, char *start_node_names[], int n_start_node_names, char *feature_node_names[], int n_feature_node_names) { vlib_node_t *n; u32 i; memset (cm, 0, sizeof (cm[0])); cm->config_string_hash = hash_create_vec (0, STRUCT_SIZE_OF (vnet_config_t, config_string_vector[0]), sizeof (uword)); ASSERT (n_feature_node_names >= 1); vec_resize (cm->start_node_indices, n_start_node_names); for (i = 0; i < n_start_node_names; i++) { n = vlib_get_node_by_name (vm, (u8 *) start_node_names[i]); /* Given node name must exist. */ ASSERT (n != 0); cm->start_node_indices[i] = n->index; } vec_resize (cm->node_index_by_feature_index, n_feature_node_names); for (i = 0; i < n_feature_node_names; i++) { if (!feature_node_names[i]) cm->node_index_by_feature_index[i] = ~0; else { n = vlib_get_node_by_name (vm, (u8 *) feature_node_names[i]); /* Given node may exist in plug-in library which is not present */ if (n) { if (i + 1 == n_feature_node_names) cm->end_node_index = n->index; cm->node_index_by_feature_index[i] = n->index; } else cm->node_index_by_feature_index[i] = ~0; } } } static void remove_reference (vnet_config_main_t * cm, vnet_config_t * c) { ASSERT (c->reference_count > 0); c->reference_count -= 1; if (c->reference_count == 0) { hash_unset (cm->config_string_hash, c->config_string_vector); vnet_config_free (cm, c); pool_put (cm->config_pool, c); } } static int feature_cmp (void *a1, void *a2) { vnet_config_feature_t *f1 = a1; vnet_config_feature_t *f2 = a2; return (int) f1->feature_index - f2->feature_index; } always_inline u32 * vnet_get_config_heap (vnet_config_main_t * cm, u32 ci) { return heap_elt_at_index (cm->config_string_heap, ci); } u32 vnet_config_add_feature (vlib_main_t * vm, vnet_config_main_t * cm, u32 config_string_heap_index, u32 feature_index, void *feature_config, u32 n_feature_config_bytes) { vnet_config_t *old, *new; vnet_config_feature_t *new_features, *f; u32 n_feature_config_u32s; u32 node_index = vec_elt (cm->node_index_by_feature_index, feature_index); if (node_index == ~0) // feature node does not exist return config_string_heap_index; // return original config index if (config_string_heap_index == ~0) { old = 0; new_features = 0; } else { u32 *p = vnet_get_config_heap (cm, config_string_heap_index); old = pool_elt_at_index (cm->config_pool, p[-1]); new_features = old->features; if (new_features) new_features = duplicate_feature_vector (new_features); } vec_add2 (new_features, f, 1); f->feature_index = feature_index; f->node_index = node_index; n_feature_config_u32s = round_pow2 (n_feature_config_bytes, sizeof (f->feature_config[0])) / sizeof (f->feature_config[0]); vec_add (f->feature_config, feature_config, n_feature_config_u32s); /* Sort (prioritize) features. */ if (vec_len (new_features) > 1) vec_sort_with_function (new_features, feature_cmp); if (old) remove_reference (cm, old); new = find_config_with_features (vm, cm, new_features); new->reference_count += 1; /* * User gets pointer to config string first element * (which defines the pool index * this config string comes from). */ vec_validate (cm->config_pool_index_by_user_index, new->config_string_heap_index + 1); cm->config_pool_index_by_user_index[new->config_string_heap_index + 1] = new - cm->config_pool; return new->config_string_heap_index + 1; } u32 vnet_config_del_feature (vlib_main_t * vm, vnet_config_main_t * cm, u32 config_string_heap_index, u32 feature_index, void *feature_config, u32 n_feature_config_bytes) { vnet_config_t *old, *new; vnet_config_feature_t *new_features, *f; u32 n_feature_config_u32s; { u32 *p = vnet_get_config_heap (cm, config_string_heap_index); old = pool_elt_at_index (cm->config_pool, p[-1]); } n_feature_config_u32s = round_pow2 (n_feature_config_bytes, sizeof (f->feature_config[0])) / sizeof (f->feature_config[0]); /* Find feature with same index and opaque data. */ vec_foreach (f, old->features) { if (f->feature_index == feature_index && vec_len (f->feature_config) == n_feature_config_u32s && (n_feature_config_u32s == 0 || !memcmp (f->feature_config, feature_config, n_feature_config_bytes))) break; } /* Feature not found. */ if (f >= vec_end (old->features)) return config_string_heap_index; // return original config index new_features = duplicate_feature_vector (old->features); f = new_features + (f - old->features); vnet_config_feature_free (f); vec_delete (new_features, 1, f - new_features); /* must remove old from config_pool now as it may be expanded and change memory location if the following function find_config_with_features() adds a new config because none of existing config's has matching features and so can be reused */ remove_reference (cm, old); new = find_config_with_features (vm, cm, new_features); new->reference_count += 1; vec_validate (cm->config_pool_index_by_user_index, new->config_string_heap_index + 1); cm->config_pool_index_by_user_index[new->config_string_heap_index + 1] = new - cm->config_pool; return new->config_string_heap_index + 1; } /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */