MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_kvargs_count

Function rte_kvargs_count

dpdk/lib/kvargs/rte_kvargs.c:154–168  ·  view source on GitHub ↗

* Return the number of times a given arg_name exists in the key/value list. * E.g. given a list = { rx = 0, rx = 1, tx = 2 } the number of args for * arg "rx" will be 2. */

Source from the content-addressed store, hash-verified

152 * arg "rx" will be 2.
153 */
154unsigned
155rte_kvargs_count(const struct rte_kvargs *kvlist, const char *key_match)
156{
157 const struct rte_kvargs_pair *pair;
158 unsigned i, ret;
159
160 ret = 0;
161 for (i = 0; i < kvlist->count; i++) {
162 pair = &kvlist->pairs[i];
163 if (key_match == NULL || strcmp(pair->key, key_match) == 0)
164 ret++;
165 }
166
167 return ret;
168}
169
170/*
171 * For each matching key, call the given handler function.

Callers 15

dpaa2_sec_get_devargsFunction · 0.85
dpaa_sec_get_devargsFunction · 0.85
cnxk_gpio_parse_argFunction · 0.85
ifpga_vdev_parse_devargsFunction · 0.85
rte_pmd_ring_probeFunction · 0.85
mlx4_argsFunction · 0.85
virtio_dev_devargs_parseFunction · 0.85
virtio_user_pmd_probeFunction · 0.85
virtio_pci_devargs_parseFunction · 0.85
ionic_pci_devargsFunction · 0.85

Calls 1

strcmpFunction · 0.85

Tested by 1

test_valid_kvargsFunction · 0.68