net/ixgbe: do not return internal code in rte_eth_dev_reset
PATCH 1/1 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.
--- drivers/net/ixgbe/base/ixgbe_vf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ixgbe/base/ixgbe_vf.c +6 -1
@@ -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);
Signature · 1 line
2.18.0
Quoted 38 lines
-----Original Message-----
From: Luca Boccassi [mailto:[email protected]]
Sent: Tuesday, August 21, 2018 12:07 PM
To: [email protected]
Cc: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>
Subject: [PATCH] net/ixgbe: do not return internal code inrte_eth_dev_resetIn case of a temporary failure the ixgbe driver can return the internal error
IXGBE_ERR_RESET_FAILEDto the application. Instead, return-EAGAINas per the public API specification.Signed-off-by Luca Boccassi <[email protected]>--- drivers/net/ixgbe/base/ixgbe_vf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/net/ixgbe/base/ixgbe_vf.c +6
-2@@ -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); --
Quoted 1 line
2.18.0
Quoted 27 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Luca Boccassi
Sent: Tuesday, August 21, 2018 7:07 PM
To: [email protected]
Cc: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>
Subject: [dpdk-dev] [PATCH] net/ixgbe: do not return internal code inrte_eth_dev_resetIn case of a temporary failure the ixgbe driver can return the internal error
IXGBE_ERR_RESET_FAILEDto the application. Instead, return-EAGAINas per the public API specification.Signed-off-by Luca Boccassi <[email protected]>--- drivers/net/ixgbe/base/ixgbe_vf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/net/ixgbe/base/ixgbe_vf.c +0
-0@@ -203,8 +203,13 @@ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw)usec_delay (5 );
drivers/net/ixgbe/base/ixgbe_vf.c s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw) · line 212
Quoted 10 lines
drivers/net/ixgbe/base/ixgbe_vf.c +6
-1} +/* +* 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?
Quoted 5 lines
drivers/net/ixgbe/base/ixgbe_vf.c +0
-1/* Reset VF registers to initial values */ ixgbe_virt_clr_reg (hw); --2.18.0
Quoted 39 lines · Qi Z
Quoted 39 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Luca Boccassi
Sent: Tuesday, August 21, 2018 7:07 PM
To: [email protected]
Cc: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>
Subject: [dpdk-dev] [PATCH] net/ixgbe: do not return internal code inrte_eth_dev_resetIn case of a temporary failure the ixgbe driver can return the internal error
IXGBE_ERR_RESET_FAILEDto the application. Instead, return-EAGAINas per
the public API specification.Signed-off-by Luca Boccassi <[email protected]>---
drivers/net/ixgbe/base/ixgbe_vf.c | 7 ++++++-1 file changed, 6 insertions(+), 1 deletion(-)drivers/net/ixgbe/base/ixgbe_vf.c +3
-0@@ -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
drivers/net/ixgbe/base/ixgbe_vf.c +2
-0+* IXGBE_ERR_RESET_FAILED +*/ if (!timeout)
drivers/net/ixgbe/base/ixgbe_vf.c +0
-1-return IXGBE_ERR_RESET_FAILED ;
Quoted 8 lines
drivers/net/ixgbe/base/ixgbe_vf.c s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw) · line 212
Quoted 1 line
drivers/net/ixgbe/base/ixgbe_vf.c +1
-0+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 inixgbe_reset_hw_vfthat will propagated the internal error.
Why not convert it in "eth_ixgbevf_dev_init" which looks like a right place?
Ok, done in v2
Signature · 2 lines
Kind regards, Luca Boccassi
PATCH v2 1/1 net/ixgbe: do not return internal code in rte_eth_dev_reset
In reply to Luca BoccassiIn 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.
---
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(-)
drivers/net/ixgbe/ixgbe_ethdev.c +6 -1
@@ -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. */
Signature · 1 line
2.18.0
Quoted 11 lines
-----Original Message-----
From: Luca Boccassi [mailto:[email protected]]
Sent: Monday, September 3, 2018 10:18 PM
To: [email protected]
Cc: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Zhang, Qi Z <[email protected]>; Luca Boccassi <[email protected]>; [email protected]
Subject: [PATCH v2] net/ixgbe: do not return internal code inrte_eth_dev_reset
Change title to "net/ixgbe: do not return internal code" to avoid check-git-log error.
Quoted 9 lines
In case of a temporary failure the ixgbe driver can return the internal error
IXGBE_ERR_RESET_FAILEDto the application. Instead, return-EAGAINas per the public API specification.Fixes cddaf87a1ecb ("lib: fix unused values")Signed-off-by Luca Boccassi <[email protected]>
Applied to dpdk-next-net-intel.
Thanks!
Qi