| 832 | } |
| 833 | |
| 834 | static int |
| 835 | run_v4(void) |
| 836 | { |
| 837 | uint64_t start, acc; |
| 838 | uint64_t def_nh = 0; |
| 839 | struct rte_fib *fib; |
| 840 | struct rte_fib_conf conf = {0}; |
| 841 | struct rt_rule_4 *rt; |
| 842 | uint32_t i, j, k; |
| 843 | int ret = 0; |
| 844 | struct rte_lpm *lpm = NULL; |
| 845 | struct rte_lpm_config lpm_conf; |
| 846 | uint32_t *tbl4 = config.lookup_tbl; |
| 847 | uint64_t fib_nh[BURST_SZ]; |
| 848 | uint32_t lpm_nh[BURST_SZ]; |
| 849 | |
| 850 | rt = (struct rt_rule_4 *)config.rt; |
| 851 | |
| 852 | if (config.flags & DRY_RUN_FLAG) { |
| 853 | if (config.routes_file_s != NULL) |
| 854 | ret = dump_rt_4(rt); |
| 855 | if (ret != 0) |
| 856 | return ret; |
| 857 | if (config.lookup_ips_file_s != NULL) |
| 858 | ret = dump_lookup(AF_INET); |
| 859 | return ret; |
| 860 | } |
| 861 | |
| 862 | conf.type = get_fib_type(); |
| 863 | conf.default_nh = def_nh; |
| 864 | conf.max_routes = config.nb_routes * 2; |
| 865 | conf.rib_ext_sz = 0; |
| 866 | if (conf.type == RTE_FIB_DIR24_8) { |
| 867 | conf.dir24_8.nh_sz = rte_ctz32(config.ent_sz); |
| 868 | conf.dir24_8.num_tbl8 = RTE_MIN(config.tbl8, |
| 869 | get_max_nh(conf.dir24_8.nh_sz)); |
| 870 | } |
| 871 | |
| 872 | fib = rte_fib_create("test", -1, &conf); |
| 873 | if (fib == NULL) { |
| 874 | printf("Can not alloc FIB, err %d\n", rte_errno); |
| 875 | return -rte_errno; |
| 876 | } |
| 877 | |
| 878 | if (config.lookup_fn != 0) { |
| 879 | if (config.lookup_fn == 1) |
| 880 | ret = rte_fib_select_lookup(fib, |
| 881 | RTE_FIB_LOOKUP_DIR24_8_SCALAR_MACRO); |
| 882 | else if (config.lookup_fn == 2) |
| 883 | ret = rte_fib_select_lookup(fib, |
| 884 | RTE_FIB_LOOKUP_DIR24_8_VECTOR_AVX512); |
| 885 | else if (config.lookup_fn == 3) |
| 886 | ret = rte_fib_select_lookup(fib, |
| 887 | RTE_FIB_LOOKUP_DIR24_8_SCALAR_INLINE); |
| 888 | else if (config.lookup_fn == 4) |
| 889 | ret = rte_fib_select_lookup(fib, |
| 890 | RTE_FIB_LOOKUP_DIR24_8_SCALAR_UNI); |
| 891 | else |
no test coverage detected