[v3] net/ixgbe: fix vf reset hw error handling

Message ID 20200915064622.20256-1-stevex.yang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v3] net/ixgbe: fix vf reset hw error handling |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Steve Yang Sept. 15, 2020, 6:46 a.m. UTC
  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(-)
  

Comments

Guo, Jia Sept. 23, 2020, 6:16 a.m. UTC | #1
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
  
Qi Zhang Sept. 23, 2020, 11:46 a.m. UTC | #2
> -----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
  

Patch

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. */