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

Function run_v4

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

Source from the content-addressed store, hash-verified

832}
833
834static int
835run_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

Callers 1

mainFunction · 0.85

Calls 15

dump_rt_4Function · 0.85
dump_lookupFunction · 0.85
get_fib_typeFunction · 0.85
rte_ctz32Function · 0.85
rte_fib_createFunction · 0.85
rte_fib_select_lookupFunction · 0.85
rte_fib_addFunction · 0.85
print_depth_errFunction · 0.85
rte_fib_lookup_bulkFunction · 0.85
rte_fib_deleteFunction · 0.85
get_max_nhFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected