net: add rte prefix to ether defines
[dpdk.git] / app / test-pmd / cmdline.c
index 3b469ac..d1e0d44 100644 (file)
@@ -44,7 +44,6 @@
 #include <rte_ethdev.h>
 #include <rte_string_fns.h>
 #include <rte_devargs.h>
-#include <rte_eth_ctrl.h>
 #include <rte_flow.h>
 #include <rte_gro.h>
 
@@ -94,14 +93,15 @@ static void cmd_help_brief_parsed(__attribute__((unused)) void *parsed_result,
                cl,
                "\n"
                "Help is available for the following sections:\n\n"
-               "    help control    : Start and stop forwarding.\n"
-               "    help display    : Displaying port, stats and config "
+               "    help control                    : Start and stop forwarding.\n"
+               "    help display                    : Displaying port, stats and config "
                "information.\n"
-               "    help config     : Configuration information.\n"
-               "    help ports      : Configuring ports.\n"
-               "    help registers  : Reading and setting port registers.\n"
-               "    help filters    : Filters configuration help.\n"
-               "    help all        : All of the above sections.\n\n"
+               "    help config                     : Configuration information.\n"
+               "    help ports                      : Configuring ports.\n"
+               "    help registers                  : Reading and setting port registers.\n"
+               "    help filters                    : Filters configuration help.\n"
+               "    help traffic_management         : Traffic Management commmands.\n"
+               "    help all                        : All of the above sections.\n\n"
        );
 
 }
@@ -210,21 +210,32 @@ static void cmd_help_long_parsed(void *parsed_result,
 
                        "show port meter stats (port_id) (meter_id) (clear)\n"
                        "    Get meter stats on a port\n\n"
-                        "show port tm cap (port_id)\n"
-                        "       Display the port TM capability.\n\n"
 
-                        "show port tm level cap (port_id) (level_id)\n"
-                        "       Display the port TM hierarchical level capability.\n\n"
+                       "show fwd stats all\n"
+                       "    Display statistics for all fwd engines.\n\n"
 
-                        "show port tm node cap (port_id) (node_id)\n"
-                        "       Display the port TM node capability.\n\n"
+                       "clear fwd stats all\n"
+                       "    Clear statistics for all fwd engines.\n\n"
 
-                        "show port tm node type (port_id) (node_id)\n"
-                        "       Display the port TM node type.\n\n"
+                       "show port (port_id) rx_offload capabilities\n"
+                       "    List all per queue and per port Rx offloading"
+                       " capabilities of a port\n\n"
 
-                        "show port tm node stats (port_id) (node_id) (clear)\n"
-                        "       Display the port TM node stats.\n\n"
+                       "show port (port_id) rx_offload configuration\n"
+                       "    List port level and all queue level"
+                       " Rx offloading configuration\n\n"
 
+                       "show port (port_id) tx_offload capabilities\n"
+                       "    List all per queue and per port"
+                       " Tx offloading capabilities of a port\n\n"
+
+                       "show port (port_id) tx_offload configuration\n"
+                       "    List port level and all queue level"
+                       " Tx offloading configuration\n\n"
+
+                       "show port (port_id) tx_metadata\n"
+                       "    Show Tx metadata value set"
+                       " for a specific port\n\n"
                );
        }
 
@@ -280,6 +291,9 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "set portlist (x[,y]*)\n"
                        "    Set the list of forwarding ports.\n\n"
 
+                       "set port setup on (iterator|event)\n"
+                       "    Select how attached port is retrieved for setup.\n\n"
+
                        "set tx loopback (port_id) (on|off)\n"
                        "    Enable or disable tx loopback.\n\n"
 
@@ -368,12 +382,12 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "filtered for VF(s) from port_id.\n\n"
 
                        "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) "
-                       "(inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|"
+                       "(inner_vlan) (vxlan|nvgre|ipingre|vxlan-gpe) (imac-ivlan|imac-ivlan-tenid|"
                        "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n"
                        "   add a tunnel filter of a port.\n\n"
 
                        "tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) "
-                       "(inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|"
+                       "(inner_vlan) (vxlan|nvgre|ipingre|vxlan-gpe) (imac-ivlan|imac-ivlan-tenid|"
                        "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n"
                        "   remove a tunnel filter of a port.\n\n"
 
@@ -639,11 +653,6 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "E-tag set filter del e-tag-id (value) port (port_id)\n"
                        "    Delete an E-tag forwarding filter on a port\n\n"
 
-#if defined RTE_LIBRTE_PMD_SOFTNIC && defined RTE_LIBRTE_SCHED
-                       "set port tm hierarchy default (port_id)\n"
-                       "       Set default traffic Management hierarchy on a port\n\n"
-
-#endif
                        "ddp add (port_id) (profile_path[,backup_profile_path])\n"
                        "    Load a profile package on a port\n\n"
 
@@ -724,61 +733,6 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "show port (port_id) queue-region\n"
                        "    show all queue region related configuration info\n\n"
 
-                       "add port tm node shaper profile (port_id) (shaper_profile_id)"
-                       " (tb_rate) (tb_size) (packet_length_adjust)\n"
-                       "       Add port tm node private shaper profile.\n\n"
-
-                       "del port tm node shaper profile (port_id) (shaper_profile_id)\n"
-                       "       Delete port tm node private shaper profile.\n\n"
-
-                       "add port tm node shared shaper (port_id) (shared_shaper_id)"
-                       " (shaper_profile_id)\n"
-                       "       Add/update port tm node shared shaper.\n\n"
-
-                       "del port tm node shared shaper (port_id) (shared_shaper_id)\n"
-                       "       Delete port tm node shared shaper.\n\n"
-
-                       "set port tm node shaper profile (port_id) (node_id)"
-                       " (shaper_profile_id)\n"
-                       "       Set port tm node shaper profile.\n\n"
-
-                       "add port tm node wred profile (port_id) (wred_profile_id)"
-                       " (color_g) (min_th_g) (max_th_g) (maxp_inv_g) (wq_log2_g)"
-                       " (color_y) (min_th_y) (max_th_y) (maxp_inv_y) (wq_log2_y)"
-                       " (color_r) (min_th_r) (max_th_r) (maxp_inv_r) (wq_log2_r)\n"
-                       "       Add port tm node wred profile.\n\n"
-
-                       "del port tm node wred profile (port_id) (wred_profile_id)\n"
-                       "       Delete port tm node wred profile.\n\n"
-
-                       "add port tm nonleaf node (port_id) (node_id) (parent_node_id)"
-                       " (priority) (weight) (level_id) (shaper_profile_id)"
-                       " (n_sp_priorities) (stats_mask) (n_shared_shapers)"
-                       " [(shared_shaper_id_0) (shared_shaper_id_1)...]\n"
-                       "       Add port tm nonleaf node.\n\n"
-
-                       "add port tm leaf node (port_id) (node_id) (parent_node_id)"
-                       " (priority) (weight) (level_id) (shaper_profile_id)"
-                       " (cman_mode) (wred_profile_id) (stats_mask) (n_shared_shapers)"
-                       " [(shared_shaper_id_0) (shared_shaper_id_1)...]\n"
-                       "       Add port tm leaf node.\n\n"
-
-                       "del port tm node (port_id) (node_id)\n"
-                       "       Delete port tm node.\n\n"
-
-                       "set port tm node parent (port_id) (node_id) (parent_node_id)"
-                       " (priority) (weight)\n"
-                       "       Set port tm node parent.\n\n"
-
-                       "suspend port tm node (port_id) (node_id)"
-                       "       Suspend tm node.\n\n"
-
-                       "resume port tm node (port_id) (node_id)"
-                       "       Resume tm node.\n\n"
-
-                       "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"
@@ -790,6 +744,12 @@ static void cmd_help_long_parsed(void *parsed_result,
                        " eth-dst (eth-dst)\n"
                        "       Configure the VXLAN encapsulation for flows.\n\n"
 
+                       "vxlan-tos-ttl ip-version (ipv4|ipv6) vni (vni) udp-src"
+                       " (udp-src) udp-dst (udp-dst) ip-tos (ip-tos) ip-ttl (ip-ttl)"
+                       " 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"
+
                        "nvgre ip-version (ipv4|ipv6) tni (tni) ip-src"
                        " (ip-src) ip-dst (ip-dst) eth-src (eth-src) eth-dst"
                        " (eth-dst)\n"
@@ -848,7 +808,7 @@ static void cmd_help_long_parsed(void *parsed_result,
                        " for ports.\n\n"
 
                        "port config all rss (all|default|ip|tcp|udp|sctp|"
-                       "ether|port|vxlan|geneve|nvgre|none|<flowtype_id>)\n"
+                       "ether|port|vxlan|geneve|nvgre|vxlan-gpe|none|<flowtype_id>)\n"
                        "    Set the RSS mode.\n\n"
 
                        "port config port-id rss reta (hash,queue)[,(hash,queue)]\n"
@@ -914,6 +874,52 @@ static void cmd_help_long_parsed(void *parsed_result,
 
                        "port config (port_id) udp_tunnel_port add|rm vxlan|geneve (udp_port)\n\n"
                        "    Add/remove UDP tunnel port for tunneling offload\n\n"
+
+                       "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\n"
+                       "     Enable or disable a per port Rx offloading"
+                       " on all Rx queues of a port\n\n"
+
+                       "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\n"
+                       "    Enable or disable a per queue Rx offloading"
+                       " only on a specific Rx queue\n\n"
+
+                       "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|match_metadata on|off\n"
+                       "    Enable or disable a per port Tx offloading"
+                       " on all Tx queues of a port\n\n"
+
+                       "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\n"
+                       "    Enable or disable a per queue Tx offloading"
+                       " only on a specific Tx queue\n\n"
+
+                       "bpf-load rx|tx (port) (queue) (J|M|B) (file_name)\n"
+                       "    Load an eBPF program as a callback"
+                       " for particular RX/TX queue\n\n"
+
+                       "bpf-unload rx|tx (port) (queue)\n"
+                       "    Unload previously loaded eBPF program"
+                       " for particular RX/TX queue\n\n"
+
+                       "port config (port_id) tx_metadata (value)\n"
+                       "    Set Tx metadata value per port. Testpmd will add this value"
+                       " to any Tx packet sent from this port\n\n"
                );
        }
 
@@ -1133,6 +1139,107 @@ static void cmd_help_long_parsed(void *parsed_result,
                        " flow rules\n\n"
                );
        }
+
+       if (show_all || !strcmp(res->section, "traffic_management")) {
+               cmdline_printf(
+                       cl,
+                       "\n"
+                       "Traffic Management:\n"
+                       "--------------\n"
+                       "show port tm cap (port_id)\n"
+                       "       Display the port TM capability.\n\n"
+
+                       "show port tm level cap (port_id) (level_id)\n"
+                       "       Display the port TM hierarchical level capability.\n\n"
+
+                       "show port tm node cap (port_id) (node_id)\n"
+                       "       Display the port TM node capability.\n\n"
+
+                       "show port tm node type (port_id) (node_id)\n"
+                       "       Display the port TM node type.\n\n"
+
+                       "show port tm node stats (port_id) (node_id) (clear)\n"
+                       "       Display the port TM node stats.\n\n"
+
+#if defined RTE_LIBRTE_PMD_SOFTNIC && defined RTE_LIBRTE_SCHED
+                       "set port tm hierarchy default (port_id)\n"
+                       "       Set default traffic Management hierarchy on a port\n\n"
+#endif
+
+                       "add port tm node shaper profile (port_id) (shaper_profile_id)"
+                       " (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size)"
+                       " (packet_length_adjust)\n"
+                       "       Add port tm node private shaper profile.\n\n"
+
+                       "del port tm node shaper profile (port_id) (shaper_profile_id)\n"
+                       "       Delete port tm node private shaper profile.\n\n"
+
+                       "add port tm node shared shaper (port_id) (shared_shaper_id)"
+                       " (shaper_profile_id)\n"
+                       "       Add/update port tm node shared shaper.\n\n"
+
+                       "del port tm node shared shaper (port_id) (shared_shaper_id)\n"
+                       "       Delete port tm node shared shaper.\n\n"
+
+                       "set port tm node shaper profile (port_id) (node_id)"
+                       " (shaper_profile_id)\n"
+                       "       Set port tm node shaper profile.\n\n"
+
+                       "add port tm node wred profile (port_id) (wred_profile_id)"
+                       " (color_g) (min_th_g) (max_th_g) (maxp_inv_g) (wq_log2_g)"
+                       " (color_y) (min_th_y) (max_th_y) (maxp_inv_y) (wq_log2_y)"
+                       " (color_r) (min_th_r) (max_th_r) (maxp_inv_r) (wq_log2_r)\n"
+                       "       Add port tm node wred profile.\n\n"
+
+                       "del port tm node wred profile (port_id) (wred_profile_id)\n"
+                       "       Delete port tm node wred profile.\n\n"
+
+                       "add port tm nonleaf node (port_id) (node_id) (parent_node_id)"
+                       " (priority) (weight) (level_id) (shaper_profile_id)"
+                       " (n_sp_priorities) (stats_mask) (n_shared_shapers)"
+                       " [(shared_shaper_id_0) (shared_shaper_id_1)...]\n"
+                       "       Add port tm nonleaf node.\n\n"
+
+                       "add port tm leaf node (port_id) (node_id) (parent_node_id)"
+                       " (priority) (weight) (level_id) (shaper_profile_id)"
+                       " (cman_mode) (wred_profile_id) (stats_mask) (n_shared_shapers)"
+                       " [(shared_shaper_id_0) (shared_shaper_id_1)...]\n"
+                       "       Add port tm leaf node.\n\n"
+
+                       "del port tm node (port_id) (node_id)\n"
+                       "       Delete port tm node.\n\n"
+
+                       "set port tm node parent (port_id) (node_id) (parent_node_id)"
+                       " (priority) (weight)\n"
+                       "       Set port tm node parent.\n\n"
+
+                       "suspend port tm node (port_id) (node_id)"
+                       "       Suspend tm node.\n\n"
+
+                       "resume port tm node (port_id) (node_id)"
+                       "       Resume tm node.\n\n"
+
+                       "port tm hierarchy commit (port_id) (clean_on_fail)\n"
+                       "       Commit tm hierarchy.\n\n"
+
+                       "set port tm mark ip_ecn (port) (green) (yellow)"
+                       " (red)\n"
+                       "    Enables/Disables the traffic management marking"
+                       " for IP ECN (Explicit Congestion Notification)"
+                       " packets on a given port\n\n"
+
+                       "set port tm mark ip_dscp (port) (green) (yellow)"
+                       " (red)\n"
+                       "    Enables/Disables the traffic management marking"
+                       " on the port for IP dscp packets\n\n"
+
+                       "set port tm mark vlan_dei (port) (green) (yellow)"
+                       " (red)\n"
+                       "    Enables/Disables the traffic management marking"
+                       " on the port for VLAN packets with DEI enabled\n\n"
+               );
+       }
+
 }
 
 cmdline_parse_token_string_t cmd_help_long_help =
@@ -1141,12 +1248,13 @@ cmdline_parse_token_string_t cmd_help_long_help =
 cmdline_parse_token_string_t cmd_help_long_section =
        TOKEN_STRING_INITIALIZER(struct cmd_help_long_result, section,
                        "all#control#display#config#"
-                       "ports#registers#filters");
+                       "ports#registers#filters#traffic_management");
 
 cmdline_parse_inst_t cmd_help_long = {
        .f = cmd_help_long_parsed,
        .data = NULL,
-       .help_str = "help all|control|display|config|ports|register|filters: "
+       .help_str = "help all|control|display|config|ports|register|"
+               "filters|traffic_management: "
                "Show help",
        .tokens = {
                (void *)&cmd_help_long_help,
@@ -1249,6 +1357,59 @@ cmdline_parse_inst_t cmd_operate_specific_port = {
        },
 };
 
+/* *** enable port setup (after attach) via iterator or event *** */
+struct cmd_set_port_setup_on_result {
+       cmdline_fixed_string_t set;
+       cmdline_fixed_string_t port;
+       cmdline_fixed_string_t setup;
+       cmdline_fixed_string_t on;
+       cmdline_fixed_string_t mode;
+};
+
+static void cmd_set_port_setup_on_parsed(void *parsed_result,
+                               __attribute__((unused)) struct cmdline *cl,
+                               __attribute__((unused)) void *data)
+{
+       struct cmd_set_port_setup_on_result *res = parsed_result;
+
+       if (strcmp(res->mode, "event") == 0)
+               setup_on_probe_event = true;
+       else if (strcmp(res->mode, "iterator") == 0)
+               setup_on_probe_event = false;
+       else
+               printf("Unknown mode\n");
+}
+
+cmdline_parse_token_string_t cmd_set_port_setup_on_set =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_port_setup_on_result,
+                       set, "set");
+cmdline_parse_token_string_t cmd_set_port_setup_on_port =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_port_setup_on_result,
+                       port, "port");
+cmdline_parse_token_string_t cmd_set_port_setup_on_setup =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_port_setup_on_result,
+                       setup, "setup");
+cmdline_parse_token_string_t cmd_set_port_setup_on_on =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_port_setup_on_result,
+                       on, "on");
+cmdline_parse_token_string_t cmd_set_port_setup_on_mode =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_port_setup_on_result,
+                       mode, "iterator#event");
+
+cmdline_parse_inst_t cmd_set_port_setup_on = {
+       .f = cmd_set_port_setup_on_parsed,
+       .data = NULL,
+       .help_str = "set port setup on iterator|event",
+       .tokens = {
+               (void *)&cmd_set_port_setup_on_set,
+               (void *)&cmd_set_port_setup_on_port,
+               (void *)&cmd_set_port_setup_on_setup,
+               (void *)&cmd_set_port_setup_on_on,
+               (void *)&cmd_set_port_setup_on_mode,
+               NULL,
+       },
+};
+
 /* *** attach a specified port *** */
 struct cmd_operate_attach_port_result {
        cmdline_fixed_string_t port;
@@ -1305,7 +1466,7 @@ static void cmd_operate_detach_port_parsed(void *parsed_result,
        struct cmd_operate_detach_port_result *res = parsed_result;
 
        if (!strcmp(res->keyword, "detach"))
-               detach_port(res->port_id);
+               detach_port_device(res->port_id);
        else
                printf("Unknown parameter\n");
 }
@@ -1764,16 +1925,16 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
                uint64_t rx_offloads = port->dev_conf.rxmode.offloads;
 
                if (!strcmp(res->name, "max-pkt-len")) {
-                       if (res->value < ETHER_MIN_LEN) {
+                       if (res->value < RTE_ETHER_MIN_LEN) {
                                printf("max-pkt-len can not be less than %d\n",
-                                               ETHER_MIN_LEN);
+                                               RTE_ETHER_MIN_LEN);
                                return;
                        }
                        if (res->value == port->dev_conf.rxmode.max_rx_pkt_len)
                                return;
 
                        port->dev_conf.rxmode.max_rx_pkt_len = res->value;
-                       if (res->value > ETHER_MAX_LEN)
+                       if (res->value > RTE_ETHER_MAX_LEN)
                                rx_offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
                        else
                                rx_offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
@@ -1835,8 +1996,8 @@ cmd_config_mtu_parsed(void *parsed_result,
 {
        struct cmd_config_mtu_result *res = parsed_result;
 
-       if (res->value < ETHER_MIN_LEN) {
-               printf("mtu cannot be less than %d\n", ETHER_MIN_LEN);
+       if (res->value < RTE_ETHER_MIN_LEN) {
+               printf("mtu cannot be less than %d\n", RTE_ETHER_MIN_LEN);
                return;
        }
        port_mtu_set(res->port_id, res->value);
@@ -2122,7 +2283,7 @@ cmdline_parse_inst_t cmd_config_rss = {
        .f = cmd_config_rss_parsed,
        .data = NULL,
        .help_str = "port config all rss "
-               "all|default|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none|<flowtype_id>",
+               "all|default|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|vxlan-gpe|none|<flowtype_id>",
        .tokens = {
                (void *)&cmd_config_rss_port,
                (void *)&cmd_config_rss_keyword,
@@ -5920,6 +6081,8 @@ static void cmd_create_bonded_device_parsed(void *parsed_result,
                nb_ports = rte_eth_dev_count_avail();
                reconfig(port_id, res->socket);
                rte_eth_promiscuous_enable(port_id);
+               ports[port_id].need_setup = 0;
+               ports[port_id].port_status = RTE_PORT_STOPPED;
        }
 
 }
@@ -5961,7 +6124,7 @@ struct cmd_set_bond_mac_addr_result {
        cmdline_fixed_string_t bonding;
        cmdline_fixed_string_t mac_addr;
        uint16_t port_num;
-       struct ether_addr address;
+       struct rte_ether_addr address;
 };
 
 static void cmd_set_bond_mac_addr_parsed(void *parsed_result,
@@ -7321,6 +7484,49 @@ cmdline_parse_inst_t cmd_showqueue = {
        },
 };
 
+/* show/clear fwd engine statistics */
+struct fwd_result {
+       cmdline_fixed_string_t action;
+       cmdline_fixed_string_t fwd;
+       cmdline_fixed_string_t stats;
+       cmdline_fixed_string_t all;
+};
+
+cmdline_parse_token_string_t cmd_fwd_action =
+       TOKEN_STRING_INITIALIZER(struct fwd_result, action, "show#clear");
+cmdline_parse_token_string_t cmd_fwd_fwd =
+       TOKEN_STRING_INITIALIZER(struct fwd_result, fwd, "fwd");
+cmdline_parse_token_string_t cmd_fwd_stats =
+       TOKEN_STRING_INITIALIZER(struct fwd_result, stats, "stats");
+cmdline_parse_token_string_t cmd_fwd_all =
+       TOKEN_STRING_INITIALIZER(struct fwd_result, all, "all");
+
+static void
+cmd_showfwdall_parsed(void *parsed_result,
+                     __rte_unused struct cmdline *cl,
+                     __rte_unused void *data)
+{
+       struct fwd_result *res = parsed_result;
+
+       if (!strcmp(res->action, "show"))
+               fwd_stats_display();
+       else
+               fwd_stats_reset();
+}
+
+static cmdline_parse_inst_t cmd_showfwdall = {
+       .f = cmd_showfwdall_parsed,
+       .data = NULL,
+       .help_str = "show|clear fwd stats all",
+       .tokens = {
+               (void *)&cmd_fwd_action,
+               (void *)&cmd_fwd_fwd,
+               (void *)&cmd_fwd_stats,
+               (void *)&cmd_fwd_all,
+               NULL,
+       },
+};
+
 /* *** READ PORT REGISTER *** */
 struct cmd_read_reg_result {
        cmdline_fixed_string_t read;
@@ -7691,7 +7897,7 @@ struct cmd_mac_addr_result {
        cmdline_fixed_string_t mac_addr_cmd;
        cmdline_fixed_string_t what;
        uint16_t port_num;
-       struct ether_addr address;
+       struct rte_ether_addr address;
 };
 
 static void cmd_mac_addr_parsed(void *parsed_result,
@@ -7890,7 +8096,7 @@ struct cmd_set_uc_hash_table {
        cmdline_fixed_string_t port;
        portid_t port_id;
        cmdline_fixed_string_t what;
-       struct ether_addr address;
+       struct rte_ether_addr address;
        cmdline_fixed_string_t mode;
 };
 
@@ -8014,7 +8220,7 @@ struct cmd_set_vf_macvlan_filter {
        portid_t port_id;
        cmdline_fixed_string_t vf;
        uint8_t vf_id;
-       struct ether_addr address;
+       struct rte_ether_addr address;
        cmdline_fixed_string_t filter_type;
        cmdline_fixed_string_t mode;
 };
@@ -8030,7 +8236,7 @@ cmd_set_vf_macvlan_parsed(void *parsed_result,
 
        memset(&filter, 0, sizeof(struct rte_eth_mac_filter));
 
-       rte_memcpy(&filter.mac_addr, &res->address, ETHER_ADDR_LEN);
+       rte_memcpy(&filter.mac_addr, &res->address, RTE_ETHER_ADDR_LEN);
 
        /* set VF MAC filter */
        filter.is_vf = 1;
@@ -8273,7 +8479,7 @@ struct cmd_vf_mac_addr_result {
        uint16_t port_num;
        cmdline_fixed_string_t vf;
        uint8_t vf_num;
-       struct ether_addr address;
+       struct rte_ether_addr address;
 };
 
 static void cmd_vf_mac_addr_parsed(void *parsed_result,
@@ -8586,8 +8792,8 @@ struct cmd_tunnel_filter_result {
        cmdline_fixed_string_t cmd;
        cmdline_fixed_string_t what;
        portid_t port_id;
-       struct ether_addr outer_mac;
-       struct ether_addr inner_mac;
+       struct rte_ether_addr outer_mac;
+       struct rte_ether_addr inner_mac;
        cmdline_ipaddr_t ip_value;
        uint16_t inner_vlan;
        cmdline_fixed_string_t tunnel_type;
@@ -8607,8 +8813,8 @@ cmd_tunnel_filter_parsed(void *parsed_result,
 
        memset(&tunnel_filter_conf, 0, sizeof(tunnel_filter_conf));
 
-       ether_addr_copy(&res->outer_mac, &tunnel_filter_conf.outer_mac);
-       ether_addr_copy(&res->inner_mac, &tunnel_filter_conf.inner_mac);
+       rte_ether_addr_copy(&res->outer_mac, &tunnel_filter_conf.outer_mac);
+       rte_ether_addr_copy(&res->inner_mac, &tunnel_filter_conf.inner_mac);
        tunnel_filter_conf.inner_vlan = res->inner_vlan;
 
        if (res->ip_value.family == AF_INET) {
@@ -8645,6 +8851,8 @@ cmd_tunnel_filter_parsed(void *parsed_result,
 
        if (!strcmp(res->tunnel_type, "vxlan"))
                tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN;
+       else if (!strcmp(res->tunnel_type, "vxlan-gpe"))
+               tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN_GPE;
        else if (!strcmp(res->tunnel_type, "nvgre"))
                tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_NVGRE;
        else if (!strcmp(res->tunnel_type, "ipingre"))
@@ -8694,7 +8902,7 @@ cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value =
        ip_value);
 cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type =
        TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result,
-       tunnel_type, "vxlan#nvgre#ipingre");
+       tunnel_type, "vxlan#nvgre#ipingre#vxlan-gpe");
 
 cmdline_parse_token_string_t cmd_tunnel_filter_filter_type =
        TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result,
@@ -8818,6 +9026,8 @@ cmd_cfg_tunnel_udp_port_parsed(void *parsed_result,
                tunnel_udp.prot_type = RTE_TUNNEL_TYPE_VXLAN;
        } else if (!strcmp(res->tunnel_type, "geneve")) {
                tunnel_udp.prot_type = RTE_TUNNEL_TYPE_GENEVE;
+       } else if (!strcmp(res->tunnel_type, "vxlan-gpe")) {
+               tunnel_udp.prot_type = RTE_TUNNEL_TYPE_VXLAN_GPE;
        } else {
                printf("Invalid tunnel type\n");
                return;
@@ -8852,7 +9062,7 @@ cmdline_parse_token_string_t cmd_config_tunnel_udp_port_action =
                                 "add#rm");
 cmdline_parse_token_string_t cmd_config_tunnel_udp_port_tunnel_type =
        TOKEN_STRING_INITIALIZER(struct cmd_config_tunnel_udp_port, tunnel_type,
-                                "vxlan#geneve");
+                                "vxlan#geneve#vxlan-gpe");
 cmdline_parse_token_num_t cmd_config_tunnel_udp_port_value =
        TOKEN_NUM_INITIALIZER(struct cmd_config_tunnel_udp_port, udp_port,
                              UINT16);
@@ -8860,7 +9070,7 @@ cmdline_parse_token_num_t cmd_config_tunnel_udp_port_value =
 cmdline_parse_inst_t cmd_cfg_tunnel_udp_port = {
        .f = cmd_cfg_tunnel_udp_port_parsed,
        .data = NULL,
-       .help_str = "port config <port_id> udp_tunnel_port add|rm vxlan|geneve <udp_port>",
+       .help_str = "port config <port_id> udp_tunnel_port add|rm vxlan|geneve|vxlan-gpe <udp_port>",
        .tokens = {
                (void *)&cmd_config_tunnel_udp_port_port,
                (void *)&cmd_config_tunnel_udp_port_config,
@@ -9000,7 +9210,7 @@ cmd_set_mirror_mask_parsed(void *parsed_result,
                        return;
 
                for (i = 0; i < nb_item; i++) {
-                       if (vlan_list[i] > ETHER_MAX_VLAN_ID) {
+                       if (vlan_list[i] > RTE_ETHER_MAX_VLAN_ID) {
                                printf("Invalid vlan_id: must be < 4096\n");
                                return;
                        }
@@ -10373,7 +10583,7 @@ struct cmd_ethertype_filter_result {
        portid_t port_id;
        cmdline_fixed_string_t ops;
        cmdline_fixed_string_t mac;
-       struct ether_addr mac_addr;
+       struct rte_ether_addr mac_addr;
        cmdline_fixed_string_t ethertype;
        uint16_t ethertype_value;
        cmdline_fixed_string_t drop;
@@ -10433,7 +10643,7 @@ cmd_ethertype_filter_parsed(void *parsed_result,
        if (!strcmp(res->mac, "mac_addr")) {
                filter.flags |= RTE_ETHTYPE_FLAGS_MAC;
                rte_memcpy(&filter.mac_addr, &res->mac_addr,
-                       sizeof(struct ether_addr));
+                       sizeof(struct rte_ether_addr));
        }
        if (!strcmp(res->drop, "drop"))
                filter.flags |= RTE_ETHTYPE_FLAGS_DROP;
@@ -10512,7 +10722,7 @@ struct cmd_flow_director_result {
        cmdline_fixed_string_t fd_id;
        uint32_t  fd_id_value;
        cmdline_fixed_string_t mac;
-       struct ether_addr mac_addr;
+       struct rte_ether_addr mac_addr;
        cmdline_fixed_string_t tunnel;
        cmdline_fixed_string_t tunnel_type;
        cmdline_fixed_string_t tunnel_id;
@@ -10815,12 +11025,12 @@ cmd_flow_director_filter_parsed(void *parsed_result,
        if (fdir_conf.mode ==  RTE_FDIR_MODE_PERFECT_MAC_VLAN)
                rte_memcpy(&entry.input.flow.mac_vlan_flow.mac_addr,
                                 &res->mac_addr,
-                                sizeof(struct ether_addr));
+                                sizeof(struct rte_ether_addr));
 
        if (fdir_conf.mode ==  RTE_FDIR_MODE_PERFECT_TUNNEL) {
                rte_memcpy(&entry.input.flow.tunnel_flow.mac_addr,
                                 &res->mac_addr,
-                                sizeof(struct ether_addr));
+                                sizeof(struct rte_ether_addr));
                entry.input.flow.tunnel_flow.tunnel_type =
                        str2fdir_tunneltype(res->tunnel_type);
                entry.input.flow.tunnel_flow.tunnel_id =
@@ -11874,6 +12084,7 @@ flowtype_to_str(uint16_t ftype)
                {"vxlan", RTE_ETH_FLOW_VXLAN},
                {"geneve", RTE_ETH_FLOW_GENEVE},
                {"nvgre", RTE_ETH_FLOW_NVGRE},
+               {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
        };
 
        for (i = 0; i < RTE_DIM(ftype_table); i++) {
@@ -12011,7 +12222,7 @@ cmd_set_hash_global_config_parsed(void *parsed_result,
                                                        res->port_id);
        else
                printf("Global hash configurations have been set "
-                       "succcessfully by port %d\n", res->port_id);
+                       "successfully by port %d\n", res->port_id);
 }
 
 cmdline_parse_token_string_t cmd_set_hash_global_config_all =
@@ -12252,7 +12463,7 @@ struct cmd_mcast_addr_result {
        cmdline_fixed_string_t mcast_addr_cmd;
        cmdline_fixed_string_t what;
        uint16_t port_num;
-       struct ether_addr mc_addr;
+       struct rte_ether_addr mc_addr;
 };
 
 static void cmd_mcast_addr_parsed(void *parsed_result,
@@ -12261,7 +12472,7 @@ static void cmd_mcast_addr_parsed(void *parsed_result,
 {
        struct cmd_mcast_addr_result *res = parsed_result;
 
-       if (!is_multicast_ether_addr(&res->mc_addr)) {
+       if (!rte_is_multicast_ether_addr(&res->mc_addr)) {
                printf("Invalid multicast addr %02X:%02X:%02X:%02X:%02X:%02X\n",
                       res->mc_addr.addr_bytes[0], res->mc_addr.addr_bytes[1],
                       res->mc_addr.addr_bytes[2], res->mc_addr.addr_bytes[3],
@@ -13671,7 +13882,7 @@ struct cmd_set_vf_mac_addr_result {
        cmdline_fixed_string_t addr;
        portid_t port_id;
        uint16_t vf_id;
-       struct ether_addr mac_addr;
+       struct rte_ether_addr mac_addr;
 
 };
 
@@ -13976,7 +14187,7 @@ struct cmd_macsec_sc_result {
        cmdline_fixed_string_t sc;
        cmdline_fixed_string_t tx_rx;
        portid_t port_id;
-       struct ether_addr mac;
+       struct rte_ether_addr mac;
        uint16_t pi;
 };
 
@@ -14975,14 +15186,19 @@ struct cmd_set_vxlan_result {
        cmdline_ipaddr_t ip_src;
        cmdline_ipaddr_t ip_dst;
        uint16_t tci;
-       struct ether_addr eth_src;
-       struct ether_addr eth_dst;
+       uint8_t tos;
+       uint8_t ttl;
+       struct rte_ether_addr eth_src;
+       struct rte_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_tos_ttl =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, vxlan,
+                                "vxlan-tos-ttl");
 cmdline_parse_token_string_t cmd_set_vxlan_vxlan_with_vlan =
        TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, vxlan,
                                 "vxlan-with-vlan");
@@ -15007,6 +15223,16 @@ cmdline_parse_token_string_t cmd_set_vxlan_udp_dst =
                                 "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_tos =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, pos_token,
+                                "ip-tos");
+cmdline_parse_token_num_t cmd_set_vxlan_ip_tos_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_vxlan_result, tos, UINT8);
+cmdline_parse_token_string_t cmd_set_vxlan_ip_ttl =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, pos_token,
+                                "ip-ttl");
+cmdline_parse_token_num_t cmd_set_vxlan_ip_ttl_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_vxlan_result, ttl, UINT8);
 cmdline_parse_token_string_t cmd_set_vxlan_ip_src =
        TOKEN_STRING_INITIALIZER(struct cmd_set_vxlan_result, pos_token,
                                 "ip-src");
@@ -15045,10 +15271,15 @@ static void cmd_set_vxlan_parsed(void *parsed_result,
                .vxlan_id = rte_cpu_to_be_32(res->vni) & RTE_BE32(0x00ffffff),
        };
 
+       vxlan_encap_conf.select_tos_ttl = 0;
        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;
+       else if (strcmp(res->vxlan, "vxlan-tos-ttl") == 0) {
+               vxlan_encap_conf.select_vlan = 0;
+               vxlan_encap_conf.select_tos_ttl = 1;
+       }
        if (strcmp(res->ip_version, "ipv4") == 0)
                vxlan_encap_conf.select_ipv4 = 1;
        else if (strcmp(res->ip_version, "ipv6") == 0)
@@ -15058,6 +15289,8 @@ static void cmd_set_vxlan_parsed(void *parsed_result,
        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);
+       vxlan_encap_conf.ip_tos = res->tos;
+       vxlan_encap_conf.ip_ttl = res->ttl;
        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);
@@ -15068,9 +15301,9 @@ static void cmd_set_vxlan_parsed(void *parsed_result,
        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_ETHER_ADDR_LEN);
        rte_memcpy(vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes,
-                  ETHER_ADDR_LEN);
+                  RTE_ETHER_ADDR_LEN);
 }
 
 cmdline_parse_inst_t cmd_set_vxlan = {
@@ -15102,6 +15335,40 @@ cmdline_parse_inst_t cmd_set_vxlan = {
        },
 };
 
+cmdline_parse_inst_t cmd_set_vxlan_tos_ttl = {
+       .f = cmd_set_vxlan_parsed,
+       .data = NULL,
+       .help_str = "set vxlan-tos-ttl ip-version ipv4|ipv6 vni <vni> udp-src"
+               " <udp-src> udp-dst <udp-dst> ip-tos <ip-tos> ip-ttl <ip-ttl>"
+               " 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_tos_ttl,
+               (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_tos,
+               (void *)&cmd_set_vxlan_ip_tos_value,
+               (void *)&cmd_set_vxlan_ip_ttl,
+               (void *)&cmd_set_vxlan_ip_ttl_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,
@@ -15144,8 +15411,8 @@ struct cmd_set_nvgre_result {
        cmdline_ipaddr_t ip_src;
        cmdline_ipaddr_t ip_dst;
        uint16_t tci;
-       struct ether_addr eth_src;
-       struct ether_addr eth_dst;
+       struct rte_ether_addr eth_src;
+       struct rte_ether_addr eth_dst;
 };
 
 cmdline_parse_token_string_t cmd_set_nvgre_set =
@@ -15225,9 +15492,9 @@ static void cmd_set_nvgre_parsed(void *parsed_result,
        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_ETHER_ADDR_LEN);
        rte_memcpy(nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
-                  ETHER_ADDR_LEN);
+                  RTE_ETHER_ADDR_LEN);
 }
 
 cmdline_parse_inst_t cmd_set_nvgre = {
@@ -15282,6 +15549,629 @@ cmdline_parse_inst_t cmd_set_nvgre_with_vlan = {
        },
 };
 
+/** Set L2 encapsulation details */
+struct cmd_set_l2_encap_result {
+       cmdline_fixed_string_t set;
+       cmdline_fixed_string_t l2_encap;
+       cmdline_fixed_string_t pos_token;
+       cmdline_fixed_string_t ip_version;
+       uint32_t vlan_present:1;
+       uint16_t tci;
+       struct rte_ether_addr eth_src;
+       struct rte_ether_addr eth_dst;
+};
+
+cmdline_parse_token_string_t cmd_set_l2_encap_set =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_l2_encap_result, set, "set");
+cmdline_parse_token_string_t cmd_set_l2_encap_l2_encap =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_l2_encap_result, l2_encap, "l2_encap");
+cmdline_parse_token_string_t cmd_set_l2_encap_l2_encap_with_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_l2_encap_result, l2_encap,
+                                "l2_encap-with-vlan");
+cmdline_parse_token_string_t cmd_set_l2_encap_ip_version =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_l2_encap_result, pos_token,
+                                "ip-version");
+cmdline_parse_token_string_t cmd_set_l2_encap_ip_version_value =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_l2_encap_result, ip_version,
+                                "ipv4#ipv6");
+cmdline_parse_token_string_t cmd_set_l2_encap_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_l2_encap_result, pos_token,
+                                "vlan-tci");
+cmdline_parse_token_num_t cmd_set_l2_encap_vlan_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_l2_encap_result, tci, UINT16);
+cmdline_parse_token_string_t cmd_set_l2_encap_eth_src =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_l2_encap_result, pos_token,
+                                "eth-src");
+cmdline_parse_token_etheraddr_t cmd_set_l2_encap_eth_src_value =
+       TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_l2_encap_result, eth_src);
+cmdline_parse_token_string_t cmd_set_l2_encap_eth_dst =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_l2_encap_result, pos_token,
+                                "eth-dst");
+cmdline_parse_token_etheraddr_t cmd_set_l2_encap_eth_dst_value =
+       TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_l2_encap_result, eth_dst);
+
+static void cmd_set_l2_encap_parsed(void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_set_l2_encap_result *res = parsed_result;
+
+       if (strcmp(res->l2_encap, "l2_encap") == 0)
+               l2_encap_conf.select_vlan = 0;
+       else if (strcmp(res->l2_encap, "l2_encap-with-vlan") == 0)
+               l2_encap_conf.select_vlan = 1;
+       if (strcmp(res->ip_version, "ipv4") == 0)
+               l2_encap_conf.select_ipv4 = 1;
+       else if (strcmp(res->ip_version, "ipv6") == 0)
+               l2_encap_conf.select_ipv4 = 0;
+       else
+               return;
+       if (l2_encap_conf.select_vlan)
+               l2_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
+       rte_memcpy(l2_encap_conf.eth_src, res->eth_src.addr_bytes,
+                  RTE_ETHER_ADDR_LEN);
+       rte_memcpy(l2_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+                  RTE_ETHER_ADDR_LEN);
+}
+
+cmdline_parse_inst_t cmd_set_l2_encap = {
+       .f = cmd_set_l2_encap_parsed,
+       .data = NULL,
+       .help_str = "set l2_encap ip-version ipv4|ipv6"
+               " eth-src <eth-src> eth-dst <eth-dst>",
+       .tokens = {
+               (void *)&cmd_set_l2_encap_set,
+               (void *)&cmd_set_l2_encap_l2_encap,
+               (void *)&cmd_set_l2_encap_ip_version,
+               (void *)&cmd_set_l2_encap_ip_version_value,
+               (void *)&cmd_set_l2_encap_eth_src,
+               (void *)&cmd_set_l2_encap_eth_src_value,
+               (void *)&cmd_set_l2_encap_eth_dst,
+               (void *)&cmd_set_l2_encap_eth_dst_value,
+               NULL,
+       },
+};
+
+cmdline_parse_inst_t cmd_set_l2_encap_with_vlan = {
+       .f = cmd_set_l2_encap_parsed,
+       .data = NULL,
+       .help_str = "set l2_encap-with-vlan ip-version ipv4|ipv6"
+               " vlan-tci <vlan-tci> eth-src <eth-src> eth-dst <eth-dst>",
+       .tokens = {
+               (void *)&cmd_set_l2_encap_set,
+               (void *)&cmd_set_l2_encap_l2_encap_with_vlan,
+               (void *)&cmd_set_l2_encap_ip_version,
+               (void *)&cmd_set_l2_encap_ip_version_value,
+               (void *)&cmd_set_l2_encap_vlan,
+               (void *)&cmd_set_l2_encap_vlan_value,
+               (void *)&cmd_set_l2_encap_eth_src,
+               (void *)&cmd_set_l2_encap_eth_src_value,
+               (void *)&cmd_set_l2_encap_eth_dst,
+               (void *)&cmd_set_l2_encap_eth_dst_value,
+               NULL,
+       },
+};
+
+/** Set L2 decapsulation details */
+struct cmd_set_l2_decap_result {
+       cmdline_fixed_string_t set;
+       cmdline_fixed_string_t l2_decap;
+       cmdline_fixed_string_t pos_token;
+       uint32_t vlan_present:1;
+};
+
+cmdline_parse_token_string_t cmd_set_l2_decap_set =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_l2_decap_result, set, "set");
+cmdline_parse_token_string_t cmd_set_l2_decap_l2_decap =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_l2_decap_result, l2_decap,
+                                "l2_decap");
+cmdline_parse_token_string_t cmd_set_l2_decap_l2_decap_with_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_l2_decap_result, l2_decap,
+                                "l2_decap-with-vlan");
+
+static void cmd_set_l2_decap_parsed(void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_set_l2_decap_result *res = parsed_result;
+
+       if (strcmp(res->l2_decap, "l2_decap") == 0)
+               l2_decap_conf.select_vlan = 0;
+       else if (strcmp(res->l2_decap, "l2_decap-with-vlan") == 0)
+               l2_decap_conf.select_vlan = 1;
+}
+
+cmdline_parse_inst_t cmd_set_l2_decap = {
+       .f = cmd_set_l2_decap_parsed,
+       .data = NULL,
+       .help_str = "set l2_decap",
+       .tokens = {
+               (void *)&cmd_set_l2_decap_set,
+               (void *)&cmd_set_l2_decap_l2_decap,
+               NULL,
+       },
+};
+
+cmdline_parse_inst_t cmd_set_l2_decap_with_vlan = {
+       .f = cmd_set_l2_decap_parsed,
+       .data = NULL,
+       .help_str = "set l2_decap-with-vlan",
+       .tokens = {
+               (void *)&cmd_set_l2_decap_set,
+               (void *)&cmd_set_l2_decap_l2_decap_with_vlan,
+               NULL,
+       },
+};
+
+/** Set MPLSoGRE encapsulation details */
+struct cmd_set_mplsogre_encap_result {
+       cmdline_fixed_string_t set;
+       cmdline_fixed_string_t mplsogre;
+       cmdline_fixed_string_t pos_token;
+       cmdline_fixed_string_t ip_version;
+       uint32_t vlan_present:1;
+       uint32_t label;
+       cmdline_ipaddr_t ip_src;
+       cmdline_ipaddr_t ip_dst;
+       uint16_t tci;
+       struct rte_ether_addr eth_src;
+       struct rte_ether_addr eth_dst;
+};
+
+cmdline_parse_token_string_t cmd_set_mplsogre_encap_set =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, set,
+                                "set");
+cmdline_parse_token_string_t cmd_set_mplsogre_encap_mplsogre_encap =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, mplsogre,
+                                "mplsogre_encap");
+cmdline_parse_token_string_t cmd_set_mplsogre_encap_mplsogre_encap_with_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result,
+                                mplsogre, "mplsogre_encap-with-vlan");
+cmdline_parse_token_string_t cmd_set_mplsogre_encap_ip_version =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result,
+                                pos_token, "ip-version");
+cmdline_parse_token_string_t cmd_set_mplsogre_encap_ip_version_value =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result,
+                                ip_version, "ipv4#ipv6");
+cmdline_parse_token_string_t cmd_set_mplsogre_encap_label =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result,
+                                pos_token, "label");
+cmdline_parse_token_num_t cmd_set_mplsogre_encap_label_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_mplsogre_encap_result, label,
+                             UINT32);
+cmdline_parse_token_string_t cmd_set_mplsogre_encap_ip_src =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result,
+                                pos_token, "ip-src");
+cmdline_parse_token_ipaddr_t cmd_set_mplsogre_encap_ip_src_value =
+       TOKEN_IPADDR_INITIALIZER(struct cmd_set_mplsogre_encap_result, ip_src);
+cmdline_parse_token_string_t cmd_set_mplsogre_encap_ip_dst =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result,
+                                pos_token, "ip-dst");
+cmdline_parse_token_ipaddr_t cmd_set_mplsogre_encap_ip_dst_value =
+       TOKEN_IPADDR_INITIALIZER(struct cmd_set_mplsogre_encap_result, ip_dst);
+cmdline_parse_token_string_t cmd_set_mplsogre_encap_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result,
+                                pos_token, "vlan-tci");
+cmdline_parse_token_num_t cmd_set_mplsogre_encap_vlan_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_mplsogre_encap_result, tci,
+                             UINT16);
+cmdline_parse_token_string_t cmd_set_mplsogre_encap_eth_src =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result,
+                                pos_token, "eth-src");
+cmdline_parse_token_etheraddr_t cmd_set_mplsogre_encap_eth_src_value =
+       TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_mplsogre_encap_result,
+                                   eth_src);
+cmdline_parse_token_string_t cmd_set_mplsogre_encap_eth_dst =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result,
+                                pos_token, "eth-dst");
+cmdline_parse_token_etheraddr_t cmd_set_mplsogre_encap_eth_dst_value =
+       TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_mplsogre_encap_result,
+                                   eth_dst);
+
+static void cmd_set_mplsogre_encap_parsed(void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_set_mplsogre_encap_result *res = parsed_result;
+       union {
+               uint32_t mplsogre_label;
+               uint8_t label[4];
+       } id = {
+               .mplsogre_label = rte_cpu_to_be_32(res->label<<12),
+       };
+
+       if (strcmp(res->mplsogre, "mplsogre_encap") == 0)
+               mplsogre_encap_conf.select_vlan = 0;
+       else if (strcmp(res->mplsogre, "mplsogre_encap-with-vlan") == 0)
+               mplsogre_encap_conf.select_vlan = 1;
+       if (strcmp(res->ip_version, "ipv4") == 0)
+               mplsogre_encap_conf.select_ipv4 = 1;
+       else if (strcmp(res->ip_version, "ipv6") == 0)
+               mplsogre_encap_conf.select_ipv4 = 0;
+       else
+               return;
+       rte_memcpy(mplsogre_encap_conf.label, &id.label, 3);
+       if (mplsogre_encap_conf.select_ipv4) {
+               IPV4_ADDR_TO_UINT(res->ip_src, mplsogre_encap_conf.ipv4_src);
+               IPV4_ADDR_TO_UINT(res->ip_dst, mplsogre_encap_conf.ipv4_dst);
+       } else {
+               IPV6_ADDR_TO_ARRAY(res->ip_src, mplsogre_encap_conf.ipv6_src);
+               IPV6_ADDR_TO_ARRAY(res->ip_dst, mplsogre_encap_conf.ipv6_dst);
+       }
+       if (mplsogre_encap_conf.select_vlan)
+               mplsogre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
+       rte_memcpy(mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes,
+                  RTE_ETHER_ADDR_LEN);
+       rte_memcpy(mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+                  RTE_ETHER_ADDR_LEN);
+}
+
+cmdline_parse_inst_t cmd_set_mplsogre_encap = {
+       .f = cmd_set_mplsogre_encap_parsed,
+       .data = NULL,
+       .help_str = "set mplsogre_encap ip-version ipv4|ipv6 label <label>"
+               " ip-src <ip-src> ip-dst <ip-dst> eth-src <eth-src>"
+               " eth-dst <eth-dst>",
+       .tokens = {
+               (void *)&cmd_set_mplsogre_encap_set,
+               (void *)&cmd_set_mplsogre_encap_mplsogre_encap,
+               (void *)&cmd_set_mplsogre_encap_ip_version,
+               (void *)&cmd_set_mplsogre_encap_ip_version_value,
+               (void *)&cmd_set_mplsogre_encap_label,
+               (void *)&cmd_set_mplsogre_encap_label_value,
+               (void *)&cmd_set_mplsogre_encap_ip_src,
+               (void *)&cmd_set_mplsogre_encap_ip_src_value,
+               (void *)&cmd_set_mplsogre_encap_ip_dst,
+               (void *)&cmd_set_mplsogre_encap_ip_dst_value,
+               (void *)&cmd_set_mplsogre_encap_eth_src,
+               (void *)&cmd_set_mplsogre_encap_eth_src_value,
+               (void *)&cmd_set_mplsogre_encap_eth_dst,
+               (void *)&cmd_set_mplsogre_encap_eth_dst_value,
+               NULL,
+       },
+};
+
+cmdline_parse_inst_t cmd_set_mplsogre_encap_with_vlan = {
+       .f = cmd_set_mplsogre_encap_parsed,
+       .data = NULL,
+       .help_str = "set mplsogre_encap-with-vlan ip-version ipv4|ipv6"
+               " label <label> ip-src <ip-src> ip-dst <ip-dst>"
+               " vlan-tci <vlan-tci> eth-src <eth-src> eth-dst <eth-dst>",
+       .tokens = {
+               (void *)&cmd_set_mplsogre_encap_set,
+               (void *)&cmd_set_mplsogre_encap_mplsogre_encap_with_vlan,
+               (void *)&cmd_set_mplsogre_encap_ip_version,
+               (void *)&cmd_set_mplsogre_encap_ip_version_value,
+               (void *)&cmd_set_mplsogre_encap_label,
+               (void *)&cmd_set_mplsogre_encap_label_value,
+               (void *)&cmd_set_mplsogre_encap_ip_src,
+               (void *)&cmd_set_mplsogre_encap_ip_src_value,
+               (void *)&cmd_set_mplsogre_encap_ip_dst,
+               (void *)&cmd_set_mplsogre_encap_ip_dst_value,
+               (void *)&cmd_set_mplsogre_encap_vlan,
+               (void *)&cmd_set_mplsogre_encap_vlan_value,
+               (void *)&cmd_set_mplsogre_encap_eth_src,
+               (void *)&cmd_set_mplsogre_encap_eth_src_value,
+               (void *)&cmd_set_mplsogre_encap_eth_dst,
+               (void *)&cmd_set_mplsogre_encap_eth_dst_value,
+               NULL,
+       },
+};
+
+/** Set MPLSoGRE decapsulation details */
+struct cmd_set_mplsogre_decap_result {
+       cmdline_fixed_string_t set;
+       cmdline_fixed_string_t mplsogre;
+       cmdline_fixed_string_t pos_token;
+       cmdline_fixed_string_t ip_version;
+       uint32_t vlan_present:1;
+};
+
+cmdline_parse_token_string_t cmd_set_mplsogre_decap_set =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_decap_result, set,
+                                "set");
+cmdline_parse_token_string_t cmd_set_mplsogre_decap_mplsogre_decap =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_decap_result, mplsogre,
+                                "mplsogre_decap");
+cmdline_parse_token_string_t cmd_set_mplsogre_decap_mplsogre_decap_with_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_decap_result,
+                                mplsogre, "mplsogre_decap-with-vlan");
+cmdline_parse_token_string_t cmd_set_mplsogre_decap_ip_version =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_decap_result,
+                                pos_token, "ip-version");
+cmdline_parse_token_string_t cmd_set_mplsogre_decap_ip_version_value =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_decap_result,
+                                ip_version, "ipv4#ipv6");
+
+static void cmd_set_mplsogre_decap_parsed(void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_set_mplsogre_decap_result *res = parsed_result;
+
+       if (strcmp(res->mplsogre, "mplsogre_decap") == 0)
+               mplsogre_decap_conf.select_vlan = 0;
+       else if (strcmp(res->mplsogre, "mplsogre_decap-with-vlan") == 0)
+               mplsogre_decap_conf.select_vlan = 1;
+       if (strcmp(res->ip_version, "ipv4") == 0)
+               mplsogre_decap_conf.select_ipv4 = 1;
+       else if (strcmp(res->ip_version, "ipv6") == 0)
+               mplsogre_decap_conf.select_ipv4 = 0;
+}
+
+cmdline_parse_inst_t cmd_set_mplsogre_decap = {
+       .f = cmd_set_mplsogre_decap_parsed,
+       .data = NULL,
+       .help_str = "set mplsogre_decap ip-version ipv4|ipv6",
+       .tokens = {
+               (void *)&cmd_set_mplsogre_decap_set,
+               (void *)&cmd_set_mplsogre_decap_mplsogre_decap,
+               (void *)&cmd_set_mplsogre_decap_ip_version,
+               (void *)&cmd_set_mplsogre_decap_ip_version_value,
+               NULL,
+       },
+};
+
+cmdline_parse_inst_t cmd_set_mplsogre_decap_with_vlan = {
+       .f = cmd_set_mplsogre_decap_parsed,
+       .data = NULL,
+       .help_str = "set mplsogre_decap-with-vlan ip-version ipv4|ipv6",
+       .tokens = {
+               (void *)&cmd_set_mplsogre_decap_set,
+               (void *)&cmd_set_mplsogre_decap_mplsogre_decap_with_vlan,
+               (void *)&cmd_set_mplsogre_decap_ip_version,
+               (void *)&cmd_set_mplsogre_decap_ip_version_value,
+               NULL,
+       },
+};
+
+/** Set MPLSoUDP encapsulation details */
+struct cmd_set_mplsoudp_encap_result {
+       cmdline_fixed_string_t set;
+       cmdline_fixed_string_t mplsoudp;
+       cmdline_fixed_string_t pos_token;
+       cmdline_fixed_string_t ip_version;
+       uint32_t vlan_present:1;
+       uint32_t label;
+       uint16_t udp_src;
+       uint16_t udp_dst;
+       cmdline_ipaddr_t ip_src;
+       cmdline_ipaddr_t ip_dst;
+       uint16_t tci;
+       struct rte_ether_addr eth_src;
+       struct rte_ether_addr eth_dst;
+};
+
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_set =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result, set,
+                                "set");
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_mplsoudp_encap =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result, mplsoudp,
+                                "mplsoudp_encap");
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_mplsoudp_encap_with_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                mplsoudp, "mplsoudp_encap-with-vlan");
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_ip_version =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                pos_token, "ip-version");
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_ip_version_value =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                ip_version, "ipv4#ipv6");
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_label =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                pos_token, "label");
+cmdline_parse_token_num_t cmd_set_mplsoudp_encap_label_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_mplsoudp_encap_result, label,
+                             UINT32);
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_udp_src =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                pos_token, "udp-src");
+cmdline_parse_token_num_t cmd_set_mplsoudp_encap_udp_src_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_mplsoudp_encap_result, udp_src,
+                             UINT16);
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_udp_dst =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                pos_token, "udp-dst");
+cmdline_parse_token_num_t cmd_set_mplsoudp_encap_udp_dst_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_mplsoudp_encap_result, udp_dst,
+                             UINT16);
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_ip_src =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                pos_token, "ip-src");
+cmdline_parse_token_ipaddr_t cmd_set_mplsoudp_encap_ip_src_value =
+       TOKEN_IPADDR_INITIALIZER(struct cmd_set_mplsoudp_encap_result, ip_src);
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_ip_dst =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                pos_token, "ip-dst");
+cmdline_parse_token_ipaddr_t cmd_set_mplsoudp_encap_ip_dst_value =
+       TOKEN_IPADDR_INITIALIZER(struct cmd_set_mplsoudp_encap_result, ip_dst);
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                pos_token, "vlan-tci");
+cmdline_parse_token_num_t cmd_set_mplsoudp_encap_vlan_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_set_mplsoudp_encap_result, tci,
+                             UINT16);
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_eth_src =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                pos_token, "eth-src");
+cmdline_parse_token_etheraddr_t cmd_set_mplsoudp_encap_eth_src_value =
+       TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                   eth_src);
+cmdline_parse_token_string_t cmd_set_mplsoudp_encap_eth_dst =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                pos_token, "eth-dst");
+cmdline_parse_token_etheraddr_t cmd_set_mplsoudp_encap_eth_dst_value =
+       TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_mplsoudp_encap_result,
+                                   eth_dst);
+
+static void cmd_set_mplsoudp_encap_parsed(void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_set_mplsoudp_encap_result *res = parsed_result;
+       union {
+               uint32_t mplsoudp_label;
+               uint8_t label[4];
+       } id = {
+               .mplsoudp_label = rte_cpu_to_be_32(res->label<<12),
+       };
+
+       if (strcmp(res->mplsoudp, "mplsoudp_encap") == 0)
+               mplsoudp_encap_conf.select_vlan = 0;
+       else if (strcmp(res->mplsoudp, "mplsoudp_encap-with-vlan") == 0)
+               mplsoudp_encap_conf.select_vlan = 1;
+       if (strcmp(res->ip_version, "ipv4") == 0)
+               mplsoudp_encap_conf.select_ipv4 = 1;
+       else if (strcmp(res->ip_version, "ipv6") == 0)
+               mplsoudp_encap_conf.select_ipv4 = 0;
+       else
+               return;
+       rte_memcpy(mplsoudp_encap_conf.label, &id.label, 3);
+       mplsoudp_encap_conf.udp_src = rte_cpu_to_be_16(res->udp_src);
+       mplsoudp_encap_conf.udp_dst = rte_cpu_to_be_16(res->udp_dst);
+       if (mplsoudp_encap_conf.select_ipv4) {
+               IPV4_ADDR_TO_UINT(res->ip_src, mplsoudp_encap_conf.ipv4_src);
+               IPV4_ADDR_TO_UINT(res->ip_dst, mplsoudp_encap_conf.ipv4_dst);
+       } else {
+               IPV6_ADDR_TO_ARRAY(res->ip_src, mplsoudp_encap_conf.ipv6_src);
+               IPV6_ADDR_TO_ARRAY(res->ip_dst, mplsoudp_encap_conf.ipv6_dst);
+       }
+       if (mplsoudp_encap_conf.select_vlan)
+               mplsoudp_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
+       rte_memcpy(mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes,
+                  RTE_ETHER_ADDR_LEN);
+       rte_memcpy(mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+                  RTE_ETHER_ADDR_LEN);
+}
+
+cmdline_parse_inst_t cmd_set_mplsoudp_encap = {
+       .f = cmd_set_mplsoudp_encap_parsed,
+       .data = NULL,
+       .help_str = "set mplsoudp_encap ip-version ipv4|ipv6 label <label>"
+               " 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_mplsoudp_encap_set,
+               (void *)&cmd_set_mplsoudp_encap_mplsoudp_encap,
+               (void *)&cmd_set_mplsoudp_encap_ip_version,
+               (void *)&cmd_set_mplsoudp_encap_ip_version_value,
+               (void *)&cmd_set_mplsoudp_encap_label,
+               (void *)&cmd_set_mplsoudp_encap_label_value,
+               (void *)&cmd_set_mplsoudp_encap_udp_src,
+               (void *)&cmd_set_mplsoudp_encap_udp_src_value,
+               (void *)&cmd_set_mplsoudp_encap_udp_dst,
+               (void *)&cmd_set_mplsoudp_encap_udp_dst_value,
+               (void *)&cmd_set_mplsoudp_encap_ip_src,
+               (void *)&cmd_set_mplsoudp_encap_ip_src_value,
+               (void *)&cmd_set_mplsoudp_encap_ip_dst,
+               (void *)&cmd_set_mplsoudp_encap_ip_dst_value,
+               (void *)&cmd_set_mplsoudp_encap_eth_src,
+               (void *)&cmd_set_mplsoudp_encap_eth_src_value,
+               (void *)&cmd_set_mplsoudp_encap_eth_dst,
+               (void *)&cmd_set_mplsoudp_encap_eth_dst_value,
+               NULL,
+       },
+};
+
+cmdline_parse_inst_t cmd_set_mplsoudp_encap_with_vlan = {
+       .f = cmd_set_mplsoudp_encap_parsed,
+       .data = NULL,
+       .help_str = "set mplsoudp_encap-with-vlan ip-version ipv4|ipv6"
+               " label <label> 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_mplsoudp_encap_set,
+               (void *)&cmd_set_mplsoudp_encap_mplsoudp_encap_with_vlan,
+               (void *)&cmd_set_mplsoudp_encap_ip_version,
+               (void *)&cmd_set_mplsoudp_encap_ip_version_value,
+               (void *)&cmd_set_mplsoudp_encap_label,
+               (void *)&cmd_set_mplsoudp_encap_label_value,
+               (void *)&cmd_set_mplsoudp_encap_udp_src,
+               (void *)&cmd_set_mplsoudp_encap_udp_src_value,
+               (void *)&cmd_set_mplsoudp_encap_udp_dst,
+               (void *)&cmd_set_mplsoudp_encap_udp_dst_value,
+               (void *)&cmd_set_mplsoudp_encap_ip_src,
+               (void *)&cmd_set_mplsoudp_encap_ip_src_value,
+               (void *)&cmd_set_mplsoudp_encap_ip_dst,
+               (void *)&cmd_set_mplsoudp_encap_ip_dst_value,
+               (void *)&cmd_set_mplsoudp_encap_vlan,
+               (void *)&cmd_set_mplsoudp_encap_vlan_value,
+               (void *)&cmd_set_mplsoudp_encap_eth_src,
+               (void *)&cmd_set_mplsoudp_encap_eth_src_value,
+               (void *)&cmd_set_mplsoudp_encap_eth_dst,
+               (void *)&cmd_set_mplsoudp_encap_eth_dst_value,
+               NULL,
+       },
+};
+
+/** Set MPLSoUDP decapsulation details */
+struct cmd_set_mplsoudp_decap_result {
+       cmdline_fixed_string_t set;
+       cmdline_fixed_string_t mplsoudp;
+       cmdline_fixed_string_t pos_token;
+       cmdline_fixed_string_t ip_version;
+       uint32_t vlan_present:1;
+};
+
+cmdline_parse_token_string_t cmd_set_mplsoudp_decap_set =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_decap_result, set,
+                                "set");
+cmdline_parse_token_string_t cmd_set_mplsoudp_decap_mplsoudp_decap =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_decap_result, mplsoudp,
+                                "mplsoudp_decap");
+cmdline_parse_token_string_t cmd_set_mplsoudp_decap_mplsoudp_decap_with_vlan =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_decap_result,
+                                mplsoudp, "mplsoudp_decap-with-vlan");
+cmdline_parse_token_string_t cmd_set_mplsoudp_decap_ip_version =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_decap_result,
+                                pos_token, "ip-version");
+cmdline_parse_token_string_t cmd_set_mplsoudp_decap_ip_version_value =
+       TOKEN_STRING_INITIALIZER(struct cmd_set_mplsoudp_decap_result,
+                                ip_version, "ipv4#ipv6");
+
+static void cmd_set_mplsoudp_decap_parsed(void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_set_mplsoudp_decap_result *res = parsed_result;
+
+       if (strcmp(res->mplsoudp, "mplsoudp_decap") == 0)
+               mplsoudp_decap_conf.select_vlan = 0;
+       else if (strcmp(res->mplsoudp, "mplsoudp_decap-with-vlan") == 0)
+               mplsoudp_decap_conf.select_vlan = 1;
+       if (strcmp(res->ip_version, "ipv4") == 0)
+               mplsoudp_decap_conf.select_ipv4 = 1;
+       else if (strcmp(res->ip_version, "ipv6") == 0)
+               mplsoudp_decap_conf.select_ipv4 = 0;
+}
+
+cmdline_parse_inst_t cmd_set_mplsoudp_decap = {
+       .f = cmd_set_mplsoudp_decap_parsed,
+       .data = NULL,
+       .help_str = "set mplsoudp_decap ip-version ipv4|ipv6",
+       .tokens = {
+               (void *)&cmd_set_mplsoudp_decap_set,
+               (void *)&cmd_set_mplsoudp_decap_mplsoudp_decap,
+               (void *)&cmd_set_mplsoudp_decap_ip_version,
+               (void *)&cmd_set_mplsoudp_decap_ip_version_value,
+               NULL,
+       },
+};
+
+cmdline_parse_inst_t cmd_set_mplsoudp_decap_with_vlan = {
+       .f = cmd_set_mplsoudp_decap_parsed,
+       .data = NULL,
+       .help_str = "set mplsoudp_decap-with-vlan ip-version ipv4|ipv6",
+       .tokens = {
+               (void *)&cmd_set_mplsoudp_decap_set,
+               (void *)&cmd_set_mplsoudp_decap_mplsoudp_decap_with_vlan,
+               (void *)&cmd_set_mplsoudp_decap_ip_version,
+               (void *)&cmd_set_mplsoudp_decap_ip_version_value,
+               NULL,
+       },
+};
+
 /* Strict link priority scheduling mode setting */
 static void
 cmd_strict_link_prio_parsed(
@@ -16943,7 +17833,7 @@ print_rx_offloads(uint64_t offloads)
        begin = __builtin_ctzll(offloads);
        end = sizeof(offloads) * CHAR_BIT - __builtin_clzll(offloads);
 
-       single_offload = 1 << begin;
+       single_offload = 1ULL << begin;
        for (bit = begin; bit < end; bit++) {
                if (offloads & single_offload)
                        printf(" %s",
@@ -17121,10 +18011,7 @@ search_rx_offload(const char *name)
                if (!strcasecmp(single_name, name)) {
                        found = 1;
                        break;
-               } else if (!strcasecmp(single_name, "UNKNOWN"))
-                       break;
-               else if (single_name == NULL)
-                       break;
+               }
                single_offload <<= 1;
        }
 
@@ -17340,7 +18227,7 @@ print_tx_offloads(uint64_t offloads)
        begin = __builtin_ctzll(offloads);
        end = sizeof(offloads) * CHAR_BIT - __builtin_clzll(offloads);
 
-       single_offload = 1 << begin;
+       single_offload = 1ULL << begin;
        for (bit = begin; bit < end; bit++) {
                if (offloads & single_offload)
                        printf(" %s",
@@ -17499,7 +18386,8 @@ cmdline_parse_token_string_t cmd_config_per_port_tx_offload_result_offload =
                          "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");
+                         "mt_lockfree#multi_segs#mbuf_fast_free#security#"
+                         "match_metadata");
 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,
@@ -17516,13 +18404,13 @@ search_tx_offload(const char *name)
        single_offload = 1;
        for (bit = 0; bit < sizeof(single_offload) * CHAR_BIT; bit++) {
                single_name = rte_eth_dev_tx_offload_name(single_offload);
+               if (single_name == NULL)
+                       break;
                if (!strcasecmp(single_name, name)) {
                        found = 1;
                        break;
                } else if (!strcasecmp(single_name, "UNKNOWN"))
                        break;
-               else if (single_name == NULL)
-                       break;
                single_offload <<= 1;
        }
 
@@ -17580,8 +18468,8 @@ cmdline_parse_inst_t cmd_config_per_port_tx_offload = {
                    "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",
+                   "mt_lockfree|multi_segs|mbuf_fast_free|security|"
+                   "match_metadata on|off",
        .tokens = {
                (void *)&cmd_config_per_port_tx_offload_result_port,
                (void *)&cmd_config_per_port_tx_offload_result_config,
@@ -17698,6 +18586,113 @@ cmdline_parse_inst_t cmd_config_per_queue_tx_offload = {
        }
 };
 
+/* *** configure tx_metadata for specific port *** */
+struct cmd_config_tx_metadata_specific_result {
+       cmdline_fixed_string_t port;
+       cmdline_fixed_string_t keyword;
+       uint16_t port_id;
+       cmdline_fixed_string_t item;
+       uint32_t value;
+};
+
+static void
+cmd_config_tx_metadata_specific_parsed(void *parsed_result,
+                               __attribute__((unused)) struct cmdline *cl,
+                               __attribute__((unused)) void *data)
+{
+       struct cmd_config_tx_metadata_specific_result *res = parsed_result;
+
+       if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+               return;
+       ports[res->port_id].tx_metadata = rte_cpu_to_be_32(res->value);
+       /* Add/remove callback to insert valid metadata in every Tx packet. */
+       if (ports[res->port_id].tx_metadata)
+               add_tx_md_callback(res->port_id);
+       else
+               remove_tx_md_callback(res->port_id);
+}
+
+cmdline_parse_token_string_t cmd_config_tx_metadata_specific_port =
+       TOKEN_STRING_INITIALIZER(struct cmd_config_tx_metadata_specific_result,
+                       port, "port");
+cmdline_parse_token_string_t cmd_config_tx_metadata_specific_keyword =
+       TOKEN_STRING_INITIALIZER(struct cmd_config_tx_metadata_specific_result,
+                       keyword, "config");
+cmdline_parse_token_num_t cmd_config_tx_metadata_specific_id =
+       TOKEN_NUM_INITIALIZER(struct cmd_config_tx_metadata_specific_result,
+                       port_id, UINT16);
+cmdline_parse_token_string_t cmd_config_tx_metadata_specific_item =
+       TOKEN_STRING_INITIALIZER(struct cmd_config_tx_metadata_specific_result,
+                       item, "tx_metadata");
+cmdline_parse_token_num_t cmd_config_tx_metadata_specific_value =
+       TOKEN_NUM_INITIALIZER(struct cmd_config_tx_metadata_specific_result,
+                       value, UINT32);
+
+cmdline_parse_inst_t cmd_config_tx_metadata_specific = {
+       .f = cmd_config_tx_metadata_specific_parsed,
+       .data = NULL,
+       .help_str = "port config <port_id> tx_metadata <value>",
+       .tokens = {
+               (void *)&cmd_config_tx_metadata_specific_port,
+               (void *)&cmd_config_tx_metadata_specific_keyword,
+               (void *)&cmd_config_tx_metadata_specific_id,
+               (void *)&cmd_config_tx_metadata_specific_item,
+               (void *)&cmd_config_tx_metadata_specific_value,
+               NULL,
+       },
+};
+
+/* *** display tx_metadata per port configuration *** */
+struct cmd_show_tx_metadata_result {
+       cmdline_fixed_string_t cmd_show;
+       cmdline_fixed_string_t cmd_port;
+       cmdline_fixed_string_t cmd_keyword;
+       portid_t cmd_pid;
+};
+
+static void
+cmd_show_tx_metadata_parsed(void *parsed_result,
+               __attribute__((unused)) struct cmdline *cl,
+               __attribute__((unused)) void *data)
+{
+       struct cmd_show_tx_metadata_result *res = parsed_result;
+
+       if (!rte_eth_dev_is_valid_port(res->cmd_pid)) {
+               printf("invalid port id %u\n", res->cmd_pid);
+               return;
+       }
+       if (!strcmp(res->cmd_keyword, "tx_metadata")) {
+               printf("Port %u tx_metadata: %u\n", res->cmd_pid,
+                       rte_be_to_cpu_32(ports[res->cmd_pid].tx_metadata));
+       }
+}
+
+cmdline_parse_token_string_t cmd_show_tx_metadata_show =
+       TOKEN_STRING_INITIALIZER(struct cmd_show_tx_metadata_result,
+                       cmd_show, "show");
+cmdline_parse_token_string_t cmd_show_tx_metadata_port =
+       TOKEN_STRING_INITIALIZER(struct cmd_show_tx_metadata_result,
+                       cmd_port, "port");
+cmdline_parse_token_num_t cmd_show_tx_metadata_pid =
+       TOKEN_NUM_INITIALIZER(struct cmd_show_tx_metadata_result,
+                       cmd_pid, UINT16);
+cmdline_parse_token_string_t cmd_show_tx_metadata_keyword =
+       TOKEN_STRING_INITIALIZER(struct cmd_show_tx_metadata_result,
+                       cmd_keyword, "tx_metadata");
+
+cmdline_parse_inst_t cmd_show_tx_metadata = {
+       .f = cmd_show_tx_metadata_parsed,
+       .data = NULL,
+       .help_str = "show port <port_id> tx_metadata",
+       .tokens = {
+               (void *)&cmd_show_tx_metadata_show,
+               (void *)&cmd_show_tx_metadata_port,
+               (void *)&cmd_show_tx_metadata_pid,
+               (void *)&cmd_show_tx_metadata_keyword,
+               NULL,
+       },
+};
+
 /* ******************************************************************************** */
 
 /* list of instructions */
@@ -17710,6 +18705,7 @@ cmdline_parse_ctx_t main_ctx[] = {
        (cmdline_parse_inst_t *)&cmd_showqueue,
        (cmdline_parse_inst_t *)&cmd_showportall,
        (cmdline_parse_inst_t *)&cmd_showcfg,
+       (cmdline_parse_inst_t *)&cmd_showfwdall,
        (cmdline_parse_inst_t *)&cmd_start,
        (cmdline_parse_inst_t *)&cmd_start_tx_first,
        (cmdline_parse_inst_t *)&cmd_start_tx_first_n,
@@ -17796,6 +18792,7 @@ cmdline_parse_ctx_t main_ctx[] = {
        (cmdline_parse_inst_t *)&cmd_operate_specific_port,
        (cmdline_parse_inst_t *)&cmd_operate_attach_port,
        (cmdline_parse_inst_t *)&cmd_operate_detach_port,
+       (cmdline_parse_inst_t *)&cmd_set_port_setup_on,
        (cmdline_parse_inst_t *)&cmd_config_speed_all,
        (cmdline_parse_inst_t *)&cmd_config_speed_specific,
        (cmdline_parse_inst_t *)&cmd_config_loopback_all,
@@ -17908,9 +18905,22 @@ cmdline_parse_ctx_t main_ctx[] = {
        (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_tos_ttl,
        (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_set_l2_encap,
+       (cmdline_parse_inst_t *)&cmd_set_l2_encap_with_vlan,
+       (cmdline_parse_inst_t *)&cmd_set_l2_decap,
+       (cmdline_parse_inst_t *)&cmd_set_l2_decap_with_vlan,
+       (cmdline_parse_inst_t *)&cmd_set_mplsogre_encap,
+       (cmdline_parse_inst_t *)&cmd_set_mplsogre_encap_with_vlan,
+       (cmdline_parse_inst_t *)&cmd_set_mplsogre_decap,
+       (cmdline_parse_inst_t *)&cmd_set_mplsogre_decap_with_vlan,
+       (cmdline_parse_inst_t *)&cmd_set_mplsoudp_encap,
+       (cmdline_parse_inst_t *)&cmd_set_mplsoudp_encap_with_vlan,
+       (cmdline_parse_inst_t *)&cmd_set_mplsoudp_decap,
+       (cmdline_parse_inst_t *)&cmd_set_mplsoudp_decap_with_vlan,
        (cmdline_parse_inst_t *)&cmd_ddp_add,
        (cmdline_parse_inst_t *)&cmd_ddp_del,
        (cmdline_parse_inst_t *)&cmd_ddp_get_list,
@@ -17967,6 +18977,8 @@ cmdline_parse_ctx_t main_ctx[] = {
        (cmdline_parse_inst_t *)&cmd_operate_bpf_ld_parse,
        (cmdline_parse_inst_t *)&cmd_operate_bpf_unld_parse,
 #endif
+       (cmdline_parse_inst_t *)&cmd_config_tx_metadata_specific,
+       (cmdline_parse_inst_t *)&cmd_show_tx_metadata,
        NULL,
 };