summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Wiles <keith.wiles@intel.com>2017-09-11 09:53:30 -0500
committerKeith Wiles <keith.wiles@intel.com>2017-11-25 07:48:58 -0600
commit1ac2a7fa6cb155df9348e0adf9fa441305a7dde4 (patch)
tree7b9a9579a4f253b821f2bc95753ae481be5ff36b
parent6dd2cf6aa1fe1961b93412ba78d14aedeb1be896 (diff)
downloaddpdk-draft-cli-1ac2a7fa6cb155df9348e0adf9fa441305a7dde4.zip
dpdk-draft-cli-1ac2a7fa6cb155df9348e0adf9fa441305a7dde4.tar.gz
dpdk-draft-cli-1ac2a7fa6cb155df9348e0adf9fa441305a7dde4.tar.xz
testpmd: cleanup
Signed-off-by: Keith Wiles <keith.wiles@intel.com>
-rw-r--r--app/test-pmd/cli_cmds.c1140
1 files changed, 810 insertions, 330 deletions
diff --git a/app/test-pmd/cli_cmds.c b/app/test-pmd/cli_cmds.c
index 531e134..6935f37 100644
--- a/app/test-pmd/cli_cmds.c
+++ b/app/test-pmd/cli_cmds.c
@@ -118,12 +118,12 @@ parse_list(char *str, const char *item_name, uint32_t max_items,
}
if (c != ',') {
- printf("character %c is not a decimal digit\n", c);
+ cli_printf("character %c is not a decimal digit\n", c);
return 0;
}
if (!value_ok) {
- printf("No valid value before comma\n");
+ cli_printf("No valid value before comma\n");
return 0;
}
@@ -137,7 +137,7 @@ parse_list(char *str, const char *item_name, uint32_t max_items,
}
if (nb_item >= max_items) {
- printf("Number of %s = %u > %u (maximum items)\n",
+ cli_printf("Number of %s = %u > %u (maximum items)\n",
item_name, nb_item + 1, max_items);
return 0;
}
@@ -152,7 +152,7 @@ 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 "
+ cli_printf("duplicated %s %u at "
"index %u and %u\n",
item_name, parsed_items[i],
i, j);
@@ -1382,13 +1382,13 @@ showport_parse_reta_config(struct rte_eth_rss_reta_entry64 *conf,
return -1;
size = p0 - p;
if (size >= sizeof(s)) {
- printf("The string size exceeds the internal buffer size\n");
+ cli_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 "
+ cli_printf("The bits of masks do not match the number of "
"reta entries: %u\n", num);
return -1;
}
@@ -1411,9 +1411,20 @@ static struct cli_map display_map[] = {
{ 45, "clear port %|info|stats|xstats|fdir|stat_qmap|dcb_tc|cap %d" },
{ 46, "clear port %|info|stats|xstats|fdir|stat_qmap|dcb_tc|cap all" },
{ 50, "show %|rxq|txq info %d %d" },
+ { 60, "show config %|rxtx|cores|fwd|txpkts" },
+ { 70, "ddp add %d %s" },
+ { 80, "ddp del %d %s" },
+ { 90, "ddp get info %s" },
+ { 100, "ddp get list %d" },
+ { 110, "show vf stats %d %d" },
+ { 120, "clear vf stats %d %d" },
{ -1, NULL }
};
+/* Get dynamic device personalization profile info list*/
+#define PROFILE_INFO_SIZE 48
+#define MAX_PROFILE_NUM 16
+
static int
display_cmd(int argc, char **argv)
{
@@ -1430,9 +1441,9 @@ display_cmd(int argc, char **argv)
if (!m)
return -1;
- pid = atoi(argv[2]);
switch(m->index) {
- case 0:
+ case 0: /* show port %d rss reta %d %s */
+ pid = atoi(argv[2]);
size = atoi(argv[5]);
rte_eth_dev_info_get(pid, &dev_info);
if (dev_info.reta_size == 0 || size != dev_info.reta_size ||
@@ -1450,7 +1461,11 @@ display_cmd(int argc, char **argv)
}
port_rss_reta_info(pid, reta_conf, size);
break;
- case 10:
+ case 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 */
+ pid = atoi(argv[2]);
port_rss_hash_conf_show(pid, argv[4], argv[5] != NULL);
break;
case 20: { /* show bypass config %d */
@@ -1463,6 +1478,8 @@ display_cmd(int argc, char **argv)
{"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",
@@ -1520,7 +1537,7 @@ display_cmd(int argc, char **argv)
#endif
}
break;
- case 30: {
+ case 30: { /* show bonding config %d */
int bonding_mode, agg_mode;
uint8_t slaves[RTE_MAX_ETHPORTS];
int num_slaves, num_active_slaves;
@@ -1531,68 +1548,68 @@ display_cmd(int argc, char **argv)
/* 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);
+ cli_printf("\tFailed to get bonding mode for port = %d\n", port_id);
return 0;
} else
- printf("\tBonding mode: %d\n", bonding_mode);
+ 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(port_id);
if (balance_xmit_policy < 0) {
- printf("\tFailed to get balance xmit policy for port = %d\n",
+ cli_printf("\tFailed to get balance xmit policy for port = %d\n",
port_id);
return 0;
} else {
- printf("\tBalance Xmit Policy: ");
+ cli_printf("\tBalance Xmit Policy: ");
switch (balance_xmit_policy) {
case BALANCE_XMIT_POLICY_LAYER2:
- printf("BALANCE_XMIT_POLICY_LAYER2");
+ cli_printf("BALANCE_XMIT_POLICY_LAYER2");
break;
case BALANCE_XMIT_POLICY_LAYER23:
- printf("BALANCE_XMIT_POLICY_LAYER23");
+ cli_printf("BALANCE_XMIT_POLICY_LAYER23");
break;
case BALANCE_XMIT_POLICY_LAYER34:
- printf("BALANCE_XMIT_POLICY_LAYER34");
+ cli_printf("BALANCE_XMIT_POLICY_LAYER34");
break;
}
- printf("\n");
+ cli_printf("\n");
}
}
if (bonding_mode == BONDING_MODE_8023AD) {
agg_mode = rte_eth_bond_8023ad_agg_selection_get(port_id);
- printf("\tIEEE802.3AD Aggregator Mode: ");
+ cli_printf("\tIEEE802.3AD Aggregator Mode: ");
switch (agg_mode) {
case AGG_BANDWIDTH:
- printf("bandwidth");
+ cli_printf("bandwidth");
break;
case AGG_STABLE:
- printf("stable");
+ cli_printf("stable");
break;
case AGG_COUNT:
- printf("count");
+ cli_printf("count");
break;
}
- printf("\n");
+ cli_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);
+ cli_printf("\tFailed to get slave list for port = %d\n", port_id);
return 0;
}
if (num_slaves > 0) {
- printf("\tSlaves (%d): [", num_slaves);
+ cli_printf("\tSlaves (%d): [", num_slaves);
for (i = 0; i < num_slaves - 1; i++)
- printf("%d ", slaves[i]);
+ cli_printf("%d ", slaves[i]);
- printf("%d]\n", slaves[num_slaves - 1]);
+ cli_printf("%d]\n", slaves[num_slaves - 1]);
} else {
- printf("\tSlaves: []\n");
+ cli_printf("\tSlaves: []\n");
}
@@ -1600,25 +1617,24 @@ display_cmd(int argc, char **argv)
RTE_MAX_ETHPORTS);
if (num_active_slaves < 0) {
- printf("\tFailed to get active slave list for port = %d\n", port_id);
+ cli_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);
+ cli_printf("\tActive Slaves (%d): [", num_active_slaves);
for (i = 0; i < num_active_slaves - 1; i++)
- printf("%d ", slaves[i]);
+ cli_printf("%d ", slaves[i]);
- printf("%d]\n", slaves[num_active_slaves - 1]);
+ cli_printf("%d]\n", slaves[num_active_slaves - 1]);
} else
- printf("\tActive Slaves: []\n");
+ cli_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);
+ if (primary_id < 0)
+ cli_printf("\tFailed to get primary slave for port = %d\n", port_id);
+ else
+ cli_printf("\tPrimary: [%d]\n", primary_id);
}
break;
case 40: /* show port %|info|stats|xstats|fdir|stat_qmap|dcb_tc|cap %d */
@@ -1679,14 +1695,337 @@ display_cmd(int argc, char **argv)
}
break;
case 50: /* show %|rxq|txq info %d %d */
- pid = atoi(argv[4]);
- qid = atoi(argv[5]);
- if (!strcmp(argv[2], "rxq"))
+ pid = atoi(argv[3]);
+ qid = atoi(argv[4]);
+ if (!strcmp(argv[1], "rxq"))
rx_queue_infos_display(pid, qid);
else
tx_queue_infos_display(pid, qid);
break;
+ case 60: /* show config rxtx|cores|fwd|txpkts */
+ if (!strcmp(argv[2], "rxtx"))
+ rxtx_config_display();
+ else if (!strcmp(argv[2], "cores"))
+ fwd_lcores_config_display();
+ else if (!strcmp(argv[2], "fwd"))
+ pkt_fwd_config_display(&cur_fwd_config);
+ else if (!strcmp(argv[2], "txpkts"))
+ show_tx_pkt_segments();
+ break;
+ case 70: { /* ddp add %d %s */
+ uint8_t *buff;
+ uint32_t size;
+ char *filepath;
+ char *file_fld[2];
+ int file_num;
+ int ret = -ENOTSUP;
+
+ pid = atoi(argv[2]);
+ if (pid > nb_ports) {
+ cli_printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
+ return 0;
+ }
+
+ if (!all_ports_stopped()) {
+ cli_printf("Please stop all ports first\n");
+ return 0;
+ }
+
+ filepath = strdup(argv[3]);
+ if (filepath == NULL) {
+ cli_printf("Failed to allocate memory\n");
+ return 0;
+ }
+ file_num = rte_strsplit(filepath, strlen(filepath), file_fld, 2, ',');
+
+ buff = open_ddp_package_file(file_fld[0], &size);
+ if (!buff) {
+ free((void *)filepath);
+ return 0;
+ }
+
+#ifdef RTE_LIBRTE_I40E_PMD
+ if (ret == -ENOTSUP)
+ ret = rte_pmd_i40e_process_ddp_package(pid,
+ buff, size,
+ RTE_PMD_I40E_PKG_OP_WR_ADD);
+#endif
+ if (ret == -EEXIST)
+ cli_printf("Profile has already existed.\n");
+ else if (ret < 0)
+ cli_printf("Failed to load profile.\n");
+ else if (file_num == 2)
+ save_ddp_package_file(file_fld[1], buff, size);
+
+ close_ddp_package_file(buff);
+ free((void *)filepath);
+ }
+ break;
+ case 80: { /* ddp del %d %s */
+ uint8_t *buff;
+ uint32_t size;
+ int ret = -ENOTSUP;
+
+ pid = atoi(argv[2]);
+ if (pid > nb_ports) {
+ cli_printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
+ return 0;
+ }
+
+ if (!all_ports_stopped()) {
+ cli_printf("Please stop all ports first\n");
+ return 0;
+ }
+
+ buff = open_ddp_package_file(argv[3], &size);
+ if (!buff)
+ return 0;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+ if (ret == -ENOTSUP)
+ ret = rte_pmd_i40e_process_ddp_package(pid,
+ buff, size,
+ RTE_PMD_I40E_PKG_OP_WR_DEL);
+#endif
+
+ if (ret == -EACCES)
+ cli_printf("Profile does not exist.\n");
+ else if (ret < 0)
+ cli_printf("Failed to delete profile.\n");
+
+ close_ddp_package_file(buff);
+ }
+ break;
+ case 90: { /* ddp get info %s */
+ uint8_t *pkg;
+ uint32_t pkg_size;
+ int ret = -ENOTSUP;
+#ifdef RTE_LIBRTE_I40E_PMD
+ uint32_t i;
+ uint8_t *buff;
+ uint32_t buff_size;
+ struct rte_pmd_i40e_profile_info info;
+ uint32_t dev_num;
+ struct rte_pmd_i40e_ddp_device_id *devs;
+#endif
+
+ pkg = open_ddp_package_file(argv[3], &pkg_size);
+ if (!pkg)
+ return 0;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+ ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
+ (uint8_t *)&info, sizeof(info),
+ RTE_PMD_I40E_PKG_INFO_GLOBAL_HEADER);
+ if (!ret) {
+ cli_printf("Global Track id: 0x%x\n", info.track_id);
+ cli_printf("Global Version: %d.%d.%d.%d\n",
+ info.version.major,
+ info.version.minor,
+ info.version.update,
+ info.version.draft);
+ cli_printf("Global Package name: %s\n\n", info.name);
+ }
+
+ ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
+ (uint8_t *)&info, sizeof(info),
+ RTE_PMD_I40E_PKG_INFO_HEADER);
+ if (!ret) {
+ cli_printf("i40e Profile Track id: 0x%x\n", info.track_id);
+ cli_printf("i40e Profile Version: %d.%d.%d.%d\n",
+ info.version.major,
+ info.version.minor,
+ info.version.update,
+ info.version.draft);
+ cli_printf("i40e Profile name: %s\n\n", info.name);
+ }
+
+ ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
+ (uint8_t *)&buff_size, sizeof(buff_size),
+ RTE_PMD_I40E_PKG_INFO_GLOBAL_NOTES_SIZE);
+ if (!ret && buff_size) {
+ buff = (uint8_t *)malloc(buff_size);
+ if (buff) {
+ ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
+ buff, buff_size,
+ RTE_PMD_I40E_PKG_INFO_GLOBAL_NOTES);
+ if (!ret)
+ cli_printf("Package Notes:\n%s\n\n", buff);
+ free(buff);
+ }
+ }
+
+ ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
+ (uint8_t *)&dev_num, sizeof(dev_num),
+ RTE_PMD_I40E_PKG_INFO_DEVID_NUM);
+ if (!ret && dev_num) {
+ devs = (struct rte_pmd_i40e_ddp_device_id *)malloc(dev_num *
+ sizeof(struct rte_pmd_i40e_ddp_device_id));
+ if (devs) {
+ ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
+ (uint8_t *)devs, dev_num *
+ sizeof(struct rte_pmd_i40e_ddp_device_id),
+ RTE_PMD_I40E_PKG_INFO_DEVID_LIST);
+ if (!ret) {
+ cli_printf("List of supported devices:\n");
+ for (i = 0; i < dev_num; i++) {
+ cli_printf(" %04X:%04X %04X:%04X\n",
+ devs[i].vendor_dev_id >> 16,
+ devs[i].vendor_dev_id & 0xFFFF,
+ devs[i].sub_vendor_dev_id >> 16,
+ devs[i].sub_vendor_dev_id & 0xFFFF);
+ }
+ cli_printf("\n");
+ }
+ free(devs);
+ }
+ }
+ ret = 0;
+#endif
+ if (ret == -ENOTSUP)
+ cli_printf("Function not supported in PMD driver\n");
+ close_ddp_package_file(pkg);
+ }
+ break;
+ case 100: { /* ddp get list %d */
+#ifdef RTE_LIBRTE_I40E_PMD
+ struct rte_pmd_i40e_profile_list *p_list;
+ struct rte_pmd_i40e_profile_info *p_info;
+ uint32_t p_num;
+ uint32_t size;
+ uint32_t i;
+#endif
+ int ret = -ENOTSUP;
+
+ pid = atoi(argv[3]);
+ if (pid > nb_ports) {
+ cli_printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
+ return 0;
+ }
+
+#ifdef RTE_LIBRTE_I40E_PMD
+ size = PROFILE_INFO_SIZE * MAX_PROFILE_NUM + 4;
+ p_list = (struct rte_pmd_i40e_profile_list *)malloc(size);
+ if (!p_list)
+ cli_printf("%s: Failed to malloc buffer\n", __func__);
+
+ if (ret == -ENOTSUP)
+ ret = rte_pmd_i40e_get_ddp_list(pid,
+ (uint8_t *)p_list, size);
+
+ if (!ret) {
+ p_num = p_list->p_count;
+ cli_printf("Profile number is: %d\n\n", p_num);
+
+ for (i = 0; i < p_num; i++) {
+ p_info = &p_list->p_info[i];
+ cli_printf("Profile %d:\n", i);
+ cli_printf("Track id: 0x%x\n", p_info->track_id);
+ cli_printf("Version: %d.%d.%d.%d\n",
+ p_info->version.major,
+ p_info->version.minor,
+ p_info->version.update,
+ p_info->version.draft);
+ cli_printf("Profile name: %s\n\n", p_info->name);
+ }
+ }
+
+ free(p_list);
+#endif
+
+ if (ret < 0)
+ cli_printf("Failed to get ddp list\n");
+ }
+ break;
+ case 110: { /* show vf stats %d %d */
+ struct rte_eth_stats stats;
+ int ret = -ENOTSUP;
+ static const char *nic_stats_border = "########################";
+
+ pid = atoi(argv[3]);
+ qid = atoi(argv[4]);
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return 0;
+
+ memset(&stats, 0, sizeof(stats));
+
+#ifdef RTE_LIBRTE_I40E_PMD
+ if (ret == -ENOTSUP)
+ ret = rte_pmd_i40e_get_vf_stats(pid, qid, &stats);
+#endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+ if (ret == -ENOTSUP)
+ ret = rte_pmd_bnxt_get_vf_stats(pid, qid, &stats);
+#endif
+
+ switch (ret) {
+ case 0:
+ break;
+ case -EINVAL:
+ cli_printf("invalid vf_id %d\n", qid);
+ break;
+ case -ENODEV:
+ cli_printf("invalid port_id %d\n", pid);
+ break;
+ case -ENOTSUP:
+ cli_printf("function not implemented\n");
+ break;
+ default:
+ cli_printf("programming error: (%s)\n", strerror(-ret));
+ }
+
+ cli_printf("\n %s NIC statistics for port %-2d vf %-2d %s\n",
+ nic_stats_border, pid, qid, nic_stats_border);
+
+ cli_printf(" RX-packets: %-10"PRIu64" RX-missed: %-10"PRIu64" RX-bytes: "
+ "%-"PRIu64"\n",
+ stats.ipackets, stats.imissed, stats.ibytes);
+ cli_printf(" RX-errors: %-"PRIu64"\n", stats.ierrors);
+ cli_printf(" RX-nombuf: %-10"PRIu64"\n",
+ stats.rx_nombuf);
+ cli_printf(" TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64" TX-bytes: "
+ "%-"PRIu64"\n",
+ stats.opackets, stats.oerrors, stats.obytes);
+
+ cli_printf(" %s############################%s\n",
+ nic_stats_border, nic_stats_border);
+ }
+ break;
+ case 120: { /* clear vf stats %d %d */
+ int ret = -ENOTSUP;
+
+ pid = atoi(argv[3]);
+ qid = atoi(argv[4]);
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return 0;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+ if (ret == -ENOTSUP)
+ ret = rte_pmd_i40e_reset_vf_stats(pid, qid);
+#endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+ if (ret == -ENOTSUP)
+ ret = rte_pmd_bnxt_reset_vf_stats(pid, qid);
+#endif
+
+ switch (ret) {
+ case 0:
+ break;
+ case -EINVAL:
+ cli_printf("invalid vf_id %d\n", qid);
+ break;
+ case -ENODEV:
+ cli_printf("invalid port_id %d\n", pid);
+ break;
+ case -ENOTSUP:
+ cli_printf("function not implemented\n");
+ break;
+ default:
+ cli_printf("programming error: (%s)\n", strerror(-ret));
+ }
+ }
+ break;
default:
return -1;
}
@@ -1725,7 +2064,7 @@ gro_cmd(int argc, char **argv)
return 0;
if (test_done == 0) {
- printf("Before set GRO flow_num and item_num_per_flow,"
+ cli_printf("Before set GRO flow_num and item_num_per_flow,"
" please stop forwarding first\n");
return 0;
}
@@ -1734,13 +2073,13 @@ gro_cmd(int argc, char **argv)
val = atoi(argv[2]);
flow = atoi(argv[3]);
if (val == 0)
- printf("Invalid flow number. Revert to default value:"
+ cli_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"
+ cli_printf("Invalid item number per-flow. Revert"
" to default value:%u.\n",
GRO_DEFAULT_ITEM_NUM_PER_FLOW);
else
@@ -1813,13 +2152,13 @@ static struct cli_map set_map[] = {
{ 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" },
+ { 490, "E-tag set insertion on port-tag-id %d port %d vf %d" },
- { 500, "set E-tag insertion off port %d vf %d" },
- { 510, "set E-tag stripping %|on|off port %d vf %d" },
- { 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" },
+ { 500, "E-tag set insertion off port %d vf %d" },
+ { 510, "E-tag set stripping %|on|off port %d vf %d" },
+ { 520, "E-tag set forwarding %|on|off port %d vf %d" },
+ { 530, "E-tag set filter add e-tag-id %d dst-pool %d port %d" },
+ { 531, "E-tag set filter del e-tag-id %d port %d" },
{ 540, "vlan set %|strip|filter|qinq|stripq %|on|off %l" },
{ 550, "vlan set %|inner|outer tpid %d %d" },
#ifdef RTE_LIBRTE_PMD_BOND
@@ -1828,9 +2167,8 @@ static struct cli_map set_map[] = {
{ 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" },
+ { 650, "set 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" },
@@ -1842,8 +2180,10 @@ static struct cli_map set_map[] = {
{ 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" },
-
-
+ { 900, "ptype mapping get %d %d" },
+ { 910, "ptype mapping replace %d %d %d %d" },
+ { 920, "ptype mapping reset %d" },
+ { 930, "ptype mapping update%d %d %d" },
{ -1, NULL }
};
@@ -2081,7 +2421,7 @@ set_cmd(int argc, char **argv)
break;
case 20: /* set %|coremask|portmask %H */
if (test_done == 0) {
- printf("Please stop forwarding first\n");
+ cli_printf("Please stop forwarding first\n");
return 0;
}
@@ -2124,7 +2464,7 @@ set_cmd(int argc, char **argv)
break;
case 60: /* set %|corelist|portlist %s */
if (test_done == 0) {
- printf("Please stop forwarding first\n");
+ cli_printf("Please stop forwarding first\n");
return 0;
}
@@ -2241,17 +2581,17 @@ set_cmd(int argc, char **argv)
case 0:
break;
case -EINVAL:
- printf("invalid vlan_id %d or vf_mask %" PRIu64 "\n",
+ cli_printf("invalid vlan_id %d or vf_mask %" PRIu64 "\n",
vid, hex);
break;
case -ENODEV:
- printf("invalid port_id %d\n", pid);
+ cli_printf("invalid port_id %d\n", pid);
break;
case -ENOTSUP:
- printf("function not implemented or supported\n");
+ cli_printf("function not implemented or supported\n");
break;
default:
- printf("programming error: (%s)\n", strerror(-ret));
+ cli_printf("programming error: (%s)\n", strerror(-ret));
}
}
break;
@@ -2844,23 +3184,23 @@ set_cmd(int argc, char **argv)
/** Check if the port is not started **/
if (port->port_status != RTE_PORT_STOPPED) {
- printf("Please stop port %d first\n", port_id);
+ cli_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"
+ cli_printf("Dedicate queues for LACP control packets"
" enabled\n");
else
- printf("Enabling dedicate queues for LACP control "
+ cli_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 "
+ cli_printf("Dedicated queues for LACP control packets "
"disabled\n");
else
- printf("Disabling dedicated queues for LACP control "
+ cli_printf("Disabling dedicated queues for LACP control "
"traffic on port %d failed\n", port_id);
}
}
@@ -2893,20 +3233,7 @@ set_cmd(int argc, char **argv)
/* 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);
+ cli_printf("set_bond_mac_addr error: (%s)\n", strerror(-n));
break;
case 680: { /* set bonding xmit_balance_policy %d %|l2|l23|l34 */
uint8_t policy = 0;
@@ -2951,7 +3278,7 @@ set_cmd(int argc, char **argv)
pid = atoi(argv[3]);
if (pid >= nb_ports) {
- printf("Port id %d must be less than %d\n",
+ cli_printf("Port id %d must be less than %d\n",
pid, nb_ports);
return 0;
}
@@ -3105,6 +3432,143 @@ set_cmd(int argc, char **argv)
strerror(-ret));
}
break;
+ case 900: { /* ptype mapping get %d %d */
+ int ret = -ENOTSUP;
+#ifdef RTE_LIBRTE_I40E_PMD
+ int max_ptype_num = 256;
+ struct rte_pmd_i40e_ptype_mapping mapping[max_ptype_num];
+ uint16_t count;
+ int i;
+#endif
+
+ pid = atoi(argv[3]);
+ val = atoi(argv[4]);
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return 0;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+ ret = rte_pmd_i40e_ptype_mapping_get(pid,
+ mapping,
+ max_ptype_num,
+ &count,
+ val);
+#endif
+
+ switch (ret) {
+ case 0:
+ break;
+ case -ENODEV:
+ cli_printf("invalid port_id %d\n", pid);
+ break;
+ case -ENOTSUP:
+ cli_printf("function not implemented\n");
+ break;
+ default:
+ cli_printf("programming error: (%s)\n", strerror(-ret));
+ }
+
+#ifdef RTE_LIBRTE_I40E_PMD
+ if (!ret) {
+ for (i = 0; i < count; i++)
+ cli_printf("%3d\t0x%08x\n",
+ mapping[i].hw_ptype,
+ mapping[i].sw_ptype);
+ }
+#endif
+ }
+ break;
+ case 910: { /* ptype mapping replace %d %d %d %d */
+ int ret = -ENOTSUP;
+
+ pid = atoi(argv[3]);
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return 0;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+ ret = rte_pmd_i40e_ptype_mapping_replace(pid,
+ atoi(argv[4]),
+ atoi(argv[5]),
+ atoi(argv[6]));
+#endif
+
+ switch (ret) {
+ case 0:
+ break;
+ case -EINVAL:
+ cli_printf("invalid ptype 0x%8x or 0x%8x\n",
+ atoi(argv[4]), atoi(argv[6]));
+ break;
+ case -ENODEV:
+ cli_printf("invalid port_id %d\n", pid);
+ break;
+ case -ENOTSUP:
+ cli_printf("function not implemented\n");
+ break;
+ default:
+ cli_printf("programming error: (%s)\n", strerror(-ret));
+ }
+ }
+ break;
+ case 920: { /* ptype mapping reset %d */
+ int ret = -ENOTSUP;
+
+ pid = atoi(argv[3]);
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return 0;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+ ret = rte_pmd_i40e_ptype_mapping_reset(pid);
+#endif
+
+ switch (ret) {
+ case 0:
+ break;
+ case -ENODEV:
+ cli_printf("invalid port_id %d\n", pid);
+ break;
+ case -ENOTSUP:
+ cli_printf("function not implemented\n");
+ break;
+ default:
+ cli_printf("programming error: (%s)\n", strerror(-ret));
+ }
+ }
+ break;
+ case 930: { /* ptype mapping update %d %d %d */
+ int ret = -ENOTSUP;
+#ifdef RTE_LIBRTE_I40E_PMD
+ struct rte_pmd_i40e_ptype_mapping mapping;
+#endif
+ pid = atoi(argv[3]);
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return 0;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+ mapping.hw_ptype = atoi(argv[4]);
+ mapping.sw_ptype = atoi(argv[5]);
+ ret = rte_pmd_i40e_ptype_mapping_update(pid,
+ &mapping,
+ 1,
+ 0);
+#endif
+
+ switch (ret) {
+ case 0:
+ break;
+ case -EINVAL:
+ cli_printf("invalid ptype 0x%8x\n", atoi(argv[5]));
+ break;
+ case -ENODEV:
+ cli_printf("invalid port_id %d\n", pid);
+ break;
+ case -ENOTSUP:
+ cli_printf("function not implemented\n");
+ break;
+ default:
+ cli_printf("programming error: (%s)\n", strerror(-ret));
+ }
+ }
+ break;
default:
return -1;
}
@@ -3297,7 +3761,7 @@ port_cmd(int argc, char **argv)
int ret = 0;
if (test_done == 0) {
- printf("Please stop forwarding first\n");
+ cli_printf("Please stop forwarding first\n");
return 0;
}
@@ -3308,7 +3772,7 @@ port_cmd(int argc, char **argv)
return 0;
if (port_is_started(pid) != 1) {
- printf("Please start port %u first\n", pid);
+ cli_printf("Please start port %u first\n", pid);
return 0;
}
@@ -3317,7 +3781,7 @@ port_cmd(int argc, char **argv)
else if (!strcmp(rxtxq, "txq"))
isrx = 0;
else {
- printf("Unknown parameter\n");
+ cli_printf("Unknown parameter\n");
return 0;
}
@@ -3331,7 +3795,7 @@ port_cmd(int argc, char **argv)
else if (!strcmp(argv[4], "stop"))
isstart = 0;
else {
- printf("Unknown parameter\n");
+ cli_printf("Unknown parameter\n");
return 0;
}
@@ -3345,7 +3809,7 @@ port_cmd(int argc, char **argv)
ret = rte_eth_dev_tx_queue_stop(pid, qid);
if (ret == -ENOTSUP)
- printf("Function not supported in PMD driver\n");
+ cli_printf("Function not supported in PMD driver\n");
}
break;
case 10: /* port %|start|stop|close all */
@@ -3490,7 +3954,7 @@ port_cmd(int argc, char **argv)
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);
+ cli_printf("mtu cannot be less than %d\n", ETHER_MIN_LEN);
return 0;
}
port_mtu_set(atoi(argv[3]), uval);
@@ -3981,20 +4445,20 @@ static struct cli_map filter_map[] = {
{
20,
- "filter ethertype %d %|add|del %|mac_addr|mac_ignr %m ethertype %d %|drop|fwd queue %d"
+ "ethertype filter %d %|add|del %|mac_addr|mac_ignr %m ethertype %d %|drop|fwd queue %d"
},
{
40,
- "filter 2tuple %d %|add|del dst_port %d protocol %d mask %d tcp_flags %d priority %d queue %d"
+ "2tuple_filter %d %|add|del dst_port %d protocol %d mask %d tcp_flags %d priority %d queue %d"
},
{
60,
"filter 5tuple %d %|add|del dst_ip %4 src_ip %4 dst_port %d src_port %d protocol %d mask %d tcp_flags %d priority %d queue %d"
},
- { 80, "filter syn %d %|add|del priority %|high|low queue %d" },
+ { 80, "syn_filter %d %|add|del priority %|high|low queue %d" },
{
100,
- "filter flex %d %|add|del len %d bytes %s mask %s priority %d queue %d"
+ "flex_filter %d %|add|del len %d bytes %s mask %s priority %d queue %d"
},
{
@@ -4039,27 +4503,27 @@ static struct cli_map filter_map[] = {
"flexbytes %s %|drop|fwd queue %d fd_id %d"
},
- { 180, "filter flow_director flush %d" },
+ { 180, "flush_flow_director %d" },
{
190,
- "filter flow_director mask %d mode IP vlan %d src_mask %4 %6 %d dst_mask %4 %6 %d %m %d"
+ "flow_director_mask %d mode IP vlan %d src_mask %4 %6 %d dst_mask %4 %6 %d %m %d"
},
- { 191, "filter flow_director mask %d mode MAC-VLAN vlan %d" },
+ { 191, "flow_director_mask %d mode MAC-VLAN vlan %d" },
{
192,
- "filter flow_director mask %d mode Tunnel vlan %d mac %m tunnel-type %d tunnelid %d"
+ "flow_director_mask %d mode Tunnel vlan %d mac %m tunnel-type %d tunnelid %d"
},
{
- 220, "filter flow_director flex_mask %d "
+ 220, "flow_director_flex_mask %d "
"flow %|none|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv6-other"
"|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|l2_payload %s"
},
- { 230, "filter flow_director flex_payload %d %|raw|l2|l3|l4 %s" },
+ { 230, "flow_director_flex_payload %d %|raw|l2|l3|l4 %s" },
{ -1, NULL }
};
@@ -4154,7 +4618,7 @@ str2fdir_tunneltype(char *string) {
if ((ip_addr).family == AF_INET) \
(ip) = (ip_addr).ipv4.s_addr; \
else { \
- printf("invalid parameter.\n"); \
+ cli_printf("invalid parameter.\n"); \
return -1; \
} \
} while (0)
@@ -4166,7 +4630,7 @@ str2fdir_tunneltype(char *string) {
&((ip_addr).ipv6), \
sizeof(struct in6_addr)); \
else { \
- printf("invalid parameter.\n"); \
+ cli_printf("invalid parameter.\n"); \
return -1; \
} \
} while (0)
@@ -4295,7 +4759,7 @@ filter_cmd(int argc, char **argv)
break;
}
- n = rte_stropt("", argv[8], "|");
+ n = rte_stropt("vxlan|nvgre|ipingre", argv[8], "|");
switch(n) {
case 0:
tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN;
@@ -4322,19 +4786,17 @@ filter_cmd(int argc, char **argv)
RTE_ETH_FILTER_DELETE,
&tunnel_filter_conf);
if (ret < 0)
- printf("cmd_tunnel_filter_parsed error: (%s)\n",
+ cli_printf("cmd_tunnel_filter_parsed error: (%s)\n",
strerror(-ret));
}
break;
- case 20: { /* filter ethertype %d %|add|del %|mac_addr|mac_ignr %m ethertype %d %|drop|fwd queue %d */
+ case 20: { /* ethertype filter %d %|add|del %|mac_addr|mac_ignr %m ethertype %d %|drop|fwd queue %d */
struct rte_eth_ethertype_filter filter;
pid = atoi(argv[2]);
- ret =
- rte_eth_dev_filter_supported(pid,
- RTE_ETH_FILTER_ETHERTYPE);
+ ret = rte_eth_dev_filter_supported(pid, RTE_ETH_FILTER_ETHERTYPE);
if (ret < 0) {
- printf(
+ cli_printf(
"ethertype filter is not supported on port %u.\n",
pid);
return -1;
@@ -4363,29 +4825,29 @@ filter_cmd(int argc, char **argv)
RTE_ETH_FILTER_DELETE,
&filter);
if (ret < 0)
- printf("ethertype filter programming error: (%s)\n",
+ cli_printf("ethertype filter programming error: (%s)\n",
strerror(-ret));
}
break;
- case 40: { /* filter 2tuple %d %|add|del dst_port %d protocol %d mask %d tcp_flags %d priority %d queue %d */
+ case 40: { /* 2tuple_filter %d %|add|del dst_port %d protocol %d mask %d tcp_flags %d priority %d queue %d */
struct rte_eth_ntuple_filter filter;
uint8_t proto, tcp_flags, priority;
uint16_t dst_port;
uint32_t mask;
char *ops;
- pid = atoi(argv[2]);
- ops = argv[3];
- dst_port = atoi(argv[5]);
- proto = atoi(argv[7]);
- mask = atoi(argv[9]);
- tcp_flags = atoi(argv[11]);
- priority = atoi(argv[13]);
- qid = atoi(argv[15]);
+ pid = atoi(argv[1]);
+ ops = argv[2];
+ dst_port = atoi(argv[4]);
+ proto = atoi(argv[6]);
+ mask = atoi(argv[8]);
+ tcp_flags = atoi(argv[10]);
+ priority = atoi(argv[12]);
+ qid = atoi(argv[14]);
ret = rte_eth_dev_filter_supported(pid, RTE_ETH_FILTER_NTUPLE);
if (ret < 0) {
- printf("ntuple filter is not supported on port %u.\n",
+ cli_printf("ntuple filter is not supported on port %u.\n",
pid);
return ret;
}
@@ -4398,12 +4860,12 @@ filter_cmd(int argc, char **argv)
filter.proto = proto;
filter.priority = priority;
if (tcp_flags != 0 && filter.proto != IPPROTO_TCP) {
- printf("nonzero tcp_flags is only meaningful"
+ cli_printf("nonzero tcp_flags is only meaningful"
" when protocol is TCP.\n");
return -1;
}
if (tcp_flags > TCP_FLAG_ALL) {
- printf("invalid TCP flags.\n");
+ cli_printf("invalid TCP flags.\n");
return -1;
}
@@ -4427,11 +4889,11 @@ filter_cmd(int argc, char **argv)
RTE_ETH_FILTER_DELETE,
&filter);
if (ret < 0)
- printf("2tuple filter programming error: (%s)\n",
+ cli_printf("2tuple filter programming error: (%s)\n",
strerror(-ret));
}
break;
- case 60: { /* filter 5tuple %d %|add|del dst_ip %4 src_ip %4 dst_port %d src_port %d protocol %d mask %d tcp_flags %d priority %d queue %d */
+ case 60: { /* 5tuple_filter %d %|add|del dst_ip %4 src_ip %4 dst_port %d src_port %d protocol %d mask %d tcp_flags %d priority %d queue %d */
struct rte_eth_ntuple_filter filter;
uint8_t proto, tcp_flags, priority;
uint16_t dst_port, src_port;
@@ -4439,21 +4901,21 @@ filter_cmd(int argc, char **argv)
struct rte_ipaddr ip_dst, ip_src;
char *ops, *dst_ip, *src_ip;
- pid = atoi(argv[2]);
- ops = argv[3];
- dst_ip = argv[5];
- src_ip = argv[7];
- dst_port = atoi(argv[9]);
- src_port = atoi(argv[11]);
- proto = atoi(argv[13]);
- mask = atoi(argv[15]);
- tcp_flags = atoi(argv[17]);
- priority = atoi(argv[19]);
- qid = atoi(argv[21]);
+ pid = atoi(argv[1]);
+ ops = argv[2];
+ dst_ip = argv[4];
+ src_ip = argv[6];
+ dst_port = atoi(argv[8]);
+ src_port = atoi(argv[10]);
+ proto = atoi(argv[12]);
+ mask = atoi(argv[14]);
+ tcp_flags = atoi(argv[16]);
+ priority = atoi(argv[18]);
+ qid = atoi(argv[20]);
ret = rte_eth_dev_filter_supported(pid, RTE_ETH_FILTER_NTUPLE);
if (ret < 0) {
- printf("ntuple filter is not supported on port %u.\n",
+ cli_printf("ntuple filter is not supported on port %u.\n",
pid);
return ret;
}
@@ -4469,12 +4931,12 @@ filter_cmd(int argc, char **argv)
filter.proto = proto;
filter.priority = priority;
if (tcp_flags != 0 && filter.proto != IPPROTO_TCP) {
- printf("nonzero tcp_flags is only meaningful"
+ cli_printf("nonzero tcp_flags is only meaningful"
" when protocol is TCP.\n");
return -1;
}
if (tcp_flags > TCP_FLAG_ALL) {
- printf("invalid TCP flags.\n");
+ cli_printf("invalid TCP flags.\n");
return -1;
}
@@ -4490,7 +4952,7 @@ filter_cmd(int argc, char **argv)
filter.dst_ip = ip_dst.ipv4.s_addr;
else {
if (filter.dst_ip_mask == 0) {
- printf(
+ cli_printf(
"can not support ipv6 involved compare.\n");
return -1;
}
@@ -4504,7 +4966,7 @@ filter_cmd(int argc, char **argv)
filter.src_ip = ip_src.ipv4.s_addr;
else {
if (filter.src_ip_mask == 0) {
- printf(
+ cli_printf(
"can not support ipv6 involved compare.\n");
return -1;
}
@@ -4526,21 +4988,21 @@ filter_cmd(int argc, char **argv)
RTE_ETH_FILTER_DELETE,
&filter);
if (ret < 0)
- printf("5tuple filter programming error: (%s)\n",
+ cli_printf("5tuple filter programming error: (%s)\n",
strerror(-ret));
}
break;
- case 80: { /* filter syn %d %|add|del priority %|high|low queue %d */
+ case 80: { /* syn_filter %d %|add|del priority %|high|low queue %d */
struct rte_eth_syn_filter syn_filter;
char *ops, *high;
- pid = atoi(argv[2]);
- ops = argv[3];
- high = argv[5];
- qid = atoi(argv[7]);
+ pid = atoi(argv[1]);
+ ops = argv[2];
+ high = argv[4];
+ qid = atoi(argv[6]);
ret = rte_eth_dev_filter_supported(pid, RTE_ETH_FILTER_SYN);
if (ret < 0) {
- printf("syn filter is not supported on port %u.\n",
+ cli_printf("syn filter is not supported on port %u.\n",
pid);
return -1;
}
@@ -4565,11 +5027,11 @@ filter_cmd(int argc, char **argv)
&syn_filter);
if (ret < 0)
- printf("syn filter programming error: (%s)\n",
+ cli_printf("syn filter programming error: (%s)\n",
strerror(-ret));
}
break;
- case 100: { /* filter flex %d %|add|del len %d bytes %s mask %s priority %d queue %d */
+ case 100: { /* flex_fliter %d %|add|del len %d bytes %s mask %s priority %d queue %d */
struct rte_eth_flex_filter filter;
char *bytes_ptr, *mask_ptr;
uint16_t len, len_value, i, j = 0;
@@ -4577,16 +5039,16 @@ filter_cmd(int argc, char **argv)
int val, priority;
uint8_t byte = 0;
- pid = atoi(argv[2]);
- ops = argv[3];
- len_value = atoi(argv[5]);
- bytes_ptr = argv[7];
- mask_ptr = argv[9];
- priority = atoi(argv[11]);
- qid = atoi(argv[13]);
+ pid = atoi(argv[1]);
+ ops = argv[2];
+ len_value = atoi(argv[4]);
+ bytes_ptr = argv[6];
+ mask_ptr = argv[8];
+ priority = atoi(argv[10]);
+ qid = atoi(argv[12]);
if (len_value > RTE_FLEX_FILTER_MAXLEN) {
- printf("the len exceed the max length 128\n");
+ cli_printf("the len exceed the max length 128\n");
return -1;
}
memset(&filter, 0, sizeof(struct rte_eth_flex_filter));
@@ -4600,34 +5062,34 @@ filter_cmd(int argc, char **argv)
bytes_ptr += 2;
len = strnlen(bytes_ptr, len_value * 2);
if (len == 0 || (len % 8 != 0)) {
- printf("please check len and bytes input\n");
+ cli_printf("please check len and bytes input\n");
return -1;
}
for (i = 0; i < len; i++) {
c = bytes_ptr[i];
if (isxdigit(c) == 0) {
/* invalid characters. */
- printf("invalid input\n");
+ cli_printf("invalid input\n");
return -1;
}
val = xdigit2val(c);
if (i % 2) {
byte |= val;
filter.bytes[j] = byte;
- printf("bytes[%d]:%02x ", j, filter.bytes[j]);
+ cli_printf("bytes[%d]:%02x ", j, filter.bytes[j]);
j++;
byte = 0;
} else
byte |= val << 4;
}
- printf("\n");
+ cli_printf("\n");
/* translate mask string to uint8_t array. */
if (mask_ptr[0] == '0' && ((mask_ptr[1] == 'x') ||
(mask_ptr[1] == 'X')))
mask_ptr += 2;
len = strnlen(mask_ptr, (len_value + 3) / 4);
if (len == 0) {
- printf("invalid input\n");
+ cli_printf("invalid input\n");
return -1;
}
j = 0;
@@ -4636,20 +5098,20 @@ filter_cmd(int argc, char **argv)
c = mask_ptr[i];
if (isxdigit(c) == 0) {
/* invalid characters. */
- printf("invalid input\n");
+ cli_printf("invalid input\n");
return -1;
}
val = xdigit2val(c);
if (i % 2) {
byte |= val;
filter.mask[j] = byte;
- printf("mask[%d]:%02x ", j, filter.mask[j]);
+ cli_printf("mask[%d]:%02x ", j, filter.mask[j]);
j++;
byte = 0;
} else
byte |= val << 4;
}
- printf("\n");
+ cli_printf("\n");
if (!strcmp(ops, "add"))
ret = rte_eth_dev_filter_ctrl(pid,
@@ -4663,33 +5125,33 @@ filter_cmd(int argc, char **argv)
&filter);
if (ret < 0)
- printf("flex filter setting error: (%s)\n",
+ cli_printf("flex filter setting error: (%s)\n",
strerror(-ret));
}
break;
- case 120: /* "filter flow_director %d mode IP %|add|del|update "
+ case 120: /* "flow_director_filter %d mode IP %|add|del|update "
"flow %|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv6-other"
"|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|l2_payload "
"src %4 dst %4 tos %d proto %d ttl %d vlan %d "
"flexbytes %s %|drop|fwd %s queue %d fd_id %d" */
- case 121: /* "filter flow_director %d mode IP %|add|del|update "
+ case 121: /* "flow_director_filter %d mode IP %|add|del|update "
"flow %|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv6-other"
"|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|l2_payload "
"src %4 %d dst %4 %d tos %d proto %d ttl %d vlan %d "
"flexbytes %s %|drop|fwd %s queue %d fd_id %d" */
- case 122: /* "filter flow_director %d mode IP %|add|del|update "
+ case 122: /* "flow_director_filter %d mode IP %|add|del|update "
"flow %|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv6-other"
"|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|l2_payload "
"src %4 %d dst %4 %d verify_tag %d tos %d proto %d ttl %d vlan %d "
"flexbytes %s %|drop|fwd %s queue %d fd_id %d" */
- case 123: /* "filter flow_director %d mode IP %|add|del|update "
+ case 123: /* "flow_director_filter %d mode IP %|add|del|update "
"flow %|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv6-other"
"|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|l2_payload "
"ether %d flexbytes %s %|drop|fwd %s queue %d fd_id %d" */
- case 124: /* "filter flow_director %d mode MAC-VLAN %|add|del|update "
+ case 124: /* "flow_director_filter %d mode MAC-VLAN %|add|del|update "
"mac %m vlan %d flexbytes %s %|drop|fwd queue %d fd_id %d" */
case 125: {
- /* "filter flow_director %d mode Tunnel %|add|del|update "
+ /* "flow_director_filter %d mode Tunnel %|add|del|update "
"mac %m vlan %d tunnel %|NVGRE|VxLAN tunnel-id %d"
"flexbytes %s %|drop|fwd queue %d fd_id %d" */
struct rte_eth_fdir_filter entry;
@@ -4704,85 +5166,85 @@ filter_cmd(int argc, char **argv)
uint16_t port_src = 0, port_dst = 0, tag = 0, ether = 0;
struct rte_ipaddr ip_dst, ip_src;
- pid = atoi(argv[2]);
- mode = argv[4];
- ops = argv[5];
+ pid = atoi(argv[1]);
+ mode = argv[3];
+ ops = argv[4];
if (m->index == 120) {
- flow = argv[7];
- src_ip = argv[9];
+ flow = argv[6];
+ src_ip = argv[8];
+ dst_ip = argv[10];
+ tos = atoi(argv[12]);
+ proto = atoi(argv[14]);
+ ttl = atoi(argv[16]);
+ vid = atoi(argv[18]);
+ flex = argv[20];
+ drop = argv[21];
+ pf_vf = argv[22];
+ qid = atoi(argv[24]);
+ fid = atoi(argv[26]);
+ } else if (m->index == 121) {
+ flow = argv[6];
+ src_ip = argv[8];
+ port_src = atoi(argv[9]);
dst_ip = argv[11];
- tos = atoi(argv[13]);
- proto = atoi(argv[15]);
- ttl = atoi(argv[17]);
+ port_dst = atoi(argv[12]);
+ tos = atoi(argv[14]);
+ proto = atoi(argv[16]);
+ ttl = atoi(argv[18]);
vid = atoi(argv[19]);
- flex = argv[21];
- drop = argv[22];
- pf_vf = argv[23];
- qid = atoi(argv[25]);
- fid = atoi(argv[27]);
- } else if (m->index == 121) {
- flow = argv[7];
- src_ip = argv[9];
- port_src = atoi(argv[10]);
- dst_ip = argv[12];
- port_dst = atoi(argv[13]);
- tos = atoi(argv[15]);
- proto = atoi(argv[17]);
- ttl = atoi(argv[19]);
- vid = atoi(argv[20]);
- flex = argv[23];
- drop = argv[24];
- pf_vf = argv[25];
- qid = atoi(argv[27]);
- fid = atoi(argv[29]);
+ flex = argv[22];
+ drop = argv[23];
+ pf_vf = argv[24];
+ qid = atoi(argv[26]);
+ fid = atoi(argv[28]);
} else if (m->index == 122) {
- flow = argv[7];
- src_ip = argv[9];
- port_src = atoi(argv[10]);
- dst_ip = argv[12];
- port_dst = atoi(argv[13]);
- tag = atoi(argv[15]);
- tos = atoi(argv[17]);
- proto = atoi(argv[19]);
- ttl = atoi(argv[21]);
- vid = atoi(argv[23]);
- flex = argv[25];
- drop = argv[26];
- pf_vf = argv[27];
- qid = atoi(argv[29]);
- fid = atoi(argv[31]);
+ flow = argv[6];
+ src_ip = argv[8];
+ port_src = atoi(argv[9]);
+ dst_ip = argv[11];
+ port_dst = atoi(argv[12]);
+ tag = atoi(argv[14]);
+ tos = atoi(argv[16]);
+ proto = atoi(argv[18]);
+ ttl = atoi(argv[20]);
+ vid = atoi(argv[22]);
+ flex = argv[24];
+ drop = argv[25];
+ pf_vf = argv[26];
+ qid = atoi(argv[28]);
+ fid = atoi(argv[30]);
} else if (m->index == 123) {
- flow = argv[7];
- ether = atoi(argv[9]);
- flex = argv[11];
- drop = argv[12];
- pf_vf = argv[13];
- qid = atoi(argv[15]);
- fid = atoi(argv[17]);
+ flow = argv[6];
+ ether = atoi(argv[8]);
+ flex = argv[10];
+ drop = argv[11];
+ pf_vf = argv[12];
+ qid = atoi(argv[14]);
+ fid = atoi(argv[16]);
} else if (m->index == 124) {
- mac = argv[7];
- vid = atoi(argv[9]);
- flex = argv[11];
- drop = argv[12];
- pf_vf = argv[13];
- qid = atoi(argv[15]);
- fid = atoi(argv[17]);
+ mac = argv[6];
+ vid = atoi(argv[8]);
+ flex = argv[10];
+ drop = argv[11];
+ pf_vf = argv[12];
+ qid = atoi(argv[14]);
+ fid = atoi(argv[16]);
} else if (m->index == 125) {
- mac = argv[7];
- vid = atoi(argv[9]);
- tunnel = argv[11];
- tid = atoi(argv[13]);
- flex = argv[15];
- drop = argv[16];
- pf_vf = argv[17];
- qid = atoi(argv[19]);
- fid = atoi(argv[21]);
+ mac = argv[6];
+ vid = atoi(argv[8]);
+ tunnel = argv[10];
+ tid = atoi(argv[12]);
+ flex = argv[14];
+ drop = argv[15];
+ pf_vf = argv[16];
+ qid = atoi(argv[18]);
+ fid = atoi(argv[20]);
}
ret = rte_eth_dev_filter_supported(pid, RTE_ETH_FILTER_FDIR);
if (ret < 0) {
- printf("flow director is not supported on port %u.\n",
+ cli_printf("flow director is not supported on port %u.\n",
pid);
return -1;
}
@@ -4791,17 +5253,17 @@ filter_cmd(int argc, char **argv)
if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
if (strcmp(mode, "MAC-VLAN")) {
- printf("Please set mode to MAC-VLAN.\n");
+ cli_printf("Please set mode to MAC-VLAN.\n");
return -1;
}
} else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
if (strcmp(mode, "Tunnel")) {
- printf("Please set mode to Tunnel.\n");
+ cli_printf("Please set mode to Tunnel.\n");
return -1;
}
} else {
if (strcmp(mode, "IP")) {
- printf("Please set mode to IP.\n");
+ cli_printf("Please set mode to IP.\n");
return -1;
}
entry.input.flow_type = str2flowtype(flow);
@@ -4811,7 +5273,7 @@ filter_cmd(int argc, char **argv)
parse_flexbytes(flex, flexbytes,
RTE_ETH_FDIR_MAX_FLEXLEN);
if (ret < 0) {
- printf("error: Cannot parse flexbytes input.\n");
+ cli_printf("error: Cannot parse flexbytes input.\n");
return -1;
}
@@ -4945,14 +5407,14 @@ filter_cmd(int argc, char **argv)
vf_id = strtoul(pf_vf + 2, &end, 10);
if (errno != 0 || *end != '\0' ||
vf_id >= dev_info.max_vfs) {
- printf("invalid parameter %s.\n",
+ cli_printf("invalid parameter %s.\n",
pf_vf);
return -1;
}
entry.input.flow_ext.is_vf = 1;
entry.input.flow_ext.dst_id = (uint16_t)vf_id;
} else {
- printf("invalid parameter %s.\n", pf_vf);
+ cli_printf("invalid parameter %s.\n", pf_vf);
return -1;
}
}
@@ -4974,15 +5436,15 @@ filter_cmd(int argc, char **argv)
RTE_ETH_FILTER_UPDATE,
&entry);
if (ret < 0)
- printf("flow director programming error: (%s)\n",
+ cli_printf("flow director programming error: (%s)\n",
strerror(-ret));
}
break;
- case 180: /* filter flow_director flush %d */
- pid = atoi(argv[3]);
+ case 180: /* flush_flow_director %d */
+ pid = atoi(argv[1]);
ret = rte_eth_dev_filter_supported(pid, RTE_ETH_FILTER_FDIR);
if (ret < 0) {
- printf("flow director is not supported on port %u.\n",
+ cli_printf("flow director is not supported on port %u.\n",
pid);
return -1;
}
@@ -4990,12 +5452,12 @@ filter_cmd(int argc, char **argv)
ret = rte_eth_dev_filter_ctrl(pid, RTE_ETH_FILTER_FDIR,
RTE_ETH_FILTER_FLUSH, NULL);
if (ret < 0)
- printf("flow director table flushing error: (%s)\n",
+ cli_printf("flow director table flushing error: (%s)\n",
strerror(-ret));
break;
- case 190: /* filter flow_director mask %d mode IP vlan %d src_mask %4 %6 %d dst_mask %4 %6 %d */
- case 191: /* filter flow_director mask %d mode MAC-VLAN vlan %d */
- case 192: { /* filter flow_director mask %d mode Tunnel vlan %d mac %d tunnel-type %d tunnelid %d */
+ case 190: /* flow_director_mask %d mode IP vlan %d src_mask %4 %6 %d dst_mask %4 %6 %d */
+ case 191: /* flow_director_mask %d mode MAC-VLAN vlan %d */
+ case 192: { /* flow_director_mask %d mode Tunnel vlan %d mac %d tunnel-type %d tunnelid %d */
struct rte_eth_fdir_masks *mask;
struct rte_port *port;
struct rte_ipaddr ip;
@@ -5005,27 +5467,27 @@ filter_cmd(int argc, char **argv)
uint16_t tunnel_type = 0, mac_mask = 0;
uint32_t tid = 0;
- pid = atoi(argv[3]);
- mode = argv[5];
+ pid = atoi(argv[1]);
+ mode = argv[3];
if (m->index == 190) {
- vlan_mask = atoi(argv[7]);
- ip4_src = argv[9];
- ip6_src = argv[10];
- port_src = atoi(argv[11]);
- ip4_dst = argv[13];
- ip6_dst = argv[14];
- port_dst = atoi(argv[15]);
+ vlan_mask = atoi(argv[5]);
+ ip4_src = argv[7];
+ ip6_src = argv[8];
+ port_src = atoi(argv[9]);
+ ip4_dst = argv[11];
+ ip6_dst = argv[12];
+ port_dst = atoi(argv[13]);
} else if (m->index == 191)
- vlan_mask = atoi(argv[7]);
+ vlan_mask = atoi(argv[5]);
else if (m->index == 192) {
- vlan_mask = atoi(argv[7]);
- mac_mask = atoi(argv[9]);
- tunnel_type = atoi(argv[11]);
- tid = atoi(argv[13]);
+ vlan_mask = atoi(argv[5]);
+ mac_mask = atoi(argv[7]);
+ tunnel_type = atoi(argv[9]);
+ tid = atoi(argv[11]);
}
if (pid > nb_ports) {
- printf("Invalid port, range is [0, %d]\n",
+ cli_printf("Invalid port, range is [0, %d]\n",
nb_ports - 1);
return -1;
}
@@ -5033,7 +5495,7 @@ filter_cmd(int argc, char **argv)
port = &ports[pid];
/** Check if the port is not started **/
if (port->port_status != RTE_PORT_STOPPED) {
- printf("Please stop port %d first\n", pid);
+ cli_printf("Please stop port %d first\n", pid);
return -1;
}
@@ -5041,14 +5503,14 @@ filter_cmd(int argc, char **argv)
if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
if (strcmp(mode, "MAC-VLAN")) {
- printf("Please set mode to MAC-VLAN.\n");
+ cli_printf("Please set mode to MAC-VLAN.\n");
return -1;
}
mask->vlan_tci_mask = rte_cpu_to_be_16(vlan_mask);
} else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
if (strcmp(mode, "Tunnel")) {
- printf("Please set mode to Tunnel.\n");
+ cli_printf("Please set mode to Tunnel.\n");
return -1;
}
@@ -5058,7 +5520,7 @@ filter_cmd(int argc, char **argv)
mask->tunnel_type_mask = tunnel_type;
} else {
if (strcmp(mode, "IP")) {
- printf("Please set mode to IP.\n");
+ cli_printf("Please set mode to IP.\n");
return -1;
}
@@ -5083,7 +5545,7 @@ filter_cmd(int argc, char **argv)
}
break;
case 220: {
- /* "filter flow_director flex_mask %d "
+ /* "flow_director_flex_mask %d "
"flow %|none|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv6-other"
"|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|l2_payload %s" */
struct rte_eth_fdir_info fdir_info;
@@ -5093,12 +5555,12 @@ filter_cmd(int argc, char **argv)
uint32_t flow_type_mask;
uint16_t i;
- pid = atoi(argv[3]);
- flow = argv[4];
- mask = argv[6];
+ pid = atoi(argv[1]);
+ flow = argv[2];
+ mask = argv[4];
if (pid > nb_ports) {
- printf("Invalid port, range is [0, %d]\n",
+ cli_printf("Invalid port, range is [0, %d]\n",
nb_ports - 1);
return -1;
}
@@ -5106,7 +5568,7 @@ filter_cmd(int argc, char **argv)
port = &ports[pid];
/** Check if the port is not started **/
if (port->port_status != RTE_PORT_STOPPED) {
- printf("Please stop port %d first\n", pid);
+ cli_printf("Please stop port %d first\n", pid);
return -1;
}
@@ -5115,7 +5577,7 @@ filter_cmd(int argc, char **argv)
flex_mask.mask,
RTE_ETH_FDIR_MAX_FLEXLEN);
if (ret < 0) {
- printf("error: Cannot parse mask input.\n");
+ cli_printf("error: Cannot parse mask input.\n");
return -1;
}
@@ -5123,7 +5585,7 @@ filter_cmd(int argc, char **argv)
ret = rte_eth_dev_filter_ctrl(pid, RTE_ETH_FILTER_FDIR,
RTE_ETH_FILTER_INFO, &fdir_info);
if (ret < 0) {
- printf("Cannot get FDir filter info\n");
+ cli_printf("Cannot get FDir filter info\n");
return -1;
}
@@ -5148,7 +5610,7 @@ filter_cmd(int argc, char **argv)
flow_type_mask = fdir_info.flow_types_mask[0];
if (!strcmp(flow, "all")) {
if (!flow_type_mask) {
- printf("No flow type supported\n");
+ cli_printf("No flow type supported\n");
return -1;
}
for (i = RTE_ETH_FLOW_UNKNOWN; i < RTE_ETH_FLOW_MAX;
@@ -5162,7 +5624,7 @@ filter_cmd(int argc, char **argv)
}
flex_mask.flow_type = str2flowtype(flow);
if (!(flow_type_mask & (1 << flex_mask.flow_type))) {
- printf("Flow type %s not supported on port %d\n",
+ cli_printf("Flow type %s not supported on port %d\n",
flow, pid);
return -1;
}
@@ -5170,17 +5632,17 @@ filter_cmd(int argc, char **argv)
cmd_reconfig_device_queue(pid, 1, 1);
}
break;
- case 230: { /* filter flow_director flex_payload %d %|raw|l2|l3|l4 %s */
+ case 230: { /* flow_director_flex_payload %d %|raw|l2|l3|l4 %s */
struct rte_eth_flex_payload_cfg flex_cfg;
struct rte_port *port;
char *payload, *layer;
- pid = atoi(argv[3]);
- layer = argv[4];
- payload = argv[5];
+ pid = atoi(argv[1]);
+ layer = argv[2];
+ payload = argv[3];
if (pid > nb_ports) {
- printf("Invalid port, range is [0, %d]\n",
+ cli_printf("Invalid port, range is [0, %d]\n",
nb_ports - 1);
return -1;
}
@@ -5188,7 +5650,7 @@ filter_cmd(int argc, char **argv)
port = &ports[pid];
/** Check if the port is not started **/
if (port->port_status != RTE_PORT_STOPPED) {
- printf("Please stop port %d first\n", pid);
+ cli_printf("Please stop port %d first\n", pid);
return -1;
}
@@ -5206,7 +5668,7 @@ filter_cmd(int argc, char **argv)
ret = parse_offsets(payload, flex_cfg.src_offset,
RTE_ETH_FDIR_MAX_FLEXLEN);
if (ret < 0) {
- printf("error: Cannot parse flex payload input.\n");
+ cli_printf("error: Cannot parse flex payload input.\n");
return -1;
}
@@ -5221,17 +5683,17 @@ filter_cmd(int argc, char **argv)
}
static struct cli_map hash_map[] = {
- { 0, "hash get sym_hash_ena_per_port %d" },
- { 10, "hash set sym_hash_ena_per_port %d %|enable|disable" },
- { 20, "hash hash_global_config get %d" },
+ { 0, "get_sym_hash_ena_per_port %d" },
+ { 10, "set_sym_hash_ena_per_port %d %|enable|disable" },
+ { 20, "get_hash_global_config %d" },
{
- 30, "hash set_hash_global_config %d %|toeplitz|simple_xor|default "
+ 30, "set_hash_global_config %d %|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"
},
{
- 40, "hash hash_input set %d "
+ 40, "set_hash_input_set %d "
"%|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|dst-ipv6| "
@@ -5243,7 +5705,7 @@ static struct cli_map hash_map[] = {
"%|select|add"
},
{
- 50, "hash fdir_input set %d "
+ 50, "set_fdir_input_set %d "
"%|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|dst-ipv6|"
@@ -5351,13 +5813,13 @@ hash_cmd(int argc, char **argv)
return -1;
switch(m->index) {
- case 0: { /* hash get sym_hash_ena_per_port %d */
+ case 0: { /* get_sym_hash_ena_per_port %d */
struct rte_eth_hash_filter_info info;
- pid = atoi(argv[3]);
+ pid = atoi(argv[1]);
if (rte_eth_dev_filter_supported(pid,
RTE_ETH_FILTER_HASH) < 0) {
- printf(
+ cli_printf(
"RTE_ETH_FILTER_HASH not supported on port: %d\n",
pid);
return -1;
@@ -5369,22 +5831,22 @@ hash_cmd(int argc, char **argv)
RTE_ETH_FILTER_GET, &info);
if (ret < 0) {
- printf("Cannot get symmetric hash enable per port "
+ cli_printf("Cannot get symmetric hash enable per port "
"on port %u\n", pid);
return -1;
}
- printf("Symmetric hash is %s on port %u\n", info.info.enable ?
+ cli_printf("Symmetric hash is %s on port %u\n", info.info.enable ?
"enabled" : "disabled", pid);
}
break;
- case 10: { /* "hash set sym_hash_ena_per_port %d %|enable|disable" */
+ case 10: { /* "set_sym_hash_ena_per_port %d %|enable|disable" */
struct rte_eth_hash_filter_info info;
- pid = atoi(argv[3]);
+ pid = atoi(argv[1]);
if (rte_eth_dev_filter_supported(pid,
RTE_ETH_FILTER_HASH) < 0) {
- printf(
+ cli_printf(
"RTE_ETH_FILTER_HASH not supported on port: %d\n",
pid);
return -1;
@@ -5397,24 +5859,24 @@ hash_cmd(int argc, char **argv)
ret = rte_eth_dev_filter_ctrl(pid, RTE_ETH_FILTER_HASH,
RTE_ETH_FILTER_SET, &info);
if (ret < 0) {
- printf("Cannot set symmetric hash enable per port on "
+ cli_printf("Cannot set symmetric hash enable per port on "
"port %u\n", pid);
return -1;
}
- printf("Symmetric hash has been set to %s on port %u\n",
+ cli_printf("Symmetric hash has been set to %s on port %u\n",
argv[4], pid);
}
break;
- case 20: { /* "hash hash_global_config get %d" */
+ case 20: { /* "get_hash_global_config %d" */
struct rte_eth_hash_filter_info info;
uint32_t idx, offset;
uint16_t i;
char *str;
- pid = atoi(argv[3]);
+ pid = atoi(argv[1]);
if (rte_eth_dev_filter_supported(pid,
RTE_ETH_FILTER_HASH) < 0) {
- printf("RTE_ETH_FILTER_HASH not supported on port %d\n",
+ cli_printf("RTE_ETH_FILTER_HASH not supported on port %d\n",
pid);
return -1;
}
@@ -5424,7 +5886,7 @@ hash_cmd(int argc, char **argv)
ret = rte_eth_dev_filter_ctrl(pid, RTE_ETH_FILTER_HASH,
RTE_ETH_FILTER_GET, &info);
if (ret < 0) {
- printf(
+ cli_printf(
"Cannot get hash global configurations by port %d\n",
pid);
return -1;
@@ -5432,13 +5894,13 @@ hash_cmd(int argc, char **argv)
switch (info.info.global_conf.hash_func) {
case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
- printf("Hash function is Toeplitz\n");
+ cli_printf("Hash function is Toeplitz\n");
break;
case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
- printf("Hash function is Simple XOR\n");
+ cli_printf("Hash function is Simple XOR\n");
break;
default:
- printf("Unknown hash function\n");
+ cli_printf("Unknown hash function\n");
break;
}
@@ -5451,7 +5913,7 @@ hash_cmd(int argc, char **argv)
str = flowtype_to_str(i);
if (!str)
continue;
- printf("Symmetric hash is %s globally for flow type %s "
+ cli_printf("Symmetric hash is %s globally for flow type %s "
"by port %d\n",
((info.info.global_conf.sym_hash_enable_mask[idx]
&
@@ -5462,7 +5924,7 @@ hash_cmd(int argc, char **argv)
}
break;
case 30: {
- /* "hash set_hash_global_config %d %|toeplitz|simple_xor|default "
+ /* "set_hash_global_config %d %|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" */
@@ -5470,13 +5932,13 @@ hash_cmd(int argc, char **argv)
uint32_t ftype, idx, offset;
char *hash, *flow, *on;
- pid = atoi(argv[2]);
- hash = argv[3];
- flow = argv[4];
- on = argv[5];
+ pid = atoi(argv[1]);
+ hash = argv[2];
+ flow = argv[3];
+ on = argv[4];
if (rte_eth_dev_filter_supported(pid,
RTE_ETH_FILTER_HASH) < 0) {
- printf("RTE_ETH_FILTER_HASH not supported on port %d\n",
+ cli_printf("RTE_ETH_FILTER_HASH not supported on port %d\n",
pid);
return -1;
}
@@ -5502,16 +5964,16 @@ hash_cmd(int argc, char **argv)
ret = rte_eth_dev_filter_ctrl(pid, RTE_ETH_FILTER_HASH,
RTE_ETH_FILTER_SET, &info);
if (ret < 0)
- printf(
+ cli_printf(
"Cannot set global hash configurations by port %d\n",
pid);
else
- printf("Global hash configurations have been set "
+ cli_printf("Global hash configurations have been set "
"succcessfully by port %d\n", pid);
}
break;
case 40: {
- /* "hash hash_input set %d "
+ /* "set_hash_input_set %d "
"%|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|dst-ipv6| "
@@ -5524,10 +5986,10 @@ hash_cmd(int argc, char **argv)
struct rte_eth_hash_filter_info info;
char *flow, *field, *select;
- pid = atoi(argv[3]);
- flow = argv[4];
- field = argv[5];
- select = argv[6];
+ pid = atoi(argv[1]);
+ flow = argv[2];
+ field = argv[3];
+ select = argv[4];
memset(&info, 0, sizeof(info));
info.info_type = RTE_ETH_HASH_FILTER_INPUT_SET_SELECT;
@@ -5543,7 +6005,7 @@ hash_cmd(int argc, char **argv)
}
break;
case 50: {
- /* "hash fdir_input set %d "
+ /* "set_fdir_input_set %d "
"%|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|dst-ipv6|"
@@ -5555,10 +6017,10 @@ hash_cmd(int argc, char **argv)
struct rte_eth_fdir_filter_info info;
char *flow, *field, *select;
- pid = atoi(argv[3]);
- flow = argv[4];
- field = argv[5];
- select = argv[6];
+ pid = atoi(argv[1]);
+ flow = argv[2];
+ field = argv[3];
+ select = argv[4];
memset(&info, 0, sizeof(info));
info.info_type = RTE_ETH_FDIR_FILTER_INPUT_SET_SELECT;
@@ -5667,7 +6129,7 @@ static struct cli_map misc_map[] = {
static void
dump_struct_sizes(void)
{
-#define DUMP_SIZE(t) printf("sizeof(" #t ") = %u\n", (unsigned)sizeof(t));
+#define DUMP_SIZE(t) cli_printf("sizeof(" #t ") = %u\n", (unsigned)sizeof(t));
DUMP_SIZE(struct rte_mbuf);
DUMP_SIZE(struct rte_mempool);
DUMP_SIZE(struct rte_ring);
@@ -5699,7 +6161,7 @@ misc_cmd(int argc, char **argv)
ret = rte_eth_dev_filter_ctrl(pid, RTE_ETH_FILTER_NONE,
RTE_ETH_FILTER_SET, &conf);
if (ret != 0)
- printf("Global config error\n");
+ cli_printf("Global config error\n");
}
break;
case 10: /* misc dump %|physmen|memzone|struct_sizes|ring|mempool|devargs */
@@ -5753,7 +6215,7 @@ misc_cmd(int argc, char **argv)
pid = atoi(argv[3]);
mac = rte_ether_aton(argv[4], NULL);
if (!is_multicast_ether_addr(mac)) {
- printf(
+ cli_printf(
"Invalid multicast addr %02X:%02X:%02X:%02X:%02X:%02X\n",
mac->addr_bytes[0], mac->addr_bytes[1],
mac->addr_bytes[2], mac->addr_bytes[3],
@@ -5799,6 +6261,7 @@ static struct cli_tree default_tree[] = {
c_cmd("show", display_cmd, "display port configurations"),
c_cmd("clear", display_cmd, "clear port configurations"),
+ c_cmd("ddp", display_cmd, "DDP configurations"),
c_cmd("set", set_cmd, "Set commands"),
c_cmd("vlan", set_cmd, "vlan commands"),
@@ -5810,12 +6273,29 @@ static struct cli_tree default_tree[] = {
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("E-tag", set_cmd, "E-tag 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("ethertype", filter_cmd, "ethertype filter commands"),
+ c_cmd("2tuple_filter", filter_cmd, "2tuple filter commands"),
+ c_cmd("5tuple_filter", filter_cmd, "5tuple filter commands"),
+ c_cmd("syn_filter", filter_cmd, "syn filter commands"),
+ c_cmd("flex_filter", filter_cmd, "syn filter commands"),
+ c_cmd("flow_director_filter", filter_cmd, "flow directory filter commands"),
+ c_cmd("flush_flow_director", filter_cmd, "flush flow directory filter commands"),
+ c_cmd("flow_director_mask", filter_cmd, "flow directory mask filter commands"),
+ c_cmd("flow_director_flex_mask", filter_cmd, "flow directory flex mask commands"),
+ c_cmd("flow_director_flex_payload", filter_cmd, "flow directory flex payload commands"),
c_cmd("hash", hash_cmd, "hash commands"),
+ c_cmd("get_sym_hash_ena_per_port", hash_cmd, "hash commands"),
+ c_cmd("set_sym_hash_ena_per_port", hash_cmd, "hash commands"),
+ c_cmd("get_hash_global_config", hash_cmd, "hash commands"),
+ c_cmd("set_hash_global_config", hash_cmd, "hash commands"),
+ c_cmd("get_hash_input_set", hash_cmd, "hash commands"),
+ c_cmd("set_fdir_input_set", hash_cmd, "hash commands"),
c_end()
};