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

Function run_v6

dpdk/app/test-fib/main.c:1034–1209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1032}
1033
1034static int
1035run_v6(void)
1036{
1037 uint64_t start, acc;
1038 uint64_t def_nh = 0;
1039 struct rte_fib6 *fib;
1040 struct rte_fib6_conf conf = {0};
1041 struct rt_rule_6 *rt;
1042 uint32_t i, j, k;
1043 int ret = 0;
1044 struct rte_lpm6 *lpm = NULL;
1045 struct rte_lpm6_config lpm_conf;
1046 uint8_t *tbl6;
1047 uint64_t fib_nh[BURST_SZ];
1048 int32_t lpm_nh[BURST_SZ];
1049
1050 rt = (struct rt_rule_6 *)config.rt;
1051 tbl6 = config.lookup_tbl;
1052
1053 if (config.flags & DRY_RUN_FLAG) {
1054 if (config.routes_file_s != NULL)
1055 ret = dump_rt_6(rt);
1056 if (ret != 0)
1057 return ret;
1058 if (config.lookup_ips_file_s != NULL)
1059 ret = dump_lookup(AF_INET6);
1060 return ret;
1061 }
1062
1063 conf.type = get_fib_type();
1064 conf.default_nh = def_nh;
1065 conf.max_routes = config.nb_routes * 2;
1066 conf.rib_ext_sz = 0;
1067 if (conf.type == RTE_FIB6_TRIE) {
1068 conf.trie.nh_sz = rte_ctz32(config.ent_sz);
1069 conf.trie.num_tbl8 = RTE_MIN(config.tbl8,
1070 get_max_nh(conf.trie.nh_sz));
1071 }
1072
1073 fib = rte_fib6_create("test", -1, &conf);
1074 if (fib == NULL) {
1075 printf("Can not alloc FIB, err %d\n", rte_errno);
1076 return -rte_errno;
1077 }
1078
1079 if (config.lookup_fn != 0) {
1080 if (config.lookup_fn == 1)
1081 ret = rte_fib6_select_lookup(fib,
1082 RTE_FIB6_LOOKUP_TRIE_SCALAR);
1083 else if (config.lookup_fn == 2)
1084 ret = rte_fib6_select_lookup(fib,
1085 RTE_FIB6_LOOKUP_TRIE_VECTOR_AVX512);
1086 else
1087 ret = -EINVAL;
1088 if (ret != 0) {
1089 printf("Can not init lookup function\n");
1090 return ret;
1091 }

Callers 1

mainFunction · 0.85

Calls 15

dump_rt_6Function · 0.85
dump_lookupFunction · 0.85
get_fib_typeFunction · 0.85
rte_ctz32Function · 0.85
rte_fib6_createFunction · 0.85
rte_fib6_select_lookupFunction · 0.85
rte_fib6_addFunction · 0.85
print_depth_errFunction · 0.85
rte_fib6_lookup_bulkFunction · 0.85
rte_fib6_deleteFunction · 0.85
get_max_nhFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected