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

Function test19

dpdk/app/test/test_lpm6.c:1035–1227  ·  view source on GitHub ↗

* - Add rule that covers a TBL24 range previously invalid & lookup (& delete & * lookup) * - Add rule that extends a TBL24 invalid entry & lookup (& delete & lookup) * - Add rule that extends a TBL24 valid entry & lookup for both rules (& * delete & lookup) * - Add rule that updates the next hop in TBL24 & lookup (& delete & lookup) * - Add rule that updates the next hop in TBL8 & lookup

Source from the content-addressed store, hash-verified

1033 * - Delete a rule that is not present in the TBL8 & lookup
1034 */
1035int32_t
1036test19(void)
1037{
1038 struct rte_lpm6 *lpm = NULL;
1039 struct rte_lpm6_config config;
1040 uint8_t ip[16];
1041 uint8_t depth;
1042 uint32_t next_hop_add, next_hop_return;
1043 int32_t status = 0;
1044
1045 config.max_rules = MAX_RULES;
1046 config.number_tbl8s = NUMBER_TBL8S;
1047 config.flags = 0;
1048
1049 /* Add rule that covers a TBL24 range previously invalid & lookup
1050 * (& delete & lookup)
1051 */
1052 lpm = rte_lpm6_create(__func__, SOCKET_ID_ANY, &config);
1053 TEST_LPM_ASSERT(lpm != NULL);
1054
1055 IPv6(ip, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
1056 depth = 16;
1057 next_hop_add = 100;
1058
1059 status = rte_lpm6_add(lpm, ip, depth, next_hop_add);
1060 TEST_LPM_ASSERT(status == 0);
1061
1062 status = rte_lpm6_lookup(lpm, ip, &next_hop_return);
1063 TEST_LPM_ASSERT((status == 0) && (next_hop_return == next_hop_add));
1064
1065 status = rte_lpm6_delete(lpm, ip, depth);
1066 TEST_LPM_ASSERT(status == 0);
1067
1068 status = rte_lpm6_lookup(lpm, ip, &next_hop_return);
1069 TEST_LPM_ASSERT(status == -ENOENT);
1070
1071 rte_lpm6_delete_all(lpm);
1072
1073 IPv6(ip, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
1074 depth = 25;
1075 next_hop_add = 100;
1076
1077 status = rte_lpm6_add(lpm, ip, depth, next_hop_add);
1078 TEST_LPM_ASSERT(status == 0);
1079
1080 status = rte_lpm6_lookup(lpm, ip, &next_hop_return);
1081 TEST_LPM_ASSERT((status == 0) && (next_hop_return == next_hop_add));
1082
1083 status = rte_lpm6_delete(lpm, ip, depth);
1084 TEST_LPM_ASSERT(status == 0);
1085
1086 rte_lpm6_delete_all(lpm);
1087
1088 /*
1089 * Add rule that extends a TBL24 valid entry & lookup for both rules
1090 * (& delete & lookup)
1091 */
1092

Callers

nothing calls this directly

Calls 7

IPv6Function · 0.85
rte_lpm6_createFunction · 0.50
rte_lpm6_addFunction · 0.50
rte_lpm6_lookupFunction · 0.50
rte_lpm6_deleteFunction · 0.50
rte_lpm6_delete_allFunction · 0.50
rte_lpm6_freeFunction · 0.50

Tested by

no test coverage detected