app/testpmd: separate forward config setup from display
[dpdk.git] / app / test-pmd / cmdline.c
index c34d4c1..73a5a47 100644 (file)
@@ -549,7 +549,7 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "    Detach physical or virtual dev by port_id\n\n"
 
                        "port config (port_id|all)"
-                       " speed (10|100|1000|10000|40000|auto)"
+                       " speed (10|100|1000|10000|40000|100000|auto)"
                        " duplex (half|full|auto)\n"
                        "    Set speed and duplex for all ports or port_id\n\n"
 
@@ -559,10 +559,10 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "port config all max-pkt-len (value)\n"
                        "    Set the max packet length.\n\n"
 
-                       "port config all (crc-strip|rx-cksum|hw-vlan|hw-vlan-filter|"
+                       "port config all (crc-strip|scatter|rx-cksum|hw-vlan|hw-vlan-filter|"
                        "hw-vlan-strip|hw-vlan-extend|drop-en)"
                        " (on|off)\n"
-                       "    Set crc-strip/rx-checksum/hardware-vlan/drop_en"
+                       "    Set crc-strip/scatter/rx-checksum/hardware-vlan/drop_en"
                        " for ports.\n\n"
 
                        "port config all rss (all|ip|tcp|udp|sctp|ether|none)\n"
@@ -669,6 +669,7 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "flow_director_filter (port_id) mode IP (add|del|update)"
                        " flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)"
                        " src (src_ip_address) dst (dst_ip_address)"
+                       " tos (tos_value) proto (proto_value) ttl (ttl_value)"
                        " vlan (vlan_value) flexbytes (flexbytes_value)"
                        " (drop|fwd) pf|vf(vf_id) queue (queue_id)"
                        " fd_id (fd_id_value)\n"
@@ -678,6 +679,7 @@ static void cmd_help_long_parsed(void *parsed_result,
                        " flow (ipv4-tcp|ipv4-udp|ipv6-tcp|ipv6-udp)"
                        " src (src_ip_address) (src_port)"
                        " dst (dst_ip_address) (dst_port)"
+                       " tos (tos_value) ttl (ttl_value)"
                        " vlan (vlan_value) flexbytes (flexbytes_value)"
                        " (drop|fwd) pf|vf(vf_id) queue (queue_id)"
                        " fd_id (fd_id_value)\n"
@@ -687,7 +689,9 @@ static void cmd_help_long_parsed(void *parsed_result,
                        " flow (ipv4-sctp|ipv6-sctp)"
                        " src (src_ip_address) (src_port)"
                        " dst (dst_ip_address) (dst_port)"
-                       " tag (verification_tag) vlan (vlan_value)"
+                       " tag (verification_tag) "
+                       " tos (tos_value) ttl (ttl_value)"
+                       " vlan (vlan_value)"
                        " flexbytes (flexbytes_value) (drop|fwd)"
                        " pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\n"
                        "    Add/Del a SCTP type flow director filter.\n\n"
@@ -767,14 +771,15 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "fld-8th|none) (select|add)\n"
                        "    Set the input set for hash.\n\n"
 
-                       "set_fdir_input_set (port_id) (ipv4|ipv4-frag|"
-                       "ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|"
+                       "set_fdir_input_set (port_id) "
+                       "(ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
                        "ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
-                       "l2_payload) (src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|"
-                       "udp-src-port|udp-dst-port|tcp-src-port|tcp-dst-port|"
-                       "sctp-src-port|sctp-dst-port|sctp-veri-tag|fld-1st|"
-                       "fld-2nd|fld-3rd|fld-4th|fld-5th|fld-6th|fld-7th|"
-                       "fld-8th|none) (select|add)\n"
+                       "l2_payload) (ivlan|ethertype|src-ipv4|dst-ipv4|src-ipv6|"
+                       "dst-ipv6|ipv4-tos|ipv4-proto|ipv4-ttl|ipv6-tc|"
+                       "ipv6-next-header|ipv6-hop-limits|udp-src-port|"
+                       "udp-dst-port|tcp-src-port|tcp-dst-port|"
+                       "sctp-src-port|sctp-dst-port|sctp-veri-tag|none)"
+                       " (select|add)\n"
                        "    Set the input set for FDir.\n\n"
                );
        }
@@ -983,14 +988,60 @@ struct cmd_config_speed_all {
        cmdline_fixed_string_t value2;
 };
 
+static int
+parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed)
+{
+
+       int duplex;
+
+       if (!strcmp(duplexstr, "half")) {
+               duplex = ETH_LINK_HALF_DUPLEX;
+       } else if (!strcmp(duplexstr, "full")) {
+               duplex = ETH_LINK_FULL_DUPLEX;
+       } else if (!strcmp(duplexstr, "auto")) {
+               duplex = ETH_LINK_FULL_DUPLEX;
+       } else {
+               printf("Unknown duplex parameter\n");
+               return -1;
+       }
+
+       if (!strcmp(speedstr, "10")) {
+               *speed = (duplex == ETH_LINK_HALF_DUPLEX) ?
+                               ETH_LINK_SPEED_10M_HD : ETH_LINK_SPEED_10M;
+       } else if (!strcmp(speedstr, "100")) {
+               *speed = (duplex == ETH_LINK_HALF_DUPLEX) ?
+                               ETH_LINK_SPEED_100M_HD : ETH_LINK_SPEED_100M;
+       } else {
+               if (duplex != ETH_LINK_FULL_DUPLEX) {
+                       printf("Invalid speed/duplex parameters\n");
+                       return -1;
+               }
+               if (!strcmp(speedstr, "1000")) {
+                       *speed = ETH_LINK_SPEED_1G;
+               } else if (!strcmp(speedstr, "10000")) {
+                       *speed = ETH_LINK_SPEED_10G;
+               } else if (!strcmp(speedstr, "40000")) {
+                       *speed = ETH_LINK_SPEED_40G;
+               } else if (!strcmp(speedstr, "100000")) {
+                       *speed = ETH_LINK_SPEED_100G;
+               } else if (!strcmp(speedstr, "auto")) {
+                       *speed = ETH_LINK_SPEED_AUTONEG;
+               } else {
+                       printf("Unknown speed parameter\n");
+                       return -1;
+               }
+       }
+
+       return 0;
+}
+
 static void
 cmd_config_speed_all_parsed(void *parsed_result,
                        __attribute__((unused)) struct cmdline *cl,
                        __attribute__((unused)) void *data)
 {
        struct cmd_config_speed_all *res = parsed_result;
-       uint16_t link_speed = ETH_LINK_SPEED_AUTONEG;
-       uint16_t link_duplex = 0;
+       uint32_t link_speed;
        portid_t pid;
 
        if (!all_ports_stopped()) {
@@ -998,37 +1049,12 @@ cmd_config_speed_all_parsed(void *parsed_result,
                return;
        }
 
-       if (!strcmp(res->value1, "10"))
-               link_speed = ETH_LINK_SPEED_10;
-       else if (!strcmp(res->value1, "100"))
-               link_speed = ETH_LINK_SPEED_100;
-       else if (!strcmp(res->value1, "1000"))
-               link_speed = ETH_LINK_SPEED_1000;
-       else if (!strcmp(res->value1, "10000"))
-               link_speed = ETH_LINK_SPEED_10G;
-       else if (!strcmp(res->value1, "40000"))
-               link_speed = ETH_LINK_SPEED_40G;
-       else if (!strcmp(res->value1, "auto"))
-               link_speed = ETH_LINK_SPEED_AUTONEG;
-       else {
-               printf("Unknown parameter\n");
-               return;
-       }
-
-       if (!strcmp(res->value2, "half"))
-               link_duplex = ETH_LINK_HALF_DUPLEX;
-       else if (!strcmp(res->value2, "full"))
-               link_duplex = ETH_LINK_FULL_DUPLEX;
-       else if (!strcmp(res->value2, "auto"))
-               link_duplex = ETH_LINK_AUTONEG_DUPLEX;
-       else {
-               printf("Unknown parameter\n");
+       if (parse_and_check_speed_duplex(res->value1, res->value2,
+                       &link_speed) < 0)
                return;
-       }
 
        FOREACH_PORT(pid, ports) {
-               ports[pid].dev_conf.link_speed = link_speed;
-               ports[pid].dev_conf.link_duplex = link_duplex;
+               ports[pid].dev_conf.link_speeds = link_speed;
        }
 
        cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
@@ -1045,7 +1071,7 @@ cmdline_parse_token_string_t cmd_config_speed_all_item1 =
        TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item1, "speed");
 cmdline_parse_token_string_t cmd_config_speed_all_value1 =
        TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, value1,
-                                               "10#100#1000#10000#40000#auto");
+                                               "10#100#1000#10000#40000#100000#auto");
 cmdline_parse_token_string_t cmd_config_speed_all_item2 =
        TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item2, "duplex");
 cmdline_parse_token_string_t cmd_config_speed_all_value2 =
@@ -1055,7 +1081,7 @@ cmdline_parse_token_string_t cmd_config_speed_all_value2 =
 cmdline_parse_inst_t cmd_config_speed_all = {
        .f = cmd_config_speed_all_parsed,
        .data = NULL,
-       .help_str = "port config all speed 10|100|1000|10000|40000|auto duplex "
+       .help_str = "port config all speed 10|100|1000|10000|40000|100000|auto duplex "
                                                        "half|full|auto",
        .tokens = {
                (void *)&cmd_config_speed_all_port,
@@ -1086,8 +1112,7 @@ cmd_config_speed_specific_parsed(void *parsed_result,
                                __attribute__((unused)) void *data)
 {
        struct cmd_config_speed_specific *res = parsed_result;
-       uint16_t link_speed = ETH_LINK_SPEED_AUTONEG;
-       uint16_t link_duplex = 0;
+       uint32_t link_speed;
 
        if (!all_ports_stopped()) {
                printf("Please stop all ports first\n");
@@ -1097,36 +1122,11 @@ cmd_config_speed_specific_parsed(void *parsed_result,
        if (port_id_is_invalid(res->id, ENABLED_WARN))
                return;
 
-       if (!strcmp(res->value1, "10"))
-               link_speed = ETH_LINK_SPEED_10;
-       else if (!strcmp(res->value1, "100"))
-               link_speed = ETH_LINK_SPEED_100;
-       else if (!strcmp(res->value1, "1000"))
-               link_speed = ETH_LINK_SPEED_1000;
-       else if (!strcmp(res->value1, "10000"))
-               link_speed = ETH_LINK_SPEED_10000;
-       else if (!strcmp(res->value1, "40000"))
-               link_speed = ETH_LINK_SPEED_40G;
-       else if (!strcmp(res->value1, "auto"))
-               link_speed = ETH_LINK_SPEED_AUTONEG;
-       else {
-               printf("Unknown parameter\n");
-               return;
-       }
-
-       if (!strcmp(res->value2, "half"))
-               link_duplex = ETH_LINK_HALF_DUPLEX;
-       else if (!strcmp(res->value2, "full"))
-               link_duplex = ETH_LINK_FULL_DUPLEX;
-       else if (!strcmp(res->value2, "auto"))
-               link_duplex = ETH_LINK_AUTONEG_DUPLEX;
-       else {
-               printf("Unknown parameter\n");
+       if (parse_and_check_speed_duplex(res->value1, res->value2,
+                       &link_speed) < 0)
                return;
-       }
 
-       ports[res->id].dev_conf.link_speed = link_speed;
-       ports[res->id].dev_conf.link_duplex = link_duplex;
+       ports[res->id].dev_conf.link_speeds = link_speed;
 
        cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
 }
@@ -1145,7 +1145,7 @@ cmdline_parse_token_string_t cmd_config_speed_specific_item1 =
                                                                "speed");
 cmdline_parse_token_string_t cmd_config_speed_specific_value1 =
        TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, value1,
-                                               "10#100#1000#10000#40000#auto");
+                                               "10#100#1000#10000#40000#100000#auto");
 cmdline_parse_token_string_t cmd_config_speed_specific_item2 =
        TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, item2,
                                                                "duplex");
@@ -1156,7 +1156,7 @@ cmdline_parse_token_string_t cmd_config_speed_specific_value2 =
 cmdline_parse_inst_t cmd_config_speed_specific = {
        .f = cmd_config_speed_specific_parsed,
        .data = NULL,
-       .help_str = "port config X speed 10|100|1000|10000|40000|auto duplex "
+       .help_str = "port config X speed 10|100|1000|10000|40000|100000|auto duplex "
                                                        "half|full|auto",
        .tokens = {
                (void *)&cmd_config_speed_specific_port,
@@ -1223,6 +1223,8 @@ cmd_config_rx_tx_parsed(void *parsed_result,
                return;
        }
 
+       fwd_config_setup();
+
        init_port_config();
 
        cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
@@ -1410,6 +1412,15 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result,
                        printf("Unknown parameter\n");
                        return;
                }
+       } else if (!strcmp(res->name, "scatter")) {
+               if (!strcmp(res->value, "on"))
+                       rx_mode.enable_scatter = 1;
+               else if (!strcmp(res->value, "off"))
+                       rx_mode.enable_scatter = 0;
+               else {
+                       printf("Unknown parameter\n");
+                       return;
+               }
        } else if (!strcmp(res->name, "rx-cksum")) {
                if (!strcmp(res->value, "on"))
                        rx_mode.hw_ip_checksum = 1;
@@ -1487,7 +1498,7 @@ cmdline_parse_token_string_t cmd_config_rx_mode_flag_all =
        TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, all, "all");
 cmdline_parse_token_string_t cmd_config_rx_mode_flag_name =
        TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, name,
-                                       "crc-strip#rx-cksum#hw-vlan#"
+                                       "crc-strip#scatter#rx-cksum#hw-vlan#"
                                        "hw-vlan-filter#hw-vlan-strip#hw-vlan-extend");
 cmdline_parse_token_string_t cmd_config_rx_mode_flag_value =
        TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, value,
@@ -1496,7 +1507,7 @@ cmdline_parse_token_string_t cmd_config_rx_mode_flag_value =
 cmdline_parse_inst_t cmd_config_rx_mode_flag = {
        .f = cmd_config_rx_mode_flag_parsed,
        .data = NULL,
-       .help_str = "port config all crc-strip|rx-cksum|hw-vlan|"
+       .help_str = "port config all crc-strip|scatter|rx-cksum|hw-vlan|"
                "hw-vlan-filter|hw-vlan-strip|hw-vlan-extend on|off",
        .tokens = {
                (void *)&cmd_config_rx_mode_flag_port,
@@ -2511,16 +2522,20 @@ static void cmd_set_list_parsed(void *parsed_result,
                nb_item = parse_item_list(res->list_of_items, "core",
                                          RTE_MAX_LCORE,
                                          parsed_items.lcorelist, 1);
-               if (nb_item > 0)
+               if (nb_item > 0) {
                        set_fwd_lcores_list(parsed_items.lcorelist, nb_item);
+                       fwd_config_setup();
+               }
                return;
        }
        if (!strcmp(res->list_name, "portlist")) {
                nb_item = parse_item_list(res->list_of_items, "port",
                                          RTE_MAX_ETHPORTS,
                                          parsed_items.portlist, 1);
-               if (nb_item > 0)
+               if (nb_item > 0) {
                        set_fwd_ports_list(parsed_items.portlist, nb_item);
+                       fwd_config_setup();
+               }
        }
 }
 
@@ -2564,10 +2579,13 @@ static void cmd_set_mask_parsed(void *parsed_result,
                printf("Please stop forwarding first\n");
                return;
        }
-       if (!strcmp(res->mask, "coremask"))
+       if (!strcmp(res->mask, "coremask")) {
                set_fwd_lcores_mask(res->hexavalue);
-       else if (!strcmp(res->mask, "portmask"))
+               fwd_config_setup();
+       } else if (!strcmp(res->mask, "portmask")) {
                set_fwd_ports_mask(res->hexavalue);
+               fwd_config_setup();
+       }
 }
 
 cmdline_parse_token_string_t cmd_setmask_set =
@@ -2604,11 +2622,13 @@ static void cmd_set_parsed(void *parsed_result,
                           __attribute__((unused)) void *data)
 {
        struct cmd_set_result *res = parsed_result;
-       if (!strcmp(res->what, "nbport"))
+       if (!strcmp(res->what, "nbport")) {
                set_fwd_ports_number(res->value);
-       else if (!strcmp(res->what, "nbcore"))
+               fwd_config_setup();
+       } else if (!strcmp(res->what, "nbcore")) {
                set_fwd_lcores_number(res->value);
-       else if (!strcmp(res->what, "burst"))
+               fwd_config_setup();
+       } else if (!strcmp(res->what, "burst"))
                set_nb_pkt_per_burst(res->value);
        else if (!strcmp(res->what, "verbose"))
                set_verbose_level(res->value);
@@ -2721,6 +2741,74 @@ cmdline_parse_inst_t cmd_set_txsplit = {
        },
 };
 
+/* *** CONFIG TX QUEUE FLAGS *** */
+
+struct cmd_config_txqflags_result {
+       cmdline_fixed_string_t port;
+       cmdline_fixed_string_t config;
+       cmdline_fixed_string_t all;
+       cmdline_fixed_string_t what;
+       int32_t hexvalue;
+};
+
+static void cmd_config_txqflags_parsed(void *parsed_result,
+                               __attribute__((unused)) struct cmdline *cl,
+                               __attribute__((unused)) void *data)
+{
+       struct cmd_config_txqflags_result *res = parsed_result;
+
+       if (!all_ports_stopped()) {
+               printf("Please stop all ports first\n");
+               return;
+       }
+
+       if (strcmp(res->what, "txqflags")) {
+               printf("Unknown parameter\n");
+               return;
+       }
+
+       if (res->hexvalue >= 0) {
+               txq_flags = res->hexvalue;
+       } else {
+               printf("txqflags must be >= 0\n");
+               return;
+       }
+
+       init_port_config();
+
+       cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
+}
+
+cmdline_parse_token_string_t cmd_config_txqflags_port =
+       TOKEN_STRING_INITIALIZER(struct cmd_config_txqflags_result, port,
+                                "port");
+cmdline_parse_token_string_t cmd_config_txqflags_config =
+       TOKEN_STRING_INITIALIZER(struct cmd_config_txqflags_result, config,
+                                "config");
+cmdline_parse_token_string_t cmd_config_txqflags_all =
+       TOKEN_STRING_INITIALIZER(struct cmd_config_txqflags_result, all,
+                                "all");
+cmdline_parse_token_string_t cmd_config_txqflags_what =
+       TOKEN_STRING_INITIALIZER(struct cmd_config_txqflags_result, what,
+                                "txqflags");
+cmdline_parse_token_num_t cmd_config_txqflags_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_config_txqflags_result,
+                               hexvalue, INT32);
+
+cmdline_parse_inst_t cmd_config_txqflags = {
+       .f = cmd_config_txqflags_parsed,
+       .data = NULL,
+       .help_str = "port config all txqflags value",
+       .tokens = {
+               (void *)&cmd_config_txqflags_port,
+               (void *)&cmd_config_txqflags_config,
+               (void *)&cmd_config_txqflags_all,
+               (void *)&cmd_config_txqflags_what,
+               (void *)&cmd_config_txqflags_value,
+               NULL,
+       },
+};
+
 /* *** ADD/REMOVE ALL VLAN IDENTIFIERS TO/FROM A PORT VLAN RX FILTER *** */
 struct cmd_rx_vlan_filter_all_result {
        cmdline_fixed_string_t rx_vlan;
@@ -5336,7 +5424,7 @@ static void cmd_showcfg_parsed(void *parsed_result,
        else if (!strcmp(res->what, "cores"))
                fwd_lcores_config_display();
        else if (!strcmp(res->what, "fwd"))
-               fwd_config_display();
+               pkt_fwd_config_display(&cur_fwd_config);
        else if (!strcmp(res->what, "txpkts"))
                show_tx_pkt_segments();
 }
@@ -6678,14 +6766,12 @@ cmd_tunnel_filter_parsed(void *parsed_result,
 
        if (res->ip_value.family == AF_INET) {
                tunnel_filter_conf.ip_addr.ipv4_addr =
-                       rte_be_to_cpu_32(res->ip_value.addr.ipv4.s_addr);
+                       res->ip_value.addr.ipv4.s_addr;
                tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV4;
        } else {
-               int i;
-               for (i = 0; i < 4; i++) {
-                       tunnel_filter_conf.ip_addr.ipv6_addr[i] =
-                       rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]);
-               }
+               memcpy(&(tunnel_filter_conf.ip_addr.ipv6_addr),
+                       &(res->ip_value.addr.ipv6),
+                       sizeof(struct in6_addr));
                tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6;
        }
 
@@ -7193,8 +7279,6 @@ static void cmd_dump_parsed(void *parsed_result,
                rte_dump_physmem_layout(stdout);
        else if (!strcmp(res->dump, "dump_memzone"))
                rte_memzone_dump(stdout);
-       else if (!strcmp(res->dump, "dump_log_history"))
-               rte_log_dump_history(stdout);
        else if (!strcmp(res->dump, "dump_struct_sizes"))
                dump_struct_sizes();
        else if (!strcmp(res->dump, "dump_ring"))
@@ -7209,7 +7293,6 @@ cmdline_parse_token_string_t cmd_dump_dump =
        TOKEN_STRING_INITIALIZER(struct cmd_dump_result, dump,
                "dump_physmem#"
                "dump_memzone#"
-               "dump_log_history#"
                "dump_struct_sizes#"
                "dump_ring#"
                "dump_mempool#"
@@ -8027,6 +8110,12 @@ struct cmd_flow_director_result {
        uint16_t port_dst;
        cmdline_fixed_string_t verify_tag;
        uint32_t verify_tag_value;
+       cmdline_ipaddr_t tos;
+       uint8_t tos_value;
+       cmdline_ipaddr_t proto;
+       uint8_t proto_value;
+       cmdline_ipaddr_t ttl;
+       uint8_t ttl_value;
        cmdline_fixed_string_t vlan;
        uint16_t vlan_value;
        cmdline_fixed_string_t flexbytes;
@@ -8206,12 +8295,15 @@ cmd_flow_director_filter_parsed(void *parsed_result,
        switch (entry.input.flow_type) {
        case RTE_ETH_FLOW_FRAG_IPV4:
        case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER:
+               entry.input.flow.ip4_flow.proto = res->proto_value;
        case RTE_ETH_FLOW_NONFRAG_IPV4_UDP:
        case RTE_ETH_FLOW_NONFRAG_IPV4_TCP:
                IPV4_ADDR_TO_UINT(res->ip_dst,
                        entry.input.flow.ip4_flow.dst_ip);
                IPV4_ADDR_TO_UINT(res->ip_src,
                        entry.input.flow.ip4_flow.src_ip);
+               entry.input.flow.ip4_flow.tos = res->tos_value;
+               entry.input.flow.ip4_flow.ttl = res->ttl_value;
                /* need convert to big endian. */
                entry.input.flow.udp4_flow.dst_port =
                                rte_cpu_to_be_16(res->port_dst);
@@ -8223,6 +8315,8 @@ cmd_flow_director_filter_parsed(void *parsed_result,
                        entry.input.flow.sctp4_flow.ip.dst_ip);
                IPV4_ADDR_TO_UINT(res->ip_src,
                        entry.input.flow.sctp4_flow.ip.src_ip);
+               entry.input.flow.ip4_flow.tos = res->tos_value;
+               entry.input.flow.ip4_flow.ttl = res->ttl_value;
                /* need convert to big endian. */
                entry.input.flow.sctp4_flow.dst_port =
                                rte_cpu_to_be_16(res->port_dst);
@@ -8233,12 +8327,15 @@ cmd_flow_director_filter_parsed(void *parsed_result,
                break;
        case RTE_ETH_FLOW_FRAG_IPV6:
        case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER:
+               entry.input.flow.ipv6_flow.proto = res->proto_value;
        case RTE_ETH_FLOW_NONFRAG_IPV6_UDP:
        case RTE_ETH_FLOW_NONFRAG_IPV6_TCP:
                IPV6_ADDR_TO_ARRAY(res->ip_dst,
                        entry.input.flow.ipv6_flow.dst_ip);
                IPV6_ADDR_TO_ARRAY(res->ip_src,
                        entry.input.flow.ipv6_flow.src_ip);
+               entry.input.flow.ipv6_flow.tc = res->tos_value;
+               entry.input.flow.ipv6_flow.hop_limits = res->ttl_value;
                /* need convert to big endian. */
                entry.input.flow.udp6_flow.dst_port =
                                rte_cpu_to_be_16(res->port_dst);
@@ -8250,6 +8347,8 @@ cmd_flow_director_filter_parsed(void *parsed_result,
                        entry.input.flow.sctp6_flow.ip.dst_ip);
                IPV6_ADDR_TO_ARRAY(res->ip_src,
                        entry.input.flow.sctp6_flow.ip.src_ip);
+               entry.input.flow.ipv6_flow.tc = res->tos_value;
+               entry.input.flow.ipv6_flow.hop_limits = res->ttl_value;
                /* need convert to big endian. */
                entry.input.flow.sctp6_flow.dst_port =
                                rte_cpu_to_be_16(res->port_dst);
@@ -8377,6 +8476,24 @@ cmdline_parse_token_string_t cmd_flow_director_verify_tag =
 cmdline_parse_token_num_t cmd_flow_director_verify_tag_value =
        TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
                              verify_tag_value, UINT32);
+cmdline_parse_token_string_t cmd_flow_director_tos =
+       TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+                                tos, "tos");
+cmdline_parse_token_num_t cmd_flow_director_tos_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+                             tos_value, UINT8);
+cmdline_parse_token_string_t cmd_flow_director_proto =
+       TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+                                proto, "proto");
+cmdline_parse_token_num_t cmd_flow_director_proto_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+                             proto_value, UINT8);
+cmdline_parse_token_string_t cmd_flow_director_ttl =
+       TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+                                ttl, "ttl");
+cmdline_parse_token_num_t cmd_flow_director_ttl_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+                             ttl_value, UINT8);
 cmdline_parse_token_string_t cmd_flow_director_vlan =
        TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
                                 vlan, "vlan");
@@ -8455,6 +8572,12 @@ cmdline_parse_inst_t cmd_add_del_ip_flow_director = {
                (void *)&cmd_flow_director_ip_src,
                (void *)&cmd_flow_director_dst,
                (void *)&cmd_flow_director_ip_dst,
+               (void *)&cmd_flow_director_tos,
+               (void *)&cmd_flow_director_tos_value,
+               (void *)&cmd_flow_director_proto,
+               (void *)&cmd_flow_director_proto_value,
+               (void *)&cmd_flow_director_ttl,
+               (void *)&cmd_flow_director_ttl_value,
                (void *)&cmd_flow_director_vlan,
                (void *)&cmd_flow_director_vlan_value,
                (void *)&cmd_flow_director_flexbytes,
@@ -8487,6 +8610,10 @@ cmdline_parse_inst_t cmd_add_del_udp_flow_director = {
                (void *)&cmd_flow_director_dst,
                (void *)&cmd_flow_director_ip_dst,
                (void *)&cmd_flow_director_port_dst,
+               (void *)&cmd_flow_director_tos,
+               (void *)&cmd_flow_director_tos_value,
+               (void *)&cmd_flow_director_ttl,
+               (void *)&cmd_flow_director_ttl_value,
                (void *)&cmd_flow_director_vlan,
                (void *)&cmd_flow_director_vlan_value,
                (void *)&cmd_flow_director_flexbytes,
@@ -8521,6 +8648,10 @@ cmdline_parse_inst_t cmd_add_del_sctp_flow_director = {
                (void *)&cmd_flow_director_port_dst,
                (void *)&cmd_flow_director_verify_tag,
                (void *)&cmd_flow_director_verify_tag_value,
+               (void *)&cmd_flow_director_tos,
+               (void *)&cmd_flow_director_tos_value,
+               (void *)&cmd_flow_director_ttl,
+               (void *)&cmd_flow_director_ttl_value,
                (void *)&cmd_flow_director_vlan,
                (void *)&cmd_flow_director_vlan_value,
                (void *)&cmd_flow_director_flexbytes,
@@ -9447,16 +9578,19 @@ str2inset(char *string)
                char str[32];
                enum rte_eth_input_set_field inset;
        } inset_table[] = {
+               {"ethertype", RTE_ETH_INPUT_SET_L2_ETHERTYPE},
                {"ovlan", RTE_ETH_INPUT_SET_L2_OUTER_VLAN},
                {"ivlan", RTE_ETH_INPUT_SET_L2_INNER_VLAN},
                {"src-ipv4", RTE_ETH_INPUT_SET_L3_SRC_IP4},
                {"dst-ipv4", RTE_ETH_INPUT_SET_L3_DST_IP4},
                {"ipv4-tos", RTE_ETH_INPUT_SET_L3_IP4_TOS},
                {"ipv4-proto", RTE_ETH_INPUT_SET_L3_IP4_PROTO},
+               {"ipv4-ttl", RTE_ETH_INPUT_SET_L3_IP4_TTL},
                {"src-ipv6", RTE_ETH_INPUT_SET_L3_SRC_IP6},
                {"dst-ipv6", RTE_ETH_INPUT_SET_L3_DST_IP6},
                {"ipv6-tc", RTE_ETH_INPUT_SET_L3_IP6_TC},
                {"ipv6-next-header", RTE_ETH_INPUT_SET_L3_IP6_NEXT_HEADER},
+               {"ipv6-hop-limits", RTE_ETH_INPUT_SET_L3_IP6_HOP_LIMITS},
                {"udp-src-port", RTE_ETH_INPUT_SET_L4_UDP_SRC_PORT},
                {"udp-dst-port", RTE_ETH_INPUT_SET_L4_UDP_DST_PORT},
                {"tcp-src-port", RTE_ETH_INPUT_SET_L4_TCP_SRC_PORT},
@@ -9515,7 +9649,7 @@ cmdline_parse_token_num_t cmd_set_hash_input_set_port_id =
 cmdline_parse_token_string_t cmd_set_hash_input_set_flow_type =
        TOKEN_STRING_INITIALIZER(struct cmd_set_hash_input_set_result,
                flow_type,
-               "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#ipv6#"
+               "ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#"
                "ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#ipv6-other#l2_payload");
 cmdline_parse_token_string_t cmd_set_hash_input_set_field =
        TOKEN_STRING_INITIALIZER(struct cmd_set_hash_input_set_result,
@@ -9534,8 +9668,8 @@ cmdline_parse_inst_t cmd_set_hash_input_set = {
        .f = cmd_set_hash_input_set_parsed,
        .data = NULL,
        .help_str = "set_hash_input_set <port_id> "
-       "ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|ipv6-frag|"
-       "ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload "
+       "ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
+       "ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload "
        "ovlan|ivlan|src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|ipv4-tos|ipv4-proto|"
        "ipv6-tc|ipv6-next-header|udp-src-port|udp-dst-port|tcp-src-port|"
        "tcp-dst-port|sctp-src-port|sctp-dst-port|sctp-veri-tag|udp-key|"
@@ -9590,15 +9724,16 @@ cmdline_parse_token_num_t cmd_set_fdir_input_set_port_id =
 cmdline_parse_token_string_t cmd_set_fdir_input_set_flow_type =
        TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result,
        flow_type,
-       "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#ipv6#"
+       "ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#"
        "ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#ipv6-other#l2_payload");
 cmdline_parse_token_string_t cmd_set_fdir_input_set_field =
        TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result,
        inset_field,
-       "src-ipv4#dst-ipv4#src-ipv6#dst-ipv6#udp-src-port#udp-dst-port#"
+       "ivlan#ethertype#src-ipv4#dst-ipv4#src-ipv6#dst-ipv6#"
+       "ipv4-tos#ipv4-proto#ipv4-ttl#ipv6-tc#ipv6-next-header#"
+       "ipv6-hop-limits#udp-src-port#udp-dst-port#"
        "tcp-src-port#tcp-dst-port#sctp-src-port#sctp-dst-port#"
-       "sctp-veri-tag#fld-1st#fld-2nd#fld-3rd#fld-4th#fld-5th#fld-6th#"
-       "fld-7th#fld-8th#none");
+       "sctp-veri-tag#none");
 cmdline_parse_token_string_t cmd_set_fdir_input_set_select =
        TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result,
        select, "select#add");
@@ -9607,12 +9742,13 @@ cmdline_parse_inst_t cmd_set_fdir_input_set = {
        .f = cmd_set_fdir_input_set_parsed,
        .data = NULL,
        .help_str = "set_fdir_input_set <port_id> "
-       "ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|ipv6-frag|"
-       "ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload "
-       "src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|udp-src-port|udp-dst-port|"
-       "tcp-src-port|tcp-dst-port|sctp-src-port|sctp-dst-port|sctp-veri-tag|"
-       "fld-1st|fld-2nd|fld-3rd|fld-4th|fld-5th|fld-6th|"
-       "fld-7th|fld-8th|none select|add",
+       "ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
+       "ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload "
+       "ivlan|ethertype|src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|"
+       "ipv4-tos|ipv4-proto|ipv4-ttl|ipv6-tc|ipv6-next-header|"
+       "ipv6-hop-limits|udp-src-port|udp-dst-port|"
+       "tcp-src-port|tcp-dst-port|sctp-src-port|sctp-dst-port|"
+       "sctp-veri-tag|none select|add",
        .tokens = {
                (void *)&cmd_set_fdir_input_set_cmd,
                (void *)&cmd_set_fdir_input_set_port_id,
@@ -10427,6 +10563,7 @@ cmdline_parse_ctx_t main_ctx[] = {
        (cmdline_parse_inst_t *)&cmd_config_rx_mode_flag,
        (cmdline_parse_inst_t *)&cmd_config_rss,
        (cmdline_parse_inst_t *)&cmd_config_rxtx_queue,
+       (cmdline_parse_inst_t *)&cmd_config_txqflags,
        (cmdline_parse_inst_t *)&cmd_config_rss_reta,
        (cmdline_parse_inst_t *)&cmd_showport_reta,
        (cmdline_parse_inst_t *)&cmd_config_burst,