| 1032 | } |
| 1033 | |
| 1034 | static int |
| 1035 | run_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 | } |
no test coverage detected