From: Ajit Khaparde Date: Mon, 8 Jan 2018 20:24:29 +0000 (-0800) Subject: net/bnxt: return proper error code X-Git-Tag: spdx-start~374 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=bdd555043a94dff4a3d09d1dc8a6c610891959b6;p=dpdk.git net/bnxt: return proper error code If the FW fails bnxt_hwrm_func_reset() with an error status, instead of returning -1, return a more standard value of -EIO. Similarly sometimes the status returned by certain FW commands may not be generic. Return a more standard value of -EIO in that case as well. Signed-off-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index d0002824f2..ce7030d1a6 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -378,6 +378,10 @@ static int bnxt_init_chip(struct bnxt *bp) err_out: bnxt_free_all_hwrm_resources(bp); + /* Some of the error status returned by FW may not be from errno.h */ + if (rc > 0) + rc = -EIO; + return rc; } @@ -3268,7 +3272,7 @@ skip_init: rc = bnxt_hwrm_func_reset(bp); if (rc) { RTE_LOG(ERR, PMD, "hwrm chip reset failure rc: %x\n", rc); - rc = -1; + rc = -EIO; goto error_free; }