Skip to contentSkip to conversation

net/ixgbe: fix vf reset hw error handling

PATCH Superseded SteveX Yang 4 participants 7 messages Sep 2, 2020 – Sep 23, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ixgbe: fix vf reset hw error handling

The PF control message will interrupt the assigning MAC address for VF when PF physical link down, and the VF reset operation returns the IXGBE_ERR_INVALID_MAC_ADDR. In this case, reuses the MAC address from eth_ixgbevf_dev_init() directly, no need care of PF assignment.

Fixes f69166c9a3c9 ("net/ixgbe: fix reset error handling")
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +8 -1
index fd0cb9b0e..c2fa59c73 100644
@@ -5326,10 +5326,17 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	ixgbe_dev_wait_setup_link_complete(dev, 0);
 
 	err = hw->mac.ops.reset_hw(hw);
-	if (err) {
+
+	/*
+	 * The VF reset operation returns the IXGBE_ERR_INVALID_MAC_ADDR when
+	 * the underlying PF driver has not assigned a MAC address to the VF.
+	 * In this case, reuses the MAC address from eth_ixgbevf_dev_init().
+	 */
+	if (err != IXGBE_SUCCESS && err != IXGBE_ERR_INVALID_MAC_ADDR) {
 		PMD_INIT_LOG(ERR, "Unable to reset vf hardware (%d)", err);
 		return err;
 	}
+
 	hw->mac.get_link_status = true;
 
 	/* negotiate mailbox API version to use with the PF. */
Signature · 1 line
2.17.1
#1 lore raw

Hi,

Quoted 8 lines

-----Original Message-----
From: Yang, SteveX <[email protected]>
Sent: 2020年9月2日 8:44
To: [email protected]
Cc: Zhao1, Wei <[email protected]>; Guo, Jia <[email protected]>; Yang, Qiming <[email protected]>; Yang, SteveX <[email protected]>
Subject: [PATCH] net/ixgbe: fix vf reset hw error handling

Quoted 4 lines

The PF control message will interrupt the assigning MAC address for VF when PF physical link down, and the VF reset operation returns the IXGBE_ERR_INVALID_MAC_ADDR. In this case, reuses the MAC address from eth_ixgbevf_dev_init() directly, no need care of PF assignment.

Better do not use function name.
Reuse the MAC address when device initialization instead of waiting PF reassign.

Quoted 22 lines
Fixes f69166c9a3c9 ("net/ixgbe: fix reset error handling")
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +3 -1
index fd0cb9b0e..c2fa59c73 100644
@@ -5326,10 +5326,17 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	ixgbe_dev_wait_setup_link_complete(dev, 0);
 
 	err = hw->mac.ops.reset_hw(hw);
-	if (err) {
+
+	/*
+	 * The VF reset operation returns the

IXGBE_ERR_INVALID_MAC_ADDR when

drivers/net/ixgbe/ixgbe_ethdev.c ixgbevf_dev_start(struct rte_eth_dev *dev)

Quoted 4 lines
drivers/net/ixgbe/ixgbe_ethdev.c +4 -0
+	 * the underlying PF driver has not assigned a MAC address to the VF.
+	 * In this case, reuses the MAC address from eth_ixgbevf_dev_init().
+	 */
+	if (err != IXGBE_SUCCESS && err != IXGBE_ERR_INVALID_MAC_ADDR)

Is there any other cases will also caused IXGBE_ERR_INVALID_MAC_ADDR?

Quoted 10 lines

{

drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
 		PMD_INIT_LOG(ERR, "Unable to reset vf hardware (%d)", err);
 		return err;
 	}
+
 	hw->mac.get_link_status = true;
 
 	/* negotiate mailbox API version to use with the PF. */
--

2.17.1

#2 lore raw

PATCH v2 1/1 net/ixgbe: fix vf reset hw error handling

In reply to SteveX Yang

The PF control message will interrupt the assigning MAC address for VF when PF physical link down, and the VF reset operation returns the IXGBE_ERR_INVALID_MAC_ADDR. In this case, reuse the MAC address when device initialization insteads of waiting PF reassign.

Fixes f69166c9a3c9 ("net/ixgbe: fix reset error handling")

---
v2:
update comment.

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +8 -1
index fd0cb9b0e..c2fa59c73 100644
@@ -5326,10 +5326,17 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	ixgbe_dev_wait_setup_link_complete(dev, 0);
 
 	err = hw->mac.ops.reset_hw(hw);
-	if (err) {
+
+	/*
+	 * The VF reset operation returns the IXGBE_ERR_INVALID_MAC_ADDR when
+	 * the underlying PF driver has not assigned a MAC address to the VF.
+	 * In this case, reuses the MAC address from eth_ixgbevf_dev_init().
+	 */
+	if (err != IXGBE_SUCCESS && err != IXGBE_ERR_INVALID_MAC_ADDR) {
 		PMD_INIT_LOG(ERR, "Unable to reset vf hardware (%d)", err);
 		return err;
 	}
+
 	hw->mac.get_link_status = true;
 
 	/* negotiate mailbox API version to use with the PF. */
Signature · 1 line
2.17.1
#3 lore raw

Hi, steve

Quoted 8 lines

-----Original Message-----
From: Yang, SteveX <[email protected]>
Sent: Tuesday, September 8, 2020 11:17 AM
To: [email protected]
Cc: Zhao1, Wei <[email protected]>; Guo, Jia <[email protected]>; Yang, Qiming <[email protected]>; Yang, SteveX <[email protected]>
Subject: [PATCH v2] net/ixgbe: fix vf reset hw error handling

Quoted 5 lines

The PF control message will interrupt the assigning MAC address for VF when PF physical link down, and the VF reset operation returns the IXGBE_ERR_INVALID_MAC_ADDR. In this case, reuse the MAC address when device initialization insteads of waiting PF reassign.

This commit log is not very clear and readable. I think as qiming said before, such as below should be enough,
"When start a VF with no initial MAC address assigned by the underlying Host PF driver, just reuse the MAC address assigned when VF is initializing."

Quoted 16 lines
Fixes f69166c9a3c9 ("net/ixgbe: fix reset error handling")

---
v2:
update comment.

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index fd0cb9b0e..c2fa59c73 100644

drivers/net/ixgbe/ixgbe_ethdev.c ixgbevf_dev_start(struct rte_eth_dev *dev) · line 5330

Quoted 6 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -1
@@ -5326,10 +5326,17 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	ixgbe_dev_wait_setup_link_complete(dev, 0);
 
 	err = hw->mac.ops.reset_hw(hw);
-	if (err) {
+
+	/*

Please use /** at the first line.

drivers/net/ixgbe/ixgbe_ethdev.c ixgbevf_dev_start(struct rte_eth_dev *dev) · line 5334

Quoted 5 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
+	 * The VF reset operation returns the

IXGBE_ERR_INVALID_MAC_ADDR when

drivers/net/ixgbe/ixgbe_ethdev.c +3 -0
+	 * the underlying PF driver has not assigned a MAC address to the VF.
+	 * In this case, reuses the MAC address from eth_ixgbevf_dev_init().
+	 */

"In this case, reuses the MAC address assigned by VF initialization.", please ref.

Quoted 12 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
+	if (err != IXGBE_SUCCESS && err !=

IXGBE_ERR_INVALID_MAC_ADDR) {
PMD_INIT_LOG(ERR, "Unable to reset vf hardware (%d)",
err);

drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
 		return err;
 	}
+
 	hw->mac.get_link_status = true;
 
 	/* negotiate mailbox API version to use with the PF. */
--

2.17.1

#4 lore raw

PATCH v3 1/1 net/ixgbe: fix vf reset hw error handling

In reply to SteveX Yang

When start a VF with no initial MAC address assigned by the underlying Host PF driver, just reuse the MAC address assigned when VF is initializing.

Fixes f69166c9a3c9 ("net/ixgbe: fix reset error handling")

---
v3:
* update commit and inline comment
v2:
* update comment

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +7 -1
index d9582473a..d68f090fd 100644
@@ -5322,10 +5322,16 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	ixgbe_dev_wait_setup_link_complete(dev, 0);
 
 	err = hw->mac.ops.reset_hw(hw);
-	if (err) {
+
+	/**
+	 * In this case, reuses the MAC address assigned by VF
+	 * initialization.
+	 */
+	if (err != IXGBE_SUCCESS && err != IXGBE_ERR_INVALID_MAC_ADDR) {
 		PMD_INIT_LOG(ERR, "Unable to reset vf hardware (%d)", err);
 		return err;
 	}
+
 	hw->mac.get_link_status = true;
 
 	/* negotiate mailbox API version to use with the PF. */
Signature · 1 line
2.17.1
Acked-by on v3 1/1
#5 lore raw
Quoted 50 lines

-----Original Message-----
From: Yang, SteveX <[email protected]>
Sent: Tuesday, September 15, 2020 2:46 PM
To: [email protected]
Cc: Zhao1, Wei <[email protected]>; Guo, Jia <[email protected]>; Yang, Qiming <[email protected]>; Yang, SteveX <[email protected]>
Subject: [PATCH v3] net/ixgbe: fix vf reset hw error handling

When start a VF with no initial MAC address assigned by the underlying Host PF driver, just reuse the MAC address assigned when VF is initializing.

Fixes f69166c9a3c9 ("net/ixgbe: fix reset error handling")

---
v3:
* update commit and inline comment
v2:
* update comment

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +7 -1
index d9582473a..d68f090fd 100644
@@ -5322,10 +5322,16 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	ixgbe_dev_wait_setup_link_complete(dev, 0);
 
 	err = hw->mac.ops.reset_hw(hw);
-	if (err) {
+
+	/**
+	 * In this case, reuses the MAC address assigned by VF
+	 * initialization.
+	 */
+	if (err != IXGBE_SUCCESS && err !=
 IXGBE_ERR_INVALID_MAC_ADDR) {
 		PMD_INIT_LOG(ERR, "Unable to reset vf hardware (%d)",
 err);
 		return err;
 	}
+
 	hw->mac.get_link_status = true;

/* negotiate mailbox API version to use with the PF. */
--
2.17.1

Applied
#6 lore raw
Quoted 10 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Guo, Jia
Sent: Wednesday, September 23, 2020 2:17 PM
To: Yang, SteveX <[email protected]>; [email protected]
Cc: Zhao1, Wei <[email protected]>; Yang, Qiming <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3] net/ixgbe: fix vf reset hw error handling

Quoted 17 lines
Quoted 15 lines

-----Original Message-----
From: Yang, SteveX <[email protected]>
Sent: Tuesday, September 15, 2020 2:46 PM
To: [email protected]
Cc: Zhao1, Wei <[email protected]>; Guo, Jia <[email protected]>; Yang, Qiming <[email protected]>; Yang, SteveX <[email protected]>
Subject: [PATCH v3] net/ixgbe: fix vf reset hw error handling

When start a VF with no initial MAC address assigned by the underlying Host PF driver, just reuse the MAC address assigned when VF is initializing.

Fixes f69166c9a3c9 ("net/ixgbe: fix reset error handling")

Applied to dpdk-next-net-intel.

Thanks
Qi