<div dir="ltr"><div dir="ltr" style="user-select: auto;">Hi,<div style="user-select: auto;"><br style="user-select: auto;"></div><div style="user-select: auto;">The following tests are failing but my patch is not related to anything related to these. Please re-run the tests.</div><div style="user-select: auto;"><pre style="white-space:pre-wrap;color:rgb(0,0,0)">Failed Tests:
- mtu_update
- scatter</pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal"><br style="user-select: auto;"></span></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal">Thanks,</span><br style="user-select: auto;"></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;white-space:normal">Huzaifa</span></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><br style="user-select: auto;"></pre></div></div><br style="user-select: auto;"><div class="gmail_quote" style="user-select: auto;"><div dir="ltr" class="gmail_attr" style="user-select: auto;">On Tue, Mar 22, 2022 at 2:36 PM huzaifa.rahman <<a href="mailto:huzaifa.rahman@emumba.com">huzaifa.rahman@emumba.com</a>> wrote:<br style="user-select: auto;"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Help command is not available for ethtool example. It is needed so user<br style="user-select: auto;">
can see all the available commands directly from the command line along<br style="user-select: auto;">
with the formats.<br style="user-select: auto;">
<br style="user-select: auto;">
Signed-off-by: huzaifa.rahman <<a href="mailto:huzaifa.rahman@emumba.com" target="_blank" style="user-select: auto;">huzaifa.rahman@emumba.com</a>><br style="user-select: auto;">
---<br style="user-select: auto;">
doc/guides/sample_app_ug/ethtool.rst | 1 +<br style="user-select: auto;">
examples/ethtool/ethtool-app/ethapp.c | 38 +++++++++++++++++++++++++++<br style="user-select: auto;">
examples/ethtool/ethtool-app/ethapp.h | 1 +<br style="user-select: auto;">
3 files changed, 40 insertions(+)<br style="user-select: auto;">
<br style="user-select: auto;">
diff --git a/doc/guides/sample_app_ug/ethtool.rst b/doc/guides/sample_app_ug/ethtool.rst<br style="user-select: auto;">
index 159e9e0639..6e57015170 100644<br style="user-select: auto;">
--- a/doc/guides/sample_app_ug/ethtool.rst<br style="user-select: auto;">
+++ b/doc/guides/sample_app_ug/ethtool.rst<br style="user-select: auto;">
@@ -58,6 +58,7 @@ they do as follows:<br style="user-select: auto;">
* ``validate``: Check that given MAC address is valid unicast address<br style="user-select: auto;">
* ``vlan``: Add/remove VLAN id<br style="user-select: auto;">
* ``quit``: Exit program<br style="user-select: auto;">
+* ``help``: List all available commands<br style="user-select: auto;">
<br style="user-select: auto;">
<br style="user-select: auto;">
Explanation<br style="user-select: auto;">
diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c<br style="user-select: auto;">
index 78e86534e8..1c0e6c050f 100644<br style="user-select: auto;">
--- a/examples/ethtool/ethtool-app/ethapp.c<br style="user-select: auto;">
+++ b/examples/ethtool/ethtool-app/ethapp.c<br style="user-select: auto;">
@@ -57,6 +57,8 @@ cmdline_parse_token_string_t pcmd_stats_token_cmd =<br style="user-select: auto;">
TOKEN_STRING_INITIALIZER(struct pcmd_get_params, cmd, "stats");<br style="user-select: auto;">
cmdline_parse_token_string_t pcmd_drvinfo_token_cmd =<br style="user-select: auto;">
TOKEN_STRING_INITIALIZER(struct pcmd_get_params, cmd, "drvinfo");<br style="user-select: auto;">
+cmdline_parse_token_string_t pcmd_list_token_cmd =<br style="user-select: auto;">
+ TOKEN_STRING_INITIALIZER(struct pcmd_get_params, cmd, "help");<br style="user-select: auto;">
cmdline_parse_token_string_t pcmd_link_token_cmd =<br style="user-select: auto;">
TOKEN_STRING_INITIALIZER(struct pcmd_get_params, cmd, "link");<br style="user-select: auto;">
<br style="user-select: auto;">
@@ -133,6 +135,11 @@ cmdline_parse_token_string_t pcmd_vlan_token_mode =<br style="user-select: auto;">
cmdline_parse_token_num_t pcmd_vlan_token_vid =<br style="user-select: auto;">
TOKEN_NUM_INITIALIZER(struct pcmd_vlan_params, vid, RTE_UINT16);<br style="user-select: auto;">
<br style="user-select: auto;">
+void<br style="user-select: auto;">
+print_cmd_info(unsigned int sr, const char *name, const char *format, const char *description)<br style="user-select: auto;">
+{<br style="user-select: auto;">
+ printf("%-4u%-17s%-45s%-50s\n", sr, name, format, description);<br style="user-select: auto;">
+}<br style="user-select: auto;">
<br style="user-select: auto;">
static void<br style="user-select: auto;">
pcmd_quit_callback(__rte_unused void *ptr_params,<br style="user-select: auto;">
@@ -142,6 +149,30 @@ pcmd_quit_callback(__rte_unused void *ptr_params,<br style="user-select: auto;">
cmdline_quit(ctx);<br style="user-select: auto;">
}<br style="user-select: auto;">
<br style="user-select: auto;">
+static void<br style="user-select: auto;">
+pcmd_help_callback(__rte_unused void *ptr_params,<br style="user-select: auto;">
+ __rte_unused struct cmdline *ctx,<br style="user-select: auto;">
+ __rte_unused void *ptr_data)<br style="user-select: auto;">
+{<br style="user-select: auto;">
+ printf("%-4s%-17s%-45s%-50s\n\n", "Sr.", "Name", "Format", "Description");<br style="user-select: auto;">
+ print_cmd_info(1, "drvinfo", "drvinfo", "Print driver info");<br style="user-select: auto;">
+ print_cmd_info(2, "open", "open <port_id>", "Open port");<br style="user-select: auto;">
+ print_cmd_info(3, "pause", "pause <port_id> [<all|tx|rx|none>]", "Get/set port pause state");<br style="user-select: auto;">
+ print_cmd_info(4, "stop", "stop <port_id>", "Stop port");<br style="user-select: auto;">
+ print_cmd_info(5, "portstats", "portstats <port_id>", "Print port statistics");<br style="user-select: auto;">
+ print_cmd_info(6, "link", "link", "Print port link states");<br style="user-select: auto;">
+ print_cmd_info(7, "macaddr", "macaddr <port_id> [<mac_addr>]", "Gets/sets MAC address");<br style="user-select: auto;">
+ print_cmd_info(8, "mtu", "mtu <port_id> <mtu_value>", "Set NIC MTU");<br style="user-select: auto;">
+ print_cmd_info(9, "regs", "regs <port_id> <filename>", "Dump port register(s) to file");<br style="user-select: auto;">
+ print_cmd_info(10, "ringparam", "ringparam <port_id> [<tx_param> <rx_param>]", "Get/set ring parameters");<br style="user-select: auto;">
+ print_cmd_info(11, "rxmode", "rxmode <port_id>", "Toggle port Rx mode");<br style="user-select: auto;">
+ print_cmd_info(12, "validate", "validate <mac_addr>", "Check that given MAC address is valid unicast address");<br style="user-select: auto;">
+ print_cmd_info(13, "vlan", "vlan <port_id> <add|del> <vlan_id>", "Add/remove VLAN id");<br style="user-select: auto;">
+ print_cmd_info(14, "eeprom", "eeprom <port_id> <filename>", "Dump EEPROM to file");<br style="user-select: auto;">
+ print_cmd_info(15, "module-eeprom", "module-eeprom <port_id> <filename>", "Dump plugin module EEPROM to file");<br style="user-select: auto;">
+ print_cmd_info(16, "quit", "quit", "Exit program");<br style="user-select: auto;">
+ print_cmd_info(17, "help", "help", "List all available commands");<br style="user-select: auto;">
+}<br style="user-select: auto;">
<br style="user-select: auto;">
static void<br style="user-select: auto;">
pcmd_drvinfo_callback(__rte_unused void *ptr_params,<br style="user-select: auto;">
@@ -680,6 +711,12 @@ cmdline_parse_inst_t pcmd_drvinfo = {<br style="user-select: auto;">
.help_str = "drvinfo\n Print driver info",<br style="user-select: auto;">
.tokens = {(void *)&pcmd_drvinfo_token_cmd, NULL},<br style="user-select: auto;">
};<br style="user-select: auto;">
+cmdline_parse_inst_t pcmd_help_cmds = {<br style="user-select: auto;">
+ .f = pcmd_help_callback,<br style="user-select: auto;">
+ .data = NULL,<br style="user-select: auto;">
+ .help_str = "help\n List all available commands",<br style="user-select: auto;">
+ .tokens = {(void *)&pcmd_list_token_cmd, NULL},<br style="user-select: auto;">
+};<br style="user-select: auto;">
cmdline_parse_inst_t pcmd_link = {<br style="user-select: auto;">
.f = pcmd_link_callback,<br style="user-select: auto;">
.data = NULL,<br style="user-select: auto;">
@@ -871,6 +908,7 @@ cmdline_parse_inst_t pcmd_vlan = {<br style="user-select: auto;">
<br style="user-select: auto;">
<br style="user-select: auto;">
cmdline_parse_ctx_t list_prompt_commands[] = {<br style="user-select: auto;">
+ (cmdline_parse_inst_t *)&pcmd_help_cmds,<br style="user-select: auto;">
(cmdline_parse_inst_t *)&pcmd_drvinfo,<br style="user-select: auto;">
(cmdline_parse_inst_t *)&pcmd_eeprom,<br style="user-select: auto;">
(cmdline_parse_inst_t *)&pcmd_module_eeprom,<br style="user-select: auto;">
diff --git a/examples/ethtool/ethtool-app/ethapp.h b/examples/ethtool/ethtool-app/ethapp.h<br style="user-select: auto;">
index 7a70480c88..4db09ed771 100644<br style="user-select: auto;">
--- a/examples/ethtool/ethtool-app/ethapp.h<br style="user-select: auto;">
+++ b/examples/ethtool/ethtool-app/ethapp.h<br style="user-select: auto;">
@@ -10,3 +10,4 @@ void unlock_port(int idx_port);<br style="user-select: auto;">
void mark_port_inactive(int idx_port);<br style="user-select: auto;">
void mark_port_active(int idx_port);<br style="user-select: auto;">
void mark_port_newmac(int idx_port);<br style="user-select: auto;">
+void print_cmd_info(unsigned int sr, const char *name, const char *format, const char *description);<br style="user-select: auto;">
-- <br style="user-select: auto;">
2.25.1<br style="user-select: auto;">
<br style="user-select: auto;">
</blockquote></div></div>