| 322 | } |
| 323 | |
| 324 | struct rte_thash_ctx * |
| 325 | rte_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 | |
| 350 | void |
| 351 | rte_thash_free_ctx(struct rte_thash_ctx *ctx) |