net/ice: clean input set macro definition
[dpdk.git] / app / test-pmd / parameters.c
index 414a006..a326c8c 100644 (file)
@@ -163,6 +163,7 @@ usage(char* progname)
        printf("  --hairpinq=N: set the number of hairpin queues per port to "
               "N.\n");
        printf("  --burst=N: set the number of packets per burst to N.\n");
+       printf("  --flowgen-clones=N: set the number of single packet clones to send in flowgen mode. Should be less than burst value.\n");
        printf("  --mbcache=N: set the cache of mbuf memory pool to N.\n");
        printf("  --rxpt=N: set prefetch threshold register of RX rings to N.\n");
        printf("  --rxht=N: set the host threshold register of RX rings to N.\n");
@@ -183,6 +184,7 @@ usage(char* progname)
        printf("  --txpkts=X[,Y]*: set TX segment sizes"
                " or total packet length.\n");
        printf("  --txonly-multi-flow: generate multiple flows in txonly mode\n");
+       printf("  --eth-link-speed: force link speed.\n");
        printf("  --disable-link-check: disable check on link status when "
               "starting/stopping ports.\n");
        printf("  --disable-device-start: do not automatically start port\n");
@@ -484,6 +486,43 @@ parse_event_printing_config(const char *optarg, int enable)
        return 0;
 }
 
+static int
+parse_link_speed(int n)
+{
+       uint32_t speed = ETH_LINK_SPEED_FIXED;
+
+       switch (n) {
+       case 1000:
+               speed |= ETH_LINK_SPEED_1G;
+               break;
+       case 10000:
+               speed |= ETH_LINK_SPEED_10G;
+               break;
+       case 25000:
+               speed |= ETH_LINK_SPEED_25G;
+               break;
+       case 40000:
+               speed |= ETH_LINK_SPEED_40G;
+               break;
+       case 50000:
+               speed |= ETH_LINK_SPEED_50G;
+               break;
+       case 100000:
+               speed |= ETH_LINK_SPEED_100G;
+               break;
+       case 200000:
+               speed |= ETH_LINK_SPEED_200G;
+               break;
+       case 100:
+       case 10:
+       default:
+               printf("Unsupported fixed speed\n");
+               return 0;
+       }
+
+       return speed;
+}
+
 void
 launch_args_parse(int argc, char** argv)
 {
@@ -561,6 +600,7 @@ launch_args_parse(int argc, char** argv)
                { "hairpinq",                   1, 0, 0 },
                { "hairpin-mode",               1, 0, 0 },
                { "burst",                      1, 0, 0 },
+               { "flowgen-clones",             1, 0, 0 },
                { "mbcache",                    1, 0, 0 },
                { "txpt",                       1, 0, 0 },
                { "txht",                       1, 0, 0 },
@@ -577,6 +617,7 @@ launch_args_parse(int argc, char** argv)
                { "rxpkts",                     1, 0, 0 },
                { "txpkts",                     1, 0, 0 },
                { "txonly-multi-flow",          0, 0, 0 },
+               { "eth-link-speed",             1, 0, 0 },
                { "disable-link-check",         0, 0, 0 },
                { "disable-device-start",       0, 0, 0 },
                { "no-lsc-interrupt",           0, 0, 0 },
@@ -834,12 +875,9 @@ launch_args_parse(int argc, char** argv)
                        }
                        if (!strcmp(lgopts[opt_idx].name, "max-pkt-len")) {
                                n = atoi(optarg);
-                               if (n >= RTE_ETHER_MIN_LEN) {
+                               if (n >= RTE_ETHER_MIN_LEN)
                                        rx_mode.max_rx_pkt_len = (uint32_t) n;
-                                       if (n > RTE_ETHER_MAX_LEN)
-                                               rx_offloads |=
-                                                       DEV_RX_OFFLOAD_JUMBO_FRAME;
-                               } else
+                               else
                                        rte_exit(EXIT_FAILURE,
                                                 "Invalid max-pkt-len=%d - should be > %d\n",
                                                 n, RTE_ETHER_MIN_LEN);
@@ -1089,6 +1127,14 @@ launch_args_parse(int argc, char** argv)
                                else
                                        nb_pkt_per_burst = (uint16_t) n;
                        }
+                       if (!strcmp(lgopts[opt_idx].name, "flowgen-clones")) {
+                               n = atoi(optarg);
+                               if (n >= 0)
+                                       nb_pkt_flowgen_clones = (uint16_t) n;
+                               else
+                                       rte_exit(EXIT_FAILURE,
+                                                "clones must be >= 0 and <= current burst\n");
+                       }
                        if (!strcmp(lgopts[opt_idx].name, "mbcache")) {
                                n = atoi(optarg);
                                if ((n >= 0) &&
@@ -1225,6 +1271,11 @@ launch_args_parse(int argc, char** argv)
                                txonly_multi_flow = 1;
                        if (!strcmp(lgopts[opt_idx].name, "no-flush-rx"))
                                no_flush_rx = 1;
+                       if (!strcmp(lgopts[opt_idx].name, "eth-link-speed")) {
+                               n = atoi(optarg);
+                               if (n >= 0 && parse_link_speed(n) > 0)
+                                       eth_link_speed = parse_link_speed(n);
+                       }
                        if (!strcmp(lgopts[opt_idx].name, "disable-link-check"))
                                no_link_check = 1;
                        if (!strcmp(lgopts[opt_idx].name, "disable-device-start"))