From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id ADF2C2B9D for ; Fri, 3 Mar 2017 10:20:37 +0100 (CET) Received: from 6wind.com (unknown [10.16.0.184]) by proxy.6wind.com (Postfix) with SMTP id 8C63B24809; Fri, 3 Mar 2017 10:20:31 +0100 (CET) Received: by 6wind.com (sSMTP sendmail emulation); Fri, 03 Mar 2017 10:20:29 +0100 From: Pascal Mazon To: jingjing.wu@intel.com Cc: dev@dpdk.org, Pascal Mazon Date: Fri, 3 Mar 2017 10:20:16 +0100 Message-Id: X-Mailer: git-send-email 2.8.0.rc0 Subject: [dpdk-dev] [PATCH] app/testpmd: add default MAC set cmd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 09:20:37 -0000 Signed-off-by: Pascal Mazon --- 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 : " - "Add/Remove MAC address on port_id", + .help_str = "mac_addr add|remove|set : " + "Add/Remove/Set MAC address on port_id", .tokens = { (void *)&cmd_mac_addr_cmd, (void *)&cmd_mac_addr_what, -- 2.8.0.rc0