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

Function rte_thash_find_existing

dpdk/lib/hash/rte_thash.c:324–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324struct rte_thash_ctx *
325rte_thash_find_existing(const char *name)
326{
327 struct rte_thash_ctx *ctx;
328 struct rte_tailq_entry *te;
329 struct rte_thash_list *thash_list;
330
331 thash_list = RTE_TAILQ_CAST(rte_thash_tailq.head, rte_thash_list);
332
333 rte_mcfg_tailq_read_lock();
334 TAILQ_FOREACH(te, thash_list, next) {
335 ctx = (struct rte_thash_ctx *)te->data;
336 if (strncmp(name, ctx->name, sizeof(ctx->name)) == 0)
337 break;
338 }
339
340 rte_mcfg_tailq_read_unlock();
341
342 if (te == NULL) {
343 rte_errno = ENOENT;
344 return NULL;
345 }
346
347 return ctx;
348}
349
350void
351rte_thash_free_ctx(struct rte_thash_ctx *ctx)

Callers 1

test_find_existingFunction · 0.85

Calls 3

rte_mcfg_tailq_read_lockFunction · 0.85
strncmpFunction · 0.85

Tested by 1

test_find_existingFunction · 0.68