net/mlx5: add flow flush
[dpdk.git] / app / test-fib / main.c
index 9e6a4f2..830c32c 100644 (file)
@@ -624,15 +624,15 @@ print_usage(void)
                "(if -f is not specified)>]\n"
                "[-r <percentage ratio of random ip's to lookup"
                "(if -t is not specified)>]\n"
-               "[-c <do comarison with LPM library>]\n"
+               "[-c <do comparison with LPM library>]\n"
                "[-6 <do tests with ipv6 (default ipv4)>]\n"
                "[-s <shuffle randomly generated routes>]\n"
                "[-a <check nexthops for all ipv4 address space"
                "(only valid with -c)>]\n"
-               "[-b <fib algorithm>]\n\tavailible options for ipv4\n"
+               "[-b <fib algorithm>]\n\tavailable options for ipv4\n"
                "\t\trib - RIB based FIB\n"
                "\t\tdir - DIR24_8 based FIB\n"
-               "\tavailible options for ipv6:\n"
+               "\tavailable options for ipv6:\n"
                "\t\trib - RIB based FIB\n"
                "\t\ttrie - TRIE based FIB\n"
                "defaults are: dir for ipv4 and trie for ipv6\n"
@@ -641,7 +641,7 @@ print_usage(void)
                "[-g <number of tbl8's for dir24_8 or trie FIBs>]\n"
                "[-w <path to the file to dump routing table>]\n"
                "[-u <path to the file to dump ip's for lookup>]\n"
-               "[-v <type of loookup function:"
+               "[-v <type of lookup function:"
                "\ts1, s2, s3 (3 types of scalar), v (vector) -"
                " for DIR24_8 based FIB\n"
                "\ts, v - for TRIE based ipv6 FIB>]\n",
@@ -711,6 +711,10 @@ parse_opts(int argc, char **argv)
                                print_usage();
                                rte_exit(-EINVAL, "Invalid option -n\n");
                        }
+
+                       if (config.nb_routes < config.print_fract)
+                               config.print_fract = config.nb_routes;
+
                        break;
                case 'd':
                        distrib_string = optarg;
@@ -857,6 +861,7 @@ run_v4(void)
        conf.type = get_fib_type();
        conf.default_nh = def_nh;
        conf.max_routes = config.nb_routes * 2;
+       conf.rib_ext_sz = 0;
        if (conf.type == RTE_FIB_DIR24_8) {
                conf.dir24_8.nh_sz = __builtin_ctz(config.ent_sz);
                conf.dir24_8.num_tbl8 = RTE_MIN(config.tbl8,
@@ -1057,6 +1062,7 @@ run_v6(void)
        conf.type = get_fib_type();
        conf.default_nh = def_nh;
        conf.max_routes = config.nb_routes * 2;
+       conf.rib_ext_sz = 0;
        if (conf.type == RTE_FIB6_TRIE) {
                conf.trie.nh_sz = __builtin_ctz(config.ent_sz);
                conf.trie.num_tbl8 = RTE_MIN(config.tbl8,
@@ -1240,6 +1246,10 @@ main(int argc, char **argv)
                config.nb_routes = 0;
                while (fgets(line, sizeof(line), fr) != NULL)
                        config.nb_routes++;
+
+               if (config.nb_routes < config.print_fract)
+                       config.print_fract = config.nb_routes;
+
                rewind(fr);
        }