#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>
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"
);
}
"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"
);
}
"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"
"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"
"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)"
- " (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"
-
"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"
" 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"
" 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"
"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"
);
}
" 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 =
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,
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;
{
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);
.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,
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,
},
};
+/* 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;
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,
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;
};
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;
};
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;
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,
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;
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) {
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"))
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,
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;
"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);
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,
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;
}
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;
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;
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;
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 =
{"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++) {
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 =
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,
{
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],
cmdline_fixed_string_t addr;
portid_t port_id;
uint16_t vf_id;
- struct ether_addr mac_addr;
+ struct rte_ether_addr mac_addr;
};
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;
};
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");
"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");
.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)
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);
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 = {
},
};
+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,
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 =
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 = {
cmdline_fixed_string_t ip_version;
uint32_t vlan_present:1;
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_l2_encap_set =
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,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
rte_memcpy(l2_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
}
cmdline_parse_inst_t cmd_set_l2_encap = {
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_mplsogre_encap_set =
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,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
rte_memcpy(mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
}
cmdline_parse_inst_t cmd_set_mplsogre_encap = {
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_mplsoudp_encap_set =
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,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
rte_memcpy(mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
}
cmdline_parse_inst_t cmd_set_mplsoudp_encap = {
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",
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",
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;
}
(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,
(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,