Skip to contentSkip to conversation

igbvf: fix MAC address set problem

PATCH In review Qiming Yang 3 participants 7 messages Apr 27, 2017 – May 5, 2017 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igbvf: fix MAC address set problem

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

Fixes 2a3cf07108b4 ("igbvf: fix MAC address if none assigned by PF")
---
 drivers/net/e1000/igb_ethdev.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/e1000/igb_ethdev.c +6 -6
index ca9f98c..967805b 100644
@@ -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]);
Signature · 1 line
2.7.4
#1 lore raw

Hi Qiming,

Quoted 7 lines

-----Original Message-----
From: Yang, Qiming
Sent: Thursday, April 27, 2017 5:02 PM
To: [email protected]
Cc: Lu, Wenzhuo; [email protected]; Yang, Qiming
Subject: [PATCH] igbvf: fix MAC address set problem

Quoted 6 lines

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

Fixes 2a3cf07108b4 ("igbvf: fix MAC address if none assigned by PF")

A little confused about the Fixes. You said this patch is for when mac address is set by PF. But the fixes said the previous patch is for not set by PF. Seems they're different scenarios. Why this can a fix for a different scenario? Thanks.

#2 lore raw

Hi, Wenzhuo

Quoted 19 lines

-----Original Message-----
From: Lu, Wenzhuo
Sent: Friday, April 28, 2017 8:39 AM
To: Yang, Qiming <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH] igbvf: fix MAC address set problem

Hi Qiming,

Quoted 10 lines

-----Original Message-----
From: Yang, Qiming
Sent: Thursday, April 27, 2017 5:02 PM
To: [email protected]
Cc: Lu, Wenzhuo; [email protected]; Yang, Qiming
Subject: [PATCH] igbvf: fix MAC address set problem

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

Quoted 7 lines
Quoted 3 lines
Fixes 2a3cf07108b4 ("igbvf: fix MAC address if none assigned by PF")

A little confused about the Fixes. You said this patch is for when mac address is set by PF. But the fixes said the previous patch is for not set by PF. Seems they're different scenarios. Why this can a fix for a different scenario? Thanks.

Previous patch only do rar set when random a MAC for VF, when MAC address is assigned by PF, register is not set.
Maybe I should correct the fix line, the issue I fixed is exist before 2a3cf07108b4.

#3 lore raw

Hi Qiming,

Quoted 35 lines

-----Original Message-----
From: Yang, Qiming
Sent: Friday, April 28, 2017 2:54 PM
To: Lu, Wenzhuo; [email protected]
Cc: [email protected]
Subject: RE: [PATCH] igbvf: fix MAC address set problem

Hi, Wenzhuo

Quoted 19 lines

-----Original Message-----
From: Lu, Wenzhuo
Sent: Friday, April 28, 2017 8:39 AM
To: Yang, Qiming <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH] igbvf: fix MAC address set problem

Hi Qiming,

Quoted 10 lines

-----Original Message-----
From: Yang, Qiming
Sent: Thursday, April 27, 2017 5:02 PM
To: [email protected]
Cc: Lu, Wenzhuo; [email protected]; Yang, Qiming
Subject: [PATCH] igbvf: fix MAC address set problem

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

Quoted 7 lines
Quoted 4 lines
Fixes 2a3cf07108b4 ("igbvf: fix MAC address if none assigned by

PF")

A little confused about the Fixes. You said this patch is for when mac address is set by PF. But the fixes said the previous patch is for not set by PF. Seems they're different scenarios. Why this can a fix for a

Quoted 7 lines

different scenario?

Quoted 1 line

Thanks.

Previous patch only do rar set when random a MAC for VF, when MAC address is assigned by PF, register is not set.
Maybe I should correct the fix line, the issue I fixed is exist before 2a3cf07108b4.

Better if you can find the previous patch :)

#4 lore raw

PATCH v2 1/1 net/e1000: fix VF MAC address set problem

In reply to Qiming Yang

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")
---
 drivers/net/e1000/igb_ethdev.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/e1000/igb_ethdev.c +6 -6
index ca9f98c..967805b 100644
@@ -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]);
Signature · 1 line
2.7.4
Acked-by on v2 1/1
#5 lore raw

Re: [PATCH v2] net/e1000: fix VF MAC address set problem

Hi,

Quoted 7 lines

-----Original Message-----
From: Yang, Qiming
Sent: Wednesday, May 3, 2017 1:53 PM
To: [email protected]
Cc: [email protected]; Lu, Wenzhuo; Yang, Qiming
Subject: [PATCH v2] net/e1000: fix VF MAC address set problem

Quoted 6 lines

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")
#6 lore raw

Re: [dpdk-stable] [PATCH v2] net/e1000: fix VF MAC address set problem

03/05/2017 09:13, Lu, Wenzhuo:

Quoted 9 lines

Hi,

Quoted 6 lines

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")

Applied, thanks