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

Function test16

dpdk/app/test/test_lpm6.c:761–793  ·  view source on GitHub ↗

* Call add, lookup and delete for a single rule with depth > 24 */

Source from the content-addressed store, hash-verified

759 * Call add, lookup and delete for a single rule with depth > 24
760 */
761int32_t
762test16(void)
763{
764 struct rte_lpm6 *lpm = NULL;
765 struct rte_lpm6_config config;
766 uint8_t ip[] = {12,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0};
767 uint8_t depth = 128;
768 uint32_t next_hop_add = 100, next_hop_return = 0;
769 int32_t status = 0;
770
771 config.max_rules = MAX_RULES;
772 config.number_tbl8s = NUMBER_TBL8S;
773 config.flags = 0;
774
775 lpm = rte_lpm6_create(__func__, SOCKET_ID_ANY, &config);
776 TEST_LPM_ASSERT(lpm != NULL);
777
778 status = rte_lpm6_add(lpm, ip, depth, next_hop_add);
779 TEST_LPM_ASSERT(status == 0);
780
781 status = rte_lpm6_lookup(lpm, ip, &next_hop_return);
782 TEST_LPM_ASSERT((status == 0) && (next_hop_return == next_hop_add));
783
784 status = rte_lpm6_delete(lpm, ip, depth);
785 TEST_LPM_ASSERT(status == 0);
786
787 status = rte_lpm6_lookup(lpm, ip, &next_hop_return);
788 TEST_LPM_ASSERT(status == -ENOENT);
789
790 rte_lpm6_free(lpm);
791
792 return PASS;
793}
794
795/*
796 * Use rte_lpm6_add to add rules which effect only the second half of the lpm

Callers

nothing calls this directly

Calls 5

rte_lpm6_createFunction · 0.50
rte_lpm6_addFunction · 0.50
rte_lpm6_lookupFunction · 0.50
rte_lpm6_deleteFunction · 0.50
rte_lpm6_freeFunction · 0.50

Tested by

no test coverage detected