X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=app%2Ftest-pmd%2Fparameters.c;h=f1daa6eca322a1889e0748b12badbdf8839f364d;hb=d4c9ffd4fe1c84dcc40757d937de43244cd89833;hp=473f82433d72b3440a91e520ee39a7cd94593918;hpb=299191e0c9ba560a9d0f92cf75f7e9660ac8f1e2;p=dpdk.git diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 473f82433d..f1daa6eca3 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include @@ -153,6 +152,9 @@ usage(char* progname) printf(" --crc-strip: enable CRC stripping by hardware.\n"); printf(" --enable-rx-cksum: enable rx hardware checksum offload.\n"); printf(" --disable-hw-vlan: disable hardware vlan.\n"); + printf(" --disable-hw-vlan-filter: disable hardware vlan filter.\n"); + printf(" --disable-hw-vlan-strip: disable hardware vlan strip.\n"); + printf(" --disable-hw-vlan-extend: disable hardware vlan extend.\n"); printf(" --enable-drop-en: enable per queue packet drop.\n"); printf(" --disable-rss: disable rss.\n"); printf(" --port-topology=N: set port topology (N: paired (default) or " @@ -366,6 +368,7 @@ parse_portnuma_config(const char *q_arg) }; unsigned long int_fld[_NUM_FLD]; char *str_fld[_NUM_FLD]; + portid_t pid; /* reset from value set at definition */ while ((p = strchr(p0,'(')) != NULL) { @@ -387,8 +390,11 @@ parse_portnuma_config(const char *q_arg) return -1; } port_id = (uint8_t)int_fld[FLD_PORT]; - if (port_id >= nb_ports) { - printf("Invalid port, range is [0, %d]\n", nb_ports - 1); + if (port_id_is_invalid(port_id, ENABLED_WARN)) { + printf("Valid port range is [0"); + FOREACH_PORT(pid, ports) + printf(", %d", pid); + printf("]\n"); return -1; } socket_id = (uint8_t)int_fld[FLD_SOCKET]; @@ -419,6 +425,7 @@ parse_ringnuma_config(const char *q_arg) }; unsigned long int_fld[_NUM_FLD]; char *str_fld[_NUM_FLD]; + portid_t pid; #define RX_RING_ONLY 0x1 #define TX_RING_ONLY 0x2 #define RXTX_RING 0x3 @@ -443,8 +450,11 @@ parse_ringnuma_config(const char *q_arg) return -1; } port_id = (uint8_t)int_fld[FLD_PORT]; - if (port_id >= nb_ports) { - printf("Invalid port, range is [0, %d]\n", nb_ports - 1); + if (port_id_is_invalid(port_id, ENABLED_WARN)) { + printf("Valid port range is [0"); + FOREACH_PORT(pid, ports) + printf(", %d", pid); + printf("]\n"); return -1; } socket_id = (uint8_t)int_fld[FLD_SOCKET]; @@ -517,6 +527,9 @@ launch_args_parse(int argc, char** argv) { "crc-strip", 0, 0, 0 }, { "enable-rx-cksum", 0, 0, 0 }, { "disable-hw-vlan", 0, 0, 0 }, + { "disable-hw-vlan-filter", 0, 0, 0 }, + { "disable-hw-vlan-strip", 0, 0, 0 }, + { "disable-hw-vlan-extend", 0, 0, 0 }, { "enable-drop-en", 0, 0, 0 }, { "disable-rss", 0, 0, 0 }, { "port-topology", 1, 0, 0 }, @@ -619,8 +632,7 @@ launch_args_parse(int argc, char** argv) nb_fwd_ports = (uint8_t) n; else rte_exit(EXIT_FAILURE, - "nb-ports should be > 0 and <= %d\n", - nb_ports); + "Invalid port %d\n", n); } if (!strcmp(lgopts[opt_idx].name, "nb-cores")) { n = atoi(optarg); @@ -756,6 +768,18 @@ launch_args_parse(int argc, char** argv) rx_mode.hw_vlan_extend = 0; } + if (!strcmp(lgopts[opt_idx].name, + "disable-hw-vlan-filter")) + rx_mode.hw_vlan_filter = 0; + + if (!strcmp(lgopts[opt_idx].name, + "disable-hw-vlan-strip")) + rx_mode.hw_vlan_strip = 0; + + if (!strcmp(lgopts[opt_idx].name, + "disable-hw-vlan-extend")) + rx_mode.hw_vlan_extend = 0; + if (!strcmp(lgopts[opt_idx].name, "enable-drop-en")) rx_drop_en = 1;