DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>
Subject: [dpdk-dev] [PATCH v3 2/2] app/testpmd: fix wrong API of adding VF MAC
Date: Fri, 18 Aug 2017 02:33:43 +0800	[thread overview]
Message-ID: <1502994823-125017-3-git-send-email-wenzhuo.lu@intel.com> (raw)
In-Reply-To: <1502994823-125017-1-git-send-email-wenzhuo.lu@intel.com>

When adding a VF MAC address, rte_eth_dev_mac_addr_add
is called. It's not right, because this API is used to
add a MAC address for a VMDq pool not a VF. Although it
can work on ixgbe as VMDq pool and VF mean the same thing
on ixgbe.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 app/test-pmd/cmdline.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index cd8c358..0144191 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -7209,11 +7209,22 @@ static void cmd_vf_mac_addr_parsed(void *parsed_result,
 		__attribute__((unused)) void *data)
 {
 	struct cmd_vf_mac_addr_result *res = parsed_result;
-	int ret = 0;
+	int ret = -ENOTSUP;
+
+	if (strcmp(res->what, "add") != 0)
+		return;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+	if (ret == -ENOTSUP)
+		ret = rte_pmd_i40e_add_vf_mac_addr(res->port_num, res->vf_num,
+						   &res->address);
+#endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+	if (ret == -ENOTSUP)
+		ret = rte_pmd_bnxt_mac_addr_add(res->port_num, &res->address,
+						res->vf_num);
+#endif
 
-	if (strcmp(res->what, "add") == 0)
-		ret = rte_eth_dev_mac_addr_add(res->port_num,
-					&res->address, res->vf_num);
 	if(ret < 0)
 		printf("vf_mac_addr_cmd error: (%s)\n", strerror(-ret));
 
-- 
1.9.3

  parent reply	other threads:[~2017-08-17 18:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-24 20:51 [dpdk-dev] [PATCH] net/i40e: new API to add VF MAC address from PF Wenzhuo Lu
2017-07-25 14:09 ` [dpdk-dev] [PATCH v2] " Wenzhuo Lu
2017-08-17 13:05   ` Ferruh Yigit
2017-08-17 13:36     ` Lu, Wenzhuo
2017-08-17 18:33 ` [dpdk-dev] [PATCH v3 0/2] fix adding VF MAC in testpmd Wenzhuo Lu
2017-08-17 18:33   ` [dpdk-dev] [PATCH v3 1/2] net/i40e: new API to add VF MAC address from PF Wenzhuo Lu
2017-08-18  0:32     ` Stephen Hemminger
2017-08-18 16:43       ` Ferruh Yigit
2017-08-19 12:52         ` Lu, Wenzhuo
2017-08-17 18:33   ` Wenzhuo Lu [this message]
2017-08-28  9:53   ` [dpdk-dev] [PATCH v3 0/2] fix adding VF MAC in testpmd Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1502994823-125017-3-git-send-email-wenzhuo.lu@intel.com \
    --to=wenzhuo.lu@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).