app/testpmd: use SPDX tags in 6WIND copyrighted files
[dpdk.git] / app / test-pmd / cmdline.c
index 2418f6b..1e06dcd 100644 (file)
@@ -1,35 +1,6 @@
-/*-
- *   BSD LICENSE
- *
- *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
- *   Copyright(c) 2014 6WIND S.A.
- *   All rights reserved.
- *
- *   Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions
- *   are met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in
- *       the documentation and/or other materials provided with the
- *       distribution.
- *     * Neither the name of Intel Corporation nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2016 Intel Corporation.
+ * Copyright(c) 2014 6WIND S.A.
  */
 
 #include <stdarg.h>
@@ -89,6 +60,9 @@
 #include <rte_eth_bond.h>
 #include <rte_eth_bond_8023ad.h>
 #endif
+#ifdef RTE_LIBRTE_DPAA_PMD
+#include <rte_pmd_dpaa.h>
+#endif
 #ifdef RTE_LIBRTE_IXGBE_PMD
 #include <rte_pmd_ixgbe.h>
 #endif
@@ -271,6 +245,9 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "set verbose (level)\n"
                        "    Set the debug verbosity level X.\n\n"
 
+                       "set log global|(type) (level)\n"
+                       "    Set the log level.\n\n"
+
                        "set nbport (num)\n"
                        "    Set number of ports.\n\n"
 
@@ -486,6 +463,9 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "set vf mac addr (port_id) (vf_id) (XX:XX:XX:XX:XX:XX)\n"
                        "    Set the MAC address for a VF from the PF.\n\n"
 
+                       "set eth-peer (port_id) (peer_addr)\n"
+                       "    set the peer address for certain port.\n\n"
+
                        "set port (port_id) uta (mac_address|all) (on|off)\n"
                        "    Add/Remove a or all unicast hash filter(s)"
                        "from port X.\n\n"
@@ -881,6 +861,15 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "port config (port_id) pctype mapping update"
                        " (pctype_id_0[,pctype_id_1]*) (flow_type_id)\n"
                        "    Update a flow type to pctype mapping item on a port\n\n"
+
+                       "port config (port_id) pctype (pctype_id) hash_inset|"
+                       "fdir_inset|fdir_flx_inset get|set|clear field\n"
+                       " (field_idx)\n"
+                       "    Configure RSS|FDIR|FDIR_FLX input set for some pctype\n\n"
+
+                       "port config (port_id) pctype (pctype_id) hash_inset|"
+                       "fdir_inset|fdir_flx_inset clear all"
+                       "    Clear RSS|FDIR|FDIR_FLX input set completely for some pctype\n\n"
                );
        }
 
@@ -996,6 +985,11 @@ static void cmd_help_long_parsed(void *parsed_result,
                        " queue (queue_id) fd_id (fd_id_value)\n"
                        "    Add/Del a Tunnel flow director filter.\n\n"
 
+                       "flow_director_filter (port_id) mode raw (add|del|update)"
+                       " flow (flow_id) (drop|fwd) queue (queue_id)"
+                       " fd_id (fd_id_value) packet (packet file name)\n"
+                       "    Add/Del a raw type flow director filter.\n\n"
+
                        "flush_flow_director (port_id)\n"
                        "    Flush all flow director entries of a device.\n\n"
 
@@ -1518,6 +1512,8 @@ cmd_config_rx_tx_parsed(void *parsed_result,
                        printf("Warning: Either rx or tx queues should be non zero\n");
                        return;
                }
+               if (check_nb_rxq(res->value) != 0)
+                       return;
                nb_rxq = res->value;
        }
        else if (!strcmp(res->name, "txq")) {
@@ -1525,6 +1521,8 @@ cmd_config_rx_tx_parsed(void *parsed_result,
                        printf("Warning: Either rx or tx queues should be non zero\n");
                        return;
                }
+               if (check_nb_txq(res->value) != 0)
+                       return;
                nb_txq = res->value;
        }
        else if (!strcmp(res->name, "rxd")) {
@@ -3031,6 +3029,55 @@ cmdline_parse_inst_t cmd_set_numbers = {
        },
 };
 
+/* *** SET LOG LEVEL CONFIGURATION *** */
+
+struct cmd_set_log_result {
+       cmdline_fixed_string_t set;
+       cmdline_fixed_string_t log;
+       cmdline_fixed_string_t type;
+       uint32_t level;
+};
+
+static void
+cmd_set_log_parsed(void *parsed_result,
+                  __attribute__((unused)) struct cmdline *cl,
+                  __attribute__((unused)) void *data)
+{
+       struct cmd_set_log_result *res;
+       int ret;
+
+       res = parsed_result;
+       if (!strcmp(res->type, "global"))
+               rte_log_set_global_level(res->level);
+       else {
+               ret = rte_log_set_level_regexp(res->type, res->level);
+               if (ret < 0)
+                       printf("Unable to set log level\n");
+       }
+}
+
+cmdline_parse_token_string_t cmd_set_log_set =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_log_result, set, "set");
+cmdline_parse_token_string_t cmd_set_log_log =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_log_result, log, "log");
+cmdline_parse_token_string_t cmd_set_log_type =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_log_result, type, NULL);
+cmdline_parse_token_num_t cmd_set_log_level =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_log_result, level, UINT32);
+
+cmdline_parse_inst_t cmd_set_log = {
+       .f = cmd_set_log_parsed,
+       .data = NULL,
+       .help_str = "set log global|<type> <level>",
+       .tokens = {
+               (void *)&cmd_set_log_set,
+               (void *)&cmd_set_log_log,
+               (void *)&cmd_set_log_type,
+               (void *)&cmd_set_log_level,
+               NULL,
+       },
+};
+
 /* *** SET SEGMENT LENGTHS OF TXONLY PACKETS *** */
 
 struct cmd_set_txpkts_result {
@@ -3682,40 +3729,40 @@ cmd_csum_parsed(void *parsed_result,
                        hw = 1;
 
                if (!strcmp(res->proto, "ip")) {
-                       if (dev_info.tx_offload_capa &
-                                               DEV_TX_OFFLOAD_IPV4_CKSUM) {
+                       if (hw == 0 || (dev_info.tx_offload_capa &
+                                               DEV_TX_OFFLOAD_IPV4_CKSUM)) {
                                csum_offloads |= DEV_TX_OFFLOAD_IPV4_CKSUM;
                        } else {
                                printf("IP checksum offload is not supported "
                                       "by port %u\n", res->port_id);
                        }
                } else if (!strcmp(res->proto, "udp")) {
-                       if (dev_info.tx_offload_capa &
-                                               DEV_TX_OFFLOAD_UDP_CKSUM) {
+                       if (hw == 0 || (dev_info.tx_offload_capa &
+                                               DEV_TX_OFFLOAD_UDP_CKSUM)) {
                                csum_offloads |= DEV_TX_OFFLOAD_UDP_CKSUM;
                        } else {
                                printf("UDP checksum offload is not supported "
                                       "by port %u\n", res->port_id);
                        }
                } else if (!strcmp(res->proto, "tcp")) {
-                       if (dev_info.tx_offload_capa &
-                                               DEV_TX_OFFLOAD_TCP_CKSUM) {
+                       if (hw == 0 || (dev_info.tx_offload_capa &
+                                               DEV_TX_OFFLOAD_TCP_CKSUM)) {
                                csum_offloads |= DEV_TX_OFFLOAD_TCP_CKSUM;
                        } else {
                                printf("TCP checksum offload is not supported "
                                       "by port %u\n", res->port_id);
                        }
                } else if (!strcmp(res->proto, "sctp")) {
-                       if (dev_info.tx_offload_capa &
-                                               DEV_TX_OFFLOAD_SCTP_CKSUM) {
+                       if (hw == 0 || (dev_info.tx_offload_capa &
+                                               DEV_TX_OFFLOAD_SCTP_CKSUM)) {
                                csum_offloads |= DEV_TX_OFFLOAD_SCTP_CKSUM;
                        } else {
                                printf("SCTP checksum offload is not supported "
                                       "by port %u\n", res->port_id);
                        }
                } else if (!strcmp(res->proto, "outer-ip")) {
-                       if (dev_info.tx_offload_capa &
-                                       DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) {
+                       if (hw == 0 || (dev_info.tx_offload_capa &
+                                       DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)) {
                                csum_offloads |=
                                                DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM;
                        } else {
@@ -5813,7 +5860,7 @@ cmdline_parse_token_string_t cmd_setpromisc_portall =
                                 "all");
 cmdline_parse_token_num_t cmd_setpromisc_portnum =
        TOKEN_NUM_INITIALIZER(struct cmd_set_promisc_mode_result, port_num,
-                             UINT8);
+                             UINT16);
 cmdline_parse_token_string_t cmd_setpromisc_mode =
        TOKEN_STRING_INITIALIZER(struct cmd_set_promisc_mode_result, mode,
                                 "on#off");
@@ -7182,6 +7229,50 @@ cmdline_parse_inst_t cmd_mac_addr = {
        },
 };
 
+/* *** SET THE PEER ADDRESS FOR CERTAIN PORT *** */
+struct cmd_eth_peer_result {
+       cmdline_fixed_string_t set;
+       cmdline_fixed_string_t eth_peer;
+       portid_t port_id;
+       cmdline_fixed_string_t peer_addr;
+};
+
+static void cmd_set_eth_peer_parsed(void *parsed_result,
+                       __attribute__((unused)) struct cmdline *cl,
+                       __attribute__((unused)) void *data)
+{
+               struct cmd_eth_peer_result *res = parsed_result;
+
+               if (test_done == 0) {
+                       printf("Please stop forwarding first\n");
+                       return;
+               }
+               if (!strcmp(res->eth_peer, "eth-peer")) {
+                       set_fwd_eth_peer(res->port_id, res->peer_addr);
+                       fwd_config_setup();
+               }
+}
+cmdline_parse_token_string_t cmd_eth_peer_set =
+       TOKEN_STRING_INITIALIZER(struct cmd_eth_peer_result, set, "set");
+cmdline_parse_token_string_t cmd_eth_peer =
+       TOKEN_STRING_INITIALIZER(struct cmd_eth_peer_result, eth_peer, "eth-peer");
+cmdline_parse_token_num_t cmd_eth_peer_port_id =
+       TOKEN_NUM_INITIALIZER(struct cmd_eth_peer_result, port_id, UINT16);
+cmdline_parse_token_string_t cmd_eth_peer_addr =
+       TOKEN_STRING_INITIALIZER(struct cmd_eth_peer_result, peer_addr, NULL);
+
+cmdline_parse_inst_t cmd_set_fwd_eth_peer = {
+       .f = cmd_set_eth_peer_parsed,
+       .data = NULL,
+       .help_str = "set eth-peer <port_id> <peer_mac>",
+       .tokens = {
+               (void *)&cmd_eth_peer_set,
+               (void *)&cmd_eth_peer,
+               (void *)&cmd_eth_peer_port_id,
+               (void *)&cmd_eth_peer_addr,
+               NULL,
+       },
+};
 
 /* *** CONFIGURE QUEUE STATS COUNTER MAPPINGS *** */
 struct cmd_set_qmap_result {
@@ -9831,6 +9922,8 @@ struct cmd_flow_director_result {
        cmdline_fixed_string_t tunnel_type;
        cmdline_fixed_string_t tunnel_id;
        uint32_t tunnel_id_value;
+       cmdline_fixed_string_t packet;
+       char filepath[];
 };
 
 static inline int
@@ -9980,8 +10073,62 @@ cmd_flow_director_filter_parsed(void *parsed_result,
                        return;
                }
        } else {
-               if (strcmp(res->mode_value, "IP")) {
-                       printf("Please set mode to IP.\n");
+               if (!strcmp(res->mode_value, "raw")) {
+#ifdef RTE_LIBRTE_I40E_PMD
+                       struct rte_pmd_i40e_flow_type_mapping
+                                       mapping[RTE_PMD_I40E_FLOW_TYPE_MAX];
+                       struct rte_pmd_i40e_pkt_template_conf conf;
+                       uint16_t flow_type = str2flowtype(res->flow_type);
+                       uint16_t i, port = res->port_id;
+                       uint8_t add;
+
+                       memset(&conf, 0, sizeof(conf));
+
+                       if (flow_type == RTE_ETH_FLOW_UNKNOWN) {
+                               printf("Invalid flow type specified.\n");
+                               return;
+                       }
+                       ret = rte_pmd_i40e_flow_type_mapping_get(res->port_id,
+                                                                mapping);
+                       if (ret)
+                               return;
+                       if (mapping[flow_type].pctype == 0ULL) {
+                               printf("Invalid flow type specified.\n");
+                               return;
+                       }
+                       for (i = 0; i < RTE_PMD_I40E_PCTYPE_MAX; i++) {
+                               if (mapping[flow_type].pctype & (1ULL << i)) {
+                                       conf.input.pctype = i;
+                                       break;
+                               }
+                       }
+
+                       conf.input.packet = open_file(res->filepath,
+                                               &conf.input.length);
+                       if (!conf.input.packet)
+                               return;
+                       if (!strcmp(res->drop, "drop"))
+                               conf.action.behavior =
+                                       RTE_PMD_I40E_PKT_TEMPLATE_REJECT;
+                       else
+                               conf.action.behavior =
+                                       RTE_PMD_I40E_PKT_TEMPLATE_ACCEPT;
+                       conf.action.report_status =
+                                       RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID;
+                       conf.action.rx_queue = res->queue_id;
+                       conf.soft_id = res->fd_id_value;
+                       add  = strcmp(res->ops, "del") ? 1 : 0;
+                       ret = rte_pmd_i40e_flow_add_del_packet_template(port,
+                                                                       &conf,
+                                                                       add);
+                       if (ret < 0)
+                               printf("flow director config error: (%s)\n",
+                                      strerror(-ret));
+                       close_file(conf.input.packet);
+#endif
+                       return;
+               } else if (strcmp(res->mode_value, "IP")) {
+                       printf("Please set mode to IP or raw.\n");
                        return;
                }
                entry.input.flow_type = str2flowtype(res->flow_type);
@@ -10153,8 +10300,7 @@ cmdline_parse_token_string_t cmd_flow_director_flow =
                                 flow, "flow");
 cmdline_parse_token_string_t cmd_flow_director_flow_type =
        TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-               flow_type, "ipv4-other#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
-               "ipv6-other#ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#l2_payload");
+               flow_type, NULL);
 cmdline_parse_token_string_t cmd_flow_director_ether =
        TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
                                 ether, "ether");
@@ -10246,6 +10392,9 @@ cmdline_parse_token_string_t cmd_flow_director_mode_mac_vlan =
 cmdline_parse_token_string_t cmd_flow_director_mode_tunnel =
        TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
                                 mode_value, "Tunnel");
+cmdline_parse_token_string_t cmd_flow_director_mode_raw =
+       TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+                                mode_value, "raw");
 cmdline_parse_token_string_t cmd_flow_director_mac =
        TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
                                 mac, "mac");
@@ -10264,6 +10413,12 @@ cmdline_parse_token_string_t cmd_flow_director_tunnel_id =
 cmdline_parse_token_num_t cmd_flow_director_tunnel_id_value =
        TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
                              tunnel_id_value, UINT32);
+cmdline_parse_token_string_t cmd_flow_director_packet =
+       TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+                                packet, "packet");
+cmdline_parse_token_string_t cmd_flow_director_filepath =
+       TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+                                filepath, NULL);
 
 cmdline_parse_inst_t cmd_add_del_ip_flow_director = {
        .f = cmd_flow_director_filter_parsed,
@@ -10467,6 +10622,30 @@ cmdline_parse_inst_t cmd_add_del_tunnel_flow_director = {
        },
 };
 
+cmdline_parse_inst_t cmd_add_del_raw_flow_director = {
+       .f = cmd_flow_director_filter_parsed,
+       .data = NULL,
+       .help_str = "flow_director_filter ... : Add or delete a raw flow "
+               "director entry on NIC",
+       .tokens = {
+               (void *)&cmd_flow_director_filter,
+               (void *)&cmd_flow_director_port_id,
+               (void *)&cmd_flow_director_mode,
+               (void *)&cmd_flow_director_mode_raw,
+               (void *)&cmd_flow_director_ops,
+               (void *)&cmd_flow_director_flow,
+               (void *)&cmd_flow_director_flow_type,
+               (void *)&cmd_flow_director_drop,
+               (void *)&cmd_flow_director_queue,
+               (void *)&cmd_flow_director_queue_id,
+               (void *)&cmd_flow_director_fd_id,
+               (void *)&cmd_flow_director_fd_id_value,
+               (void *)&cmd_flow_director_packet,
+               (void *)&cmd_flow_director_filepath,
+               NULL,
+       },
+};
+
 struct cmd_flush_flow_director_result {
        cmdline_fixed_string_t flush_flow_director;
        portid_t port_id;
@@ -10743,7 +10922,7 @@ cmd_flow_director_flex_mask_parsed(void *parsed_result,
        struct rte_eth_fdir_info fdir_info;
        struct rte_eth_fdir_flex_mask flex_mask;
        struct rte_port *port;
-       uint32_t flow_type_mask;
+       uint64_t flow_type_mask;
        uint16_t i;
        int ret;
 
@@ -10796,7 +10975,7 @@ cmd_flow_director_flex_mask_parsed(void *parsed_result,
                        return;
                }
                for (i = RTE_ETH_FLOW_UNKNOWN; i < RTE_ETH_FLOW_MAX; i++) {
-                       if (flow_type_mask & (1 << i)) {
+                       if (flow_type_mask & (1ULL << i)) {
                                flex_mask.flow_type = i;
                                fdir_set_flex_mask(res->port_id, &flex_mask);
                        }
@@ -10805,7 +10984,7 @@ cmd_flow_director_flex_mask_parsed(void *parsed_result,
                return;
        }
        flex_mask.flow_type = str2flowtype(res->flow_type);
-       if (!(flow_type_mask & (1 << flex_mask.flow_type))) {
+       if (!(flow_type_mask & (1ULL << flex_mask.flow_type))) {
                printf("Flow type %s not supported on port %d\n",
                                res->flow_type, res->port_id);
                return;
@@ -11167,10 +11346,10 @@ cmd_get_hash_global_config_parsed(void *parsed_result,
        }
 
        for (i = 0; i < RTE_ETH_FLOW_MAX; i++) {
-               idx = i / UINT32_BIT;
-               offset = i % UINT32_BIT;
+               idx = i / UINT64_BIT;
+               offset = i % UINT64_BIT;
                if (!(info.info.global_conf.valid_bit_mask[idx] &
-                                               (1UL << offset)))
+                                               (1ULL << offset)))
                        continue;
                str = flowtype_to_str(i);
                if (!str)
@@ -11178,7 +11357,7 @@ cmd_get_hash_global_config_parsed(void *parsed_result,
                printf("Symmetric hash is %s globally for flow type %s "
                                                        "by port %d\n",
                        ((info.info.global_conf.sym_hash_enable_mask[idx] &
-                       (1UL << offset)) ? "enabled" : "disabled"), str,
+                       (1ULL << offset)) ? "enabled" : "disabled"), str,
                                                        res->port_id);
        }
 }
@@ -11239,12 +11418,12 @@ cmd_set_hash_global_config_parsed(void *parsed_result,
                        RTE_ETH_HASH_FUNCTION_DEFAULT;
 
        ftype = str2flowtype(res->flow_type);
-       idx = ftype / (CHAR_BIT * sizeof(uint32_t));
-       offset = ftype % (CHAR_BIT * sizeof(uint32_t));
-       info.info.global_conf.valid_bit_mask[idx] |= (1UL << offset);
+       idx = ftype / UINT64_BIT;
+       offset = ftype % UINT64_BIT;
+       info.info.global_conf.valid_bit_mask[idx] |= (1ULL << offset);
        if (!strcmp(res->enable, "enable"))
                info.info.global_conf.sym_hash_enable_mask[idx] |=
-                                               (1UL << offset);
+                                               (1ULL << offset);
        ret = rte_eth_dev_filter_ctrl(res->port_id, RTE_ETH_FILTER_HASH,
                                        RTE_ETH_FILTER_SET, &info);
        if (ret < 0)
@@ -12682,6 +12861,10 @@ cmd_set_tx_loopback_parsed(
        if (ret == -ENOTSUP)
                ret = rte_pmd_bnxt_set_tx_loopback(res->port_id, is_on);
 #endif
+#ifdef RTE_LIBRTE_DPAA_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_dpaa_set_tx_loopback(res->port_id, is_on);
+#endif
 
        switch (ret) {
        case 0:
@@ -14301,7 +14484,7 @@ cmd_ddp_add_parsed(
        }
        file_num = rte_strsplit(filepath, strlen(filepath), file_fld, 2, ',');
 
-       buff = open_ddp_package_file(file_fld[0], &size);
+       buff = open_file(file_fld[0], &size);
        if (!buff) {
                free((void *)filepath);
                return;
@@ -14319,9 +14502,9 @@ cmd_ddp_add_parsed(
        else if (ret < 0)
                printf("Failed to load profile.\n");
        else if (file_num == 2)
-               save_ddp_package_file(file_fld[1], buff, size);
+               save_file(file_fld[1], buff, size);
 
-       close_ddp_package_file(buff);
+       close_file(buff);
        free((void *)filepath);
 }
 
@@ -14376,7 +14559,7 @@ cmd_ddp_del_parsed(
                return;
        }
 
-       buff = open_ddp_package_file(res->filepath, &size);
+       buff = open_file(res->filepath, &size);
        if (!buff)
                return;
 
@@ -14392,7 +14575,7 @@ cmd_ddp_del_parsed(
        else if (ret < 0)
                printf("Failed to delete profile.\n");
 
-       close_ddp_package_file(buff);
+       close_file(buff);
 }
 
 cmdline_parse_inst_t cmd_ddp_del = {
@@ -14452,7 +14635,7 @@ cmd_ddp_info_parsed(
 
 #endif
 
-       pkg = open_ddp_package_file(res->filepath, &pkg_size);
+       pkg = open_file(res->filepath, &pkg_size);
        if (!pkg)
                return;
 
@@ -14629,7 +14812,7 @@ no_print_return:
 #endif
        if (ret == -ENOTSUP)
                printf("Function not supported in PMD driver\n");
-       close_ddp_package_file(pkg);
+       close_file(pkg);
 }
 
 cmdline_parse_inst_t cmd_ddp_get_info = {
@@ -14733,6 +14916,237 @@ cmdline_parse_inst_t cmd_ddp_get_list = {
        },
 };
 
+/* Configure input set */
+struct cmd_cfg_input_set_result {
+       cmdline_fixed_string_t port;
+       cmdline_fixed_string_t cfg;
+       portid_t port_id;
+       cmdline_fixed_string_t pctype;
+       uint8_t pctype_id;
+       cmdline_fixed_string_t inset_type;
+       cmdline_fixed_string_t opt;
+       cmdline_fixed_string_t field;
+       uint8_t field_idx;
+};
+
+static void
+cmd_cfg_input_set_parsed(
+       void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_cfg_input_set_result *res = parsed_result;
+#ifdef RTE_LIBRTE_I40E_PMD
+       enum rte_pmd_i40e_inset_type inset_type = INSET_NONE;
+       struct rte_pmd_i40e_inset inset;
+#endif
+       int ret = -ENOTSUP;
+
+       if (res->port_id > nb_ports) {
+               printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
+               return;
+       }
+
+       if (!all_ports_stopped()) {
+               printf("Please stop all ports first\n");
+               return;
+       }
+
+#ifdef RTE_LIBRTE_I40E_PMD
+       if (!strcmp(res->inset_type, "hash_inset"))
+               inset_type = INSET_HASH;
+       else if (!strcmp(res->inset_type, "fdir_inset"))
+               inset_type = INSET_FDIR;
+       else if (!strcmp(res->inset_type, "fdir_flx_inset"))
+               inset_type = INSET_FDIR_FLX;
+       ret = rte_pmd_i40e_inset_get(res->port_id, res->pctype_id,
+                                    &inset, inset_type);
+       if (ret) {
+               printf("Failed to get input set.\n");
+               return;
+       }
+
+       if (!strcmp(res->opt, "get")) {
+               ret = rte_pmd_i40e_inset_field_get(inset.inset,
+                                                  res->field_idx);
+               if (ret)
+                       printf("Field index %d is enabled.\n", res->field_idx);
+               else
+                       printf("Field index %d is disabled.\n", res->field_idx);
+               return;
+       } else if (!strcmp(res->opt, "set"))
+               ret = rte_pmd_i40e_inset_field_set(&inset.inset,
+                                                  res->field_idx);
+       else if (!strcmp(res->opt, "clear"))
+               ret = rte_pmd_i40e_inset_field_clear(&inset.inset,
+                                                    res->field_idx);
+       if (ret) {
+               printf("Failed to configure input set field.\n");
+               return;
+       }
+
+       ret = rte_pmd_i40e_inset_set(res->port_id, res->pctype_id,
+                                    &inset, inset_type);
+       if (ret) {
+               printf("Failed to set input set.\n");
+               return;
+       }
+#endif
+
+       if (ret == -ENOTSUP)
+               printf("Function not supported\n");
+}
+
+cmdline_parse_token_string_t cmd_cfg_input_set_port =
+       TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
+                                port, "port");
+cmdline_parse_token_string_t cmd_cfg_input_set_cfg =
+       TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
+                                cfg, "config");
+cmdline_parse_token_num_t cmd_cfg_input_set_port_id =
+       TOKEN_NUM_INITIALIZER(struct cmd_cfg_input_set_result,
+                             port_id, UINT16);
+cmdline_parse_token_string_t cmd_cfg_input_set_pctype =
+       TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
+                                pctype, "pctype");
+cmdline_parse_token_num_t cmd_cfg_input_set_pctype_id =
+       TOKEN_NUM_INITIALIZER(struct cmd_cfg_input_set_result,
+                             pctype_id, UINT8);
+cmdline_parse_token_string_t cmd_cfg_input_set_inset_type =
+       TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
+                                inset_type,
+                                "hash_inset#fdir_inset#fdir_flx_inset");
+cmdline_parse_token_string_t cmd_cfg_input_set_opt =
+       TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
+                                opt, "get#set#clear");
+cmdline_parse_token_string_t cmd_cfg_input_set_field =
+       TOKEN_STRING_INITIALIZER(struct cmd_cfg_input_set_result,
+                                field, "field");
+cmdline_parse_token_num_t cmd_cfg_input_set_field_idx =
+       TOKEN_NUM_INITIALIZER(struct cmd_cfg_input_set_result,
+                             field_idx, UINT8);
+
+cmdline_parse_inst_t cmd_cfg_input_set = {
+       .f = cmd_cfg_input_set_parsed,
+       .data = NULL,
+       .help_str = "port config <port_id> pctype <pctype_id> hash_inset|"
+                   "fdir_inset|fdir_flx_inset get|set|clear field <field_idx>",
+       .tokens = {
+               (void *)&cmd_cfg_input_set_port,
+               (void *)&cmd_cfg_input_set_cfg,
+               (void *)&cmd_cfg_input_set_port_id,
+               (void *)&cmd_cfg_input_set_pctype,
+               (void *)&cmd_cfg_input_set_pctype_id,
+               (void *)&cmd_cfg_input_set_inset_type,
+               (void *)&cmd_cfg_input_set_opt,
+               (void *)&cmd_cfg_input_set_field,
+               (void *)&cmd_cfg_input_set_field_idx,
+               NULL,
+       },
+};
+
+/* Clear input set */
+struct cmd_clear_input_set_result {
+       cmdline_fixed_string_t port;
+       cmdline_fixed_string_t cfg;
+       portid_t port_id;
+       cmdline_fixed_string_t pctype;
+       uint8_t pctype_id;
+       cmdline_fixed_string_t inset_type;
+       cmdline_fixed_string_t clear;
+       cmdline_fixed_string_t all;
+};
+
+static void
+cmd_clear_input_set_parsed(
+       void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_clear_input_set_result *res = parsed_result;
+#ifdef RTE_LIBRTE_I40E_PMD
+       enum rte_pmd_i40e_inset_type inset_type = INSET_NONE;
+       struct rte_pmd_i40e_inset inset;
+#endif
+       int ret = -ENOTSUP;
+
+       if (res->port_id > nb_ports) {
+               printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
+               return;
+       }
+
+       if (!all_ports_stopped()) {
+               printf("Please stop all ports first\n");
+               return;
+       }
+
+#ifdef RTE_LIBRTE_I40E_PMD
+       if (!strcmp(res->inset_type, "hash_inset"))
+               inset_type = INSET_HASH;
+       else if (!strcmp(res->inset_type, "fdir_inset"))
+               inset_type = INSET_FDIR;
+       else if (!strcmp(res->inset_type, "fdir_flx_inset"))
+               inset_type = INSET_FDIR_FLX;
+
+       memset(&inset, 0, sizeof(inset));
+
+       ret = rte_pmd_i40e_inset_set(res->port_id, res->pctype_id,
+                                    &inset, inset_type);
+       if (ret) {
+               printf("Failed to clear input set.\n");
+               return;
+       }
+
+#endif
+
+       if (ret == -ENOTSUP)
+               printf("Function not supported\n");
+}
+
+cmdline_parse_token_string_t cmd_clear_input_set_port =
+       TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
+                                port, "port");
+cmdline_parse_token_string_t cmd_clear_input_set_cfg =
+       TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
+                                cfg, "config");
+cmdline_parse_token_num_t cmd_clear_input_set_port_id =
+       TOKEN_NUM_INITIALIZER(struct cmd_clear_input_set_result,
+                             port_id, UINT16);
+cmdline_parse_token_string_t cmd_clear_input_set_pctype =
+       TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
+                                pctype, "pctype");
+cmdline_parse_token_num_t cmd_clear_input_set_pctype_id =
+       TOKEN_NUM_INITIALIZER(struct cmd_clear_input_set_result,
+                             pctype_id, UINT8);
+cmdline_parse_token_string_t cmd_clear_input_set_inset_type =
+       TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
+                                inset_type,
+                                "hash_inset#fdir_inset#fdir_flx_inset");
+cmdline_parse_token_string_t cmd_clear_input_set_clear =
+       TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
+                                clear, "clear");
+cmdline_parse_token_string_t cmd_clear_input_set_all =
+       TOKEN_STRING_INITIALIZER(struct cmd_clear_input_set_result,
+                                all, "all");
+
+cmdline_parse_inst_t cmd_clear_input_set = {
+       .f = cmd_clear_input_set_parsed,
+       .data = NULL,
+       .help_str = "port config <port_id> pctype <pctype_id> hash_inset|"
+                   "fdir_inset|fdir_flx_inset clear all",
+       .tokens = {
+               (void *)&cmd_clear_input_set_port,
+               (void *)&cmd_clear_input_set_cfg,
+               (void *)&cmd_clear_input_set_port_id,
+               (void *)&cmd_clear_input_set_pctype,
+               (void *)&cmd_clear_input_set_pctype_id,
+               (void *)&cmd_clear_input_set_inset_type,
+               (void *)&cmd_clear_input_set_clear,
+               (void *)&cmd_clear_input_set_all,
+               NULL,
+       },
+};
+
 /* show vf stats */
 
 /* Common result structure for show vf stats */
@@ -15635,6 +16049,7 @@ cmdline_parse_ctx_t main_ctx[] = {
        (cmdline_parse_inst_t *)&cmd_set_link_down,
        (cmdline_parse_inst_t *)&cmd_reset,
        (cmdline_parse_inst_t *)&cmd_set_numbers,
+       (cmdline_parse_inst_t *)&cmd_set_log,
        (cmdline_parse_inst_t *)&cmd_set_txpkts,
        (cmdline_parse_inst_t *)&cmd_set_txsplit,
        (cmdline_parse_inst_t *)&cmd_set_fwd_list,
@@ -15706,6 +16121,7 @@ cmdline_parse_ctx_t main_ctx[] = {
        (cmdline_parse_inst_t *)&cmd_read_rxd_txd,
        (cmdline_parse_inst_t *)&cmd_stop,
        (cmdline_parse_inst_t *)&cmd_mac_addr,
+       (cmdline_parse_inst_t *)&cmd_set_fwd_eth_peer,
        (cmdline_parse_inst_t *)&cmd_set_qmap,
        (cmdline_parse_inst_t *)&cmd_set_xstats_hide_zero,
        (cmdline_parse_inst_t *)&cmd_operate_port,
@@ -15752,6 +16168,7 @@ cmdline_parse_ctx_t main_ctx[] = {
        (cmdline_parse_inst_t *)&cmd_add_del_l2_flow_director,
        (cmdline_parse_inst_t *)&cmd_add_del_mac_vlan_flow_director,
        (cmdline_parse_inst_t *)&cmd_add_del_tunnel_flow_director,
+       (cmdline_parse_inst_t *)&cmd_add_del_raw_flow_director,
        (cmdline_parse_inst_t *)&cmd_flush_flow_director,
        (cmdline_parse_inst_t *)&cmd_set_flow_director_ip_mask,
        (cmdline_parse_inst_t *)&cmd_set_flow_director_mac_vlan_mask,
@@ -15821,6 +16238,8 @@ cmdline_parse_ctx_t main_ctx[] = {
        (cmdline_parse_inst_t *)&cmd_ddp_del,
        (cmdline_parse_inst_t *)&cmd_ddp_get_list,
        (cmdline_parse_inst_t *)&cmd_ddp_get_info,
+       (cmdline_parse_inst_t *)&cmd_cfg_input_set,
+       (cmdline_parse_inst_t *)&cmd_clear_input_set,
        (cmdline_parse_inst_t *)&cmd_show_vf_stats,
        (cmdline_parse_inst_t *)&cmd_clear_vf_stats,
        (cmdline_parse_inst_t *)&cmd_ptype_mapping_get,