DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: fix vf reset hw error handling
@ 2020-09-02  0:44 SteveX Yang
  2020-09-03  2:24 ` Yang, Qiming
  2020-09-08  3:17 ` [dpdk-dev] [PATCH v2] " SteveX Yang
  0 siblings, 2 replies; 7+ messages in thread
From: SteveX Yang @ 2020-09-02  0:44 UTC (permalink / raw)
  To: dev; +Cc: wei.zhao1, jia.guo, qiming.yang, 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, reuses the MAC address
from eth_ixgbevf_dev_init() directly, no need care of PF assignment.

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

Signed-off-by: SteveX Yang <stevex.yang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index fd0cb9b0e..c2fa59c73 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -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. */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ixgbe: fix vf reset hw error handling
  2020-09-02  0:44 [dpdk-dev] [PATCH] net/ixgbe: fix vf reset hw error handling SteveX Yang
@ 2020-09-03  2:24 ` Yang, Qiming
  2020-09-08  3:17 ` [dpdk-dev] [PATCH v2] " SteveX Yang
  1 sibling, 0 replies; 7+ messages in thread
From: Yang, Qiming @ 2020-09-03  2:24 UTC (permalink / raw)
  To: Yang, SteveX, dev; +Cc: Zhao1, Wei, Guo, Jia

Hi,

> -----Original Message-----
> From: Yang, SteveX <stevex.yang@intel.com>
> Sent: 2020年9月2日 8:44
> To: dev@dpdk.org
> Cc: Zhao1, Wei <wei.zhao1@intel.com>; Guo, Jia <jia.guo@intel.com>; Yang,
> Qiming <qiming.yang@intel.com>; Yang, SteveX <stevex.yang@intel.com>
> Subject: [PATCH] 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.

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

> 
> Fixes: f69166c9a3c9 ("net/ixgbe: fix reset error handling")
> 
> Signed-off-by: SteveX Yang <stevex.yang@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index fd0cb9b0e..c2fa59c73 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -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)

Is there any other cases will also caused 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH v2] net/ixgbe: fix vf reset hw error handling
  2020-09-02  0:44 [dpdk-dev] [PATCH] net/ixgbe: fix vf reset hw error handling SteveX Yang
  2020-09-03  2:24 ` Yang, Qiming
@ 2020-09-08  3:17 ` SteveX Yang
  2020-09-11  6:24   ` Guo, Jia
  2020-09-15  6:46   ` [dpdk-dev] [PATCH v3] " SteveX Yang
  1 sibling, 2 replies; 7+ messages in thread
From: SteveX Yang @ 2020-09-08  3:17 UTC (permalink / raw)
  To: dev; +Cc: wei.zhao1, jia.guo, qiming.yang, 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")

Signed-off-by: SteveX Yang <stevex.yang@intel.com>
---
v2:
update comment.
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index fd0cb9b0e..c2fa59c73 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -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. */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix vf reset hw error handling
  2020-09-08  3:17 ` [dpdk-dev] [PATCH v2] " SteveX Yang
@ 2020-09-11  6:24   ` Guo, Jia
  2020-09-15  6:46   ` [dpdk-dev] [PATCH v3] " SteveX Yang
  1 sibling, 0 replies; 7+ messages in thread
From: Guo, Jia @ 2020-09-11  6:24 UTC (permalink / raw)
  To: Yang, SteveX, dev; +Cc: Zhao1, Wei, Yang, Qiming

Hi, steve

> -----Original Message-----
> From: Yang, SteveX <stevex.yang@intel.com>
> Sent: Tuesday, September 8, 2020 11:17 AM
> To: dev@dpdk.org
> Cc: Zhao1, Wei <wei.zhao1@intel.com>; Guo, Jia <jia.guo@intel.com>; Yang,
> Qiming <qiming.yang@intel.com>; Yang, SteveX <stevex.yang@intel.com>
> Subject: [PATCH v2] 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, 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."

> Fixes: f69166c9a3c9 ("net/ixgbe: fix reset error handling")
> 
> Signed-off-by: SteveX Yang <stevex.yang@intel.com>
> ---
> v2:
> update comment.
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index fd0cb9b0e..c2fa59c73 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -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.

> +	 * 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().
> +	 */

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

> +	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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH v3] net/ixgbe: fix vf reset hw error handling
  2020-09-08  3:17 ` [dpdk-dev] [PATCH v2] " SteveX Yang
  2020-09-11  6:24   ` Guo, Jia
@ 2020-09-15  6:46   ` SteveX Yang
  2020-09-23  6:16     ` Guo, Jia
  1 sibling, 1 reply; 7+ messages in thread
From: SteveX Yang @ 2020-09-15  6:46 UTC (permalink / raw)
  To: dev; +Cc: wei.zhao1, jia.guo, qiming.yang, 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")

Signed-off-by: SteveX Yang <stevex.yang@intel.com>
---
v3:
 * update commit and inline comment
v2:
 * update comment
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index d9582473a..d68f090fd 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/ixgbe: fix vf reset hw error handling
  2020-09-15  6:46   ` [dpdk-dev] [PATCH v3] " SteveX Yang
@ 2020-09-23  6:16     ` Guo, Jia
  2020-09-23 11:46       ` Zhang, Qi Z
  0 siblings, 1 reply; 7+ messages in thread
From: Guo, Jia @ 2020-09-23  6:16 UTC (permalink / raw)
  To: Yang, SteveX, dev; +Cc: Zhao1, Wei, Yang, Qiming

Acked-by: Jeff Guo <jia.guo@intel.com>

> -----Original Message-----
> From: Yang, SteveX <stevex.yang@intel.com>
> Sent: Tuesday, September 15, 2020 2:46 PM
> To: dev@dpdk.org
> Cc: Zhao1, Wei <wei.zhao1@intel.com>; Guo, Jia <jia.guo@intel.com>; Yang,
> Qiming <qiming.yang@intel.com>; Yang, SteveX <stevex.yang@intel.com>
> 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")
> 
> Signed-off-by: SteveX Yang <stevex.yang@intel.com>
> ---
> v3:
>  * update commit and inline comment
> v2:
>  * update comment
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index d9582473a..d68f090fd 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/ixgbe: fix vf reset hw error handling
  2020-09-23  6:16     ` Guo, Jia
@ 2020-09-23 11:46       ` Zhang, Qi Z
  0 siblings, 0 replies; 7+ messages in thread
From: Zhang, Qi Z @ 2020-09-23 11:46 UTC (permalink / raw)
  To: Guo, Jia, Yang, SteveX, dev; +Cc: Zhao1, Wei, Yang, Qiming



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Guo, Jia
> Sent: Wednesday, September 23, 2020 2:17 PM
> To: Yang, SteveX <stevex.yang@intel.com>; dev@dpdk.org
> Cc: Zhao1, Wei <wei.zhao1@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v3] net/ixgbe: fix vf reset hw error handling
> 
> Acked-by: Jeff Guo <jia.guo@intel.com>
> 
> > -----Original Message-----
> > From: Yang, SteveX <stevex.yang@intel.com>
> > Sent: Tuesday, September 15, 2020 2:46 PM
> > To: dev@dpdk.org
> > Cc: Zhao1, Wei <wei.zhao1@intel.com>; Guo, Jia <jia.guo@intel.com>;
> > Yang, Qiming <qiming.yang@intel.com>; Yang, SteveX
> > <stevex.yang@intel.com>
> > 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")
> >
> > Signed-off-by: SteveX Yang <stevex.yang@intel.com>
Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-23 11:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02  0:44 [dpdk-dev] [PATCH] net/ixgbe: fix vf reset hw error handling SteveX Yang
2020-09-03  2:24 ` Yang, Qiming
2020-09-08  3:17 ` [dpdk-dev] [PATCH v2] " SteveX Yang
2020-09-11  6:24   ` Guo, Jia
2020-09-15  6:46   ` [dpdk-dev] [PATCH v3] " SteveX Yang
2020-09-23  6:16     ` Guo, Jia
2020-09-23 11:46       ` Zhang, Qi Z

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