summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Wiles <keith.wiles@intel.com>2017-09-10 18:05:57 -0500
committerKeith Wiles <keith.wiles@intel.com>2017-11-25 07:48:58 -0600
commitc8f5cffb95737fdc623acade87f1f57d9f5aaef9 (patch)
treec9c5e3bf3c41c242c00d3148664b5fc20d7ca0eb
parenta8177b88a3942343a77851aca078b02df42b5255 (diff)
downloaddpdk-draft-cli-c8f5cffb95737fdc623acade87f1f57d9f5aaef9.zip
dpdk-draft-cli-c8f5cffb95737fdc623acade87f1f57d9f5aaef9.tar.gz
dpdk-draft-cli-c8f5cffb95737fdc623acade87f1f57d9f5aaef9.tar.xz
testpmd: format changes for cli code
-rw-r--r--app/test-pmd/cli_cmds.c2808
1 files changed, 1840 insertions, 968 deletions
diff --git a/app/test-pmd/cli_cmds.c b/app/test-pmd/cli_cmds.c
index e9cc547..e435aee 100644
--- a/app/test-pmd/cli_cmds.c
+++ b/app/test-pmd/cli_cmds.c
@@ -71,8 +71,13 @@
#include <rte_net.h>
#include <rte_string_fns.h>
+#include <cli.h>
+#include <cli_map.h>
+#include <cli_string_fns.h>
+
#ifdef RTE_LIBRTE_PMD_BOND
#include <rte_eth_bond.h>
+#include <rte_eth_bond_8023ad.h>
#endif
#ifdef RTE_LIBRTE_IXGBE_PMD
#include <rte_pmd_ixgbe.h>
@@ -80,19 +85,12 @@
#ifdef RTE_LIBRTE_I40E_PMD
#include <rte_pmd_i40e.h>
#endif
-
-#include <cli.h>
-#include <cli_map.h>
-#include <cli_string_fns.h>
+#ifdef RTE_LIBRTE_BNXT_PMD
+#include <rte_pmd_bnxt.h>
+#endif
#include "testpmd.h"
-static struct cli_map help_map[] = {
- { 0, "help" },
- { 10, "help %s" },
- { -1, NULL }
-};
-
#define STR_TOKEN_SIZE 128
static uint32_t
@@ -154,25 +152,33 @@ parse_list(char *str, const char *item_name, uint32_t max_items,
for (i = 0; i < nb_item; i++) {
for (j = i + 1; j < nb_item; j++)
if (parsed_items[j] == parsed_items[i]) {
- printf("duplicated %s %u at index %u and %u\n",
- item_name, parsed_items[i], i, j);
+ printf("duplicated %s %u at "
+ "index %u and %u\n",
+ item_name, parsed_items[i],
+ i, j);
return 0;
}
}
return nb_item;
}
+static struct cli_map help_map[] = {
+ { 0, "help" },
+ { 10, "help %s" },
+ { -1, NULL }
+};
+
static int
help_cmd(int argc, char **argv)
{
- int control = 0, misc = 0, config = 0, ports = 0;
- int registers = 0, filters = 0, hash = 0, show_all = 0;
+ int control = 0, config = 0, ports = 0, display = 0;
+ int registers = 0, filters = 0, show_all = 0;
int n = -1;
RTE_SET_USED(help_map);
if (argc > 1)
- n = rte_stropt(
- "control|misc|config|ports|registers|filters|hash|all",
+ n = rte_stropt("control|display|config|ports|registers|"
+ "filters|all",
argv[1], "|");
switch(n) {
@@ -180,7 +186,7 @@ help_cmd(int argc, char **argv)
control = 1;
break;
case 1:
- misc = 1;
+ display = 1;
break;
case 2:
config = 1;
@@ -195,28 +201,26 @@ help_cmd(int argc, char **argv)
filters = 1;
break;
case 6:
- hash = 1;
- break;
- case 7:
show_all = 1;
break;
default:
cli_printf(
"\n"
"Help is available for the following sections:\n\n"
- " help control : Start and stop forwarding.\n"
- " help misc : debug and other commands.\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 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"
);
return 0;
}
- if (show_all || control)
-
+ if (show_all || control) {
cli_printf(
"\n"
"Control forwarding:\n"
@@ -236,19 +240,56 @@ help_cmd(int argc, char **argv)
"quit\n"
" Quit to prompt.\n\n"
);
+ }
- if (show_all || misc)
-
+ if (show_all || display) {
cli_printf(
"\n"
- "Misc:\n"
+ "Display:\n"
"--------\n\n"
- "misc global_config (port-id) gre-key-len (len)\n\n"
- "misc dump (physmen|memzone|struct_sizes|ring|mempool|devargs)\n\n"
- "misc dump (ring|mempool) (name)\n\n"
- "misc mcast_addr (add|remove) (port-id) (mac adddress)\n\n"
- );
+ "show port (info|stats|xstats|fdir|stat_qmap|dcb_tc|cap) (port_id|all)\n"
+ " Display information for port_id, or all.\n\n"
+
+ "show port X rss reta (size) (mask0,mask1,...)\n"
+ " Display the rss redirection table entry indicated"
+ " by masks on port X. size is used to indicate the"
+ " hardware supported reta size\n\n"
+
+ "show port rss-hash ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|"
+ "ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|"
+ "ipv6-other|l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex [key]\n"
+ " Display the RSS hash functions and RSS hash key"
+ " of port X\n\n"
+
+ "clear port (info|stats|xstats|fdir|stat_qmap) (port_id|all)\n"
+ " Clear information for port_id, or all.\n\n"
+
+ "show (rxq|txq) info (port_id) (queue_id)\n"
+ " Display information for configured RX/TX queue.\n\n"
+
+ "show config (rxtx|cores|fwd|txpkts)\n"
+ " Display the given configuration.\n\n"
+
+ "read rxd (port_id) (queue_id) (rxd_id)\n"
+ " Display an RX descriptor of a port RX queue.\n\n"
+
+ "read txd (port_id) (queue_id) (txd_id)\n"
+ " Display a TX descriptor of a port TX queue.\n\n"
+
+ "ddp get list (port_id)\n"
+ " Get ddp profile info list\n\n"
+
+ "ddp get info (profile_path)\n"
+ " Get ddp profile information.\n\n"
+
+ "show vf stats (port_id) (vf_id)\n"
+ " Display a VF's statistics.\n\n"
+
+ "clear vf stats (port_id) (vf_id)\n"
+ " Reset a VF's statistics.\n\n"
+ );
+ }
if (show_all || config) {
cli_printf(
"\n"
@@ -297,7 +338,6 @@ help_cmd(int argc, char **argv)
"set portlist (x[,y]*)\n"
" Set the list of forwarding ports.\n\n"
-#ifdef RTE_LIBRTE_IXGBE_PMD
"set tx loopback (port_id) (on|off)\n"
" Enable or disable tx loopback.\n\n"
@@ -309,15 +349,28 @@ help_cmd(int argc, char **argv)
"set vf mac antispoof (port_id) (vf_id) (on|off).\n"
" Set MAC antispoof for a VF from the PF.\n\n"
-#endif
- "set vlan strip (on|off) (port_id)\n"
+ "set macsec offload (port_id) on encrypt (on|off) replay-protect (on|off)\n"
+ " Enable MACsec offload.\n\n"
+
+ "set macsec offload (port_id) off\n"
+ " Disable MACsec offload.\n\n"
+
+ "set macsec sc (tx|rx) (port_id) (mac) (pi)\n"
+ " Configure MACsec secure connection (SC).\n\n"
+
+ "set macsec sa (tx|rx) (port_id) (idx) (an) (pn) (key)\n"
+ " Configure MACsec secure association (SA).\n\n"
+
+ "set vf broadcast (port_id) (vf_id) (on|off)\n"
+ " Set VF broadcast for a VF from the PF.\n\n"
+
+ "vlan set strip (on|off) (port_id)\n"
" Set the VLAN strip on a port.\n\n"
- "set vlan stripq (on|off) (port_id,queue_id)\n"
+ "vlan set stripq (on|off) (port_id,queue_id)\n"
" Set the VLAN strip for a queue on a port.\n\n"
-#ifdef RTE_LIBRTE_IXGBE_PMD
"set vf vlan stripq (port_id) (vf_id) (on|off)\n"
" Set the VLAN strip for all queues in a pool for a VF from the PF.\n\n"
@@ -326,53 +379,80 @@ help_cmd(int argc, char **argv)
"set vf vlan antispoof (port_id) (vf_id) (on|off)\n"
" Set VLAN antispoof for a VF from the PF.\n\n"
-#endif
- "set vlan filter (on|off) (port_id)\n"
+ "set vf vlan tag (port_id) (vf_id) (on|off)\n"
+ " Set VLAN tag for a VF from the PF.\n\n"
+
+ "set vf tx max-bandwidth (port_id) (vf_id) (bandwidth)\n"
+ " Set a VF's max bandwidth(Mbps).\n\n"
+
+ "set vf tc tx min-bandwidth (port_id) (vf_id) (bw1, bw2, ...)\n"
+ " Set all TCs' min bandwidth(%%) on a VF.\n\n"
+
+ "set vf tc tx max-bandwidth (port_id) (vf_id) (tc_no) (bandwidth)\n"
+ " Set a TC's max bandwidth(Mbps) on a VF.\n\n"
+
+ "set tx strict-link-priority (port_id) (tc_bitmap)\n"
+ " Set some TCs' strict link priority mode on a physical port.\n\n"
+
+ "set tc tx min-bandwidth (port_id) (bw1, bw2, ...)\n"
+ " Set all TCs' min bandwidth(%%) for all PF and VFs.\n\n"
+
+ "vlan set filter (on|off) (port_id)\n"
" Set the VLAN filter on a port.\n\n"
- "set vlan qinq (on|off) (port_id)\n"
+ "vlan set qinq (on|off) (port_id)\n"
" Set the VLAN QinQ (extended queue in queue)"
" on a port.\n\n"
- "set vlan (inner|outer) tpid (value) (port_id)\n"
+ "vlan set (inner|outer) tpid (value) (port_id)\n"
" Set the VLAN TPID for Packet Filtering on"
" a port\n\n"
- "set rx_vlan add (vlan_id|all) (port_id)\n"
+ "rx_vlan add (vlan_id|all) (port_id)\n"
" Add a vlan_id, or all identifiers, to the set"
" of VLAN identifiers filtered by port_id.\n\n"
- "set rx_vlan rm (vlan_id|all) (port_id)\n"
+ "rx_vlan rm (vlan_id|all) (port_id)\n"
" Remove a vlan_id, or all identifiers, from the set"
" of VLAN identifiers filtered by port_id.\n\n"
- "set rx_vlan add (vlan_id) port (port_id) vf (vf_mask)\n"
+ "rx_vlan add (vlan_id) port (port_id) vf (vf_mask)\n"
" Add a vlan_id, to the set of VLAN identifiers"
"filtered for VF(s) from port_id.\n\n"
- "set rx_vlan rm (vlan_id) port (port_id) vf (vf_mask)\n"
+ "rx_vlan rm (vlan_id) port (port_id) vf (vf_mask)\n"
" Remove a vlan_id, to the set of VLAN identifiers"
"filtered for VF(s) from port_id.\n\n"
- "set rx_vxlan_port add (udp_port) (port_id)\n"
+ "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) "
+ "(inner_vlan) (vxlan|nvgre|ipingre) (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|"
+ "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n"
+ " remove a tunnel filter of a port.\n\n"
+
+ "rx_vxlan_port add (udp_port) (port_id)\n"
" Add an UDP port for VXLAN packet filter on a port\n\n"
- "set rx_vxlan_port rm (udp_port) (port_id)\n"
+ "rx_vxlan_port rm (udp_port) (port_id)\n"
" Remove an UDP port for VXLAN packet filter on a port\n\n"
- "set tx_vlan (port_id) vlan_id[, vlan_id_outer]\n"
+ "tx_vlan set (port_id) vlan_id[, vlan_id_outer]\n"
" Set hardware insertion of VLAN IDs (single or double VLAN "
"depends on the number of VLAN IDs) in packets sent on a port.\n\n"
- "set tx_vlan pvid (port_id) (vlan_id) (on|off)\n"
+ "tx_vlan set pvid port_id vlan_id (on|off)\n"
" Set port based TX VLAN insertion.\n\n"
- "set tx_vlan reset (port_id)\n"
+ "tx_vlan reset (port_id)\n"
" Disable hardware insertion of a VLAN header in"
" packets sent on a port.\n\n"
- "set csum (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)\n"
+ "csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)\n"
" Select hardware or software calculation of the"
" checksum when transmitting a packet using the"
" csum forward engine.\n"
@@ -382,39 +462,48 @@ help_cmd(int argc, char **argv)
" the forward engine (vxlan, gre and ipip are supported)\n"
" Please check the NIC datasheet for HW limits.\n\n"
- "set csum parse-tunnel (on|off) (tx_port_id)\n"
+ "csum parse-tunnel (on|off) (tx_port_id)\n"
" If disabled, treat tunnel packets as non-tunneled"
" packets (treat inner headers as payload). The port\n"
" argument is the port used for TX in csum forward"
" engine.\n\n"
- "show csum (port_id)\n"
+ "csum show (port_id)\n"
" Display tx checksum offload configuration\n\n"
- "set tso (segsize) (portid)\n"
+ "tso set (segsize) (portid)\n"
" Enable TCP Segmentation Offload in csum forward"
" engine.\n"
" Please check the NIC datasheet for HW limits.\n\n"
- "show tso (portid)"
+ "tso show (portid)"
" Display the status of TCP Segmentation Offload.\n\n"
+ "gro (on|off) (port_id)"
+ " Enable or disable Generic Receive Offload in"
+ " csum forwarding engine.\n\n"
+
+ "gro set (max_flow_num) (max_item_num_per_flow) (port_id)\n"
+ " Set max flow number and max packet number per-flow"
+ " for GRO.\n\n"
+
"set fwd (%s)\n"
" Set packet forwarding mode.\n\n"
- "set mac_addr add (port_id) (XX:XX:XX:XX:XX:XX)\n"
+ "mac_addr add (port_id) (XX:XX:XX:XX:XX:XX)\n"
" Add a MAC address on port_id.\n\n"
- "set mac_addr remove (port_id) (XX:XX:XX:XX:XX:XX)\n"
+ "mac_addr remove (port_id) (XX:XX:XX:XX:XX:XX)\n"
" Remove a MAC address from port_id.\n\n"
- "set mac_addr add port (port_id) vf (vf_id) (mac_address)\n"
+ "mac_addr set (port_id) (XX:XX:XX:XX:XX:XX)\n"
+ " Set the default MAC address for port_id.\n\n"
+
+ "mac_addr add port (port_id) vf (vf_id) (mac_address)\n"
" Add a MAC address for a VF on the port.\n\n"
-#ifdef RTE_LIBRTE_IXGBE_PMD
"set vf mac addr (port_id) (vf_id) (XX:XX:XX:XX:XX:XX)\n"
" Set the MAC address for a VF from the PF.\n\n"
-#endif
"set port (port_id) uta (mac_address|all) (on|off)\n"
" Add/Remove a or all unicast hash filter(s)"
@@ -426,6 +515,12 @@ help_cmd(int argc, char **argv)
"set allmulti (port_id|all) (on|off)\n"
" Set the allmulti mode on port_id, or all.\n\n"
+ "set vf promisc (port_id) (vf_id) (on|off)\n"
+ " Set unicast promiscuous mode for a VF from the PF.\n\n"
+
+ "set vf allmulti (port_id) (vf_id) (on|off)\n"
+ " Set multicast promiscuous mode for a VF from the PF.\n\n"
+
"set flow_ctrl rx (on|off) tx (on|off) (high_water)"
" (low_water) (pause_time) (send_xon) mac_ctrl_frame_fwd"
" (on|off) autoneg (on|off) (port_id)\n"
@@ -450,139 +545,422 @@ help_cmd(int argc, char **argv)
" e.g., 'set stat_qmap rx 0 2 5' sets rx queue 2"
" on port 0 to mapping 5.\n\n"
+ "set port (port_id) vf (vf_id) rx|tx on|off\n"
+ " Enable/Disable a VF receive/tranmit from a port\n\n"
+
+ "set port (port_id) vf (vf_id) (mac_addr)"
+ " (exact-mac#exact-mac-vlan#hashmac|hashmac-vlan) on|off\n"
+ " Add/Remove unicast or multicast MAC addr filter"
+ " for a VF.\n\n"
+
+ "set port (port_id) vf (vf_id) rxmode (AUPE|ROPE|BAM"
+ "|MPE) (on|off)\n"
+ " AUPE:accepts untagged VLAN;"
+ "ROPE:accept unicast hash\n\n"
+ " BAM:accepts broadcast packets;"
+ "MPE:accepts all multicast packets\n\n"
+ " Enable/Disable a VF receive mode of a port\n\n"
+
+ "set port (port_id) queue (queue_id) rate (rate_num)\n"
+ " Set rate limit for a queue of a port\n\n"
+
+ "set port (port_id) vf (vf_id) rate (rate_num) "
+ "queue_mask (queue_mask_value)\n"
+ " Set rate limit for queues in VF of a port\n\n"
+
+ "set port (port_id) mirror-rule (rule_id)"
+ " (pool-mirror-up|pool-mirror-down|vlan-mirror)"
+ " (poolmask|vlanid[,vlanid]*) dst-pool (pool_id) (on|off)\n"
+ " Set pool or vlan type mirror rule on a port.\n"
+ " e.g., 'set port 0 mirror-rule 0 vlan-mirror 0,1"
+ " dst-pool 0 on' enable mirror traffic with vlan 0,1"
+ " to pool 0.\n\n"
+
+ "set port (port_id) mirror-rule (rule_id)"
+ " (uplink-mirror|downlink-mirror) dst-pool"
+ " (pool_id) (on|off)\n"
+ " Set uplink or downlink type mirror rule on a port.\n"
+ " e.g., 'set port 0 mirror-rule 0 uplink-mirror dst-pool"
+ " 0 on' enable mirror income traffic to pool 0.\n\n"
+
+ "reset port (port_id) mirror-rule (rule_id)\n"
+ " Reset a mirror rule.\n\n"
+
+ "set flush_rx (on|off)\n"
+ " Flush (default) or don't flush RX streams before"
+ " forwarding. Mainly used with PCAP drivers.\n\n"
+
+ "set bypass mode (normal|bypass|isolate) (port_id)\n"
+ " Set the bypass mode for the lowest port on bypass enabled"
+ " NIC.\n\n"
+
+ "set bypass event (timeout|os_on|os_off|power_on|power_off) "
+ "mode (normal|bypass|isolate) (port_id)\n"
+ " Set the event required to initiate specified bypass mode for"
+ " the lowest port on a bypass enabled NIC where:\n"
+ " timeout = enable bypass after watchdog timeout.\n"
+ " os_on = enable bypass when OS/board is powered on.\n"
+ " os_off = enable bypass when OS/board is powered off.\n"
+ " power_on = enable bypass when power supply is turned on.\n"
+ " power_off = enable bypass when power supply is turned off."
+ "\n\n"
+
+ "set bypass timeout (0|1.5|2|3|4|8|16|32)\n"
+ " Set the bypass watchdog timeout to 'n' seconds"
+ " where 0 = instant.\n\n"
+
+ "show bypass config (port_id)\n"
+ " Show the bypass configuration for a bypass enabled NIC"
+ " using the lowest port on the NIC.\n\n"
+
+#ifdef RTE_LIBRTE_PMD_BOND
+ "create bonded device (mode) (socket)\n"
+ " Create a new bonded device with specific bonding mode and socket.\n\n"
+
+ "add bonding slave (slave_id) (port_id)\n"
+ " Add a slave device to a bonded device.\n\n"
+
+ "remove bonding slave (slave_id) (port_id)\n"
+ " Remove a slave device from a bonded device.\n\n"
+
+ "set bonding mode (value) (port_id)\n"
+ " Set the bonding mode on a bonded device.\n\n"
+
+ "set bonding primary (slave_id) (port_id)\n"
+ " Set the primary slave for a bonded device.\n\n"
+
+ "show bonding config (port_id)\n"
+ " Show the bonding config for port_id.\n\n"
+
+ "set bonding mac_addr (port_id) (address)\n"
+ " Set the MAC address of a bonded device.\n\n"
+
+ "set bonding mode IEEE802.3AD aggregator policy (port_id) (agg_name)"
+ " Set Aggregation mode for IEEE802.3AD (mode 4)"
+
+ "set bonding xmit_balance_policy (port_id) (l2|l23|l34)\n"
+ " Set the transmit balance policy for bonded device running in balance mode.\n\n"
+
+ "set bonding mon_period (port_id) (value)\n"
+ " Set the bonding link status monitoring polling period in ms.\n\n"
+
+ "set bonding lacp dedicated_queues <port_id> (enable|disable)\n"
+ " Enable/disable dedicated queues for LACP control traffic.\n\n"
+
+#endif
"set link-up port (port_id)\n"
- " Set link up for a port.\n\n"
+ " Set link up for a port.\n\n"
"set link-down port (port_id)\n"
- " Set link down for a port.\n\n"
+ " Set link down for a port.\n\n"
- "set E-tag insertion on port-tag-id (value)"
+ "E-tag set insertion on port-tag-id (value)"
" port (port_id) vf (vf_id)\n"
" Enable E-tag insertion for a VF on a port\n\n"
- "set E-tag insertion off port (port_id) vf (vf_id)\n"
+ "E-tag set insertion off port (port_id) vf (vf_id)\n"
" Disable E-tag insertion for a VF on a port\n\n"
- "set E-tag stripping (on|off) port (port_id)\n"
+ "E-tag set stripping (on|off) port (port_id)\n"
" Enable/disable E-tag stripping on a port\n\n"
- "set E-tag forwarding (on|off) port (port_id)\n"
+ "E-tag set forwarding (on|off) port (port_id)\n"
" Enable/disable E-tag based forwarding"
" on a port\n\n"
- "set E-tag filter add e-tag-id (value) dst-pool"
+ "E-tag set filter add e-tag-id (value) dst-pool"
" (pool_id) port (port_id)\n"
" Add an E-tag forwarding filter on a port\n\n"
- "set E-tag filter del e-tag-id (value) port (port_id)\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"
- ,
- list_pkt_forwarding_modes()
+ "ddp add (port_id) (profile_path[,output_path])\n"
+ " Load a profile package on a port\n\n"
+
+ "ddp del (port_id) (profile_path)\n"
+ " Delete a profile package from a port\n\n"
+
+ "ptype mapping get (port_id) (valid_only)\n"
+ " Get ptype mapping on a port\n\n"
+
+ "ptype mapping replace (port_id) (target) (mask) (pky_type)\n"
+ " Replace target with the pkt_type in ptype mapping\n\n"
+
+ "ptype mapping reset (port_id)\n"
+ " Reset ptype mapping on a port\n\n"
+
+ "ptype mapping update (port_id) (hw_ptype) (sw_ptype)\n"
+ " Update a ptype mapping item on a port\n\n"
+
+ , list_pkt_forwarding_modes()
);
}
if (show_all || ports) {
-
cli_printf(
"\n"
- "Port Operations:\n"
- "----------------\n\n"
+ "Configuration:\n"
+ "--------------\n"
+ "Configuration changes only become active when"
+ " forwarding is started/restarted.\n\n"
- "port start (port_id|all)\n"
- " Start all ports or port_id.\n\n"
+ "set default\n"
+ " Reset forwarding to the default configuration.\n\n"
- "port stop (port_id|all)\n"
- " Stop all ports or port_id.\n\n"
+ "set verbose (level)\n"
+ " Set the debug verbosity level X.\n\n"
- "port close (port_id|all)\n"
- " Close all ports or port_id.\n\n"
+ "set nbport (num)\n"
+ " Set number of ports.\n\n"
- "port show|clear (info|stats|xstats|fdir|stat_qmap) (port_id|all)\n"
- " Clear information for port_id, or all.\n\n"
+ "set nbcore (num)\n"
+ " Set number of cores.\n\n"
- "port attach (ident)\n"
- " Attach physical or virtual dev by pci address or virtual device name\n\n"
+ "set coremask (mask)\n"
+ " Set the forwarding cores hexadecimal mask.\n\n"
- "port detach (port_id)\n"
- " Detach physical or virtual dev by port_id\n\n"
+ "set portmask (mask)\n"
+ " Set the forwarding ports hexadecimal mask.\n\n"
- "port config (port_id|all)"
- " speed (10|100|1000|10000|25000|40000|50000|100000|auto)"
- " duplex (half|full|auto)\n"
- " Set speed and duplex for all ports or port_id\n\n"
+ "set burst (num)\n"
+ " Set number of packets per burst.\n\n"
- "port config all (rxq|txq|rxd|txd) (value)\n"
- " Set number for rxq/txq/rxd/txd.\n\n"
+ "set burst tx delay (microseconds) retry (num)\n"
+ " Set the transmit delay time and number of retries,"
+ " effective when retry is enabled.\n\n"
- "port config all max-pkt-len (value)\n"
- " Set the max packet length.\n\n"
+ "set txpkts (x[,y]*)\n"
+ " Set the length of each segment of TXONLY"
+ " and optionally CSUM packets.\n\n"
- "port config all (crc-strip|scatter|rx-cksum|hw-vlan|hw-vlan-filter|"
- "hw-vlan-strip|hw-vlan-extend|drop-en)"
- " (on|off)\n"
- " Set crc-strip/scatter/rx-checksum/hardware-vlan/drop_en"
- " for ports.\n\n"
+ "set txsplit (off|on|rand)\n"
+ " Set the split policy for the TX packets."
+ " Right now only applicable for CSUM and TXONLY"
+ " modes\n\n"
- "port config all rss (all|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none)\n"
- " Set the RSS mode.\n\n"
+ "set corelist (x[,y]*)\n"
+ " Set the list of forwarding cores.\n\n"
- "port config port-id rss reta (hash,queue)[,(hash,queue)]\n"
- " Set the RSS redirection table.\n\n"
+ "set portlist (x[,y]*)\n"
+ " Set the list of forwarding ports.\n\n"
- "port config (port_id) dcb vt (on|off) (traffic_class)"
- " pfc (on|off)\n"
- " Set the DCB mode.\n\n"
+ "set tx loopback (port_id) (on|off)\n"
+ " Enable or disable tx loopback.\n\n"
- "port config all burst (value)\n"
- " Set the number of packets per burst.\n\n"
+ "set all queues drop (port_id) (on|off)\n"
+ " Set drop enable bit for all queues.\n\n"
- "port config all (txpt|txht|txwt|rxpt|rxht|rxwt)"
- " (value)\n"
- " Set the ring prefetch/host/writeback threshold"
- " for tx/rx queue.\n\n"
+ "set vf split drop (port_id) (vf_id) (on|off)\n"
+ " Set split drop enable bit for a VF from the PF.\n\n"
- "port config all (txfreet|txrst|rxfreet) (value)\n"
- " Set free threshold for rx/tx, or set"
- " tx rs bit threshold.\n\n"
- "port config mtu X value\n"
- " Set the MTU of port X to a given value\n\n"
+ "set vf mac antispoof (port_id) (vf_id) (on|off).\n"
+ " Set MAC antispoof for a VF from the PF.\n\n"
- "port (port_id) (rxq|txq) (queue_id) (start|stop)\n"
- " Start/stop a rx/tx queue of port X. Only take effect"
- " when port X is started\n\n"
+ "set macsec offload (port_id) on encrypt (on|off) replay-protect (on|off)\n"
+ " Enable MACsec offload.\n\n"
- "port config (port_id|all) l2-tunnel E-tag ether-type"
- " (value)\n"
- " Set the value of E-tag ether-type.\n\n"
+ "set macsec offload (port_id) off\n"
+ " Disable MACsec offload.\n\n"
- "port config (port_id|all) l2-tunnel E-tag"
- " (enable|disable)\n"
- " Enable/disable the E-tag support.\n\n"
+ "set macsec sc (tx|rx) (port_id) (mac) (pi)\n"
+ " Configure MACsec secure connection (SC).\n\n"
- "port show (info|stats|xstats|fdir|stat_qmap|dcb_tc) (port_id|all)\n"
- " Display information for port_id, or all.\n\n"
+ "set macsec sa (tx|rx) (port_id) (idx) (an) (pn) (key)\n"
+ " Configure MACsec secure association (SA).\n\n"
- "port show X rss reta (size) (mask0,mask1,...)\n"
- " Display the rss redirection table entry indicated"
- " by masks on port X. size is used to indicate the"
- " hardware supported reta size\n\n"
+ "set vf broadcast (port_id) (vf_id) (on|off)\n"
+ " Set VF broadcast for a VF from the PF.\n\n"
- "port show rss-hash ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|"
- "ipv4-sctp|ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|"
- "ipv6-other|l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex [key]\n"
- " Display the RSS hash functions and RSS hash key"
- " of port X\n\n"
+ "vlan set strip (on|off) (port_id)\n"
+ " Set the VLAN strip on a port.\n\n"
+
+ "vlan set stripq (on|off) (port_id,queue_id)\n"
+ " Set the VLAN strip for a queue on a port.\n\n"
+
+ "set vf vlan stripq (port_id) (vf_id) (on|off)\n"
+ " Set the VLAN strip for all queues in a pool for a VF from the PF.\n\n"
+
+ "set vf vlan insert (port_id) (vf_id) (vlan_id)\n"
+ " Set VLAN insert for a VF from the PF.\n\n"
+
+ "set vf vlan antispoof (port_id) (vf_id) (on|off)\n"
+ " Set VLAN antispoof for a VF from the PF.\n\n"
+
+ "set vf vlan tag (port_id) (vf_id) (on|off)\n"
+ " Set VLAN tag for a VF from the PF.\n\n"
+
+ "set vf tx max-bandwidth (port_id) (vf_id) (bandwidth)\n"
+ " Set a VF's max bandwidth(Mbps).\n\n"
+
+ "set vf tc tx min-bandwidth (port_id) (vf_id) (bw1, bw2, ...)\n"
+ " Set all TCs' min bandwidth(%%) on a VF.\n\n"
+
+ "set vf tc tx max-bandwidth (port_id) (vf_id) (tc_no) (bandwidth)\n"
+ " Set a TC's max bandwidth(Mbps) on a VF.\n\n"
+
+ "set tx strict-link-priority (port_id) (tc_bitmap)\n"
+ " Set some TCs' strict link priority mode on a physical port.\n\n"
+
+ "set tc tx min-bandwidth (port_id) (bw1, bw2, ...)\n"
+ " Set all TCs' min bandwidth(%%) for all PF and VFs.\n\n"
+
+ "vlan set filter (on|off) (port_id)\n"
+ " Set the VLAN filter on a port.\n\n"
+
+ "vlan set qinq (on|off) (port_id)\n"
+ " Set the VLAN QinQ (extended queue in queue)"
+ " on a port.\n\n"
+
+ "vlan set (inner|outer) tpid (value) (port_id)\n"
+ " Set the VLAN TPID for Packet Filtering on"
+ " a port\n\n"
+
+ "rx_vlan add (vlan_id|all) (port_id)\n"
+ " Add a vlan_id, or all identifiers, to the set"
+ " of VLAN identifiers filtered by port_id.\n\n"
+
+ "rx_vlan rm (vlan_id|all) (port_id)\n"
+ " Remove a vlan_id, or all identifiers, from the set"
+ " of VLAN identifiers filtered by port_id.\n\n"
+
+ "rx_vlan add (vlan_id) port (port_id) vf (vf_mask)\n"
+ " Add a vlan_id, to the set of VLAN identifiers"
+ "filtered for VF(s) from port_id.\n\n"
+
+ "rx_vlan rm (vlan_id) port (port_id) vf (vf_mask)\n"
+ " Remove a vlan_id, to the set of VLAN identifiers"
+ "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|"
+ "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|"
+ "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n"
+ " remove a tunnel filter of a port.\n\n"
+
+ "rx_vxlan_port add (udp_port) (port_id)\n"
+ " Add an UDP port for VXLAN packet filter on a port\n\n"
+
+ "rx_vxlan_port rm (udp_port) (port_id)\n"
+ " Remove an UDP port for VXLAN packet filter on a port\n\n"
+
+ "tx_vlan set (port_id) vlan_id[, vlan_id_outer]\n"
+ " Set hardware insertion of VLAN IDs (single or double VLAN "
+ "depends on the number of VLAN IDs) in packets sent on a port.\n\n"
+
+ "tx_vlan set pvid port_id vlan_id (on|off)\n"
+ " Set port based TX VLAN insertion.\n\n"
+
+ "tx_vlan reset (port_id)\n"
+ " Disable hardware insertion of a VLAN header in"
+ " packets sent on a port.\n\n"
+
+ "csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)\n"
+ " Select hardware or software calculation of the"
+ " checksum when transmitting a packet using the"
+ " csum forward engine.\n"
+ " ip|udp|tcp|sctp always concern the inner layer.\n"
+ " outer-ip concerns the outer IP layer in"
+ " case the packet is recognized as a tunnel packet by"
+ " the forward engine (vxlan, gre and ipip are supported)\n"
+ " Please check the NIC datasheet for HW limits.\n\n"
+
+ "csum parse-tunnel (on|off) (tx_port_id)\n"
+ " If disabled, treat tunnel packets as non-tunneled"
+ " packets (treat inner headers as payload). The port\n"
+ " argument is the port used for TX in csum forward"
+ " engine.\n\n"
+
+ "csum show (port_id)\n"
+ " Display tx checksum offload configuration\n\n"
+
+ "tso set (segsize) (portid)\n"
+ " Enable TCP Segmentation Offload in csum forward"
+ " engine.\n"
+ " Please check the NIC datasheet for HW limits.\n\n"
+
+ "tso show (portid)"
+ " Display the status of TCP Segmentation Offload.\n\n"
+
+ "gro (on|off) (port_id)"
+ " Enable or disable Generic Receive Offload in"
+ " csum forwarding engine.\n\n"
+
+ "gro set (max_flow_num) (max_item_num_per_flow) (port_id)\n"
+ " Set max flow number and max packet number per-flow"
+ " for GRO.\n\n"
+
+ "set fwd (%s)\n"
+ " Set packet forwarding mode.\n\n"
+
+ "mac_addr add (port_id) (XX:XX:XX:XX:XX:XX)\n"
+ " Add a MAC address on port_id.\n\n"
+
+ "mac_addr remove (port_id) (XX:XX:XX:XX:XX:XX)\n"
+ " Remove a MAC address from port_id.\n\n"
+
+ "mac_addr set (port_id) (XX:XX:XX:XX:XX:XX)\n"
+ " Set the default MAC address for port_id.\n\n"
+
+ "mac_addr add port (port_id) vf (vf_id) (mac_address)\n"
+ " Add a MAC address for a VF on the port.\n\n"
+
+ "set vf mac addr (port_id) (vf_id) (XX:XX:XX:XX:XX:XX)\n"
+ " Set the MAC address for a VF from the PF.\n\n"
+
+ "set port (port_id) uta (mac_address|all) (on|off)\n"
+ " Add/Remove a or all unicast hash filter(s)"
+ "from port X.\n\n"
+
+ "set promisc (port_id|all) (on|off)\n"
+ " Set the promiscuous mode on port_id, or all.\n\n"
+
+ "set allmulti (port_id|all) (on|off)\n"
+ " Set the allmulti mode on port_id, or all.\n\n"
+
+ "set vf promisc (port_id) (vf_id) (on|off)\n"
+ " Set unicast promiscuous mode for a VF from the PF.\n\n"
+
+ "set vf allmulti (port_id) (vf_id) (on|off)\n"
+ " Set multicast promiscuous mode for a VF from the PF.\n\n"
+
+ "set flow_ctrl rx (on|off) tx (on|off) (high_water)"
+ " (low_water) (pause_time) (send_xon) mac_ctrl_frame_fwd"
+ " (on|off) autoneg (on|off) (port_id)\n"
+ "set flow_ctrl rx (on|off) (portid)\n"
+ "set flow_ctrl tx (on|off) (portid)\n"
+ "set flow_ctrl high_water (high_water) (portid)\n"
+ "set flow_ctrl low_water (low_water) (portid)\n"
+ "set flow_ctrl pause_time (pause_time) (portid)\n"
+ "set flow_ctrl send_xon (send_xon) (portid)\n"
+ "set flow_ctrl mac_ctrl_frame_fwd (on|off) (portid)\n"
+ "set flow_ctrl autoneg (on|off) (port_id)\n"
+ " Set the link flow control parameter on a port.\n\n"
- "port set (port_id) vf (vf_id) rx|tx on|off\n"
+ "set pfc_ctrl rx (on|off) tx (on|off) (high_water)"
+ " (low_water) (pause_time) (priority) (port_id)\n"
+ " Set the priority flow control parameter on a"
+ " port.\n\n"
+
+ "set stat_qmap (tx|rx) (port_id) (queue_id) (qmapping)\n"
+ " Set statistics mapping (qmapping 0..15) for RX/TX"
+ " queue on port.\n"
+ " e.g., 'set stat_qmap rx 0 2 5' sets rx queue 2"
+ " on port 0 to mapping 5.\n\n"
+
+ "set port (port_id) vf (vf_id) rx|tx on|off\n"
" Enable/Disable a VF receive/tranmit from a port\n\n"
- "port set (port_id) vf (vf_id) (mac_addr)"
- " (exact-mac|exact-mac-vlan|hashmac|hashmac-vlan) on|off\n"
+ "set port (port_id) vf (vf_id) (mac_addr)"
+ " (exact-mac#exact-mac-vlan#hashmac|hashmac-vlan) on|off\n"
" Add/Remove unicast or multicast MAC addr filter"
" for a VF.\n\n"
- "port set (port_id) vf (vf_id) rxmode (AUPE|ROPE|BAM"
+ "set port (port_id) vf (vf_id) rxmode (AUPE|ROPE|BAM"
"|MPE) (on|off)\n"
" AUPE:accepts untagged VLAN;"
"ROPE:accept unicast hash\n\n"
@@ -590,14 +968,14 @@ help_cmd(int argc, char **argv)
"MPE:accepts all multicast packets\n\n"
" Enable/Disable a VF receive mode of a port\n\n"
- "port set (port_id) queue (queue_id) rate (rate_num)\n"
+ "set port (port_id) queue (queue_id) rate (rate_num)\n"
" Set rate limit for a queue of a port\n\n"
- "port set (port_id) vf (vf_id) rate (rate_num) "
+ "set port (port_id) vf (vf_id) rate (rate_num) "
"queue_mask (queue_mask_value)\n"
" Set rate limit for queues in VF of a port\n\n"
- "port set (port_id) mirror-rule (rule_id)"
+ "set port (port_id) mirror-rule (rule_id)"
" (pool-mirror-up|pool-mirror-down|vlan-mirror)"
" (poolmask|vlanid[,vlanid]*) dst-pool (pool_id) (on|off)\n"
" Set pool or vlan type mirror rule on a port.\n"
@@ -605,54 +983,25 @@ help_cmd(int argc, char **argv)
" dst-pool 0 on' enable mirror traffic with vlan 0,1"
" to pool 0.\n\n"
- "port set (port_id) mirror-rule (rule_id)"
+ "set port (port_id) mirror-rule (rule_id)"
" (uplink-mirror|downlink-mirror) dst-pool"
" (pool_id) (on|off)\n"
" Set uplink or downlink type mirror rule on a port.\n"
" e.g., 'set port 0 mirror-rule 0 uplink-mirror dst-pool"
" 0 on' enable mirror income traffic to pool 0.\n\n"
- "port reset (port_id) mirror-rule (rule_id)\n"
+ "reset port (port_id) mirror-rule (rule_id)\n"
" Reset a mirror rule.\n\n"
- "port set flush_rx (on|off)\n"
+ "set flush_rx (on|off)\n"
" Flush (default) or don't flush RX streams before"
" forwarding. Mainly used with PCAP drivers.\n\n"
-#ifdef RTE_LIBRTE_PMD_BOND
- "port bonding create device (mode) (socket)\n"
- " Create a new bonded device with specific bonding mode and socket.\n\n"
-
- "port bonding add slave (slave_id) (port_id)\n"
- " Add a slave device to a bonded device.\n\n"
-
- "port bonding remove slave (slave_id) (port_id)\n"
- " Remove a slave device from a bonded device.\n\n"
-
- "port bonding set mode (value) (port_id)\n"
- " Set the bonding mode on a bonded device.\n\n"
-
- "port bonding set primary (slave_id) (port_id)\n"
- " Set the primary slave for a bonded device.\n\n"
-
- "port bonding show config (port_id)\n"
- " Show the bonding config for port_id.\n\n"
-
- "port bonding set mac_addr (port_id) (address)\n"
- " Set the MAC address of a bonded device.\n\n"
-
- "port bonding set xmit_balance_policy (port_id) (l2|l23|l34)\n"
- " Set the transmit balance policy for bonded device running in balance mode.\n\n"
-
- "port bonding set mon_period (port_id) (value)\n"
- " Set the bonding link status monitoring polling period in ms.\n\n"
-#endif
-#ifdef RTE_NIC_BYPASS
- "port bypass set mode (normal|bypass|isolate) (port_id)\n"
+ "set bypass mode (normal|bypass|isolate) (port_id)\n"
" Set the bypass mode for the lowest port on bypass enabled"
" NIC.\n\n"
- "port bypass set event (timeout|os_on|os_off|power_on|power_off) "
+ "set bypass event (timeout|os_on|os_off|power_on|power_off) "
"mode (normal|bypass|isolate) (port_id)\n"
" Set the event required to initiate specified bypass mode for"
" the lowest port on a bypass enabled NIC where:\n"
@@ -663,68 +1012,144 @@ help_cmd(int argc, char **argv)
" power_off = enable bypass when power supply is turned off."
"\n\n"
- "port bypass set timeout (0|1.5|2|3|4|8|16|32)\n"
+ "set bypass timeout (0|1.5|2|3|4|8|16|32)\n"
" Set the bypass watchdog timeout to 'n' seconds"
" where 0 = instant.\n\n"
- "port bypass show config (port_id)\n"
+ "show bypass config (port_id)\n"
" Show the bypass configuration for a bypass enabled NIC"
" using the lowest port on the NIC.\n\n"
+
+#ifdef RTE_LIBRTE_PMD_BOND
+ "create bonded device (mode) (socket)\n"
+ " Create a new bonded device with specific bonding mode and socket.\n\n"
+
+ "add bonding slave (slave_id) (port_id)\n"
+ " Add a slave device to a bonded device.\n\n"
+
+ "remove bonding slave (slave_id) (port_id)\n"
+ " Remove a slave device from a bonded device.\n\n"
+
+ "set bonding mode (value) (port_id)\n"
+ " Set the bonding mode on a bonded device.\n\n"
+
+ "set bonding primary (slave_id) (port_id)\n"
+ " Set the primary slave for a bonded device.\n\n"
+
+ "show bonding config (port_id)\n"
+ " Show the bonding config for port_id.\n\n"
+
+ "set bonding mac_addr (port_id) (address)\n"
+ " Set the MAC address of a bonded device.\n\n"
+
+ "set bonding mode IEEE802.3AD aggregator policy (port_id) (agg_name)"
+ " Set Aggregation mode for IEEE802.3AD (mode 4)"
+
+ "set bonding xmit_balance_policy (port_id) (l2|l23|l34)\n"
+ " Set the transmit balance policy for bonded device running in balance mode.\n\n"
+
+ "set bonding mon_period (port_id) (value)\n"
+ " Set the bonding link status monitoring polling period in ms.\n\n"
+
+ "set bonding lacp dedicated_queues <port_id> (enable|disable)\n"
+ " Enable/disable dedicated queues for LACP control traffic.\n\n"
+
#endif
+ "set link-up port (port_id)\n"
+ " Set link up for a port.\n\n"
+
+ "set link-down port (port_id)\n"
+ " Set link down for a port.\n\n"
+
+ "E-tag set insertion on port-tag-id (value)"
+ " port (port_id) vf (vf_id)\n"
+ " Enable E-tag insertion for a VF on a port\n\n"
+
+ "E-tag set insertion off port (port_id) vf (vf_id)\n"
+ " Disable E-tag insertion for a VF on a port\n\n"
+
+ "E-tag set stripping (on|off) port (port_id)\n"
+ " Enable/disable E-tag stripping on a port\n\n"
+
+ "E-tag set forwarding (on|off) port (port_id)\n"
+ " Enable/disable E-tag based forwarding"
+ " on a port\n\n"
+
+ "E-tag set filter add e-tag-id (value) dst-pool"
+ " (pool_id) port (port_id)\n"
+ " Add an E-tag forwarding filter on 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"
+
+ "ddp add (port_id) (profile_path[,output_path])\n"
+ " Load a profile package on a port\n\n"
+
+ "ddp del (port_id) (profile_path)\n"
+ " Delete a profile package from a port\n\n"
+
+ "ptype mapping get (port_id) (valid_only)\n"
+ " Get ptype mapping on a port\n\n"
+
+ "ptype mapping replace (port_id) (target) (mask) (pky_type)\n"
+ " Replace target with the pkt_type in ptype mapping\n\n"
+
+ "ptype mapping reset (port_id)\n"
+ " Reset ptype mapping on a port\n\n"
+
+ "ptype mapping update (port_id) (hw_ptype) (sw_ptype)\n"
+ " Update a ptype mapping item on a port\n\n"
+
+ , list_pkt_forwarding_modes()
);
}
- if (show_all || registers)
+ if (show_all || registers) {
cli_printf(
"\n"
"Registers:\n"
"----------\n\n"
- "reg read rxd (port_id) (queue_id) (rxd_id)\n"
- " Display an RX descriptor of a port RX queue.\n\n"
-
- "reg read txd (port_id) (queue_id) (txd_id)\n"
- " Display a TX descriptor of a port TX queue.\n\n"
-
- "reg read (port_id) (address)\n"
+ "read reg (port_id) (address)\n"
" Display value of a port register.\n\n"
- "reg read field (port_id) (address) (bit_x) (bit_y)\n"
+ "read regfield (port_id) (address) (bit_x) (bit_y)\n"
" Display a port register bit field.\n\n"
- "reg read bit (port_id) (address) (bit_x)\n"
+ "read regbit (port_id) (address) (bit_x)\n"
" Display a single port register bit.\n\n"
- "reg write (port_id) (address) (value)\n"
+ "write reg (port_id) (address) (value)\n"
" Set value of a port register.\n\n"
- "reg write field (port_id) (address) (bit_x) (bit_y)"
+ "write regfield (port_id) (address) (bit_x) (bit_y)"
" (value)\n"
" Set bit field of a port register.\n\n"
- "reg write bit (port_id) (address) (bit_x) (value)\n"
+ "write regbit (port_id) (address) (bit_x) (value)\n"
" Set single bit value of a port register.\n\n"
);
+ }
- if (show_all || filters)
+ if (show_all || filters) {
cli_printf(
"\n"
"filters:\n"
"--------\n\n"
- "filter ethertype (port_id) (add|del)"
+ "ethertype_filter (port_id) (add|del)"
" (mac_addr|mac_ignr) (mac_address) ethertype"
" (ether_type) (drop|fwd) queue (queue_id)\n"
" Add/Del an ethertype filter.\n\n"
- "filter 2tuple (port_id) (add|del)"
+ "2tuple_filter (port_id) (add|del)"
" dst_port (dst_port_value) protocol (protocol_value)"
" mask (mask_value) tcp_flags (tcp_flags_value)"
" priority (prio_value) queue (queue_id)\n"
" Add/Del a 2tuple filter.\n\n"
- "filter 5tuple (port_id) (add|del)"
+ "5tuple_filter (port_id) (add|del)"
" dst_ip (dst_address) src_ip (src_address)"
" dst_port (dst_port_value) src_port (src_port_value)"
" protocol (protocol_value)"
@@ -732,15 +1157,15 @@ help_cmd(int argc, char **argv)
" priority (prio_value) queue (queue_id)\n"
" Add/Del a 5tuple filter.\n\n"
- "filter syn (port_id) (add|del) priority (high|low) queue (queue_id)"
+ "syn_filter (port_id) (add|del) priority (high|low) queue (queue_id)"
" Add/Del syn filter.\n\n"
- "filter flex (port_id) (add|del) len (len_value)"
+ "flex_filter (port_id) (add|del) len (len_value)"
" bytes (bytes_value) mask (mask_value)"
" priority (prio_value) queue (queue_id)\n"
" Add/Del a flex filter.\n\n"
- "filter flow_director (port_id) mode IP (add|del|update)"
+ "flow_director_filter (port_id) mode IP (add|del|update)"
" flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)"
" src (src_ip_address) dst (dst_ip_address)"
" tos (tos_value) proto (proto_value) ttl (ttl_value)"
@@ -749,7 +1174,7 @@ help_cmd(int argc, char **argv)
" fd_id (fd_id_value)\n"
" Add/Del an IP type flow director filter.\n\n"
- "filter flow_director (port_id) mode IP (add|del|update)"
+ "flow_director_filter (port_id) mode IP (add|del|update)"
" flow (ipv4-tcp|ipv4-udp|ipv6-tcp|ipv6-udp)"
" src (src_ip_address) (src_port)"
" dst (dst_ip_address) (dst_port)"
@@ -759,7 +1184,7 @@ help_cmd(int argc, char **argv)
" fd_id (fd_id_value)\n"
" Add/Del an UDP/TCP type flow director filter.\n\n"
- "filter flow_director (port_id) mode IP (add|del|update)"
+ "flow_director_filter (port_id) mode IP (add|del|update)"
" flow (ipv4-sctp|ipv6-sctp)"
" src (src_ip_address) (src_port)"
" dst (dst_ip_address) (dst_port)"
@@ -770,86 +1195,70 @@ help_cmd(int argc, char **argv)
" pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\n"
" Add/Del a SCTP type flow director filter.\n\n"
- "filter flow_director (port_id) mode IP (add|del|update)"
+ "flow_director_filter (port_id) mode IP (add|del|update)"
" flow l2_payload ether (ethertype)"
" flexbytes (flexbytes_value) (drop|fwd)"
" pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\n"
" Add/Del a l2 payload type flow director filter.\n\n"
- "filter flow_director (port_id) mode MAC-VLAN (add|del|update)"
+ "flow_director_filter (port_id) mode MAC-VLAN (add|del|update)"
" mac (mac_address) vlan (vlan_value)"
" flexbytes (flexbytes_value) (drop|fwd)"
" queue (queue_id) fd_id (fd_id_value)\n"
" Add/Del a MAC-VLAN flow director filter.\n\n"
- "filter flow_director (port_id) mode Tunnel (add|del|update)"
+ "flow_director_filter (port_id) mode Tunnel (add|del|update)"
" mac (mac_address) vlan (vlan_value)"
" tunnel (NVGRE|VxLAN) tunnel-id (tunnel_id_value)"
" flexbytes (flexbytes_value) (drop|fwd)"
" queue (queue_id) fd_id (fd_id_value)\n"
" Add/Del a Tunnel flow director filter.\n\n"
- "filter flow_director flush (port_id)\n"
+ "flush_flow_director (port_id)\n"
" Flush all flow director entries of a device.\n\n"
- "filter flow_director mask (port_id) mode IP vlan (vlan_value)"
+ "flow_director_mask (port_id) mode IP vlan (vlan_value)"
" src_mask (ipv4_src) (ipv6_src) (src_port)"
" dst_mask (ipv4_dst) (ipv6_dst) (dst_port)\n"
" Set flow director IP mask.\n\n"
- "filter flow_director mask (port_id) mode MAC-VLAN"
+ "flow_director_mask (port_id) mode MAC-VLAN"
" vlan (vlan_value)\n"
" Set flow director MAC-VLAN mask.\n\n"
- "filter flow_director mask (port_id) mode Tunnel"
+ "flow_director_mask (port_id) mode Tunnel"
" vlan (vlan_value) mac (mac_value)"
" tunnel-type (tunnel_type_value)"
" tunnel-id (tunnel_id_value)\n"
" Set flow director Tunnel mask.\n\n"
- "filter flow_director flex_mask (port_id)"
+ "flow_director_flex_mask (port_id)"
" flow (none|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|"
"ipv6-other|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|l2_payload|all)"
" (mask)\n"
" Configure mask of flex payload.\n\n"
- "filter flow_director flex_payload (port_id)"
+ "flow_director_flex_payload (port_id)"
" (raw|l2|l3|l4) (config)\n"
" Configure flex payload selection.\n\n"
- "filter tunnel add (port_id) (outer_mac) (inner_mac) (ip_addr) "
- "(inner_vlan) (vxlan|nvgre|ipingre) (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"
-
- "filter tunnel rm (port_id) (outer_mac) (inner_mac) (ip_addr) "
- "(inner_vlan) (vxlan|nvgre|ipingre) (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"
- );
-
- if (show_all || hash)
- cli_printf(
- "\n"
- "Hash:\n"
- "----------\n\n"
- "hash get sym_hash_ena_per_port (port_id)\n"
+ "get_sym_hash_ena_per_port (port_id)\n"
" get symmetric hash enable configuration per port.\n\n"
- "hash set sym_hash_ena_per_port (port_id) (enable|disable)\n"
+ "set_sym_hash_ena_per_port (port_id) (enable|disable)\n"
" set symmetric hash enable configuration per port"
" to enable or disable.\n\n"
- "hash get hash_global_config (port_id)\n"
+ "get_hash_global_config (port_id)\n"
" Get the global configurations of hash filters.\n\n"
- "hash set hash_global_config (port_id) (toeplitz|simple_xor|default)"
+ "set_hash_global_config (port_id) (toeplitz|simple_xor|default)"
" (ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|"
"ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload)"
" (enable|disable)\n"
" Set the global configurations of hash filters.\n\n"
- "hash set hash_input (port_id) (ipv4|ipv4-frag|"
+ "set_hash_input_set (port_id) (ipv4|ipv4-frag|"
"ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|"
"ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
"l2_payload) (ovlan|ivlan|src-ipv4|dst-ipv4|src-ipv6|"
@@ -861,7 +1270,7 @@ help_cmd(int argc, char **argv)
"fld-8th|none) (select|add)\n"
" Set the input set for hash.\n\n"
- "hash set fdir_input (port_id) "
+ "set_fdir_input_set (port_id) "
"(ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
"ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
"l2_payload) (ivlan|ethertype|src-ipv4|dst-ipv4|src-ipv6|"
@@ -871,7 +1280,40 @@ help_cmd(int argc, char **argv)
"sctp-src-port|sctp-dst-port|sctp-veri-tag|none)"
" (select|add)\n"
" Set the input set for FDir.\n\n"
+
+ "flow validate {port_id}"
+ " [group {group_id}] [priority {level}]"
+ " [ingress] [egress]"
+ " pattern {item} [/ {item} [...]] / end"
+ " actions {action} [/ {action} [...]] / end\n"
+ " Check whether a flow rule can be created.\n\n"
+
+ "flow create {port_id}"
+ " [group {group_id}] [priority {level}]"
+ " [ingress] [egress]"
+ " pattern {item} [/ {item} [...]] / end"
+ " actions {action} [/ {action} [...]] / end\n"
+ " Create a flow rule.\n\n"
+
+ "flow destroy {port_id} rule {rule_id} [...]\n"
+ " Destroy specific flow rules.\n\n"
+
+ "flow flush {port_id}\n"
+ " Destroy all flow rules.\n\n"
+
+ "flow query {port_id} {rule_id} {action}\n"
+ " Query an existing flow rule.\n\n"
+
+ "flow list {port_id} [group {group_id}] [...]\n"
+ " List existing flow rules sorted by priority,"
+ " filtered by group identifiers.\n\n"
+
+ "flow isolate {port_id} {boolean}\n"
+ " Restrict ingress traffic to the defined"
+ " flow rules\n\n"
);
+ }
+
return 0;
}
@@ -916,6 +1358,383 @@ control_cmd(int argc, char **argv)
return 0;
}
+static int
+showport_parse_reta_config(struct rte_eth_rss_reta_entry64 *conf,
+ uint16_t nb_entries,
+ char *str)
+{
+ uint32_t size;
+ const char *p, *p0 = str;
+ char s[256];
+ char *end;
+ char *str_fld[8];
+ uint16_t i;
+ uint16_t num = (nb_entries + RTE_RETA_GROUP_SIZE - 1) /
+ RTE_RETA_GROUP_SIZE;
+ int ret;
+
+ p = strchr(p0, '(');
+ if (p == NULL)
+ return -1;
+ p++;
+ p0 = strchr(p, ')');
+ if (p0 == NULL)
+ return -1;
+ size = p0 - p;
+ if (size >= sizeof(s)) {
+ printf("The string size exceeds the internal buffer size\n");
+ return -1;
+ }
+ snprintf(s, sizeof(s), "%.*s", size, p);
+ ret = rte_strsplit(s, sizeof(s), str_fld, num, ',');
+ if (ret <= 0 || ret != num) {
+ printf("The bits of masks do not match the number of "
+ "reta entries: %u\n", num);
+ return -1;
+ }
+ for (i = 0; i < ret; i++)
+ conf[i].mask = (uint64_t)strtoul(str_fld[i], &end, 0);
+
+ return 0;
+}
+
+static struct cli_map display_map[] = {
+ { 0, "show port %d rss reta %d %s" },
+ { 10, "show port %d rss-hash %|ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
+ "ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex" },
+ { 20, "show bypass config %d" },
+ { 30, "show bonding config %d"},
+ { 40, "%|show|clear port %|info|stats|xstats|fdir|stat_qmap|dcb_tc|cap %d" },
+ { 50, "show %|rxq|txq info %d %d" },
+ { -1, NULL }
+};
+
+static int
+display_cmd(int argc, char **argv)
+{
+ struct cli_map *m;
+ uint8_t pid;
+ uint16_t size, qid;
+ int n;
+ struct rte_eth_rss_reta_entry64 reta_conf[8];
+ struct rte_eth_dev_info dev_info;
+
+ memset(&dev_info, 0, sizeof(dev_info));
+
+ m = cli_mapping(display_map, argc, argv);
+ if (!m)
+ return -1;
+ pid = atoi(argv[2]);
+ size = atoi(argv[5]);
+ switch(m->index) {
+ case 0:
+ rte_eth_dev_info_get(pid, &dev_info);
+ if (dev_info.reta_size == 0 || size != dev_info.reta_size ||
+ size > ETH_RSS_RETA_SIZE_512) {
+ cli_printf("Invalid redirection table size: %u\n",
+ size);
+ return 0;
+ }
+
+ memset(reta_conf, 0, sizeof(reta_conf));
+ if (showport_parse_reta_config(reta_conf, size, argv[6]) < 0) {
+ cli_printf("Invalid string: %s for reta masks\n",
+ argv[6]);
+ return 0;
+ }
+ port_rss_reta_info(pid, reta_conf, size);
+ break;
+ case 10:
+ port_rss_hash_conf_show(pid, argv[4], argv[5] != NULL);
+ break;
+ case 20: { /* show bypass config %d */
+#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS
+ unsigned int bypass_mode, bypass_event;
+ int i;
+ static const char * const modes[RTE_BYPASS_MODE_NUM] =
+ {"UNKNOWN", "normal", "bypass", "isolate"};
+ static const char * const timeouts[RTE_BYPASS_TMT_NUM] =
+ {"off", "1.5", "2", "3", "4", "8", "16", "32"};
+ static const char * const modes[RTE_BYPASS_MODE_NUM] =
+ {"UNKNOWN", "normal", "bypass", "isolate"};
+ static const char * const events[RTE_BYPASS_EVENT_NUM] = {
+ "NONE",
+ "OS/board on",
+ "power supply on",
+ "OS/board off",
+ "power supply off",
+ "timeout"
+ };
+ int num_events = (sizeof events) / (sizeof events[0]);
+
+ pid = atoi(argv[4]);
+
+ bypass_mode = RTE_BYPASS_MODE_NORMAL;
+ bypass_event = RTE_BYPASS_EVENT_NODE;
+ bypass_timeout = RTE_BYPASS_TMT_OFF;
+
+ /* Display the bypass mode.*/
+ if (rte_eth_dev_bypass_state_show(port_id, &bypass_mode)) {
+ cli_printf(
+ "\tFailed to get bypass mode for port = %d\n",
+ pid);
+ return -1;
+ } else {
+ if (!RTE_BYPASS_MODE_VALID(bypass_mode))
+ bypass_mode = RTE_BYPASS_MODE_NONE;
+
+ cli_printf("\tbypass mode = %s\n",
+ modes[bypass_mode]);
+ }
+
+ /* Display the bypass timeout.*/
+ if (!RTE_BYPASS_TMT_VALID(timeout))
+ timeout = RTE_BYPASS_TMT_OFF;
+
+ cli_printf("\tbypass timeout = %s\n", timeouts[timeout]);
+
+ /* Display the bypass events and associated modes. */
+ for (i = RTE_BYPASS_EVENT_START; i < num_events; i++) {
+
+ if (rte_eth_dev_bypass_event_show(port_id, i,
+ &event_mode))
+ cli_printf("\tFailed to get bypass mode for event = %s\n",
+ events[i]);
+ else {
+ if (!RTE_BYPASS_MODE_VALID(event_mode))
+ event_mode = RTE_BYPASS_MODE_NONE;
+
+ cli_printf("\tbypass event: %-16s = %s\n",
+ events[i], modes[event_mode]);
+ }
+ }
+#else
+ cli_printf("\tFailed to get bypass configuration for port = %d\n",
+ atoi(argv[3]));
+#endif
+ }
+ break;
+ case 30: {
+ int bonding_mode, agg_mode;
+ uint8_t slaves[RTE_MAX_ETHPORTS];
+ int num_slaves, num_active_slaves;
+ int primary_id;
+ int i;
+ portid_t port_id = atoi(argv[3]);
+
+ /* Display the bonding mode.*/
+ bonding_mode = rte_eth_bond_mode_get(port_id);
+ if (bonding_mode < 0) {
+ printf("\tFailed to get bonding mode for port = %d\n", port_id);
+ return 0;
+ } else
+ printf("\tBonding mode: %d\n", bonding_mode);
+
+ if (bonding_mode == BONDING_MODE_BALANCE) {
+ int balance_xmit_policy;
+
+ balance_xmit_policy = rte_eth_bond_xmit_policy_get(port_id);
+ if (balance_xmit_policy < 0) {
+ printf("\tFailed to get balance xmit policy for port = %d\n",
+ port_id);
+ return 0;
+ } else {
+ printf("\tBalance Xmit Policy: ");
+
+ switch (balance_xmit_policy) {
+ case BALANCE_XMIT_POLICY_LAYER2:
+ printf("BALANCE_XMIT_POLICY_LAYER2");
+ break;
+ case BALANCE_XMIT_POLICY_LAYER23:
+ printf("BALANCE_XMIT_POLICY_LAYER23");
+ break;
+ case BALANCE_XMIT_POLICY_LAYER34:
+ printf("BALANCE_XMIT_POLICY_LAYER34");
+ break;
+ }
+ printf("\n");
+ }
+ }
+
+ if (bonding_mode == BONDING_MODE_8023AD) {
+ agg_mode = rte_eth_bond_8023ad_agg_selection_get(port_id);
+ printf("\tIEEE802.3AD Aggregator Mode: ");
+ switch (agg_mode) {
+ case AGG_BANDWIDTH:
+ printf("bandwidth");
+ break;
+ case AGG_STABLE:
+ printf("stable");
+ break;
+ case AGG_COUNT:
+ printf("count");
+ break;
+ }
+ printf("\n");
+ }
+
+ num_slaves = rte_eth_bond_slaves_get(port_id, slaves, RTE_MAX_ETHPORTS);
+
+ if (num_slaves < 0) {
+ printf("\tFailed to get slave list for port = %d\n", port_id);
+ return 0;
+ }
+ if (num_slaves > 0) {
+ printf("\tSlaves (%d): [", num_slaves);
+ for (i = 0; i < num_slaves - 1; i++)
+ printf("%d ", slaves[i]);
+
+ printf("%d]\n", slaves[num_slaves - 1]);
+ } else {
+ printf("\tSlaves: []\n");
+
+ }
+
+ num_active_slaves = rte_eth_bond_active_slaves_get(port_id, slaves,
+ RTE_MAX_ETHPORTS);
+
+ if (num_active_slaves < 0) {
+ printf("\tFailed to get active slave list for port = %d\n", port_id);
+ return 0;
+ }
+ if (num_active_slaves > 0) {
+ printf("\tActive Slaves (%d): [", num_active_slaves);
+ for (i = 0; i < num_active_slaves - 1; i++)
+ printf("%d ", slaves[i]);
+
+ printf("%d]\n", slaves[num_active_slaves - 1]);
+
+ } else
+ printf("\tActive Slaves: []\n");
+
+ primary_id = rte_eth_bond_primary_get(port_id);
+ if (primary_id < 0) {
+ printf("\tFailed to get primary slave for port = %d\n", port_id);
+ return 0;
+ } else
+ printf("\tPrimary: [%d]\n", primary_id);
+ }
+ break;
+ case 40: /* %|show|clear %|info|stats|xstats|fdir|stat_qmap|dcb_tc|cap %d */
+ pid = atoi(argv[2]);
+ n = rte_stropt("info|stats|xstats|fdir|stat_qmap|dcb_tc|cap",
+ argv[1], "|");
+ if (!strcmp(argv[0],"show")) {
+ switch(n) {
+ case 0:
+ port_infos_display(pid);
+ break;
+ case 1:
+ nic_stats_display(pid);
+ break;
+ case 2:
+ nic_xstats_display(pid);
+ break;
+ case 3:
+ fdir_get_infos(pid);
+ break;
+ case 4:
+ nic_stats_mapping_display(pid);
+ break;
+ case 5:
+ port_dcb_info_display(pid);
+ break;
+ case 6:
+ break;
+ default:
+ break;
+ }
+ } else {
+ switch(n) {
+ case 0:
+ return -1; /* Info is invalid for clear */
+ case 1:
+ nic_stats_clear(pid);
+ break;
+ case 2:
+ nic_xstats_clear(pid);
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case 50: /* show %|rxq|txq info %d %d */
+ pid = atoi(argv[4]);
+ qid = atoi(argv[5]);
+ if (!strcmp(argv[2], "rxq"))
+ rx_queue_infos_display(pid, qid);
+ else
+ tx_queue_infos_display(pid, qid);
+ break;
+
+ default:
+ return -1;
+ }
+ return 0;
+}
+
+static struct cli_map gro_map[] = {
+ { 0, "gro %|on|off %d"},
+ { 10, "gro set %d %d %d"},
+ { 11, "gro show %d"},
+ { -1, NULL}
+};
+
+static int
+gro_cmd(int argc, char **argv)
+{
+ struct cli_map *m;
+ uint8_t pid;
+ uint16_t val, flow;
+
+ m = cli_mapping(gro_map, argc, argv);
+ if (!m)
+ return -1;
+ pid = atoi(argv[2]);
+
+ switch(m->index) {
+ case 0:
+ pid = atoi(argv[2]);
+ setup_gro(argv[1], pid);
+ break;
+ case 10:
+ case 11:
+ pid = atoi(argv[4]);
+
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return 0;
+
+ if (test_done == 0) {
+ printf("Before set GRO flow_num and item_num_per_flow,"
+ " please stop forwarding first\n");
+ return 0;
+ }
+
+ if (m->index == 10) {
+ val = atoi(argv[2]);
+ flow = atoi(argv[3]);
+ if (val == 0)
+ printf("Invalid flow number. Revert to default value:"
+ " %u.\n", GRO_DEFAULT_FLOW_NUM);
+ else
+ gro_ports[pid].param.max_flow_num = val;
+
+ if (flow == 0)
+ printf("Invalid item number per-flow. Revert"
+ " to default value:%u.\n",
+ GRO_DEFAULT_ITEM_NUM_PER_FLOW);
+ else
+ gro_ports[pid].param.max_item_per_flow = flow;
+ }
+
+ break;
+ default:
+ return -1;
+ }
+ return 0;
+}
+
static struct cli_map set_map[] = {
{ 0, "set default" },
{ 10, "set %|nbport|nbcore|burst|verbose %d" },
@@ -932,27 +1751,26 @@ static struct cli_map set_map[] = {
{ 110, "set vf vlan stripq %d %d %|on|off" },
{ 120, "set vf vlan insert %d %d %d" },
{ 130, "set vf vlan antispoof %d %d %|on|off" },
- { 140, "set rx_vlan %|add|rm all %d" },
- { 141, "set rx_vlan %|add|rm %d %d" },
- { 150, "set rx_vlan %|add|rm %d port %d vf %D" },
+ { 140, "rx_vlan %|add|rm all %d" },
+ { 141, "rx_vlan %|add|rm %d %d" },
+ { 150, "rx_vlan %|add|rm %d port %d vf %D" },
{ 160, "set rx_vxlan_port %|add|rm %d %d" },
- { 200, "set tx_vlan %d %l" },
- { 210, "set tx_vlan pvid %d %d %|on|off" },
- { 220, "set tx_vlan reset %d" },
- { 230, "set csum %|ip|udp|tcp|sctp|outer-ip %|hw|sw %d" },
- { 240, "set csum parse-tunnel %|on|off %d" },
- { 250, "set tso %d %d" },
- {
- 260,
- "set fwd %|io|mac|macswap|flowgen|rxonly|txonly|csum|icmpecho|ieee1588"
- },
- {
- 261,
- "set fwd %|io|mac|macswap|flowgen|rxonly|txonly|csum|icmpecho|ieee1588 retry"
- },
- { 270, "set mac_addr %|add|remove %d %m" },
- { 280, "set mac_addr add port %d vf %d %m" },
+ { 200, "tx_vlan set %d %d" },
+ { 210, "tx_vlan set pvid %d %d %|on|off" },
+ { 220, "tx_vlan reset %d" },
+ { 221, "tx_vlan set %d %d %d" },
+ { 230, "csum set %|ip|udp|tcp|sctp|outer-ip %|hw|sw %d" },
+ { 240, "csum set parse-tunnel %|on|off %d" },
+ { 241, "csum show %d" },
+ { 250, "tso set %d %d" },
+ { 251, "tso show %d" },
+ { 252, "tunnel_tso set %d %d" },
+ { 253, "tunnel_tso show %d" },
+ { 260, "set fwd %s" },
+ { 261, "set fwd %s retry" },
+ { 270, "mac_addr %|add|remove|set %d %m" },
+ { 280, "mac_addr add port %d vf %d %m" },
#ifdef RTE_LIBRTE_IXGBE_PMD
{ 300, "set vf mac addr %d %d %m" },
@@ -975,6 +1793,7 @@ static struct cli_map set_map[] = {
{ 460, "set stat_qmap %|tx|rx %d %d %d" },
{ 470, "set flush_rx %|on|off" },
{ 480, "set %|link-up|link-down port %d" },
+ { 481, "set link_check $|on|off"},
{ 490, "set E-tag insertion on port-tag-id %d port %d vf %d" },
{ 500, "set E-tag insertion off port %d vf %d" },
@@ -982,8 +1801,30 @@ static struct cli_map set_map[] = {
{ 520, "set E-tag forwarding %|on|off port %d vf %d" },
{ 530, "set E-tag filter add e-tag-id %d dst-pool %d port %d" },
{ 531, "set E-tag filter del e-tag-id %d port %d" },
- { 540, "set vlan %|strip|filter|qinq|stripq %|on|off %l" },
- { 550, "set vlan %|inner|outer tpid %d %d" },
+ { 540, "vlan set %|strip|filter|qinq|stripq %|on|off %l" },
+ { 550, "vlan set %|inner|outer tpid %d %d" },
+#ifdef RTE_LIBRTE_PMD_BOND
+ { 600, "create bonded device %d %d" },
+ { 610, "add bonding slave %d %d" },
+ { 620, "remove bonding slave %d %d" },
+ { 630, "set bonding lacp dedicated_queues %d %|enable|disable"},
+ { 640, "set bonding mode %d %d" },
+ { 650, "port bonding set primary %d %d" },
+ { 660, "set bonding mac_addr %d %m" },
+ { 670, "port bonding set slave %d %d" },
+ { 680, "set bonding balance_xmit_policy %d %|l2|l23|l34" },
+ { 690, "set bonding mon_period %d %d" },
+ { 700, "set bonding agg_mode %d %|stable|bandwidth|count" },
+#endif
+ { 800, "set port %d vf %d %|tx|rx %|on|off" },
+ { 810, "set port %d vf %d %m %|exact-mac|exact-mac-vlan|hashmac|hashmac-vlan %|on|off" },
+ { 820, "set port %d vf %d rxmode %|AUPE|ROPE|BAM|MPE %|on|off" },
+ { 830, "set port %d queue %d rate %d" },
+ { 840, "set port %d vf %d rate %d queue_mask %D" },
+ { 850, "set port %d mirror-rule %d %|pool-mirror-up|pool-mirror-down|vlan-mirror %s dst-pool %d %|on|off" },
+ { 860, "set port %d mirror-rule %d %|uplink-mirror|downlink-mirror dst-pool %d %|on|off" },
+
+
{ -1, NULL }
};
@@ -1140,10 +1981,32 @@ _err2(int err, uint8_t pid, int vid, int val)
}
}
+static void
+check_tunnel_tso_nic_support(uint8_t port_id)
+{
+ struct rte_eth_dev_info dev_info;
+
+ rte_eth_dev_info_get(port_id, &dev_info);
+ if (!(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VXLAN_TNL_TSO))
+ cli_printf("Warning: TSO enabled but VXLAN TUNNEL TSO not "
+ "supported by port %d\n", port_id);
+ if (!(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_GRE_TNL_TSO))
+ cli_printf("Warning: TSO enabled but GRE TUNNEL TSO not "
+ "supported by port %d\n", port_id);
+ if (!(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPIP_TNL_TSO))
+ cli_printf("Warning: TSO enabled but IPIP TUNNEL TSO not "
+ "supported by port %d\n", port_id);
+ if (!(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_GENEVE_TNL_TSO))
+ cli_printf("Warning: TSO enabled but GENEVE TUNNEL TSO not "
+ "supported by port %d\n", port_id);
+}
+
+static int bond_dev_num = 0;
+
static int
set_cmd(int argc, char **argv)
{
- int val, n;
+ int val, n, rule, pool;
uint8_t pid;
uint16_t qid, vid, mask, eid, tid;
struct cli_map *m;
@@ -1198,6 +2061,11 @@ set_cmd(int argc, char **argv)
}
break;
case 20: /* set %|coremask|portmask %H */
+ if (test_done == 0) {
+ printf("Please stop forwarding first\n");
+ return 0;
+ }
+
hex = strtoull(argv[2], NULL, 16);
/* Skip the %| in the string options */
@@ -1205,9 +2073,11 @@ set_cmd(int argc, char **argv)
switch(n) {
case 0:
set_fwd_lcores_mask(hex);
+ fwd_config_setup();
break;
case 1:
set_fwd_ports_mask(hex);
+ fwd_config_setup();
break;
default:
return -1;
@@ -1234,6 +2104,11 @@ set_cmd(int argc, char **argv)
set_tx_pkt_split(argv[2]);
break;
case 60: /* set %|corelist|portlist %s */
+ if (test_done == 0) {
+ printf("Please stop forwarding first\n");
+ return 0;
+ }
+
n = rte_stropt(&opts[1][2], argv[1], "|");
switch(n) {
case 0:
@@ -1309,14 +2184,14 @@ set_cmd(int argc, char **argv)
n = rte_pmd_ixgbe_set_vf_vlan_anti_spoof(pid, vid, val);
_err2(n, pid, vid, val);
break;
- case 140: /* set rx_vlan %|add|rm all %d */
+ case 140: /* rx_vlan %|add|rm all %d */
pid = atoi(argv[4]);
if (!strcmp(argv[2], "add"))
rx_vlan_all_filter_set(pid, 1);
else
rx_vlan_all_filter_set(pid, 0);
break;
- case 141: /* set rx_vlan %|add|rm %d %d */
+ case 141: /* rx_vlan %|add|rm %d %d */
vid = atoi(argv[3]);
pid = atoi(argv[4]);
if (!strcmp(argv[2], "add"))
@@ -1324,7 +2199,7 @@ set_cmd(int argc, char **argv)
else
rx_vft_set(pid, vid, 0);
break;
- case 150: { /* set rx_vlan %|add|rm %d port %d vf %D */
+ case 150: { /* rx_vlan %|add|rm %d port %d vf %D */
int ret = -ENOTSUP;
__rte_unused int is_add = (strcmp(argv[2], "add") == 0) ? 1 : 0;
@@ -1382,22 +2257,28 @@ set_cmd(int argc, char **argv)
strerror(-n));
}
break;
- case 200: /* set tx_vlan %d %l */
+ case 200: /* tx_vlan set %d %d */
pid = atoi(argv[2]);
vid = atoi(argv[3]);
tx_vlan_set(pid, vid);
break;
- case 210: /* set tx_vlan pvid %d %d %|on|off */
+ case 210: /* tx_vlan set pvid %d %d %|on|off */
pid = atoi(argv[3]);
vid = atoi(argv[4]);
val = (strcmp(argv[5], "on") == 0) ? 1 : 0;
tx_vlan_pvid_set(pid, vid, val);
break;
- case 220: /* set tx_vlan reset %d */
+ case 220: /* tx_vlan reset %d */
pid = atoi(argv[3]);
tx_vlan_reset(pid);
break;
- case 230: /* set csum %|ip|udp|tcp|sctp|outer-ip %|hw|sw %d */
+ case 221: /* tx_vlan set %d %d %d */
+ pid = atoi(argv[2]);
+ vid = atoi(argv[3]);
+ val = atoi(argv[4]);
+ tx_qinq_set(pid, vid, val);
+ break;
+ case 230: /* csum set %|ip|udp|tcp|sctp|outer-ip %|hw|sw %d */
pid = atoi(argv[4]);
val = (strcmp(argv[3], "hw") == 0) ? 1 : 0;
if (!strcmp(argv[2], "ip"))
@@ -1419,7 +2300,7 @@ set_cmd(int argc, char **argv)
ports[pid].tx_ol_flags &= (~mask);
csum_show(pid);
break;
- case 240: /* set csum parse-tunnel %|on|off %d */
+ case 240: /* csum set parse-tunnel %|on|off %d */
pid = atoi(argv[4]);
val = (strcmp(argv[3], "on") == 0) ? 1 : 0;
if (val)
@@ -1430,9 +2311,17 @@ set_cmd(int argc, char **argv)
~TESTPMD_TX_OFFLOAD_PARSE_TUNNEL;
csum_show(pid);
break;
- case 250: /* set tso %d %d */
+ case 241: /* csum show %d */
pid = atoi(argv[2]);
- val = atoi(argv[3]);
+ csum_show(pid);
+ break;
+ case 250: /* tso set %d %d */
+ case 251: /* tso show %d */
+ pid = atoi(argv[2]);
+ if (m->index == 251)
+ val = 0;
+ else
+ val = atoi(argv[3]);
if (port_id_is_invalid(pid, ENABLED_WARN))
return -1;
@@ -1452,28 +2341,64 @@ set_cmd(int argc, char **argv)
cli_printf("Warning: TSO enabled but not "
"supported by port %d\n", pid);
break;
- case 260: /* set fwd %|io|mac|macswap|flowgen|rxonly|txonly|csum|icmpecho|ieee1588 */
+ case 252: /* tunnel_tso set %d %d */
+ case 253: /* tunnel_tso show %d */
+ pid = atoi(argv[2]);
+ val = (m->index == 253)? 0 : atoi(argv[3]);
+
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return 0;
+
+ ports[pid].tunnel_tso_segsz = val;
+
+ if (ports[pid].tunnel_tso_segsz == 0)
+ cli_printf("TSO for tunneled packets is disabled\n");
+ else {
+ cli_printf("TSO segment size for tunneled packets is %d\n",
+ ports[pid].tunnel_tso_segsz);
+
+ /* Below conditions are needed to make it work:
+ * (1) tunnel TSO is supported by the NIC;
+ * (2) "csum parse_tunnel" must be set so that tunneled pkts
+ * are recognized;
+ * (3) for tunneled pkts with outer L3 of IPv4,
+ * "csum set outer-ip" must be set to hw, because after tso,
+ * total_len of outer IP header is changed, and the checksum
+ * of outer IP header calculated by sw should be wrong; that
+ * is not necessary for IPv6 tunneled pkts because there's no
+ * checksum in IP header anymore.
+ */
+ check_tunnel_tso_nic_support(pid);
+
+ if (!(ports[pid].tx_ol_flags &
+ TESTPMD_TX_OFFLOAD_PARSE_TUNNEL))
+ cli_printf("Warning: csum parse_tunnel must be set "
+ "so that tunneled packets are recognized\n");
+ if (!(ports[pid].tx_ol_flags &
+ TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM))
+ cli_printf("Warning: csum set outer-ip must be set to hw "
+ "if outer L3 is IPv4; not necessary for IPv6\n");
+ }
+ break;
+ case 260: /* set fwd %s */
retry_enabled = 0;
set_pkt_forwarding_mode(argv[2]);
break;
- case 261: /* set fwd %|io|mac|macswap|flowgen|rxonly|txonly|csum|icmpecho|ieee1588 retry */
+ case 261: /* set fwd %s retry */
retry_enabled = 1;
set_pkt_forwarding_mode(argv[2]);
break;
- case 270: /* set mac_addr %|add|remove %d %m */
- pid = atoi(argv[3]);
- val = (strcmp(argv[2], "add") == 0) ? 1 : 0;
- if (val)
- n =
- rte_eth_dev_mac_addr_add(pid,
- rte_ether_aton(argv[4], NULL), 0);
+ case 270: /* mac_addr %|add|remove|set %d %m */
+ pid = atoi(argv[2]);
+ if (!strcmp(argv[1], "add"))
+ val = rte_eth_dev_mac_addr_add(pid, rte_ether_aton(argv[3], NULL), 0);
+ else if (!strcmp(argv[1], "set"))
+ val = rte_eth_dev_default_mac_addr_set(pid, rte_ether_aton(argv[3], NULL));
else
- n =
- rte_eth_dev_mac_addr_remove(pid,
- rte_ether_aton(argv[4], NULL));
+ val = rte_eth_dev_mac_addr_remove(pid, rte_ether_aton(argv[3], NULL));
- if (n < 0)
- cli_printf("mac_addr_cmd error: (%s)\n", strerror(-n));
+ if (val < 0)
+ cli_printf("mac_addr_cmd error: (%s)\n", strerror(-val));
break;
case 280: /* set mac_addr add port %d vf %d %m */
pid = atoi(argv[4]);
@@ -1484,7 +2409,6 @@ set_cmd(int argc, char **argv)
cli_printf("vf_mac_addr_cmd error: (%s)\n",
strerror(-n));
break;
-
#ifdef RTE_LIBRTE_IXGBE_PMD
case 300: /* set vf mac addr %d %d %m */
pid = atoi(argv[4]);
@@ -1632,6 +2556,9 @@ set_cmd(int argc, char **argv)
else
dev_set_link_down(pid);
break;
+ case 481:
+ no_link_check = (uint8_t)(!(strcmp(argv[2], "on")) ? 0 : 1);
+ break;
case 490: { /* set E-tag insertion on port-tag-id %d port %d vf %d */
struct rte_eth_l2_tunnel_conf entry;
@@ -1649,8 +2576,8 @@ set_cmd(int argc, char **argv)
&entry,
ETH_L2_TUNNEL_INSERTION_MASK,
1);
- }
- break;
+ }
+ break;
case 500: { /* set E-tag insertion off port %d vf %d */
struct rte_eth_l2_tunnel_conf entry;
@@ -1666,8 +2593,8 @@ set_cmd(int argc, char **argv)
&entry,
ETH_L2_TUNNEL_INSERTION_MASK,
0);
- }
- break;
+ }
+ break;
case 510: { /* set E-tag stripping %|on|off port %d vf %d */
struct rte_eth_l2_tunnel_conf entry;
@@ -1683,8 +2610,8 @@ set_cmd(int argc, char **argv)
rte_eth_dev_l2_tunnel_offload_set(pid, &entry,
ETH_L2_TUNNEL_STRIPPING_MASK,
val);
- }
- break;
+ }
+ break;
case 520: { /* set E-tag forwarding %|on|off port %d vf %d */
struct rte_eth_l2_tunnel_conf entry;
@@ -1700,8 +2627,8 @@ set_cmd(int argc, char **argv)
rte_eth_dev_l2_tunnel_offload_set(pid, &entry,
ETH_L2_TUNNEL_FORWARDING_MASK,
val);
- }
- break;
+ }
+ break;
case 530: { /* set E-tag filter add e-tag-id %d dst-pool %d port %d */
struct rte_eth_l2_tunnel_conf entry;
@@ -1737,8 +2664,8 @@ set_cmd(int argc, char **argv)
if (n < 0)
cli_printf("E-tag filter programming error: (%s)\n",
strerror(-n));
- }
- break;
+ }
+ break;
case 531: { /* set E-tag filter del e-tag-id %d port %d */
struct rte_eth_l2_tunnel_conf entry;
@@ -1773,9 +2700,9 @@ set_cmd(int argc, char **argv)
if (n < 0)
cli_printf("E-tag filter programming error: (%s)\n",
strerror(-n));
- }
- break;
- case 540: { /* set vlan %|strip|filter|qinq|stripq %|on|off %l */
+ }
+ break;
+ case 540: { /* vlan set %|strip|filter|qinq|stripq %|on|off %l */
int on;
char *str;
int i, len = 0;
@@ -1824,15 +2751,341 @@ set_cmd(int argc, char **argv)
rx_vlan_filter_set(pid, on);
else
vlan_extend_set(pid, on);
- }
- break;
- case 550: /* set vlan %|inner|outer tpid %d %d */
+ }
+ break;
+ case 550: /* vlan set %|inner|outer tpid %d %d */
pid = atoi(argv[5]);
tid = atoi(argv[4]);
val = (!strcmp(argv[2], "inner")) ?
ETH_VLAN_TYPE_INNER : ETH_VLAN_TYPE_OUTER;
vlan_tpid_set(pid, val, tid);
break;
+#ifdef RTE_LIBRTE_PMD_BOND
+ case 600: { /* create bonded device %d %d */
+ char ethdev_name[RTE_ETH_NAME_MAX_LEN];
+
+ if (test_done == 0) {
+ cli_printf("Please stop forwarding first\n");
+ return -1;
+ }
+
+ snprintf(ethdev_name, RTE_ETH_NAME_MAX_LEN,
+ "net_bond_testpmd_%d",
+ bond_dev_num++);
+
+ /* Create a new bonded device. */
+ n = rte_eth_bond_create(ethdev_name, atoi(argv[3]), atoi(
+ argv[4]));
+ if (n < 0) {
+ cli_printf("\t Failed to create bonded device.\n");
+ return -1;
+ } else {
+ pid = n;
+ cli_printf("Created new bonded device %s on (port %d).\n",
+ ethdev_name, pid);
+
+ /* Update number of ports */
+ nb_ports = rte_eth_dev_count();
+ reconfig(pid, atoi(argv[4]));
+ rte_eth_promiscuous_enable(pid);
+ }
+ }
+ break;
+ case 610: /* add bonding slave %d %d */
+ pid = atoi(argv[4]);
+ val = atoi(argv[3]);
+
+ /* Set the primary slave for a bonded device. */
+ if (rte_eth_bond_slave_add(pid, val)) {
+ cli_printf("\t Failed to add slave %d to master port = %d.\n",
+ val, pid);
+ return -1;
+ }
+ init_port_config();
+ set_port_slave_flag(val);
+ break;
+ case 620: /* remove bonding slave %d %d */
+ pid = atoi(argv[4]);
+ val = atoi(argv[3]);
+
+ /* Set the primary slave for a bonded device. */
+ if (rte_eth_bond_slave_remove(pid, val)) {
+ cli_printf("\t Failed to remove slave %d to master port = %d.\n",
+ val, pid);
+ return -1;
+ }
+ init_port_config();
+ clear_port_slave_flag(val);
+ break;
+ case 630: { /* set bonding lacp dedicated_queues %d %|enable|disable */
+ portid_t port_id = atoi(argv[4]);
+ struct rte_port *port;
+
+ port = &ports[port_id];
+
+ /** Check if the port is not started **/
+ if (port->port_status != RTE_PORT_STOPPED) {
+ printf("Please stop port %d first\n", port_id);
+ return 0;
+ }
+
+ if (!strcmp(argv[5], "enable")) {
+ if (rte_eth_bond_8023ad_dedicated_queues_enable(port_id) == 0)
+ printf("Dedicate queues for LACP control packets"
+ " enabled\n");
+ else
+ printf("Enabling dedicate queues for LACP control "
+ "packets on port %d failed\n", port_id);
+ } else if (!strcmp(argv[5], "disable")) {
+ if (rte_eth_bond_8023ad_dedicated_queues_disable(port_id) == 0)
+ printf("Dedicated queues for LACP control packets "
+ "disabled\n");
+ else
+ printf("Disabling dedicated queues for LACP control "
+ "traffic on port %d failed\n", port_id);
+ }
+ }
+ break;
+ case 640: /* set bonding mode %d %d */
+ pid = atoi(argv[3]);
+ val = atoi(argv[4]);
+ if (rte_eth_bond_mode_set(pid, val) < 0)
+ cli_printf("\t Failed to set bonding mode for port = %d.\n",
+ pid);
+ break;
+ case 650: /* port bonding set primary %d %d */
+ pid = atoi(argv[5]);
+
+ /* Set the primary slave for a bonded device. */
+ if (rte_eth_bond_primary_set(pid, atoi(argv[4]))) {
+ cli_printf("\t Failed to set primary slave for port = %d.\n",
+ pid);
+ return -1;
+ }
+ init_port_config();
+ break;
+ case 660: /* port bonding set mac_addr %d %m */
+ pid = atoi(argv[3]);
+
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return -1;
+
+ n = rte_eth_bond_mac_address_set(pid, rte_ether_aton(argv[4], NULL));
+
+ /* check the return value and print it if is < 0 */
+ if (n < 0)
+ printf("set_bond_mac_addr error: (%s)\n", strerror(-n));
+ break;
+ case 670: /* port bonding set slave %d %d */
+ pid = atoi(argv[5]);
+ val = atoi(argv[4]);
+
+ /* Set the primary slave for a bonded device. */
+ if (rte_eth_bond_slave_remove(pid, val)) {
+ cli_printf("\t Failed to remove slave %d from master port = %d.\n",
+ val, pid);
+ return -1;
+ }
+ init_port_config();
+ clear_port_slave_flag(val);
+ break;
+ case 680: { /* set bonding xmit_balance_policy %d %|l2|l23|l34 */
+ uint8_t policy = 0;
+
+ pid = atoi(argv[3]);
+
+ if (!strcmp(argv[4], "l2"))
+ policy = BALANCE_XMIT_POLICY_LAYER2;
+ else if (!strcmp(argv[4], "l23"))
+ policy = BALANCE_XMIT_POLICY_LAYER23;
+ else if (!strcmp(argv[4], "l34"))
+ policy = BALANCE_XMIT_POLICY_LAYER34;
+ else {
+ cli_printf("\t Invalid xmit policy selection");
+ return -1;
+ }
+
+ /* Set the bonding mode for the relevant port. */
+ if (rte_eth_bond_xmit_policy_set(pid, policy) != 0)
+ cli_printf("\t Failed to set bonding balance xmit policy for port = %d.\n",
+ pid);
+ }
+ break;
+ case 690: /* port bonding set mon_period %d %d */
+ pid = atoi(argv[4]);
+ val = atoi(argv[5]);
+ if (pid >= nb_ports) {
+ cli_printf("Port id %d must be less than %d\n", pid,
+ nb_ports);
+ return -1;
+ }
+
+ n = rte_eth_bond_link_monitoring_set(pid, val);
+
+ /* check the return value and print it if is < 0 */
+ if (n < 0)
+ cli_printf("set_bond_mac_addr error: (%s)\n",
+ strerror(-n));
+ break;
+ case 700: { /* set bonding agg_mode %d %|stable|bandwidth|count */
+ uint8_t policy = AGG_BANDWIDTH;
+
+ pid = atoi(argv[3]);
+ if (pid >= nb_ports) {
+ printf("Port id %d must be less than %d\n",
+ pid, nb_ports);
+ return 0;
+ }
+
+ if (!strcmp(argv[4], "bandwidth"))
+ policy = AGG_BANDWIDTH;
+ else if (!strcmp(argv[4], "stable"))
+ policy = AGG_STABLE;
+ else if (!strcmp(argv[4], "count"))
+ policy = AGG_COUNT;
+
+ rte_eth_bond_8023ad_agg_selection_set(pid, policy);
+ }
+ break;
+#endif
+ case 800: /* set port %d vf %d %|tx|rx %|on|off */
+ pid = atoi(argv[2]);
+ vid = atoi(argv[4]);
+ val = (!strcmp(argv[6], "on")) ? 1 : 0;
+ set_vf_traffic(pid, val, vid, (!strcmp(argv[5], "rx")) ? 1 : 0);
+ break;
+ case 810: { /* set port %d vf %d %m %|exact-mac|exact-mac-vlan|hashmac|hashmac-vlan %|on|off */
+ struct rte_eth_mac_filter filter;
+
+ memset(&filter, 0, sizeof(struct rte_eth_mac_filter));
+
+ rte_memcpy(&filter.mac_addr, rte_ether_aton(argv[5],
+ NULL),
+ ETHER_ADDR_LEN);
+
+ pid = atoi(argv[2]);
+ vid = atoi(argv[4]);
+ val =
+ (!strcmp(argv[7],
+ "on")) ? RTE_ETH_FILTER_ADD :
+ RTE_ETH_FILTER_DELETE;
+
+ n = rte_stropt("exact-mac|exact-mac-vlan|hashmac|hashmac-vlan",
+ argv[6], "|");
+ switch(n) {
+ case 0:
+ filter.filter_type = RTE_MAC_PERFECT_MATCH;
+ break;
+ case 1:
+ filter.filter_type = RTE_MACVLAN_PERFECT_MATCH;
+ break;
+ case 2:
+ filter.filter_type = RTE_MAC_HASH_MATCH;
+ break;
+ case 3:
+ filter.filter_type = RTE_MACVLAN_HASH_MATCH;
+ break;
+ }
+ n = rte_eth_dev_filter_ctrl(pid, RTE_ETH_FILTER_MACVLAN, val,
+ &filter);
+ if (n < 0)
+ cli_printf(
+ "bad set MAC hash parameter, return code = %d\n",
+ n);
+ }
+ break;
+ case 820: { /* set port %d vf %d rxmode %|AUPE|ROPE|BAM|MPE %|on|off */
+ uint16_t rx_mode = 0;
+
+ pid = atoi(argv[2]);
+ vid = atoi(argv[4]);
+ val = (!strcmp(argv[7], "on")) ? 1 : 0;
+ n = rte_stropt("AUPE|ROPE|BAM|MPE", argv[6], "|");
+ switch(n) {
+ case 0:
+ rx_mode |= ETH_VMDQ_ACCEPT_UNTAG;
+ break;
+ case 1:
+ rx_mode |= ETH_VMDQ_ACCEPT_HASH_UC;
+ break;
+ case 2:
+ rx_mode |= ETH_VMDQ_ACCEPT_BROADCAST;
+ break;
+ case 3:
+ rx_mode |= ETH_VMDQ_ACCEPT_MULTICAST;
+ break;
+ }
+ if (rte_pmd_ixgbe_set_vf_rxmode(pid, vid, rx_mode, val) < 0)
+ cli_printf(
+ "bad VF receive mode parameter, return code = %d \n",
+ n);
+ }
+ break;
+ case 830: /* set port %d queue %d rate %d */
+ pid = atoi(argv[2]);
+ qid = atoi(argv[4]);
+ val = atoi(argv[6]);
+ if ((n = set_queue_rate_limit(pid, qid, val)) < 0)
+ cli_printf("queue_rate_limit_cmd error: (%s)\n", strerror(
+ -n));
+ break;
+ case 840: /* set port %d vf %d rate %d queue_mask %D */
+ pid = atoi(argv[2]);
+ vid = atoi(argv[4]);
+ val = atoi(argv[6]);
+ mask = strtoull(argv[8], NULL, 10);
+ if ((n = set_vf_rate_limit(pid, vid, val, mask)) < 0)
+ cli_printf("vf_rate_limit_cmd error: (%s)\n",
+ strerror(-n));
+ break;
+ case 850: { /* set port %d mirror-rule %d %|pool-mirror-up|pool-mirror-down|vlan-mirror %s dst-pool %d %|on|off */
+ int ret,nb_item,i;
+ struct rte_eth_mirror_conf mr_conf;
+
+ pid = atoi(argv[2]);
+ rule = atoi(argv[4]);
+ pool = atoi(argv[8]);
+ val = (!strcmp(argv[9], "on")) ? 1 : 0;
+
+ memset(&mr_conf, 0, sizeof(struct rte_eth_mirror_conf));
+
+ unsigned int vlan_list[ETH_MIRROR_MAX_VLANS];
+
+ mr_conf.dst_pool = pool;
+
+ if (!strcmp(argv[5], "pool-mirror-up")) {
+ mr_conf.pool_mask = strtoull(argv[6], NULL, 16);
+ mr_conf.rule_type = ETH_MIRROR_VIRTUAL_POOL_UP;
+ } else if (!strcmp(argv[5], "pool-mirror-down")) {
+ mr_conf.pool_mask = strtoull(argv[6], NULL, 16);
+ mr_conf.rule_type = ETH_MIRROR_VIRTUAL_POOL_DOWN;
+ } else if (!strcmp(argv[5], "vlan-mirror")) {
+ mr_conf.rule_type = ETH_MIRROR_VLAN;
+ nb_item = parse_list(argv[6], "vlan",
+ ETH_MIRROR_MAX_VLANS, vlan_list,
+ 1);
+ if (nb_item <= 0)
+ return -1;
+
+ for (i = 0; i < nb_item; i++) {
+ if (vlan_list[i] > ETHER_MAX_VLAN_ID) {
+ cli_printf(
+ "Invalid vlan_id: must be < 4096\n");
+ return -1;
+ }
+
+ mr_conf.vlan.vlan_id[i] =
+ (uint16_t)vlan_list[i];
+ mr_conf.vlan.vlan_mask |= 1ULL << i;
+ }
+ }
+
+ ret = rte_eth_mirror_rule_set(pid, &mr_conf, rule, val);
+ if (ret < 0)
+ cli_printf("mirror rule add error: (%s)\n",
+ strerror(-ret));
+ }
+ break;
default:
return -1;
}
@@ -1842,50 +3095,24 @@ set_cmd(int argc, char **argv)
static struct cli_map port_map[] = {
{ 0, "port reset %d mirror-rule %d" },
- { 10, "port %|start|stop|close %d" },
- { 20, "port %|start|stop|close all" },
+ { 5, "port %d %|rxq|txq %d %|start|stop" },
+ { 10, "port %|start|stop|close all" },
+ { 20, "port %|start|stop|close %d" },
+
{ 70, "port attach %s" },
{ 80, "port detach %d" },
- {
- 90,
- "port %|show|clear %|info|stats|xstats|fdir|stat_qmap|dcb_tc %d"
- },
- { 100, "port show %|rxq|txq info %d %d" },
- { 110, "port show %|rxd|txd %d %d %d" },
- { 170, "port set %d vf %d %|tx|rx %|on|off" },
- {
- 180,
- "port set %d vf %d %m %|exact-mac|exact-mac-vlan|hashmac|hashmac-vlan %|on|off"
- },
- { 190, "port set %d vf %d rxmode %|AUPE|ROPE|BAM|MPE %|on|off" },
- { 200, "port set %d queue %d rate %d" },
- { 210, "port set %d vf %d rate %d queue_mask %D" },
- {
- 220,
- "port set %d mirror-rule %d %|pool-mirror-up|pool-mirror-down|vlan-mirror %s dst-pool %d %|on|off"
- },
- {
- 230,
- "port set %d mirror-rule %d %|uplink-mirror|downlink-mirror dst-pool %d %|on|off"
- },
- {
- 240,
- "port config %d speed %|10|100|1000|10000|2500|40000|50000|100000|auto duplex %|half|full|auto"
- },
- {
- 250,
- "port config all speed %|10|100|1000|10000|2500|40000|50000|100000|auto duplex %|half|full|auto"
- },
+
+ { 240, "port config %d speed %|10|100|1000|10000|2500|40000|50000|100000|auto duplex %|half|full|auto" },
+ { 250, "port config all speed %|10|100|1000|10000|2500|40000|50000|100000|auto duplex %|half|full|auto" },
+ { 255, "port config all txqflags %h" },
+
{ 260, "port config all %|rxq|txq|rxd|txd %d" },
{ 270, "port config all max-pkt-len %d" },
- {
- 280,
- "port config all %|crc-strip|scatter|rx-cksum|hw-vlan|hw-vlan-filter|hw-vlan-strip|hw-vlan-extend|drop-en %|on|off"
- },
- {
- 290,
- "port config all rss %|all|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none"
- },
+ { 275, "port config mtu %d %d" },
+ { 280, "port config all %|crc-strip|scatter|rx-cksum|hw-vlan|hw-vlan-filter|hw-vlan-strip|hw-vlan-extend|drop-en %|on|off" },
+ { 290, "port config all rss %|all|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none" },
+ { 295, "port config %d rss-hash-key %|ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
+ "ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex" },
{ 300, "port config %d rss reta %l" },
{ 310, "port config %d dcb vt %|on|off %d pfc %|on|off" },
{ 320, "port config all burst %d" },
@@ -1896,26 +3123,11 @@ static struct cli_map port_map[] = {
{ 370, "port config %d l2-tunnel E-tag ether-type %d" },
{ 380, "port config all l2-tunnel E-tag %|enable|disable" },
{ 390, "port config %d l2-tunnel E-tag %|enable|disable" },
-#ifdef RTE_LIBRTE_PMD_BOND
- { 400, "port bonding create device %d %d" },
- { 410, "port bonding add slave %d %d" },
- { 420, "port bonding remove slave %d %d" },
- { 430, "port bonding show config %d" },
- { 440, "port bonding set mode %d %d" },
- { 450, "port bonding set primary %d %d" },
- { 460, "port bonding set mac_addr %d %m" },
- { 470, "port bonding set slave %d %d" },
- { 480, "port bonding set xmit_balance_policy %d %|l2|l23|l34" },
- { 490, "port bonding set mon_period %d %d" },
-#endif
-#ifdef RTE_NIC_BYPASS
+
+#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS
{ 500, "port bypass set mode %|normal|bypass|isolate %d" },
- {
- 510,
- "port bypass set event %|timeout|os_on|os_off|power_on|power_off mode %|normal|bypass|isolate %d"
- },
+ { 510, "port bypass set event %|timeout|os_on|os_off|power_on|power_off mode %|normal|bypass|isolate %d" },
{ 520, "port bypass set timeout %|0|1.5|2|3|4|8|16|32" },
- { 530, "port bypass show config %d" },
#endif
{ -1, NULL }
};
@@ -2036,18 +3248,13 @@ str2fdir_l2_tunnel_type(char *string) {
return RTE_TUNNEL_TYPE_NONE;
}
-#ifdef RTE_LIBRTE_PMD_BOND
-static int bond_dev_num = 0;
-#endif
-
static int
port_cmd(int argc, char **argv)
{
int val, n;
uint8_t pid;
- uint16_t qid, vid, rule, pool;
+ uint16_t qid;
uint32_t speed, uval;
- uint64_t mask;
struct cli_map *m;
m = cli_mapping(port_map, argc, argv);
@@ -2063,22 +3270,66 @@ port_cmd(int argc, char **argv)
cli_printf("mirror rule remove error: (%s)\n",
strerror(-n));
break;
- case 10: /* port %|start|stop|close %d */
- pid = atoi(argv[2]);
- n = rte_stropt("start|stop|close", argv[1], "|");
- switch(n) {
- case 0:
- start_port(pid);
- break;
- case 1:
- stop_port(pid);
- break;
- case 2:
- close_port(pid);
- break;
+ case 5: { /* port %d %|rxq|txq %d %|start|stop */
+ uint8_t isrx;
+ uint8_t isstart;
+ char *rxtxq;
+ uint8_t qid;
+ int ret = 0;
+
+ if (test_done == 0) {
+ printf("Please stop forwarding first\n");
+ return 0;
+ }
+
+ pid = atoi(argv[1]);
+ rxtxq = argv[2];
+ qid = atoi(argv[3]);
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return 0;
+
+ if (port_is_started(pid) != 1) {
+ printf("Please start port %u first\n", pid);
+ return 0;
+ }
+
+ if (!strcmp(rxtxq, "rxq"))
+ isrx = 1;
+ else if (!strcmp(rxtxq, "txq"))
+ isrx = 0;
+ else {
+ printf("Unknown parameter\n");
+ return 0;
+ }
+
+ if (isrx && rx_queue_id_is_invalid(qid))
+ return 0;
+ else if (!isrx && tx_queue_id_is_invalid(qid))
+ return 0;
+
+ if (!strcmp(argv[4], "start"))
+ isstart = 1;
+ else if (!strcmp(argv[4], "stop"))
+ isstart = 0;
+ else {
+ printf("Unknown parameter\n");
+ return 0;
+ }
+
+ if (isstart && isrx)
+ ret = rte_eth_dev_rx_queue_start(pid, qid);
+ else if (!isstart && isrx)
+ ret = rte_eth_dev_rx_queue_stop(pid, qid);
+ else if (isstart && !isrx)
+ ret = rte_eth_dev_tx_queue_start(pid, qid);
+ else
+ ret = rte_eth_dev_tx_queue_stop(pid, qid);
+
+ if (ret == -ENOTSUP)
+ printf("Function not supported in PMD driver\n");
}
break;
- case 20: /* port %|start|stop|close all */
+ case 10: /* port %|start|stop|close all */
n = rte_stropt("start|stop|close", argv[1], "|");
switch(n) {
case 0:
@@ -2092,207 +3343,27 @@ port_cmd(int argc, char **argv)
break;
}
break;
- case 70: /* port attach %s */
- attach_port(argv[2]);
- break;
- case 80: /* port detach %d */
- detach_port(atoi(argv[2]));
- break;
- case 90: /* port %|show|clear %|info|stats|xstats|fdir|stat_qmap|dcb_tc %d */
- pid = atoi(argv[3]);
- n = rte_stropt("info|stats|xstats|fdir|stat_qmap|dcb_tc",
- argv[2], "|");
- if (!strcmp(argv[1],"show"))
- switch(n) {
- case 0:
- port_infos_display(pid);
- break;
- case 1:
- nic_stats_display(pid);
- break;
- case 2:
- nic_xstats_display(pid);
- break;
- case 3:
- fdir_get_infos(pid);
- break;
- case 4:
- nic_stats_mapping_display(pid);
- break;
- case 5:
- port_dcb_info_display(pid);
- break;
- default:
- break;
- } else
- switch(n) {
- case 0:
- return -1; /* Info is invalid for clear */
- case 1:
- nic_stats_clear(pid);
- break;
- case 2:
- nic_xstats_clear(pid);
- break;
- default:
- break;
- }
- break;
- case 100: /* port show %|rxq|txq info %d %d */
- pid = atoi(argv[4]);
- qid = atoi(argv[5]);
- if (!strcmp(argv[2], "rxq"))
- rx_queue_infos_display(pid, qid);
- else
- tx_queue_infos_display(pid, qid);
- break;
- case 110: /* port show %|rxd|txd %d %d %d */
- pid = atoi(argv[3]);
- qid = atoi(argv[4]);
- val = atoi(argv[5]);
- if (!strcmp(argv[2], "rxd"))
- rx_ring_desc_display(pid, qid, val);
- else
- tx_ring_desc_display(pid, qid, val);
- break;
- case 170: /* port set %d vf %d %|tx|rx %|on|off */
+ case 20: /* port %|start|stop|close %d */
pid = atoi(argv[2]);
- vid = atoi(argv[4]);
- val = (!strcmp(argv[6], "on")) ? 1 : 0;
- set_vf_traffic(pid, val, vid, (!strcmp(argv[5], "rx")) ? 1 : 0);
- break;
- case 180: { /* port set %d vf %d %m %|exact-mac|exact-mac-vlan|hashmac|hashmac-vlan %|on|off */
- struct rte_eth_mac_filter filter;
-
- memset(&filter, 0, sizeof(struct rte_eth_mac_filter));
-
- rte_memcpy(&filter.mac_addr, rte_ether_aton(argv[5],
- NULL),
- ETHER_ADDR_LEN);
-
- pid = atoi(argv[2]);
- vid = atoi(argv[4]);
- val =
- (!strcmp(argv[7],
- "on")) ? RTE_ETH_FILTER_ADD :
- RTE_ETH_FILTER_DELETE;
-
- n = rte_stropt("exact-mac|exact-mac-vlan|hashmac|hashmac-vlan",
- argv[6], "|");
- switch(n) {
- case 0:
- filter.filter_type = RTE_MAC_PERFECT_MATCH;
- break;
- case 1:
- filter.filter_type = RTE_MACVLAN_PERFECT_MATCH;
- break;
- case 2:
- filter.filter_type = RTE_MAC_HASH_MATCH;
- break;
- case 3:
- filter.filter_type = RTE_MACVLAN_HASH_MATCH;
- break;
- }
- n = rte_eth_dev_filter_ctrl(pid, RTE_ETH_FILTER_MACVLAN, val,
- &filter);
- if (n < 0)
- cli_printf(
- "bad set MAC hash parameter, return code = %d\n",
- n);
- }
- break;
- case 190: { /* port set %d vf %d rxmode %|AUPE|ROPE|BAM|MPE %|on|off */
- uint16_t rx_mode = 0;
-
- pid = atoi(argv[2]);
- vid = atoi(argv[4]);
- val = (!strcmp(argv[7], "on")) ? 1 : 0;
- n = rte_stropt("AUPE|ROPE|BAM|MPE", argv[6], "|");
+ n = rte_stropt("start|stop|close", argv[1], "|");
switch(n) {
case 0:
- rx_mode |= ETH_VMDQ_ACCEPT_UNTAG;
+ start_port(pid);
break;
case 1:
- rx_mode |= ETH_VMDQ_ACCEPT_HASH_UC;
+ stop_port(pid);
break;
case 2:
- rx_mode |= ETH_VMDQ_ACCEPT_BROADCAST;
- break;
- case 3:
- rx_mode |= ETH_VMDQ_ACCEPT_MULTICAST;
+ close_port(pid);
break;
}
- if (rte_pmd_ixgbe_set_vf_rxmode(pid, vid, rx_mode, val) < 0)
- cli_printf(
- "bad VF receive mode parameter, return code = %d \n",
- n);
- }
- break;
- case 200: /* port set %d queue %d rate %d */
- pid = atoi(argv[2]);
- qid = atoi(argv[4]);
- val = atoi(argv[6]);
- if ((n = set_queue_rate_limit(pid, qid, val)) < 0)
- cli_printf("queue_rate_limit_cmd error: (%s)\n", strerror(
- -n));
break;
- case 210: /* port set %d vf %d rate %d queue_mask %D */
- pid = atoi(argv[2]);
- vid = atoi(argv[4]);
- val = atoi(argv[6]);
- mask = strtoull(argv[8], NULL, 10);
- if ((n = set_vf_rate_limit(pid, vid, val, mask)) < 0)
- cli_printf("vf_rate_limit_cmd error: (%s)\n",
- strerror(-n));
+ case 70: /* port attach %s */
+ attach_port(argv[2]);
+ break;
+ case 80: /* port detach %d */
+ detach_port(atoi(argv[2]));
break;
- case 220: { /* port set %d mirror-rule %d %|pool-mirror-up|pool-mirror-down|vlan-mirror %s dst-pool %d %|on|off */
- int ret,nb_item,i;
- struct rte_eth_mirror_conf mr_conf;
-
- pid = atoi(argv[2]);
- rule = atoi(argv[4]);
- pool = atoi(argv[8]);
- val = (!strcmp(argv[9], "on")) ? 1 : 0;
-
- memset(&mr_conf, 0, sizeof(struct rte_eth_mirror_conf));
-
- unsigned int vlan_list[ETH_MIRROR_MAX_VLANS];
-
- mr_conf.dst_pool = pool;
-
- if (!strcmp(argv[5], "pool-mirror-up")) {
- mr_conf.pool_mask = strtoull(argv[6], NULL, 16);
- mr_conf.rule_type = ETH_MIRROR_VIRTUAL_POOL_UP;
- } else if (!strcmp(argv[5], "pool-mirror-down")) {
- mr_conf.pool_mask = strtoull(argv[6], NULL, 16);
- mr_conf.rule_type = ETH_MIRROR_VIRTUAL_POOL_DOWN;
- } else if (!strcmp(argv[5], "vlan-mirror")) {
- mr_conf.rule_type = ETH_MIRROR_VLAN;
- nb_item = parse_list(argv[6], "vlan",
- ETH_MIRROR_MAX_VLANS, vlan_list,
- 1);
- if (nb_item <= 0)
- return -1;
-
- for (i = 0; i < nb_item; i++) {
- if (vlan_list[i] > ETHER_MAX_VLAN_ID) {
- cli_printf(
- "Invalid vlan_id: must be < 4096\n");
- return -1;
- }
-
- mr_conf.vlan.vlan_id[i] =
- (uint16_t)vlan_list[i];
- mr_conf.vlan.vlan_mask |= 1ULL << i;
- }
- }
-
- ret = rte_eth_mirror_rule_set(pid, &mr_conf, rule, val);
- if (ret < 0)
- cli_printf("mirror rule add error: (%s)\n",
- strerror(-ret));
- }
- break;
case 240: /* port config %d speed %|10|100|1000|10000|2500|40000|50000|100000|auto duplex %|half|full|auto */
case 250: { /* port config all speed %|10|100|1000|10000|2500|40000|50000|100000|auto duplex %|half|full|auto */
uint32_t speeds[] = {
@@ -2303,6 +3374,10 @@ port_cmd(int argc, char **argv)
ETH_LINK_SPEED_100G,
ETH_LINK_SPEED_AUTONEG
};
+ if (!all_ports_stopped()) {
+ cli_printf("Please stop all port first\n");
+ return 0;
+ }
pid = atoi(argv[2]);
n = rte_stropt("10|100|1000|10000|2500|40000|50000|100000|auto",
argv[4], "|");
@@ -2319,13 +3394,29 @@ port_cmd(int argc, char **argv)
RTE_ETH_FOREACH_DEV(pid) {
ports[pid].dev_conf.link_speeds = speed;
}
- cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
- } else {
+ } else
ports[pid].dev_conf.link_speeds = speed;
- cmd_reconfig_device_queue(pid, 1, 1);
+ cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
}
- }
- break;
+ break;
+ case 255: /* port config all txqflags %h */
+ if (!all_ports_stopped()) {
+ cli_printf("Please stop all ports first\n");
+ return 0;
+ }
+
+ uval = strtoul(argv[4], NULL, 16);
+ if (uval) {
+ txq_flags = uval;
+ } else {
+ cli_printf("txqflags must be >= 0\n");
+ return 0;
+ }
+
+ init_port_config();
+
+ cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
+ break;
case 260: { /* port config all %|rxq|txq|rxd|txd %d */
if (!all_ports_stopped()) {
cli_printf("Please stop all port first\n");
@@ -2377,7 +3468,15 @@ port_cmd(int argc, char **argv)
cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
break;
- case 280: /* port config all %|crc-strip|scatter|rx-cksum|hw-vlan|hw-vlan-filter|hw-vlan-strip|hw-vlan-extend}drop-en %|on|off */
+ case 275: /* port config mtu %d %d */
+ uval = strtoul(argv[4], NULL, 10);
+ if (uval < ETHER_MIN_LEN) {
+ printf("mtu cannot be less than %d\n", ETHER_MIN_LEN);
+ return 0;
+ }
+ port_mtu_set(atoi(argv[3]), uval);
+ break;
+ case 280: /* port config all %|crc-strip|scatter|rx-cksum|hw-vlan|hw-vlan-filter|hw-vlan-strip|hw-vlan-extend|drop-en %|on|off */
if (!all_ports_stopped()) {
cli_printf("Please stop all ports first\n");
return -1;
@@ -2471,8 +3570,50 @@ port_cmd(int argc, char **argv)
i, -diag, strerror(
-diag));
}
- }
- break;
+ }
+ break;
+ case 295: { /* port config %d rss-hash-key %|ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|
+ ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex */
+ uint8_t hash_key[RSS_HASH_KEY_LENGTH];
+ struct rte_eth_dev_info dev_info;
+ uint8_t xdgt0, xdgt1;
+ uint8_t hash_key_size;
+ uint32_t key_len;
+ char *key;
+ int i;
+
+ pid = atoi(argv[2]);
+ key = argv[5];
+ memset(&dev_info, 0, sizeof(struct rte_eth_dev_info));
+ rte_eth_dev_info_get(pid, &dev_info);
+ if (dev_info.hash_key_size > 0 &&
+ dev_info.hash_key_size <= sizeof(hash_key))
+ hash_key_size = dev_info.hash_key_size;
+ else {
+ cli_printf("dev_info did not provide a valid hash key size\n");
+ return 0;
+ }
+ /* Check the length of the RSS hash key */
+ key_len = strlen(key);
+ if (key_len != (hash_key_size * 2)) {
+ cli_printf("key length: %d invalid - key must be a string of %d"
+ " hexa-decimal numbers\n",
+ (int) key_len, hash_key_size * 2);
+ return 0;
+ }
+ /* Translate RSS hash key into binary representation */
+ for (i = 0; i < hash_key_size; i++) {
+ xdgt0 = parse_and_check_key_hexa_digit(key, (i * 2));
+ if (xdgt0 == 0xFF)
+ return 0;
+ xdgt1 = parse_and_check_key_hexa_digit(key, (i * 2) + 1);
+ if (xdgt1 == 0xFF)
+ return 0;
+ hash_key[i] = (uint8_t) ((xdgt0 * 16) + xdgt1);
+ }
+ port_rss_hash_key_update(pid, argv[4], hash_key, hash_key_size);
+ }
+ break;
case 300: { /* port config %d rss reta %l */
int ret;
struct rte_eth_dev_info dev_info;
@@ -2490,8 +3631,8 @@ port_cmd(int argc, char **argv)
cli_printf("The reta size of port %d is %u\n",
pid, dev_info.reta_size);
if (dev_info.reta_size > ETH_RSS_RETA_SIZE_512) {
- cli_printf("Currently do not support more than %u entries of "
- "redirection table\n",
+ cli_printf("Currently do not support more than %u "
+ "entries of redirection table\n",
ETH_RSS_RETA_SIZE_512);
return -1;
}
@@ -2509,8 +3650,8 @@ port_cmd(int argc, char **argv)
if (ret != 0)
cli_printf("Bad redirection table parameter, "
"return code = %d \n", ret);
- }
- break;
+ }
+ break;
case 310: { /* port config %d dcb vt %|on|off %d pfc %|on|off */
struct rte_port *port;
uint8_t pfc_en;
@@ -2533,8 +3674,7 @@ port_cmd(int argc, char **argv)
}
if (nb_fwd_lcores < val) {
- cli_printf(
- "nb_cores shouldn't be less than number of TCs.\n");
+ cli_printf("nb_cores shouldn't be less than number of TCs.\n");
return -1;
}
if (!strncmp(argv[8], "on", 2))
@@ -2558,8 +3698,8 @@ port_cmd(int argc, char **argv)
}
cmd_reconfig_device_queue(pid, 1, 1);
- }
- break;
+ }
+ break;
case 320: /* port config all burst %d */
if (!all_ports_stopped()) {
cli_printf("Please stop all ports first\n");
@@ -2665,8 +3805,8 @@ port_cmd(int argc, char **argv)
if (ret == -ENOTSUP)
cli_printf("Function not supported in PMD driver\n");
- }
- break;
+ }
+ break;
case 360: /* port config all l2-tunnel E-tag ether-type %d */
case 370: { /* port config %d l2-tunnel E-tag ether-type %d */
struct rte_eth_l2_tunnel_conf entry;
@@ -2683,8 +3823,8 @@ port_cmd(int argc, char **argv)
pid = atoi(argv[2]);
rte_eth_dev_l2_tunnel_eth_type_conf(pid, &entry);
}
- }
- break;
+ }
+ break;
case 380: /* port config all l2-tunnel E-tag %|enable|disable */
case 390: { /* port config %d l2-tunnel E-tag %|enable|disable */
struct rte_eth_l2_tunnel_conf entry;
@@ -2703,286 +3843,53 @@ port_cmd(int argc, char **argv)
rte_eth_dev_l2_tunnel_offload_set(pid, &entry,
ETH_L2_TUNNEL_ENABLE_MASK, en);
}
- }
- break;
-#ifdef RTE_LIBRTE_PMD_BOND
- case 400: { /* port bonding create device %d %d */
- char ethdev_name[RTE_ETH_NAME_MAX_LEN];
-
- if (test_done == 0) {
- cli_printf("Please stop forwarding first\n");
- return -1;
- }
-
- snprintf(ethdev_name, RTE_ETH_NAME_MAX_LEN,
- "net_bond_testpmd_%d",
- bond_dev_num++);
-
- /* Create a new bonded device. */
- n = rte_eth_bond_create(ethdev_name, atoi(argv[4]), atoi(
- argv[5]));
- if (n < 0) {
- cli_printf("\t Failed to create bonded device.\n");
- return -1;
- } else {
- pid = n;
- cli_printf("Created new bonded device %s on (port %d).\n",
- ethdev_name, pid);
-
- /* Update number of ports */
- nb_ports = rte_eth_dev_count();
- reconfig(pid, atoi(argv[5]));
- rte_eth_promiscuous_enable(pid);
- }
- }
- break;
- case 410: /* port bonding add slave %d %d */
- pid = atoi(argv[5]);
- val = atoi(argv[4]);
-
- /* Set the primary slave for a bonded device. */
- if (rte_eth_bond_slave_add(pid, val)) {
- cli_printf("\t Failed to add slave %d to master port = %d.\n",
- val, pid);
- return -1;
- }
- init_port_config();
- set_port_slave_flag(val);
- break;
- case 420: /* port bonding remove slave %d %d */
- pid = atoi(argv[5]);
- val = atoi(argv[4]);
-
- /* Set the primary slave for a bonded device. */
- if (rte_eth_bond_slave_remove(pid, val)) {
- cli_printf("\t Failed to remove slave %d to master port = %d.\n",
- val, pid);
- return -1;
- }
- init_port_config();
- clear_port_slave_flag(val);
- break;
- case 430: { /* port bonding show config %d */
- int bonding_mode;
- uint8_t slaves[RTE_MAX_ETHPORTS];
- int num_slaves, num_active_slaves;
- int primary_id;
- int i;
-
- pid = atoi(argv[4]);
-
- /* Display the bonding mode.*/
- bonding_mode = rte_eth_bond_mode_get(pid);
- if (bonding_mode < 0) {
- cli_printf("\tFailed to get bonding mode for port = %d\n",
- pid);
- return -1;
- } else
- cli_printf("\tBonding mode: %d\n", bonding_mode);
-
- if (bonding_mode == BONDING_MODE_BALANCE) {
- int balance_xmit_policy;
-
- balance_xmit_policy = rte_eth_bond_xmit_policy_get(pid);
- if (balance_xmit_policy < 0) {
- cli_printf("\tFailed to get balance xmit policy for port = %d\n",
- pid);
- return -1;
- } else {
- cli_printf("\tBalance Xmit Policy: ");
-
- switch (balance_xmit_policy) {
- case BALANCE_XMIT_POLICY_LAYER2:
- cli_printf("BALANCE_XMIT_POLICY_LAYER2");
- break;
- case BALANCE_XMIT_POLICY_LAYER23:
- cli_printf("BALANCE_XMIT_POLICY_LAYER23");
- break;
- case BALANCE_XMIT_POLICY_LAYER34:
- cli_printf("BALANCE_XMIT_POLICY_LAYER34");
- break;
- }
- cli_printf("\n");
- }
- }
-
- num_slaves = rte_eth_bond_slaves_get(pid, slaves,
- RTE_MAX_ETHPORTS);
-
- if (num_slaves < 0) {
- cli_printf("\tFailed to get slave list for port = %d\n",
- pid);
- return -1;
- }
- if (num_slaves > 0) {
- cli_printf("\tSlaves (%d): [", num_slaves);
- for (i = 0; i < num_slaves - 1; i++)
- cli_printf("%d ", slaves[i]);
-
- cli_printf("%d]\n", slaves[num_slaves - 1]);
- } else
- cli_printf("\tSlaves: []\n");
-
-
- num_active_slaves = rte_eth_bond_active_slaves_get(pid, slaves,
- RTE_MAX_ETHPORTS);
-
- if (num_active_slaves < 0) {
- cli_printf(
- "\tFailed to get active slave list for port = %d\n",
- pid);
- return -1;
- }
- if (num_active_slaves > 0) {
- cli_printf("\tActive Slaves (%d): [",
- num_active_slaves);
- for (i = 0; i < num_active_slaves - 1; i++)
- cli_printf("%d ", slaves[i]);
-
- cli_printf("%d]\n", slaves[num_active_slaves - 1]);
-
- } else
- cli_printf("\tActive Slaves: []\n");
-
-
- primary_id = rte_eth_bond_primary_get(pid);
- if (primary_id < 0) {
- cli_printf(
- "\tFailed to get primary slave for port = %d\n",
- pid);
- return -1;
- } else
- cli_printf("\tPrimary: [%d]\n", primary_id);
- }
- break;
- case 440: /* port bonding set mode %d %d */
- pid = atoi(argv[4]);
- val = atoi(argv[5]);
- if (rte_eth_bond_mode_set(pid, val) < 0)
- cli_printf("\t Failed to set bonding mode for port = %d.\n",
- pid);
- break;
- case 450: /* port bonding set primary %d %d */
- pid = atoi(argv[5]);
-
- /* Set the primary slave for a bonded device. */
- if (rte_eth_bond_primary_set(pid, atoi(argv[4]))) {
- cli_printf("\t Failed to set primary slave for port = %d.\n",
- pid);
- return -1;
}
- init_port_config();
break;
- case 460: /* port bonding set mac_addr %d %m */
- pid = atoi(argv[4]);
-
- if (port_id_is_invalid(pid, ENABLED_WARN))
- return -1;
-
- n =
- rte_eth_bond_mac_address_set(pid,
- rte_ether_aton(argv[5], NULL));
-
- /* check the return value and print it if is < 0 */
- if (n < 0)
- printf("set_bond_mac_addr error: (%s)\n", strerror(-n));
- break;
- case 470: /* port bonding set slave %d %d */
- pid = atoi(argv[5]);
- val = atoi(argv[4]);
-
- /* Set the primary slave for a bonded device. */
- if (rte_eth_bond_slave_remove(pid, val)) {
- cli_printf("\t Failed to remove slave %d from master port = %d.\n",
- val, pid);
- return -1;
- }
- init_port_config();
- clear_port_slave_flag(val);
- break;
- case 480: { /* port bonding set xmit_balance_policy %d %|l2|l23|l34 */
- uint8_t policy = 0;
-
- pid = atoi(argv[4]);
-
- if (!strcmp(argv[5], "l2"))
- policy = BALANCE_XMIT_POLICY_LAYER2;
- else if (!strcmp(argv[5], "l23"))
- policy = BALANCE_XMIT_POLICY_LAYER23;
- else if (!strcmp(argv[5], "l34"))
- policy = BALANCE_XMIT_POLICY_LAYER34;
- else {
- cli_printf("\t Invalid xmit policy selection");
- return -1;
- }
-
- /* Set the bonding mode for the relevant port. */
- if (rte_eth_bond_xmit_policy_set(pid, policy) != 0)
- cli_printf("\t Failed to set bonding balance xmit policy for port = %d.\n",
- pid);
- }
- break;
- case 490: /* port bonding set mon_period %d %d */
- pid = atoi(argv[4]);
- val = atoi(argv[5]);
- if (pid >= nb_ports) {
- cli_printf("Port id %d must be less than %d\n", pid,
- nb_ports);
- return -1;
- }
-
- n = rte_eth_bond_link_monitoring_set(pid, val);
-
- /* check the return value and print it if is < 0 */
- if (n < 0)
- cli_printf("set_bond_mac_addr error: (%s)\n",
- strerror(-n));
- break;
-#endif
-#ifdef RTE_NIC_BYPASS
case 500: { /* port bypass set mode %|normal|bypass|isolate %d */
- unsigned int bypass_mode;
-
pid = atoi(argv[5]);
- bypass_mode = RTE_BYPASS_MODE_NORMAL;
+#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS
+ uint32_t bypass_mode = RTE_PMD_IXGBE_BYPASS_MODE_NORMAL;
if (!strcmp(argv[4], "bypass"))
- bypass_mode = RTE_BYPASS_MODE_BYPASS;
+ bypass_mode = RTE_PMD_IXGBE_BYPASS_MODE_BYPASS;
else if (!strcmp(argv[4], "isolate"))
- bypass_mode = RTE_BYPASS_MODE_ISOLATE;
+ bypass_mode = RTE_PMD_IXGBE_BYPASS_MODE_ISOLATE;
- if (rte_eth_dev_bypass_state_set(atoi(pid, &bypass_mode)))
- cli_printf(
- "\t Failed to set bypass mode for port = %d.\n",
+ if (rte_pmd_ixgbe_bypass_state_set(atoi(pid, &bypass_mode)))
+ cli_printf("\t Failed to set bypass mode for port = %d.\n",
pid);
- }
- break;
+#else
+ cli_printf("\t Failed to set bypass mode for port = %d.\n", pid);
+#endif
+ }
+ break;
case 510: { /* port bypass set event %|timeout|os_on|os_off|power_on|power_off mode %|normal|bypass|isolate %d */
- unsigned int bypass_mode, bypass_event;
pid = atoi(argv[7]);
- bypass_event = RTE_BYPASS_EVENT_NONE;
+#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS
+ unsigned int bypass_mode, bypass_event;
+ bypass_event = RTE_PMD_IXGBE_BYPASS_EVENT_NONE;
n = rte_stropt("timeout|os_on|os_off|power_on|power_off",
argv[4], '|');
switch(n) {
case 0:
- bypass_event = RTE_BYPASS_EVENT_TIMEOUT;
+ bypass_event = RTE_PMD_IXGBE_BYPASS_EVENT_TIMEOUT;
break;
case 1:
- bypass_event = RTE_BYPASS_EVENT_OS_ON;
+ bypass_event = RTE_PMD_IXGBE_BYPASS_EVENT_OS_ON;
break;
case 2:
- bypass_event = RTE_BYPASS_EVENT_OS_OFF;
+ bypass_event = RTE_PMD_IXGBE_BYPASS_EVENT_OS_OFF;
break;
case 3:
- bypass_event = RTE_BYPASS_EVENT_POWER_ON;
+ bypass_event = RTE_PMD_IXGBE_BYPASS_EVENT_POWER_ON;
break;
case 4:
- bypass_event = RTE_BYPASS_EVENT_POWER_OFF;
+ bypass_event = RTE_PMD_IXGBE_BYPASS_EVENT_POWER_OFF;
break;
default:
return -1;
}
/* Set the watchdog timeout. */
- if (bypass_event == RTE_BYPASS_EVENT_TIMEOUT) {
+ if (bypass_event == RTE_PMD_IXGBE_BYPASS_EVENT_TIMEOUT) {
n = -EINVAL;
if (!RTE_BYPASS_TMT_VALID(bypass_timeout) ||
(n = rte_eth_dev_wd_timeout_store(pid,
@@ -2992,111 +3899,55 @@ port_cmd(int argc, char **argv)
"for port %d, errto code: %d.\n",
bypass_timeout, pid, n);
}
- bypass_mode = RTE_BYPASS_MODE_NORMAL;
+ bypass_mode = RTE_PMD_IXGBE_BYPASS_MODE_NORMAL;
if (!strcmp(argv[6], "bypass"))
- bypass_mode = RTE_BYPASS_MODE_BYPASS;
+ bypass_mode = RTE_PMD_IXGBE_BYPASS_MODE_BYPASS;
else if (!strcmp(argv[6], "isolate"))
- bypass_mode = RTE_BYPASS_MODE_ISOLATE;
+ bypass_mode = RTE_PMD_IXGBE_BYPASS_MODE_ISOLATE;
/* Set the bypass event to transition to bypass mode. */
if (rte_eth_dev_bypass_event_store(pid,
bypass_event, bypass_mode))
cli_printf(
"\t Failed to set bypass event for port = %d.\n",
- pid);
- }
- break;
+ pid);
+#else
+ cli_printf("\t Failed to set bypass event for port = %d.\n",pid);
+#endif
+ }
+ break;
case 520: /* port bypass set timeout %|0|1.5|2|3|4|8|16|32 */
- n = rte_stropt("1.5|2|3|4|8|16|32", argv[4], '|');
+#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS
+ n = rte_stropt("0|1.5|2|3|4|8|16|32", argv[4], '|');
switch(n) {
case 0:
- bypass_timeout = RTE_BYPASS_TMT_1_5_SEC;
- break;
+ bypass_timeout = RTE_PMD_IXGBE_BYPASS_TMT_OFF;
case 1:
- bypass_timeout = RTE_BYPASS_TMT_2_SEC;
+ bypass_timeout = RTE_PMD_IXGBE_BYPASS_TMT_1_5_SEC;
break;
case 2:
- bypass_timeout = RTE_BYPASS_TMT_3_SEC;
+ bypass_timeout = RTE_PMD_IXGBE_BYPASS_TMT_2_SEC;
break;
case 3:
- bypass_timeout = RTE_BYPASS_TMT_4_SEC;
+ bypass_timeout = RTE_PMD_IXGBE_BYPASS_TMT_3_SEC;
break;
case 4:
- bypass_timeout = RTE_BYPASS_TMT_8_SEC;
+ bypass_timeout = RTE_PMD_IXGBE_BYPASS_TMT_4_SEC;
break;
case 5:
- bypass_timeout = RTE_BYPASS_TMT_16_SEC;
+ bypass_timeout = RTE_PMD_IXGBE_BYPASS_TMT_8_SEC;
break;
case 6:
- bypass_timeout = RTE_BYPASS_TMT_32SEC;
+ bypass_timeout = RTE_PMD_IXGBE_BYPASS_TMT_16_SEC;
+ break;
+ case 7:
+ bypass_timeout = RTE_PMD_IXGBE_BYPASS_TMT_32SEC;
break;
default:
break;
}
- break;
- case 530: { /* port bypass show config %d */
- unsigned int bypass_mode, bypass_event;
- int i;
- static const char * const modes[RTE_BYPASS_MODE_NUM] =
- {"UNKNOWN", "normal", "bypass", "isolate"};
- static const char * const timeouts[RTE_BYPASS_TMT_NUM] =
- {"off", "1.5", "2", "3", "4", "8", "16", "32"};
- static const char * const modes[RTE_BYPASS_MODE_NUM] =
- {"UNKNOWN", "normal", "bypass", "isolate"};
- static const char * const events[RTE_BYPASS_EVENT_NUM] = {
- "NONE",
- "OS/board on",
- "power supply on",
- "OS/board off",
- "power supply off",
- "timeout"
- };
- int num_events = (sizeof events) / (sizeof events[0]);
-
- pid = atoi(argv[4]);
-
- bypass_mode = RTE_BYPASS_MODE_NORMAL;
- bypass_event = RTE_BYPASS_EVENT_NODE;
- bypass_timeout = RTE_BYPASS_TMT_OFF;
-
- /* Display the bypass mode.*/
- if (rte_eth_dev_bypass_state_show(port_id, &bypass_mode)) {
- cli_printf(
- "\tFailed to get bypass mode for port = %d\n",
- pid);
- return -1;
- } else {
- if (!RTE_BYPASS_MODE_VALID(bypass_mode))
- bypass_mode = RTE_BYPASS_MODE_NONE;
-
- cli_printf("\tbypass mode = %s\n",
- modes[bypass_mode]);
- }
-
- /* Display the bypass timeout.*/
- if (!RTE_BYPASS_TMT_VALID(timeout))
- timeout = RTE_BYPASS_TMT_OFF;
-
- cli_printf("\tbypass timeout = %s\n", timeouts[timeout]);
-
- /* Display the bypass events and associated modes. */
- for (i = RTE_BYPASS_EVENT_START; i < num_events; i++) {
-
- if (rte_eth_dev_bypass_event_show(port_id, i,
- &event_mode))
- cli_printf("\tFailed to get bypass mode for event = %s\n",
- events[i]);
- else {
- if (!RTE_BYPASS_MODE_VALID(event_mode))
- event_mode = RTE_BYPASS_MODE_NONE;
-
- cli_printf("\tbypass event: %-16s = %s\n",
- events[i], modes[event_mode]);
- }
- }
- }
- break;
#endif
+ break;
default:
return -1;
}
@@ -4710,19 +5561,20 @@ hash_cmd(int argc, char **argv)
}
static struct cli_map reg_map[] = {
- { 0, "reg read %d %d" },
- { 10, "reg field read %d %d %d %d" },
- { 20, "reg bit read %d %d %d" },
- { 30, "reg write %d %d %d" },
- { 40, "reg field write %d %d %d %d %d" },
- { 50, "reg bit write %d %d %d %d" },
+ { 0, "read reg %d %d" },
+ { 10, "read regfield %d %d %d %d" },
+ { 20, "read regbit %d %d %d" },
+ { 30, "write reg %d %d %d" },
+ { 40, "write regfield %d %d %d %d %d" },
+ { 50, "write regbit %d %d %d %d" },
+ { 60, "read %|rxd|txd %d %d %d" },
{ -1, NULL }
};
static int
-reg_cmd(int argc, char **argv)
+rw_cmd(int argc, char **argv)
{
- int off, val, bit1, bit2;
+ int off, val, bit1, bit2, qid;
uint8_t pid;
struct cli_map *m;
@@ -4731,45 +5583,54 @@ reg_cmd(int argc, char **argv)
return -1;
switch(m->index) {
- case 0: /* reg read %d %d */
+ case 0: /* read reg %d %d */
pid = atoi(argv[2]);
off = atoi(argv[3]);
port_reg_display(pid, off);
break;
- case 10: /* reg field read %d %d %d %d */
- pid = atoi(argv[3]);
- off = atoi(argv[4]);
- bit1 = atoi(argv[5]);
- bit2 = atoi(argv[6]);
+ case 10: /* read regfield %d %d %d %d */
+ pid = atoi(argv[2]);
+ off = atoi(argv[3]);
+ bit1 = atoi(argv[4]);
+ bit2 = atoi(argv[5]);
port_reg_bit_field_display(pid, off, bit1, bit2);
break;
- case 20: /* reg bit read %d %d %d */
- pid = atoi(argv[3]);
- off = atoi(argv[4]);
- bit1 = atoi(argv[5]);
+ case 20: /* read regbit %d %d %d */
+ pid = atoi(argv[2]);
+ off = atoi(argv[3]);
+ bit1 = atoi(argv[4]);
port_reg_bit_display(pid, off, bit1);
break;
- case 30: /* reg write %d %d %d */
+ case 30: /* write reg %d %d %d */
pid = atoi(argv[2]);
off = atoi(argv[3]);
val = atoi(argv[4]);
port_reg_set(pid, off, val);
break;
- case 40: /* reg field write %d %d %d %d %d */
- pid = atoi(argv[3]);
- off = atoi(argv[4]);
- bit1 = atoi(argv[5]);
- bit2 = atoi(argv[6]);
- val = atoi(argv[7]);
+ case 40: /* write regfield %d %d %d %d %d */
+ pid = atoi(argv[2]);
+ off = atoi(argv[3]);
+ bit1 = atoi(argv[4]);
+ bit2 = atoi(argv[5]);
+ val = atoi(argv[6]);
port_reg_bit_field_set(pid, off, bit1, bit2, val);
break;
- case 50: /* reg bit write %d %d %d %d */
- pid = atoi(argv[3]);
- off = atoi(argv[4]);
- bit1 = atoi(argv[5]);
- val = atoi(argv[6]);
+ case 50: /* write regbit %d %d %d %d */
+ pid = atoi(argv[2]);
+ off = atoi(argv[3]);
+ bit1 = atoi(argv[4]);
+ val = atoi(argv[5]);
port_reg_bit_set(pid, off, bit1, val);
break;
+ case 60: /* read %|rxd|txd %d %d %d */
+ pid = atoi(argv[2]);
+ qid = atoi(argv[3]);
+ val = atoi(argv[4]);
+ if (!strcmp(argv[1], "rxd"))
+ rx_ring_desc_display(pid, qid, val);
+ else
+ tx_ring_desc_display(pid, qid, val);
+ break;
default:
return -1;
}
@@ -4778,10 +5639,7 @@ reg_cmd(int argc, char **argv)
static struct cli_map misc_map[] = {
{ 0, "misc global_config %d gre-key-len %d" },
- {
- 10,
- "misc dump %|physmen|memzone|struct_sizes|ring|mempool|devargs"
- },
+ { 10, "misc dump %|physmen|memzone|struct_sizes|ring|mempool|devargs"},
{ 20, "misc dump %|ring|mempool %s" },
{ 30, "misc mcast_addr %|add|remove %d %m" },
{ -1, NULL }
@@ -4910,21 +5768,35 @@ reset_cmd(int argc, char **argv)
static struct cli_tree default_tree[] = {
c_dir("/pmd"),
- c_cmd("help-pmd", help_cmd, "help command"),
-
- c_cmd("start", control_cmd, "Start packet forwarding"),
- c_cmd("stop", control_cmd, "Stop packet forwarding"),
- c_cmd("link-up", port_cmd, "set port link state up"),
- c_cmd("link-down", port_cmd, "set port link state down"),
- c_cmd("reset", reset_cmd,
- "reset to default forwarding"),
-
- c_cmd("misc", misc_cmd, "Misc commands"),
- c_cmd("port", port_cmd, "port commands"),
- c_cmd("set", set_cmd, "Set commands"),
- c_cmd("reg", reg_cmd, "register commands"),
- c_cmd("filter", filter_cmd, "filter commands"),
- c_cmd("hash", hash_cmd, "hash commands"),
+ c_cmd("help-pmd", help_cmd, "help command"),
+
+ c_cmd("start", control_cmd, "Start packet forwarding"),
+ c_cmd("stop", control_cmd, "Stop packet forwarding"),
+ c_cmd("link-up", port_cmd, "set port link state up"),
+ c_cmd("link-down", port_cmd, "set port link state down"),
+ c_cmd("reset", reset_cmd, "reset to default forwarding"),
+ c_cmd("misc", misc_cmd, "Misc commands"),
+ c_cmd("port", port_cmd, "port commands"),
+
+ c_cmd("show", display_cmd, "display port configurations"),
+ c_cmd("clear", display_cmd, "clear port configurations"),
+
+ c_cmd("set", set_cmd, "Set commands"),
+ c_cmd("vlan", set_cmd, "vlan commands"),
+ c_cmd("rx_vlan", set_cmd, "rx_vlan commands"),
+ c_cmd("csum", set_cmd, "csum commands"),
+ c_cmd("tso", set_cmd, "tso commands"),
+ c_cmd("tunnel_tso", set_cmd, "tunnel_tso commands"),
+ c_cmd("create", set_cmd, "create bonded interface"),
+ c_cmd("add", set_cmd, "add bonded interface"),
+ c_cmd("remove", set_cmd, "remove bonded interface"),
+ c_cmd("mac_addr", set_cmd, "mac_addr commands"),
+
+ c_cmd("gro", gro_cmd, "gro commands"),
+ c_cmd("read", rw_cmd, "read register commands"),
+ c_cmd("write", rw_cmd, "write register commands"),
+ c_cmd("filter", filter_cmd, "filter commands"),
+ c_cmd("hash", hash_cmd, "hash commands"),
c_end()
};