* [dpdk-dev] [PATCH] app/testpmd: add default MAC set cmd
@ 2017-03-03 9:20 Pascal Mazon
2017-03-10 13:19 ` Thomas Monjalon
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Pascal Mazon @ 2017-03-03 9:20 UTC (permalink / raw)
To: jingjing.wu; +Cc: dev, Pascal Mazon
Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
---
app/test-pmd/cmdline.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 43fc6366f279..4bbefa43966e 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -405,6 +405,9 @@ static void cmd_help_long_parsed(void *parsed_result,
"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"
@@ -6356,6 +6359,9 @@ static void cmd_mac_addr_parsed(void *parsed_result,
if (strcmp(res->what, "add") == 0)
ret = rte_eth_dev_mac_addr_add(res->port_num, &res->address, 0);
+ else if (strcmp(res->what, "set") == 0)
+ ret = rte_eth_dev_default_mac_addr_set(res->port_num,
+ &res->address);
else
ret = rte_eth_dev_mac_addr_remove(res->port_num, &res->address);
@@ -6370,7 +6376,7 @@ cmdline_parse_token_string_t cmd_mac_addr_cmd =
"mac_addr");
cmdline_parse_token_string_t cmd_mac_addr_what =
TOKEN_STRING_INITIALIZER(struct cmd_mac_addr_result, what,
- "add#remove");
+ "add#remove#set");
cmdline_parse_token_num_t cmd_mac_addr_portnum =
TOKEN_NUM_INITIALIZER(struct cmd_mac_addr_result, port_num, UINT8);
cmdline_parse_token_etheraddr_t cmd_mac_addr_addr =
@@ -6379,8 +6385,8 @@ cmdline_parse_token_etheraddr_t cmd_mac_addr_addr =
cmdline_parse_inst_t cmd_mac_addr = {
.f = cmd_mac_addr_parsed,
.data = (void *)0,
- .help_str = "mac_addr add|remove <port_id> <mac_addr>: "
- "Add/Remove MAC address on port_id",
+ .help_str = "mac_addr add|remove|set <port_id> <mac_addr>: "
+ "Add/Remove/Set MAC address on port_id",
.tokens = {
(void *)&cmd_mac_addr_cmd,
(void *)&cmd_mac_addr_what,
--
2.8.0.rc0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: add default MAC set cmd
2017-03-03 9:20 [dpdk-dev] [PATCH] app/testpmd: add default MAC set cmd Pascal Mazon
@ 2017-03-10 13:19 ` Thomas Monjalon
2017-03-10 16:51 ` Wu, Jingjing
2017-03-13 10:27 ` [dpdk-dev] [PATCH v2] " Pascal Mazon
2 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2017-03-10 13:19 UTC (permalink / raw)
To: Pascal Mazon; +Cc: dev, jingjing.wu
2017-03-03 10:20, Pascal Mazon:
> Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
> ---
> app/test-pmd/cmdline.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
This patch looks trivial but waiting for Jingjing approval to be sure.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: add default MAC set cmd
2017-03-03 9:20 [dpdk-dev] [PATCH] app/testpmd: add default MAC set cmd Pascal Mazon
2017-03-10 13:19 ` Thomas Monjalon
@ 2017-03-10 16:51 ` Wu, Jingjing
2017-03-13 10:27 ` [dpdk-dev] [PATCH v2] " Pascal Mazon
2 siblings, 0 replies; 5+ messages in thread
From: Wu, Jingjing @ 2017-03-10 16:51 UTC (permalink / raw)
To: Pascal Mazon; +Cc: dev
> -----Original Message-----
> From: Pascal Mazon [mailto:pascal.mazon@6wind.com]
> Sent: Friday, March 3, 2017 3:20 AM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Pascal Mazon <pascal.mazon@6wind.com>
> Subject: [PATCH] app/testpmd: add default MAC set cmd
>
> Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Just don't forget the doc update. Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v2] app/testpmd: add default MAC set cmd
2017-03-03 9:20 [dpdk-dev] [PATCH] app/testpmd: add default MAC set cmd Pascal Mazon
2017-03-10 13:19 ` Thomas Monjalon
2017-03-10 16:51 ` Wu, Jingjing
@ 2017-03-13 10:27 ` Pascal Mazon
2017-03-15 17:20 ` Thomas Monjalon
2 siblings, 1 reply; 5+ messages in thread
From: Pascal Mazon @ 2017-03-13 10:27 UTC (permalink / raw)
To: jingjing.wu; +Cc: dev, Pascal Mazon
Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
---
app/test-pmd/cmdline.c | 12 +++++++++---
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 7 +++++++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 43fc6366f279..4bbefa43966e 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -405,6 +405,9 @@ static void cmd_help_long_parsed(void *parsed_result,
"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"
@@ -6356,6 +6359,9 @@ static void cmd_mac_addr_parsed(void *parsed_result,
if (strcmp(res->what, "add") == 0)
ret = rte_eth_dev_mac_addr_add(res->port_num, &res->address, 0);
+ else if (strcmp(res->what, "set") == 0)
+ ret = rte_eth_dev_default_mac_addr_set(res->port_num,
+ &res->address);
else
ret = rte_eth_dev_mac_addr_remove(res->port_num, &res->address);
@@ -6370,7 +6376,7 @@ cmdline_parse_token_string_t cmd_mac_addr_cmd =
"mac_addr");
cmdline_parse_token_string_t cmd_mac_addr_what =
TOKEN_STRING_INITIALIZER(struct cmd_mac_addr_result, what,
- "add#remove");
+ "add#remove#set");
cmdline_parse_token_num_t cmd_mac_addr_portnum =
TOKEN_NUM_INITIALIZER(struct cmd_mac_addr_result, port_num, UINT8);
cmdline_parse_token_etheraddr_t cmd_mac_addr_addr =
@@ -6379,8 +6385,8 @@ cmdline_parse_token_etheraddr_t cmd_mac_addr_addr =
cmdline_parse_inst_t cmd_mac_addr = {
.f = cmd_mac_addr_parsed,
.data = (void *)0,
- .help_str = "mac_addr add|remove <port_id> <mac_addr>: "
- "Add/Remove MAC address on port_id",
+ .help_str = "mac_addr add|remove|set <port_id> <mac_addr>: "
+ "Add/Remove/Set MAC address on port_id",
.tokens = {
(void *)&cmd_mac_addr_cmd,
(void *)&cmd_mac_addr_what,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 64ed0285e471..bdc6a14df240 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -837,6 +837,13 @@ Add an alternative MAC address for a VF to a port::
testpmd> mac_add add port (port_id) vf (vf_id) (XX:XX:XX:XX:XX:XX)
+mac_addr set
+~~~~~~~~~~~~
+
+Set the default MAC address for a port::
+
+ testpmd> mac_addr set (port_id) (XX:XX:XX:XX:XX:XX)
+
mac_addr set (for VF)
~~~~~~~~~~~~~~~~~~~~~
--
2.8.0.rc0
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-03-15 17:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-03 9:20 [dpdk-dev] [PATCH] app/testpmd: add default MAC set cmd Pascal Mazon
2017-03-10 13:19 ` Thomas Monjalon
2017-03-10 16:51 ` Wu, Jingjing
2017-03-13 10:27 ` [dpdk-dev] [PATCH v2] " Pascal Mazon
2017-03-15 17:20 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).