patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Qiming Yang <qiming.yang@intel.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, wenzhuo.lu@intel.com,
	Qiming Yang <qiming.yang@intel.com>
Subject: [dpdk-stable] [PATCH v2] net/e1000: fix VF MAC address set problem
Date: Wed,  3 May 2017 13:52:47 +0800	[thread overview]
Message-ID: <1493790767-58836-1-git-send-email-qiming.yang@intel.com> (raw)
In-Reply-To: <1493283743-71883-1-git-send-email-qiming.yang@intel.com>

We find that VF receive address register is not set
if MAC address is assigned by PF. This patch fixes it.

Fixes: d82170d27918 ("igb: add VF support")

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/e1000/igb_ethdev.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index ca9f98c..967805b 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -1031,12 +1031,6 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
 	/* Generate a random MAC address, if none was assigned by PF. */
 	if (is_zero_ether_addr(perm_addr)) {
 		eth_random_addr(perm_addr->addr_bytes);
-		diag = e1000_rar_set(hw, perm_addr->addr_bytes, 0);
-		if (diag) {
-			rte_free(eth_dev->data->mac_addrs);
-			eth_dev->data->mac_addrs = NULL;
-			return diag;
-		}
 		PMD_INIT_LOG(INFO, "\tVF MAC address not assigned by Host PF");
 		PMD_INIT_LOG(INFO, "\tAssign randomly generated MAC address "
 			     "%02x:%02x:%02x:%02x:%02x:%02x",
@@ -1048,6 +1042,12 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
 			     perm_addr->addr_bytes[5]);
 	}
 
+	diag = e1000_rar_set(hw, perm_addr->addr_bytes, 0);
+	if (diag) {
+		rte_free(eth_dev->data->mac_addrs);
+		eth_dev->data->mac_addrs = NULL;
+		return diag;
+	}
 	/* Copy the permanent MAC address */
 	ether_addr_copy((struct ether_addr *) hw->mac.perm_addr,
 			&eth_dev->data->mac_addrs[0]);
-- 
2.7.4

  parent reply	other threads:[~2017-05-03  6:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27  9:02 [dpdk-stable] [PATCH] igbvf: fix " Qiming Yang
2017-04-28  0:39 ` Lu, Wenzhuo
2017-04-28  6:53   ` Yang, Qiming
2017-04-28  7:20     ` Lu, Wenzhuo
2017-05-03  5:52 ` Qiming Yang [this message]
2017-05-03  7:13   ` [dpdk-stable] [PATCH v2] net/e1000: fix VF " Lu, Wenzhuo
2017-05-05 14:45     ` Thomas Monjalon

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=1493790767-58836-1-git-send-email-qiming.yang@intel.com \
    --to=qiming.yang@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /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).