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

Function test15

dpdk/app/test/test_lpm6.c:724–756  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

722 * Call add, lookup and delete for a single rule with depth = 24
723 */
724int32_t
725test15(void)
726{
727 struct rte_lpm6 *lpm = NULL;
728 struct rte_lpm6_config config;
729 uint8_t ip[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
730 uint8_t depth = 24;
731 uint32_t next_hop_add = 100, next_hop_return = 0;
732 int32_t status = 0;
733
734 config.max_rules = MAX_RULES;
735 config.number_tbl8s = NUMBER_TBL8S;
736 config.flags = 0;
737
738 lpm = rte_lpm6_create(__func__, SOCKET_ID_ANY, &config);
739 TEST_LPM_ASSERT(lpm != NULL);
740
741 status = rte_lpm6_add(lpm, ip, depth, next_hop_add);
742 TEST_LPM_ASSERT(status == 0);
743
744 status = rte_lpm6_lookup(lpm, ip, &next_hop_return);
745 TEST_LPM_ASSERT((status == 0) && (next_hop_return == next_hop_add));
746
747 status = rte_lpm6_delete(lpm, ip, depth);
748 TEST_LPM_ASSERT(status == 0);
749
750 status = rte_lpm6_lookup(lpm, ip, &next_hop_return);
751 TEST_LPM_ASSERT(status == -ENOENT);
752
753 rte_lpm6_free(lpm);
754
755 return PASS;
756}
757
758/*
759 * Call add, lookup and delete for a single rule with depth > 24

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