app/testpmd: fix commands for some offloads
[dpdk.git] / app / test-pmd / cmdline.c
index 8f97067..589121d 100644 (file)
@@ -75,6 +75,7 @@
 #include "testpmd.h"
 #include "cmdline_mtr.h"
 #include "cmdline_tm.h"
+#include "bpf_cmd.h"
 
 static struct cmdline *testpmd_cl;
 
@@ -780,6 +781,27 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "port tm hierarchy commit (port_id) (clean_on_fail)\n"
                        "       Commit tm hierarchy.\n\n"
 
+                       "vxlan ip-version (ipv4|ipv6) vni (vni) udp-src"
+                       " (udp-src) udp-dst (udp-dst) ip-src (ip-src) ip-dst"
+                       " (ip-dst) eth-src (eth-src) eth-dst (eth-dst)\n"
+                       "       Configure the VXLAN encapsulation for flows.\n\n"
+
+                       "vxlan-with-vlan ip-version (ipv4|ipv6) vni (vni)"
+                       " udp-src (udp-src) udp-dst (udp-dst) ip-src (ip-src)"
+                       " ip-dst (ip-dst) vlan-tci (vlan-tci) eth-src (eth-src)"
+                       " eth-dst (eth-dst)\n"
+                       "       Configure the VXLAN encapsulation for flows.\n\n"
+
+                       "nvgre ip-version (ipv4|ipv6) tni (tni) ip-src"
+                       " (ip-src) ip-dst (ip-dst) eth-src (eth-src) eth-dst"
+                       " (eth-dst)\n"
+                       "       Configure the NVGRE encapsulation for flows.\n\n"
+
+                       "nvgre-with-vlan ip-version (ipv4|ipv6) tni (tni)"
+                       " ip-src (ip-src) ip-dst (ip-dst) vlan-tci (vlan-tci)"
+                       " eth-src (eth-src) eth-dst (eth-dst)\n"
+                       "       Configure the NVGRE encapsulation for flows.\n\n"
+
                        , list_pkt_forwarding_modes()
                );
        }
@@ -1875,11 +1897,13 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result,
                port = &ports[pid];
                rx_offloads = port->dev_conf.rxmode.offloads;
                if (!strcmp(res->name, "crc-strip")) {
-                       if (!strcmp(res->value, "on"))
+                       if (!strcmp(res->value, "on")) {
                                rx_offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
-                       else if (!strcmp(res->value, "off"))
+                               rx_offloads &= ~DEV_RX_OFFLOAD_KEEP_CRC;
+                       } else if (!strcmp(res->value, "off")) {
+                               rx_offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
                                rx_offloads &= ~DEV_RX_OFFLOAD_CRC_STRIP;
-                       else {
+                       else {
                                printf("Unknown parameter\n");
                                return;
                        }
@@ -2057,11 +2081,21 @@ cmd_config_rss_parsed(void *parsed_result,
        rss_conf.rss_key = NULL;
        /* Update global configuration for RSS types. */
        RTE_ETH_FOREACH_DEV(i) {
-               if (use_default) {
-                       rte_eth_dev_info_get(i, &dev_info);
+               struct rte_eth_rss_conf local_rss_conf;
+
+               rte_eth_dev_info_get(i, &dev_info);
+               if (use_default)
                        rss_conf.rss_hf = dev_info.flow_type_rss_offloads;
+
+               local_rss_conf = rss_conf;
+               local_rss_conf.rss_hf = rss_conf.rss_hf &
+                       dev_info.flow_type_rss_offloads;
+               if (local_rss_conf.rss_hf != rss_conf.rss_hf) {
+                       printf("Port %u modified RSS hash function based on hardware support,"
+                               "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+                               i, rss_conf.rss_hf, local_rss_conf.rss_hf);
                }
-               diag = rte_eth_dev_rss_hash_update(i, &rss_conf);
+               diag = rte_eth_dev_rss_hash_update(i, &local_rss_conf);
                if (diag < 0) {
                        all_updated = 0;
                        printf("Configuration of RSS hash at ethernet port %d "
@@ -4791,8 +4825,9 @@ cmd_gso_show_parsed(void *parsed_result,
                if (gso_ports[res->cmd_pid].enable) {
                        printf("Max GSO'd packet size: %uB\n"
                                        "Supported GSO types: TCP/IPv4, "
-                                       "VxLAN with inner TCP/IPv4 packet, "
-                                       "GRE with inner TCP/IPv4  packet\n",
+                                       "UDP/IPv4, VxLAN with inner "
+                                       "TCP/IPv4 packet, GRE with inner "
+                                       "TCP/IPv4 packet\n",
                                        gso_max_segment_size);
                } else
                        printf("GSO is not enabled on Port %u\n", res->cmd_pid);
@@ -14805,20 +14840,14 @@ static void cmd_set_port_tm_hierarchy_default_parsed(void *parsed_result,
 
        p = &ports[port_id];
 
-       /* Port tm flag */
-       if (p->softport.tm_flag == 0) {
-               printf("  tm not enabled on port %u (error)\n", port_id);
-               return;
-       }
-
        /* Forward mode: tm */
-       if (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, "tm")) {
-               printf("  tm mode not enabled(error)\n");
+       if (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, "softnic")) {
+               printf("  softnicfwd mode not enabled(error)\n");
                return;
        }
 
        /* Set the default tm hierarchy */
-       p->softport.tm.default_hierarchy_enable = 1;
+       p->softport.default_tm_hierarchy_enable = 1;
 }
 
 cmdline_parse_inst_t cmd_set_port_tm_hierarchy_default = {
@@ -14837,6 +14866,326 @@ cmdline_parse_inst_t cmd_set_port_tm_hierarchy_default = {
 };
 #endif
 
+/** Set VXLAN encapsulation details */
+struct cmd_set_vxlan_result {
+       cmdline_fixed_string_t set;
+       cmdline_fixed_string_t vxlan;
+       cmdline_fixed_string_t pos_token;
+       cmdline_fixed_string_t ip_version;
+       uint32_t vlan_present:1;
+       uint32_t vni;
+       uint16_t udp_src;
+       uint16_t udp_dst;
+       cmdline_ipaddr_t ip_src;
+       cmdline_ipaddr_t ip_dst;
+       uint16_t tci;
+       struct ether_addr eth_src;
+       struct ether_addr eth_dst;
+};
+
+cmdline_parse_token_string_t cmd_set_vxlan_set =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, set, "set");
+cmdline_parse_token_string_t cmd_set_vxlan_vxlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, vxlan, "vxlan");
+cmdline_parse_token_string_t cmd_set_vxlan_vxlan_with_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, vxlan,
+                                "vxlan-with-vlan");
+cmdline_parse_token_string_t cmd_set_vxlan_ip_version =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, pos_token,
+                                "ip-version");
+cmdline_parse_token_string_t cmd_set_vxlan_ip_version_value =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, ip_version,
+                                "ipv4#ipv6");
+cmdline_parse_token_string_t cmd_set_vxlan_vni =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, pos_token,
+                                "vni");
+cmdline_parse_token_num_t cmd_set_vxlan_vni_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_vxlan_result, vni, UINT32);
+cmdline_parse_token_string_t cmd_set_vxlan_udp_src =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, pos_token,
+                                "udp-src");
+cmdline_parse_token_num_t cmd_set_vxlan_udp_src_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_vxlan_result, udp_src, UINT16);
+cmdline_parse_token_string_t cmd_set_vxlan_udp_dst =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, pos_token,
+                                "udp-dst");
+cmdline_parse_token_num_t cmd_set_vxlan_udp_dst_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_vxlan_result, udp_dst, UINT16);
+cmdline_parse_token_string_t cmd_set_vxlan_ip_src =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, pos_token,
+                                "ip-src");
+cmdline_parse_token_ipaddr_t cmd_set_vxlan_ip_src_value =
+       TOKEN_IPADDR_INITIALIZER(struct cmd_set_vxlan_result, ip_src);
+cmdline_parse_token_string_t cmd_set_vxlan_ip_dst =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, pos_token,
+                                "ip-dst");
+cmdline_parse_token_ipaddr_t cmd_set_vxlan_ip_dst_value =
+       TOKEN_IPADDR_INITIALIZER(struct cmd_set_vxlan_result, ip_dst);
+cmdline_parse_token_string_t cmd_set_vxlan_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, pos_token,
+                                "vlan-tci");
+cmdline_parse_token_num_t cmd_set_vxlan_vlan_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_vxlan_result, tci, UINT16);
+cmdline_parse_token_string_t cmd_set_vxlan_eth_src =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, pos_token,
+                                "eth-src");
+cmdline_parse_token_etheraddr_t cmd_set_vxlan_eth_src_value =
+       TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_vxlan_result, eth_src);
+cmdline_parse_token_string_t cmd_set_vxlan_eth_dst =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, pos_token,
+                                "eth-dst");
+cmdline_parse_token_etheraddr_t cmd_set_vxlan_eth_dst_value =
+       TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_vxlan_result, eth_dst);
+
+static void cmd_set_vxlan_parsed(void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_set_vxlan_result *res = parsed_result;
+       union {
+               uint32_t vxlan_id;
+               uint8_t vni[4];
+       } id = {
+               .vxlan_id = rte_cpu_to_be_32(res->vni) & RTE_BE32(0x00ffffff),
+       };
+
+       if (strcmp(res->vxlan, "vxlan") == 0)
+               vxlan_encap_conf.select_vlan = 0;
+       else if (strcmp(res->vxlan, "vxlan-with-vlan") == 0)
+               vxlan_encap_conf.select_vlan = 1;
+       if (strcmp(res->ip_version, "ipv4") == 0)
+               vxlan_encap_conf.select_ipv4 = 1;
+       else if (strcmp(res->ip_version, "ipv6") == 0)
+               vxlan_encap_conf.select_ipv4 = 0;
+       else
+               return;
+       rte_memcpy(vxlan_encap_conf.vni, &id.vni[1], 3);
+       vxlan_encap_conf.udp_src = rte_cpu_to_be_16(res->udp_src);
+       vxlan_encap_conf.udp_dst = rte_cpu_to_be_16(res->udp_dst);
+       if (vxlan_encap_conf.select_ipv4) {
+               IPV4_ADDR_TO_UINT(res->ip_src, vxlan_encap_conf.ipv4_src);
+               IPV4_ADDR_TO_UINT(res->ip_dst, vxlan_encap_conf.ipv4_dst);
+       } else {
+               IPV6_ADDR_TO_ARRAY(res->ip_src, vxlan_encap_conf.ipv6_src);
+               IPV6_ADDR_TO_ARRAY(res->ip_dst, vxlan_encap_conf.ipv6_dst);
+       }
+       if (vxlan_encap_conf.select_vlan)
+               vxlan_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
+       rte_memcpy(vxlan_encap_conf.eth_src, res->eth_src.addr_bytes,
+                  ETHER_ADDR_LEN);
+       rte_memcpy(vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+                  ETHER_ADDR_LEN);
+}
+
+cmdline_parse_inst_t cmd_set_vxlan = {
+       .f = cmd_set_vxlan_parsed,
+       .data = NULL,
+       .help_str = "set vxlan ip-version ipv4|ipv6 vni <vni> udp-src"
+               " <udp-src> udp-dst <udp-dst> ip-src <ip-src> ip-dst <ip-dst>"
+               " eth-src <eth-src> eth-dst <eth-dst>",
+       .tokens = {
+               (void *)&cmd_set_vxlan_set,
+               (void *)&cmd_set_vxlan_vxlan,
+               (void *)&cmd_set_vxlan_ip_version,
+               (void *)&cmd_set_vxlan_ip_version_value,
+               (void *)&cmd_set_vxlan_vni,
+               (void *)&cmd_set_vxlan_vni_value,
+               (void *)&cmd_set_vxlan_udp_src,
+               (void *)&cmd_set_vxlan_udp_src_value,
+               (void *)&cmd_set_vxlan_udp_dst,
+               (void *)&cmd_set_vxlan_udp_dst_value,
+               (void *)&cmd_set_vxlan_ip_src,
+               (void *)&cmd_set_vxlan_ip_src_value,
+               (void *)&cmd_set_vxlan_ip_dst,
+               (void *)&cmd_set_vxlan_ip_dst_value,
+               (void *)&cmd_set_vxlan_eth_src,
+               (void *)&cmd_set_vxlan_eth_src_value,
+               (void *)&cmd_set_vxlan_eth_dst,
+               (void *)&cmd_set_vxlan_eth_dst_value,
+               NULL,
+       },
+};
+
+cmdline_parse_inst_t cmd_set_vxlan_with_vlan = {
+       .f = cmd_set_vxlan_parsed,
+       .data = NULL,
+       .help_str = "set vxlan-with-vlan ip-version ipv4|ipv6 vni <vni>"
+               " udp-src <udp-src> udp-dst <udp-dst> ip-src <ip-src> ip-dst"
+               " <ip-dst> vlan-tci <vlan-tci> eth-src <eth-src> eth-dst"
+               " <eth-dst>",
+       .tokens = {
+               (void *)&cmd_set_vxlan_set,
+               (void *)&cmd_set_vxlan_vxlan_with_vlan,
+               (void *)&cmd_set_vxlan_ip_version,
+               (void *)&cmd_set_vxlan_ip_version_value,
+               (void *)&cmd_set_vxlan_vni,
+               (void *)&cmd_set_vxlan_vni_value,
+               (void *)&cmd_set_vxlan_udp_src,
+               (void *)&cmd_set_vxlan_udp_src_value,
+               (void *)&cmd_set_vxlan_udp_dst,
+               (void *)&cmd_set_vxlan_udp_dst_value,
+               (void *)&cmd_set_vxlan_ip_src,
+               (void *)&cmd_set_vxlan_ip_src_value,
+               (void *)&cmd_set_vxlan_ip_dst,
+               (void *)&cmd_set_vxlan_ip_dst_value,
+               (void *)&cmd_set_vxlan_vlan,
+               (void *)&cmd_set_vxlan_vlan_value,
+               (void *)&cmd_set_vxlan_eth_src,
+               (void *)&cmd_set_vxlan_eth_src_value,
+               (void *)&cmd_set_vxlan_eth_dst,
+               (void *)&cmd_set_vxlan_eth_dst_value,
+               NULL,
+       },
+};
+
+/** Set NVGRE encapsulation details */
+struct cmd_set_nvgre_result {
+       cmdline_fixed_string_t set;
+       cmdline_fixed_string_t nvgre;
+       cmdline_fixed_string_t pos_token;
+       cmdline_fixed_string_t ip_version;
+       uint32_t tni;
+       cmdline_ipaddr_t ip_src;
+       cmdline_ipaddr_t ip_dst;
+       uint16_t tci;
+       struct ether_addr eth_src;
+       struct ether_addr eth_dst;
+};
+
+cmdline_parse_token_string_t cmd_set_nvgre_set =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_nvgre_result, set, "set");
+cmdline_parse_token_string_t cmd_set_nvgre_nvgre =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_nvgre_result, nvgre, "nvgre");
+cmdline_parse_token_string_t cmd_set_nvgre_nvgre_with_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_nvgre_result, nvgre,
+                                "nvgre-with-vlan");
+cmdline_parse_token_string_t cmd_set_nvgre_ip_version =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_nvgre_result, pos_token,
+                                "ip-version");
+cmdline_parse_token_string_t cmd_set_nvgre_ip_version_value =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_nvgre_result, ip_version,
+                                "ipv4#ipv6");
+cmdline_parse_token_string_t cmd_set_nvgre_tni =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_nvgre_result, pos_token,
+                                "tni");
+cmdline_parse_token_num_t cmd_set_nvgre_tni_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_nvgre_result, tni, UINT32);
+cmdline_parse_token_string_t cmd_set_nvgre_ip_src =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_nvgre_result, pos_token,
+                                "ip-src");
+cmdline_parse_token_num_t cmd_set_nvgre_ip_src_value =
+       TOKEN_IPADDR_INITIALIZER(struct cmd_set_nvgre_result, ip_src);
+cmdline_parse_token_string_t cmd_set_nvgre_ip_dst =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_nvgre_result, pos_token,
+                                "ip-dst");
+cmdline_parse_token_ipaddr_t cmd_set_nvgre_ip_dst_value =
+       TOKEN_IPADDR_INITIALIZER(struct cmd_set_nvgre_result, ip_dst);
+cmdline_parse_token_string_t cmd_set_nvgre_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_nvgre_result, pos_token,
+                                "vlan-tci");
+cmdline_parse_token_num_t cmd_set_nvgre_vlan_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_nvgre_result, tci, UINT16);
+cmdline_parse_token_string_t cmd_set_nvgre_eth_src =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_nvgre_result, pos_token,
+                                "eth-src");
+cmdline_parse_token_etheraddr_t cmd_set_nvgre_eth_src_value =
+       TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_nvgre_result, eth_src);
+cmdline_parse_token_string_t cmd_set_nvgre_eth_dst =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_nvgre_result, pos_token,
+                                "eth-dst");
+cmdline_parse_token_etheraddr_t cmd_set_nvgre_eth_dst_value =
+       TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_nvgre_result, eth_dst);
+
+static void cmd_set_nvgre_parsed(void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_set_nvgre_result *res = parsed_result;
+       union {
+               uint32_t nvgre_tni;
+               uint8_t tni[4];
+       } id = {
+               .nvgre_tni = rte_cpu_to_be_32(res->tni) & RTE_BE32(0x00ffffff),
+       };
+
+       if (strcmp(res->nvgre, "nvgre") == 0)
+               nvgre_encap_conf.select_vlan = 0;
+       else if (strcmp(res->nvgre, "nvgre-with-vlan") == 0)
+               nvgre_encap_conf.select_vlan = 1;
+       if (strcmp(res->ip_version, "ipv4") == 0)
+               nvgre_encap_conf.select_ipv4 = 1;
+       else if (strcmp(res->ip_version, "ipv6") == 0)
+               nvgre_encap_conf.select_ipv4 = 0;
+       else
+               return;
+       rte_memcpy(nvgre_encap_conf.tni, &id.tni[1], 3);
+       if (nvgre_encap_conf.select_ipv4) {
+               IPV4_ADDR_TO_UINT(res->ip_src, nvgre_encap_conf.ipv4_src);
+               IPV4_ADDR_TO_UINT(res->ip_dst, nvgre_encap_conf.ipv4_dst);
+       } else {
+               IPV6_ADDR_TO_ARRAY(res->ip_src, nvgre_encap_conf.ipv6_src);
+               IPV6_ADDR_TO_ARRAY(res->ip_dst, nvgre_encap_conf.ipv6_dst);
+       }
+       if (nvgre_encap_conf.select_vlan)
+               nvgre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
+       rte_memcpy(nvgre_encap_conf.eth_src, res->eth_src.addr_bytes,
+                  ETHER_ADDR_LEN);
+       rte_memcpy(nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+                  ETHER_ADDR_LEN);
+}
+
+cmdline_parse_inst_t cmd_set_nvgre = {
+       .f = cmd_set_nvgre_parsed,
+       .data = NULL,
+       .help_str = "set nvgre ip-version <ipv4|ipv6> tni <tni> ip-src"
+               " <ip-src> ip-dst <ip-dst> eth-src <eth-src>"
+               " eth-dst <eth-dst>",
+       .tokens = {
+               (void *)&cmd_set_nvgre_set,
+               (void *)&cmd_set_nvgre_nvgre,
+               (void *)&cmd_set_nvgre_ip_version,
+               (void *)&cmd_set_nvgre_ip_version_value,
+               (void *)&cmd_set_nvgre_tni,
+               (void *)&cmd_set_nvgre_tni_value,
+               (void *)&cmd_set_nvgre_ip_src,
+               (void *)&cmd_set_nvgre_ip_src_value,
+               (void *)&cmd_set_nvgre_ip_dst,
+               (void *)&cmd_set_nvgre_ip_dst_value,
+               (void *)&cmd_set_nvgre_eth_src,
+               (void *)&cmd_set_nvgre_eth_src_value,
+               (void *)&cmd_set_nvgre_eth_dst,
+               (void *)&cmd_set_nvgre_eth_dst_value,
+               NULL,
+       },
+};
+
+cmdline_parse_inst_t cmd_set_nvgre_with_vlan = {
+       .f = cmd_set_nvgre_parsed,
+       .data = NULL,
+       .help_str = "set nvgre-with-vlan ip-version <ipv4|ipv6> tni <tni>"
+               " ip-src <ip-src> ip-dst <ip-dst> vlan-tci <vlan-tci>"
+               " eth-src <eth-src> eth-dst <eth-dst>",
+       .tokens = {
+               (void *)&cmd_set_nvgre_set,
+               (void *)&cmd_set_nvgre_nvgre_with_vlan,
+               (void *)&cmd_set_nvgre_ip_version,
+               (void *)&cmd_set_nvgre_ip_version_value,
+               (void *)&cmd_set_nvgre_tni,
+               (void *)&cmd_set_nvgre_tni_value,
+               (void *)&cmd_set_nvgre_ip_src,
+               (void *)&cmd_set_nvgre_ip_src_value,
+               (void *)&cmd_set_nvgre_ip_dst,
+               (void *)&cmd_set_nvgre_ip_dst_value,
+               (void *)&cmd_set_nvgre_vlan,
+               (void *)&cmd_set_nvgre_vlan_value,
+               (void *)&cmd_set_nvgre_eth_src,
+               (void *)&cmd_set_nvgre_eth_src_value,
+               (void *)&cmd_set_nvgre_eth_dst,
+               (void *)&cmd_set_nvgre_eth_dst_value,
+               NULL,
+       },
+};
+
 /* Strict link priority scheduling mode setting */
 static void
 cmd_strict_link_prio_parsed(
@@ -16454,6 +16803,805 @@ cmdline_parse_inst_t cmd_load_from_file = {
        },
 };
 
+/* Get Rx offloads capabilities */
+struct cmd_rx_offload_get_capa_result {
+       cmdline_fixed_string_t show;
+       cmdline_fixed_string_t port;
+       portid_t port_id;
+       cmdline_fixed_string_t rx_offload;
+       cmdline_fixed_string_t capabilities;
+};
+
+cmdline_parse_token_string_t cmd_rx_offload_get_capa_show =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_rx_offload_get_capa_result,
+                show, "show");
+cmdline_parse_token_string_t cmd_rx_offload_get_capa_port =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_rx_offload_get_capa_result,
+                port, "port");
+cmdline_parse_token_num_t cmd_rx_offload_get_capa_port_id =
+       TOKEN_NUM_INITIALIZER
+               (struct cmd_rx_offload_get_capa_result,
+                port_id, UINT16);
+cmdline_parse_token_string_t cmd_rx_offload_get_capa_rx_offload =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_rx_offload_get_capa_result,
+                rx_offload, "rx_offload");
+cmdline_parse_token_string_t cmd_rx_offload_get_capa_capabilities =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_rx_offload_get_capa_result,
+                capabilities, "capabilities");
+
+static void
+print_rx_offloads(uint64_t offloads)
+{
+       uint64_t single_offload;
+       int begin;
+       int end;
+       int bit;
+
+       if (offloads == 0)
+               return;
+
+       begin = __builtin_ctzll(offloads);
+       end = sizeof(offloads) * CHAR_BIT - __builtin_clzll(offloads);
+
+       single_offload = 1 << begin;
+       for (bit = begin; bit < end; bit++) {
+               if (offloads & single_offload)
+                       printf(" %s",
+                              rte_eth_dev_rx_offload_name(single_offload));
+               single_offload <<= 1;
+       }
+}
+
+static void
+cmd_rx_offload_get_capa_parsed(
+       void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_rx_offload_get_capa_result *res = parsed_result;
+       struct rte_eth_dev_info dev_info;
+       portid_t port_id = res->port_id;
+       uint64_t queue_offloads;
+       uint64_t port_offloads;
+
+       rte_eth_dev_info_get(port_id, &dev_info);
+       queue_offloads = dev_info.rx_queue_offload_capa;
+       port_offloads = dev_info.rx_offload_capa ^ queue_offloads;
+
+       printf("Rx Offloading Capabilities of port %d :\n", port_id);
+       printf("  Per Queue :");
+       print_rx_offloads(queue_offloads);
+
+       printf("\n");
+       printf("  Per Port  :");
+       print_rx_offloads(port_offloads);
+       printf("\n\n");
+}
+
+cmdline_parse_inst_t cmd_rx_offload_get_capa = {
+       .f = cmd_rx_offload_get_capa_parsed,
+       .data = NULL,
+       .help_str = "show port <port_id> rx_offload capabilities",
+       .tokens = {
+               (void *)&cmd_rx_offload_get_capa_show,
+               (void *)&cmd_rx_offload_get_capa_port,
+               (void *)&cmd_rx_offload_get_capa_port_id,
+               (void *)&cmd_rx_offload_get_capa_rx_offload,
+               (void *)&cmd_rx_offload_get_capa_capabilities,
+               NULL,
+       }
+};
+
+/* Get Rx offloads configuration */
+struct cmd_rx_offload_get_configuration_result {
+       cmdline_fixed_string_t show;
+       cmdline_fixed_string_t port;
+       portid_t port_id;
+       cmdline_fixed_string_t rx_offload;
+       cmdline_fixed_string_t configuration;
+};
+
+cmdline_parse_token_string_t cmd_rx_offload_get_configuration_show =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_rx_offload_get_configuration_result,
+                show, "show");
+cmdline_parse_token_string_t cmd_rx_offload_get_configuration_port =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_rx_offload_get_configuration_result,
+                port, "port");
+cmdline_parse_token_num_t cmd_rx_offload_get_configuration_port_id =
+       TOKEN_NUM_INITIALIZER
+               (struct cmd_rx_offload_get_configuration_result,
+                port_id, UINT16);
+cmdline_parse_token_string_t cmd_rx_offload_get_configuration_rx_offload =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_rx_offload_get_configuration_result,
+                rx_offload, "rx_offload");
+cmdline_parse_token_string_t cmd_rx_offload_get_configuration_configuration =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_rx_offload_get_configuration_result,
+                configuration, "configuration");
+
+static void
+cmd_rx_offload_get_configuration_parsed(
+       void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_rx_offload_get_configuration_result *res = parsed_result;
+       struct rte_eth_dev_info dev_info;
+       portid_t port_id = res->port_id;
+       struct rte_port *port = &ports[port_id];
+       uint64_t port_offloads;
+       uint64_t queue_offloads;
+       uint16_t nb_rx_queues;
+       int q;
+
+       printf("Rx Offloading Configuration of port %d :\n", port_id);
+
+       port_offloads = port->dev_conf.rxmode.offloads;
+       printf("  Port :");
+       print_rx_offloads(port_offloads);
+       printf("\n");
+
+       rte_eth_dev_info_get(port_id, &dev_info);
+       nb_rx_queues = dev_info.nb_rx_queues;
+       for (q = 0; q < nb_rx_queues; q++) {
+               queue_offloads = port->rx_conf[q].offloads;
+               printf("  Queue[%2d] :", q);
+               print_rx_offloads(queue_offloads);
+               printf("\n");
+       }
+       printf("\n");
+}
+
+cmdline_parse_inst_t cmd_rx_offload_get_configuration = {
+       .f = cmd_rx_offload_get_configuration_parsed,
+       .data = NULL,
+       .help_str = "show port <port_id> rx_offload configuration",
+       .tokens = {
+               (void *)&cmd_rx_offload_get_configuration_show,
+               (void *)&cmd_rx_offload_get_configuration_port,
+               (void *)&cmd_rx_offload_get_configuration_port_id,
+               (void *)&cmd_rx_offload_get_configuration_rx_offload,
+               (void *)&cmd_rx_offload_get_configuration_configuration,
+               NULL,
+       }
+};
+
+/* Enable/Disable a per port offloading */
+struct cmd_config_per_port_rx_offload_result {
+       cmdline_fixed_string_t port;
+       cmdline_fixed_string_t config;
+       portid_t port_id;
+       cmdline_fixed_string_t rx_offload;
+       cmdline_fixed_string_t offload;
+       cmdline_fixed_string_t on_off;
+};
+
+cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_port =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_port_rx_offload_result,
+                port, "port");
+cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_config =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_port_rx_offload_result,
+                config, "config");
+cmdline_parse_token_num_t cmd_config_per_port_rx_offload_result_port_id =
+       TOKEN_NUM_INITIALIZER
+               (struct cmd_config_per_port_rx_offload_result,
+                port_id, UINT16);
+cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_rx_offload =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_port_rx_offload_result,
+                rx_offload, "rx_offload");
+cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_offload =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_port_rx_offload_result,
+                offload, "vlan_strip#ipv4_cksum#udp_cksum#tcp_cksum#tcp_lro#"
+                          "qinq_strip#outer_ipv4_cksum#macsec_strip#"
+                          "header_split#vlan_filter#vlan_extend#jumbo_frame#"
+                          "crc_strip#scatter#timestamp#security#keep_crc");
+cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_on_off =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_port_rx_offload_result,
+                on_off, "on#off");
+
+static uint64_t
+search_rx_offload(const char *name)
+{
+       uint64_t single_offload;
+       const char *single_name;
+       int found = 0;
+       unsigned int bit;
+
+       single_offload = 1;
+       for (bit = 0; bit < sizeof(single_offload) * CHAR_BIT; bit++) {
+               single_name = rte_eth_dev_rx_offload_name(single_offload);
+               if (!strcasecmp(single_name, name)) {
+                       found = 1;
+                       break;
+               } else if (!strcasecmp(single_name, "UNKNOWN"))
+                       break;
+               else if (single_name == NULL)
+                       break;
+               single_offload <<= 1;
+       }
+
+       if (found)
+               return single_offload;
+
+       return 0;
+}
+
+static void
+cmd_config_per_port_rx_offload_parsed(void *parsed_result,
+                               __attribute__((unused)) struct cmdline *cl,
+                               __attribute__((unused)) void *data)
+{
+       struct cmd_config_per_port_rx_offload_result *res = parsed_result;
+       portid_t port_id = res->port_id;
+       struct rte_eth_dev_info dev_info;
+       struct rte_port *port = &ports[port_id];
+       uint64_t single_offload;
+       uint16_t nb_rx_queues;
+       int q;
+
+       if (port->port_status != RTE_PORT_STOPPED) {
+               printf("Error: Can't config offload when Port %d "
+                      "is not stopped\n", port_id);
+               return;
+       }
+
+       single_offload = search_rx_offload(res->offload);
+       if (single_offload == 0) {
+               printf("Unknown offload name: %s\n", res->offload);
+               return;
+       }
+
+       rte_eth_dev_info_get(port_id, &dev_info);
+       nb_rx_queues = dev_info.nb_rx_queues;
+       if (!strcmp(res->on_off, "on")) {
+               port->dev_conf.rxmode.offloads |= single_offload;
+               for (q = 0; q < nb_rx_queues; q++)
+                       port->rx_conf[q].offloads |= single_offload;
+       } else {
+               port->dev_conf.rxmode.offloads &= ~single_offload;
+               for (q = 0; q < nb_rx_queues; q++)
+                       port->rx_conf[q].offloads &= ~single_offload;
+       }
+
+       cmd_reconfig_device_queue(port_id, 1, 1);
+}
+
+cmdline_parse_inst_t cmd_config_per_port_rx_offload = {
+       .f = cmd_config_per_port_rx_offload_parsed,
+       .data = NULL,
+       .help_str = "port config <port_id> rx_offload vlan_strip|ipv4_cksum|"
+                   "udp_cksum|tcp_cksum|tcp_lro|qinq_strip|outer_ipv4_cksum|"
+                   "macsec_strip|header_split|vlan_filter|vlan_extend|"
+                   "jumbo_frame|crc_strip|scatter|timestamp|security|keep_crc "
+                   "on|off",
+       .tokens = {
+               (void *)&cmd_config_per_port_rx_offload_result_port,
+               (void *)&cmd_config_per_port_rx_offload_result_config,
+               (void *)&cmd_config_per_port_rx_offload_result_port_id,
+               (void *)&cmd_config_per_port_rx_offload_result_rx_offload,
+               (void *)&cmd_config_per_port_rx_offload_result_offload,
+               (void *)&cmd_config_per_port_rx_offload_result_on_off,
+               NULL,
+       }
+};
+
+/* Enable/Disable a per queue offloading */
+struct cmd_config_per_queue_rx_offload_result {
+       cmdline_fixed_string_t port;
+       portid_t port_id;
+       cmdline_fixed_string_t rxq;
+       uint16_t queue_id;
+       cmdline_fixed_string_t rx_offload;
+       cmdline_fixed_string_t offload;
+       cmdline_fixed_string_t on_off;
+};
+
+cmdline_parse_token_string_t cmd_config_per_queue_rx_offload_result_port =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_queue_rx_offload_result,
+                port, "port");
+cmdline_parse_token_num_t cmd_config_per_queue_rx_offload_result_port_id =
+       TOKEN_NUM_INITIALIZER
+               (struct cmd_config_per_queue_rx_offload_result,
+                port_id, UINT16);
+cmdline_parse_token_string_t cmd_config_per_queue_rx_offload_result_rxq =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_queue_rx_offload_result,
+                rxq, "rxq");
+cmdline_parse_token_num_t cmd_config_per_queue_rx_offload_result_queue_id =
+       TOKEN_NUM_INITIALIZER
+               (struct cmd_config_per_queue_rx_offload_result,
+                queue_id, UINT16);
+cmdline_parse_token_string_t cmd_config_per_queue_rx_offload_result_rxoffload =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_queue_rx_offload_result,
+                rx_offload, "rx_offload");
+cmdline_parse_token_string_t cmd_config_per_queue_rx_offload_result_offload =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_queue_rx_offload_result,
+                offload, "vlan_strip#ipv4_cksum#udp_cksum#tcp_cksum#tcp_lro#"
+                          "qinq_strip#outer_ipv4_cksum#macsec_strip#"
+                          "header_split#vlan_filter#vlan_extend#jumbo_frame#"
+                          "crc_strip#scatter#timestamp#security#keep_crc");
+cmdline_parse_token_string_t cmd_config_per_queue_rx_offload_result_on_off =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_queue_rx_offload_result,
+                on_off, "on#off");
+
+static void
+cmd_config_per_queue_rx_offload_parsed(void *parsed_result,
+                               __attribute__((unused)) struct cmdline *cl,
+                               __attribute__((unused)) void *data)
+{
+       struct cmd_config_per_queue_rx_offload_result *res = parsed_result;
+       struct rte_eth_dev_info dev_info;
+       portid_t port_id = res->port_id;
+       uint16_t queue_id = res->queue_id;
+       struct rte_port *port = &ports[port_id];
+       uint64_t single_offload;
+
+       if (port->port_status != RTE_PORT_STOPPED) {
+               printf("Error: Can't config offload when Port %d "
+                      "is not stopped\n", port_id);
+               return;
+       }
+
+       rte_eth_dev_info_get(port_id, &dev_info);
+       if (queue_id >= dev_info.nb_rx_queues) {
+               printf("Error: input queue_id should be 0 ... "
+                      "%d\n", dev_info.nb_rx_queues - 1);
+               return;
+       }
+
+       single_offload = search_rx_offload(res->offload);
+       if (single_offload == 0) {
+               printf("Unknown offload name: %s\n", res->offload);
+               return;
+       }
+
+       if (!strcmp(res->on_off, "on"))
+               port->rx_conf[queue_id].offloads |= single_offload;
+       else
+               port->rx_conf[queue_id].offloads &= ~single_offload;
+
+       cmd_reconfig_device_queue(port_id, 1, 1);
+}
+
+cmdline_parse_inst_t cmd_config_per_queue_rx_offload = {
+       .f = cmd_config_per_queue_rx_offload_parsed,
+       .data = NULL,
+       .help_str = "port <port_id> rxq <queue_id> rx_offload "
+                   "vlan_strip|ipv4_cksum|"
+                   "udp_cksum|tcp_cksum|tcp_lro|qinq_strip|outer_ipv4_cksum|"
+                   "macsec_strip|header_split|vlan_filter|vlan_extend|"
+                   "jumbo_frame|crc_strip|scatter|timestamp|security|keep_crc "
+                   "on|off",
+       .tokens = {
+               (void *)&cmd_config_per_queue_rx_offload_result_port,
+               (void *)&cmd_config_per_queue_rx_offload_result_port_id,
+               (void *)&cmd_config_per_queue_rx_offload_result_rxq,
+               (void *)&cmd_config_per_queue_rx_offload_result_queue_id,
+               (void *)&cmd_config_per_queue_rx_offload_result_rxoffload,
+               (void *)&cmd_config_per_queue_rx_offload_result_offload,
+               (void *)&cmd_config_per_queue_rx_offload_result_on_off,
+               NULL,
+       }
+};
+
+/* Get Tx offloads capabilities */
+struct cmd_tx_offload_get_capa_result {
+       cmdline_fixed_string_t show;
+       cmdline_fixed_string_t port;
+       portid_t port_id;
+       cmdline_fixed_string_t tx_offload;
+       cmdline_fixed_string_t capabilities;
+};
+
+cmdline_parse_token_string_t cmd_tx_offload_get_capa_show =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_tx_offload_get_capa_result,
+                show, "show");
+cmdline_parse_token_string_t cmd_tx_offload_get_capa_port =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_tx_offload_get_capa_result,
+                port, "port");
+cmdline_parse_token_num_t cmd_tx_offload_get_capa_port_id =
+       TOKEN_NUM_INITIALIZER
+               (struct cmd_tx_offload_get_capa_result,
+                port_id, UINT16);
+cmdline_parse_token_string_t cmd_tx_offload_get_capa_tx_offload =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_tx_offload_get_capa_result,
+                tx_offload, "tx_offload");
+cmdline_parse_token_string_t cmd_tx_offload_get_capa_capabilities =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_tx_offload_get_capa_result,
+                capabilities, "capabilities");
+
+static void
+print_tx_offloads(uint64_t offloads)
+{
+       uint64_t single_offload;
+       int begin;
+       int end;
+       int bit;
+
+       if (offloads == 0)
+               return;
+
+       begin = __builtin_ctzll(offloads);
+       end = sizeof(offloads) * CHAR_BIT - __builtin_clzll(offloads);
+
+       single_offload = 1 << begin;
+       for (bit = begin; bit < end; bit++) {
+               if (offloads & single_offload)
+                       printf(" %s",
+                              rte_eth_dev_tx_offload_name(single_offload));
+               single_offload <<= 1;
+       }
+}
+
+static void
+cmd_tx_offload_get_capa_parsed(
+       void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_tx_offload_get_capa_result *res = parsed_result;
+       struct rte_eth_dev_info dev_info;
+       portid_t port_id = res->port_id;
+       uint64_t queue_offloads;
+       uint64_t port_offloads;
+
+       rte_eth_dev_info_get(port_id, &dev_info);
+       queue_offloads = dev_info.tx_queue_offload_capa;
+       port_offloads = dev_info.tx_offload_capa ^ queue_offloads;
+
+       printf("Tx Offloading Capabilities of port %d :\n", port_id);
+       printf("  Per Queue :");
+       print_tx_offloads(queue_offloads);
+
+       printf("\n");
+       printf("  Per Port  :");
+       print_tx_offloads(port_offloads);
+       printf("\n\n");
+}
+
+cmdline_parse_inst_t cmd_tx_offload_get_capa = {
+       .f = cmd_tx_offload_get_capa_parsed,
+       .data = NULL,
+       .help_str = "show port <port_id> tx_offload capabilities",
+       .tokens = {
+               (void *)&cmd_tx_offload_get_capa_show,
+               (void *)&cmd_tx_offload_get_capa_port,
+               (void *)&cmd_tx_offload_get_capa_port_id,
+               (void *)&cmd_tx_offload_get_capa_tx_offload,
+               (void *)&cmd_tx_offload_get_capa_capabilities,
+               NULL,
+       }
+};
+
+/* Get Tx offloads configuration */
+struct cmd_tx_offload_get_configuration_result {
+       cmdline_fixed_string_t show;
+       cmdline_fixed_string_t port;
+       portid_t port_id;
+       cmdline_fixed_string_t tx_offload;
+       cmdline_fixed_string_t configuration;
+};
+
+cmdline_parse_token_string_t cmd_tx_offload_get_configuration_show =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_tx_offload_get_configuration_result,
+                show, "show");
+cmdline_parse_token_string_t cmd_tx_offload_get_configuration_port =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_tx_offload_get_configuration_result,
+                port, "port");
+cmdline_parse_token_num_t cmd_tx_offload_get_configuration_port_id =
+       TOKEN_NUM_INITIALIZER
+               (struct cmd_tx_offload_get_configuration_result,
+                port_id, UINT16);
+cmdline_parse_token_string_t cmd_tx_offload_get_configuration_tx_offload =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_tx_offload_get_configuration_result,
+                tx_offload, "tx_offload");
+cmdline_parse_token_string_t cmd_tx_offload_get_configuration_configuration =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_tx_offload_get_configuration_result,
+                configuration, "configuration");
+
+static void
+cmd_tx_offload_get_configuration_parsed(
+       void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_tx_offload_get_configuration_result *res = parsed_result;
+       struct rte_eth_dev_info dev_info;
+       portid_t port_id = res->port_id;
+       struct rte_port *port = &ports[port_id];
+       uint64_t port_offloads;
+       uint64_t queue_offloads;
+       uint16_t nb_tx_queues;
+       int q;
+
+       printf("Tx Offloading Configuration of port %d :\n", port_id);
+
+       port_offloads = port->dev_conf.txmode.offloads;
+       printf("  Port :");
+       print_tx_offloads(port_offloads);
+       printf("\n");
+
+       rte_eth_dev_info_get(port_id, &dev_info);
+       nb_tx_queues = dev_info.nb_tx_queues;
+       for (q = 0; q < nb_tx_queues; q++) {
+               queue_offloads = port->tx_conf[q].offloads;
+               printf("  Queue[%2d] :", q);
+               print_tx_offloads(queue_offloads);
+               printf("\n");
+       }
+       printf("\n");
+}
+
+cmdline_parse_inst_t cmd_tx_offload_get_configuration = {
+       .f = cmd_tx_offload_get_configuration_parsed,
+       .data = NULL,
+       .help_str = "show port <port_id> tx_offload configuration",
+       .tokens = {
+               (void *)&cmd_tx_offload_get_configuration_show,
+               (void *)&cmd_tx_offload_get_configuration_port,
+               (void *)&cmd_tx_offload_get_configuration_port_id,
+               (void *)&cmd_tx_offload_get_configuration_tx_offload,
+               (void *)&cmd_tx_offload_get_configuration_configuration,
+               NULL,
+       }
+};
+
+/* Enable/Disable a per port offloading */
+struct cmd_config_per_port_tx_offload_result {
+       cmdline_fixed_string_t port;
+       cmdline_fixed_string_t config;
+       portid_t port_id;
+       cmdline_fixed_string_t tx_offload;
+       cmdline_fixed_string_t offload;
+       cmdline_fixed_string_t on_off;
+};
+
+cmdline_parse_token_string_t cmd_config_per_port_tx_offload_result_port =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_port_tx_offload_result,
+                port, "port");
+cmdline_parse_token_string_t cmd_config_per_port_tx_offload_result_config =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_port_tx_offload_result,
+                config, "config");
+cmdline_parse_token_num_t cmd_config_per_port_tx_offload_result_port_id =
+       TOKEN_NUM_INITIALIZER
+               (struct cmd_config_per_port_tx_offload_result,
+                port_id, UINT16);
+cmdline_parse_token_string_t cmd_config_per_port_tx_offload_result_tx_offload =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_port_tx_offload_result,
+                tx_offload, "tx_offload");
+cmdline_parse_token_string_t cmd_config_per_port_tx_offload_result_offload =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_port_tx_offload_result,
+                offload, "vlan_insert#ipv4_cksum#udp_cksum#tcp_cksum#"
+                         "sctp_cksum#tcp_tso#udp_tso#outer_ipv4_cksum#"
+                         "qinq_insert#vxlan_tnl_tso#gre_tnl_tso#"
+                         "ipip_tnl_tso#geneve_tnl_tso#macsec_insert#"
+                         "mt_lockfree#multi_segs#mbuf_fast_free#security");
+cmdline_parse_token_string_t cmd_config_per_port_tx_offload_result_on_off =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_port_tx_offload_result,
+                on_off, "on#off");
+
+static uint64_t
+search_tx_offload(const char *name)
+{
+       uint64_t single_offload;
+       const char *single_name;
+       int found = 0;
+       unsigned int bit;
+
+       single_offload = 1;
+       for (bit = 0; bit < sizeof(single_offload) * CHAR_BIT; bit++) {
+               single_name = rte_eth_dev_tx_offload_name(single_offload);
+               if (!strcasecmp(single_name, name)) {
+                       found = 1;
+                       break;
+               } else if (!strcasecmp(single_name, "UNKNOWN"))
+                       break;
+               else if (single_name == NULL)
+                       break;
+               single_offload <<= 1;
+       }
+
+       if (found)
+               return single_offload;
+
+       return 0;
+}
+
+static void
+cmd_config_per_port_tx_offload_parsed(void *parsed_result,
+                               __attribute__((unused)) struct cmdline *cl,
+                               __attribute__((unused)) void *data)
+{
+       struct cmd_config_per_port_tx_offload_result *res = parsed_result;
+       portid_t port_id = res->port_id;
+       struct rte_eth_dev_info dev_info;
+       struct rte_port *port = &ports[port_id];
+       uint64_t single_offload;
+       uint16_t nb_tx_queues;
+       int q;
+
+       if (port->port_status != RTE_PORT_STOPPED) {
+               printf("Error: Can't config offload when Port %d "
+                      "is not stopped\n", port_id);
+               return;
+       }
+
+       single_offload = search_tx_offload(res->offload);
+       if (single_offload == 0) {
+               printf("Unknown offload name: %s\n", res->offload);
+               return;
+       }
+
+       rte_eth_dev_info_get(port_id, &dev_info);
+       nb_tx_queues = dev_info.nb_tx_queues;
+       if (!strcmp(res->on_off, "on")) {
+               port->dev_conf.txmode.offloads |= single_offload;
+               for (q = 0; q < nb_tx_queues; q++)
+                       port->tx_conf[q].offloads |= single_offload;
+       } else {
+               port->dev_conf.txmode.offloads &= ~single_offload;
+               for (q = 0; q < nb_tx_queues; q++)
+                       port->tx_conf[q].offloads &= ~single_offload;
+       }
+
+       cmd_reconfig_device_queue(port_id, 1, 1);
+}
+
+cmdline_parse_inst_t cmd_config_per_port_tx_offload = {
+       .f = cmd_config_per_port_tx_offload_parsed,
+       .data = NULL,
+       .help_str = "port config <port_id> tx_offload "
+                   "vlan_insert|ipv4_cksum|udp_cksum|tcp_cksum|"
+                   "sctp_cksum|tcp_tso|udp_tso|outer_ipv4_cksum|"
+                   "qinq_insert|vxlan_tnl_tso|gre_tnl_tso|"
+                   "ipip_tnl_tso|geneve_tnl_tso|macsec_insert|"
+                   "mt_lockfree|multi_segs|mbuf_fast_free|security "
+                   "on|off",
+       .tokens = {
+               (void *)&cmd_config_per_port_tx_offload_result_port,
+               (void *)&cmd_config_per_port_tx_offload_result_config,
+               (void *)&cmd_config_per_port_tx_offload_result_port_id,
+               (void *)&cmd_config_per_port_tx_offload_result_tx_offload,
+               (void *)&cmd_config_per_port_tx_offload_result_offload,
+               (void *)&cmd_config_per_port_tx_offload_result_on_off,
+               NULL,
+       }
+};
+
+/* Enable/Disable a per queue offloading */
+struct cmd_config_per_queue_tx_offload_result {
+       cmdline_fixed_string_t port;
+       portid_t port_id;
+       cmdline_fixed_string_t txq;
+       uint16_t queue_id;
+       cmdline_fixed_string_t tx_offload;
+       cmdline_fixed_string_t offload;
+       cmdline_fixed_string_t on_off;
+};
+
+cmdline_parse_token_string_t cmd_config_per_queue_tx_offload_result_port =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_queue_tx_offload_result,
+                port, "port");
+cmdline_parse_token_num_t cmd_config_per_queue_tx_offload_result_port_id =
+       TOKEN_NUM_INITIALIZER
+               (struct cmd_config_per_queue_tx_offload_result,
+                port_id, UINT16);
+cmdline_parse_token_string_t cmd_config_per_queue_tx_offload_result_txq =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_queue_tx_offload_result,
+                txq, "txq");
+cmdline_parse_token_num_t cmd_config_per_queue_tx_offload_result_queue_id =
+       TOKEN_NUM_INITIALIZER
+               (struct cmd_config_per_queue_tx_offload_result,
+                queue_id, UINT16);
+cmdline_parse_token_string_t cmd_config_per_queue_tx_offload_result_txoffload =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_queue_tx_offload_result,
+                tx_offload, "tx_offload");
+cmdline_parse_token_string_t cmd_config_per_queue_tx_offload_result_offload =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_queue_tx_offload_result,
+                offload, "vlan_insert#ipv4_cksum#udp_cksum#tcp_cksum#"
+                         "sctp_cksum#tcp_tso#udp_tso#outer_ipv4_cksum#"
+                         "qinq_insert#vxlan_tnl_tso#gre_tnl_tso#"
+                         "ipip_tnl_tso#geneve_tnl_tso#macsec_insert#"
+                         "mt_lockfree#multi_segs#mbuf_fast_free#security");
+cmdline_parse_token_string_t cmd_config_per_queue_tx_offload_result_on_off =
+       TOKEN_STRING_INITIALIZER
+               (struct cmd_config_per_queue_tx_offload_result,
+                on_off, "on#off");
+
+static void
+cmd_config_per_queue_tx_offload_parsed(void *parsed_result,
+                               __attribute__((unused)) struct cmdline *cl,
+                               __attribute__((unused)) void *data)
+{
+       struct cmd_config_per_queue_tx_offload_result *res = parsed_result;
+       struct rte_eth_dev_info dev_info;
+       portid_t port_id = res->port_id;
+       uint16_t queue_id = res->queue_id;
+       struct rte_port *port = &ports[port_id];
+       uint64_t single_offload;
+
+       if (port->port_status != RTE_PORT_STOPPED) {
+               printf("Error: Can't config offload when Port %d "
+                      "is not stopped\n", port_id);
+               return;
+       }
+
+       rte_eth_dev_info_get(port_id, &dev_info);
+       if (queue_id >= dev_info.nb_tx_queues) {
+               printf("Error: input queue_id should be 0 ... "
+                      "%d\n", dev_info.nb_tx_queues - 1);
+               return;
+       }
+
+       single_offload = search_tx_offload(res->offload);
+       if (single_offload == 0) {
+               printf("Unknown offload name: %s\n", res->offload);
+               return;
+       }
+
+       if (!strcmp(res->on_off, "on"))
+               port->tx_conf[queue_id].offloads |= single_offload;
+       else
+               port->tx_conf[queue_id].offloads &= ~single_offload;
+
+       cmd_reconfig_device_queue(port_id, 1, 1);
+}
+
+cmdline_parse_inst_t cmd_config_per_queue_tx_offload = {
+       .f = cmd_config_per_queue_tx_offload_parsed,
+       .data = NULL,
+       .help_str = "port <port_id> txq <queue_id> tx_offload "
+                   "vlan_insert|ipv4_cksum|udp_cksum|tcp_cksum|"
+                   "sctp_cksum|tcp_tso|udp_tso|outer_ipv4_cksum|"
+                   "qinq_insert|vxlan_tnl_tso|gre_tnl_tso|"
+                   "ipip_tnl_tso|geneve_tnl_tso|macsec_insert|"
+                   "mt_lockfree|multi_segs|mbuf_fast_free|security "
+                   "on|off",
+       .tokens = {
+               (void *)&cmd_config_per_queue_tx_offload_result_port,
+               (void *)&cmd_config_per_queue_tx_offload_result_port_id,
+               (void *)&cmd_config_per_queue_tx_offload_result_txq,
+               (void *)&cmd_config_per_queue_tx_offload_result_queue_id,
+               (void *)&cmd_config_per_queue_tx_offload_result_txoffload,
+               (void *)&cmd_config_per_queue_tx_offload_result_offload,
+               (void *)&cmd_config_per_queue_tx_offload_result_on_off,
+               NULL,
+       }
+};
+
 /* ******************************************************************************** */
 
 /* list of instructions */
@@ -16662,6 +17810,10 @@ cmdline_parse_ctx_t main_ctx[] = {
 #if defined RTE_LIBRTE_PMD_SOFTNIC && defined RTE_LIBRTE_SCHED
        (cmdline_parse_inst_t *)&cmd_set_port_tm_hierarchy_default,
 #endif
+       (cmdline_parse_inst_t *)&cmd_set_vxlan,
+       (cmdline_parse_inst_t *)&cmd_set_vxlan_with_vlan,
+       (cmdline_parse_inst_t *)&cmd_set_nvgre,
+       (cmdline_parse_inst_t *)&cmd_set_nvgre_with_vlan,
        (cmdline_parse_inst_t *)&cmd_ddp_add,
        (cmdline_parse_inst_t *)&cmd_ddp_del,
        (cmdline_parse_inst_t *)&cmd_ddp_get_list,
@@ -16703,6 +17855,18 @@ cmdline_parse_ctx_t main_ctx[] = {
        (cmdline_parse_inst_t *)&cmd_resume_port_tm_node,
        (cmdline_parse_inst_t *)&cmd_port_tm_hierarchy_commit,
        (cmdline_parse_inst_t *)&cmd_cfg_tunnel_udp_port,
+       (cmdline_parse_inst_t *)&cmd_rx_offload_get_capa,
+       (cmdline_parse_inst_t *)&cmd_rx_offload_get_configuration,
+       (cmdline_parse_inst_t *)&cmd_config_per_port_rx_offload,
+       (cmdline_parse_inst_t *)&cmd_config_per_queue_rx_offload,
+       (cmdline_parse_inst_t *)&cmd_tx_offload_get_capa,
+       (cmdline_parse_inst_t *)&cmd_tx_offload_get_configuration,
+       (cmdline_parse_inst_t *)&cmd_config_per_port_tx_offload,
+       (cmdline_parse_inst_t *)&cmd_config_per_queue_tx_offload,
+#ifdef RTE_LIBRTE_BPF
+       (cmdline_parse_inst_t *)&cmd_operate_bpf_ld_parse,
+       (cmdline_parse_inst_t *)&cmd_operate_bpf_unld_parse,
+#endif
        NULL,
 };