From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luca Boccassi Subject: [PATCH v2] net/ixgbe: do not return internal code in rte_eth_dev_reset Date: Mon, 3 Sep 2018 15:18:11 +0100 Message-ID: <20180903141811.5893-1-bluca@debian.org> References: <20180821110649.26711-1-bluca@debian.org> Cc: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, qi.z.zhang@intel.com, Luca Boccassi , stable@dpdk.org To: dev@dpdk.org Return-path: In-Reply-To: <20180821110649.26711-1-bluca@debian.org> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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