DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: do not return internal code in rte_eth_dev_reset
@ 2018-08-21 11:06 Luca Boccassi
  2018-08-21 11:17 ` Ananyev, Konstantin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Luca Boccassi @ 2018-08-21 11:06 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, konstantin.ananyev

In case of a temporary failure the ixgbe driver can return the internal
error IXGBE_ERR_RESET_FAILED to the application. Instead, return
-EAGAIN as per the public API specification.

Signed-off-by: Luca Boccassi <bluca@debian.org>
---
 drivers/net/ixgbe/base/ixgbe_vf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_vf.c b/drivers/net/ixgbe/base/ixgbe_vf.c
index 5b25a6b4d4..62f2bf2e7d 100644
--- a/drivers/net/ixgbe/base/ixgbe_vf.c
+++ b/drivers/net/ixgbe/base/ixgbe_vf.c
@@ -203,8 +203,13 @@ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw)
 		usec_delay(5);
 	}
 
+	/*
+	 * This error code will be propagated to the app by rte_eth_dev_reset,
+	 * so use a public error code rather than the internal-only
+	 * IXGBE_ERR_RESET_FAILED
+	 */
 	if (!timeout)
-		return IXGBE_ERR_RESET_FAILED;
+		return -EAGAIN;
 
 	/* Reset VF registers to initial values */
 	ixgbe_virt_clr_reg(hw);
-- 
2.18.0

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

* Re: [dpdk-dev] [PATCH] net/ixgbe: do not return internal code in rte_eth_dev_reset
  2018-08-21 11:06 [dpdk-dev] [PATCH] net/ixgbe: do not return internal code in rte_eth_dev_reset Luca Boccassi
@ 2018-08-21 11:17 ` Ananyev, Konstantin
  2018-09-03 12:54 ` Zhang, Qi Z
  2018-09-03 14:18 ` [dpdk-dev] [PATCH v2] " Luca Boccassi
  2 siblings, 0 replies; 6+ messages in thread
From: Ananyev, Konstantin @ 2018-08-21 11:17 UTC (permalink / raw)
  To: Luca Boccassi, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: Luca Boccassi [mailto:bluca@debian.org]
> Sent: Tuesday, August 21, 2018 12:07 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Subject: [PATCH] net/ixgbe: do not return internal code in rte_eth_dev_reset
> 
> In case of a temporary failure the ixgbe driver can return the internal
> error IXGBE_ERR_RESET_FAILED to the application. Instead, return
> -EAGAIN as per the public API specification.
> 
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> ---
>  drivers/net/ixgbe/base/ixgbe_vf.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/base/ixgbe_vf.c b/drivers/net/ixgbe/base/ixgbe_vf.c
> index 5b25a6b4d4..62f2bf2e7d 100644
> --- a/drivers/net/ixgbe/base/ixgbe_vf.c
> +++ b/drivers/net/ixgbe/base/ixgbe_vf.c
> @@ -203,8 +203,13 @@ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw)
>  		usec_delay(5);
>  	}
> 
> +	/*
> +	 * This error code will be propagated to the app by rte_eth_dev_reset,
> +	 * so use a public error code rather than the internal-only
> +	 * IXGBE_ERR_RESET_FAILED
> +	 */
>  	if (!timeout)
> -		return IXGBE_ERR_RESET_FAILED;
> +		return -EAGAIN;
> 
>  	/* Reset VF registers to initial values */
>  	ixgbe_virt_clr_reg(hw);
> --
> 2.18.0

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

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

* Re: [dpdk-dev] [PATCH] net/ixgbe: do not return internal code in rte_eth_dev_reset
  2018-08-21 11:06 [dpdk-dev] [PATCH] net/ixgbe: do not return internal code in rte_eth_dev_reset Luca Boccassi
  2018-08-21 11:17 ` Ananyev, Konstantin
@ 2018-09-03 12:54 ` Zhang, Qi Z
  2018-09-03 14:18   ` Luca Boccassi
  2018-09-03 14:18 ` [dpdk-dev] [PATCH v2] " Luca Boccassi
  2 siblings, 1 reply; 6+ messages in thread
From: Zhang, Qi Z @ 2018-09-03 12:54 UTC (permalink / raw)
  To: Luca Boccassi, dev; +Cc: Lu, Wenzhuo, Ananyev, Konstantin



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Luca Boccassi
> Sent: Tuesday, August 21, 2018 7:07 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>
> Subject: [dpdk-dev] [PATCH] net/ixgbe: do not return internal code in
> rte_eth_dev_reset
> 
> In case of a temporary failure the ixgbe driver can return the internal error
> IXGBE_ERR_RESET_FAILED to the application. Instead, return -EAGAIN as per
> the public API specification.
> 
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> ---
>  drivers/net/ixgbe/base/ixgbe_vf.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/base/ixgbe_vf.c
> b/drivers/net/ixgbe/base/ixgbe_vf.c
> index 5b25a6b4d4..62f2bf2e7d 100644
> --- a/drivers/net/ixgbe/base/ixgbe_vf.c
> +++ b/drivers/net/ixgbe/base/ixgbe_vf.c
> @@ -203,8 +203,13 @@ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw)
>  		usec_delay(5);
>  	}
> 
> +	/*
> +	 * This error code will be propagated to the app by rte_eth_dev_reset,
> +	 * so use a public error code rather than the internal-only
> +	 * IXGBE_ERR_RESET_FAILED
> +	 */
>  	if (!timeout)
> -		return IXGBE_ERR_RESET_FAILED;
> +		return -EAGAIN;

I think it's better not to change this in base code which are assumed to only return IXGBE_ERR_xxx
And also this is not the only place in ixgbe_reset_hw_vf that will propagated the internal error.
Why not convert it in "eth_ixgbevf_dev_init" which looks like a right place?


> 
>  	/* Reset VF registers to initial values */
>  	ixgbe_virt_clr_reg(hw);
> --
> 2.18.0

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

* [dpdk-dev] [PATCH v2] net/ixgbe: do not return internal code in rte_eth_dev_reset
  2018-08-21 11:06 [dpdk-dev] [PATCH] net/ixgbe: do not return internal code in rte_eth_dev_reset Luca Boccassi
  2018-08-21 11:17 ` Ananyev, Konstantin
  2018-09-03 12:54 ` Zhang, Qi Z
@ 2018-09-03 14:18 ` Luca Boccassi
  2018-09-05 12:35   ` Zhang, Qi Z
  2 siblings, 1 reply; 6+ messages in thread
From: Luca Boccassi @ 2018-09-03 14:18 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, konstantin.ananyev, qi.z.zhang, Luca Boccassi, stable

In case of a temporary failure the ixgbe driver can return the internal
error IXGBE_ERR_RESET_FAILED to the application. Instead, return
-EAGAIN as per the public API specification.

Fixes: cddaf87a1ecb ("lib: fix unused values")
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
---
v2: added fixes and cc: stable
    move change to eth_ixgbevf_dev_init from the base code

 drivers/net/ixgbe/ixgbe_ethdev.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 26b192737f..eab9e2e7e6 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1619,7 +1619,12 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 	 */
 	if ((diag != IXGBE_SUCCESS) && (diag != IXGBE_ERR_INVALID_MAC_ADDR)) {
 		PMD_INIT_LOG(ERR, "VF Initialization Failure: %d", diag);
-		return diag;
+		/*
+		 * This error code will be propagated to the app by
+		 * rte_eth_dev_reset, so use a public error code rather than
+		 * the internal-only IXGBE_ERR_RESET_FAILED
+		 */
+		return -EAGAIN;
 	}
 
 	/* negotiate mailbox API version to use with the PF. */
-- 
2.18.0

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

* Re: [dpdk-dev] [PATCH] net/ixgbe: do not return internal code in rte_eth_dev_reset
  2018-09-03 12:54 ` Zhang, Qi Z
@ 2018-09-03 14:18   ` Luca Boccassi
  0 siblings, 0 replies; 6+ messages in thread
From: Luca Boccassi @ 2018-09-03 14:18 UTC (permalink / raw)
  To: Zhang, Qi Z, dev; +Cc: Lu, Wenzhuo, Ananyev, Konstantin

On Mon, 2018-09-03 at 12:54 +0000, Zhang, Qi Z wrote:
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Luca Boccassi
> > Sent: Tuesday, August 21, 2018 7:07 PM
> > To: dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>
> > Subject: [dpdk-dev] [PATCH] net/ixgbe: do not return internal code
> > in
> > rte_eth_dev_reset
> > 
> > In case of a temporary failure the ixgbe driver can return the
> > internal error
> > IXGBE_ERR_RESET_FAILED to the application. Instead, return -EAGAIN
> > as per
> > the public API specification.
> > 
> > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > ---
> >  drivers/net/ixgbe/base/ixgbe_vf.c | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ixgbe/base/ixgbe_vf.c
> > b/drivers/net/ixgbe/base/ixgbe_vf.c
> > index 5b25a6b4d4..62f2bf2e7d 100644
> > --- a/drivers/net/ixgbe/base/ixgbe_vf.c
> > +++ b/drivers/net/ixgbe/base/ixgbe_vf.c
> > @@ -203,8 +203,13 @@ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw)
> >  		usec_delay(5);
> >  	}
> > 
> > +	/*
> > +	 * This error code will be propagated to the app by
> > rte_eth_dev_reset,
> > +	 * so use a public error code rather than the internal-
> > only
> > +	 * IXGBE_ERR_RESET_FAILED
> > +	 */
> >  	if (!timeout)
> > -		return IXGBE_ERR_RESET_FAILED;
> > +		return -EAGAIN;
> 
> I think it's better not to change this in base code which are assumed
> to only return IXGBE_ERR_xxx
> And also this is not the only place in ixgbe_reset_hw_vf that will
> propagated the internal error.
> Why not convert it in "eth_ixgbevf_dev_init" which looks like a right
> place?

Ok, done in v2

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: do not return internal code in rte_eth_dev_reset
  2018-09-03 14:18 ` [dpdk-dev] [PATCH v2] " Luca Boccassi
@ 2018-09-05 12:35   ` Zhang, Qi Z
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Qi Z @ 2018-09-05 12:35 UTC (permalink / raw)
  To: Luca Boccassi, dev; +Cc: Lu, Wenzhuo, Ananyev, Konstantin, stable



> -----Original Message-----
> From: Luca Boccassi [mailto:bluca@debian.org]
> Sent: Monday, September 3, 2018 10:18 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Luca
> Boccassi <bluca@debian.org>; stable@dpdk.org
> Subject: [PATCH v2] net/ixgbe: do not return internal code in
> rte_eth_dev_reset

Change title to "net/ixgbe: do not return internal code" to avoid check-git-log error.

> 
> In case of a temporary failure the ixgbe driver can return the internal error
> IXGBE_ERR_RESET_FAILED to the application. Instead, return -EAGAIN as per
> the public API specification.
> 
> Fixes: cddaf87a1ecb ("lib: fix unused values")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Luca Boccassi <bluca@debian.org>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks!
Qi

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

end of thread, other threads:[~2018-09-05 12:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-21 11:06 [dpdk-dev] [PATCH] net/ixgbe: do not return internal code in rte_eth_dev_reset Luca Boccassi
2018-08-21 11:17 ` Ananyev, Konstantin
2018-09-03 12:54 ` Zhang, Qi Z
2018-09-03 14:18   ` Luca Boccassi
2018-09-03 14:18 ` [dpdk-dev] [PATCH v2] " Luca Boccassi
2018-09-05 12:35   ` 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).