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

Function rte_ipsec_sad_destroy

dpdk/lib/ipsec/ipsec_sad.c:417–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417void
418rte_ipsec_sad_destroy(struct rte_ipsec_sad *sad)
419{
420 struct rte_tailq_entry *te;
421 struct rte_ipsec_sad_list *sad_list;
422
423 if (sad == NULL)
424 return;
425
426 sad_list = RTE_TAILQ_CAST(rte_ipsec_sad_tailq.head,
427 rte_ipsec_sad_list);
428 rte_mcfg_tailq_write_lock();
429 TAILQ_FOREACH(te, sad_list, next) {
430 if (te->data == (void *)sad)
431 break;
432 }
433 if (te != NULL)
434 TAILQ_REMOVE(sad_list, te, next);
435
436 rte_mcfg_tailq_write_unlock();
437
438 rte_hash_free(sad->hash[RTE_IPSEC_SAD_SPI_ONLY]);
439 rte_hash_free(sad->hash[RTE_IPSEC_SAD_SPI_DIP]);
440 rte_hash_free(sad->hash[RTE_IPSEC_SAD_SPI_DIP_SIP]);
441 rte_free(sad);
442 rte_free(te);
443}
444
445/*
446 * @internal helper function

Callers 9

rte_ipsec_sad_createFunction · 0.85
test_find_existingFunction · 0.85
test_multiple_createFunction · 0.85
__test_add_invalidFunction · 0.85
__test_delete_invalidFunction · 0.85
__test_lookup_invalidFunction · 0.85
__test_lookup_basicFunction · 0.85
__test_lookup_advFunction · 0.85
__test_lookup_orderFunction · 0.85

Calls 4

rte_hash_freeFunction · 0.85
rte_freeFunction · 0.85

Tested by 8

test_find_existingFunction · 0.68
test_multiple_createFunction · 0.68
__test_add_invalidFunction · 0.68
__test_delete_invalidFunction · 0.68
__test_lookup_invalidFunction · 0.68
__test_lookup_basicFunction · 0.68
__test_lookup_advFunction · 0.68
__test_lookup_orderFunction · 0.68