net/bnxt: return standard error codes for HWRM command
If the FW returns an error for an HWRM request, it does not necessarily return standard error codes. Convert these HWRM errors to standard errno. Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
parent
07737474ec
commit
9848979bcc
@ -219,8 +219,14 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
|
|||||||
rte_spinlock_unlock(&bp->hwrm_lock); \
|
rte_spinlock_unlock(&bp->hwrm_lock); \
|
||||||
if (rc == HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED) \
|
if (rc == HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED) \
|
||||||
rc = -EACCES; \
|
rc = -EACCES; \
|
||||||
else if (rc > 0) \
|
else if (rc == HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR) \
|
||||||
|
rc = -ENOSPC; \
|
||||||
|
else if (rc == HWRM_ERR_CODE_INVALID_PARAMS) \
|
||||||
rc = -EINVAL; \
|
rc = -EINVAL; \
|
||||||
|
else if (rc == HWRM_ERR_CODE_CMD_NOT_SUPPORTED) \
|
||||||
|
rc = -ENOTSUP; \
|
||||||
|
else if (rc > 0) \
|
||||||
|
rc = -EIO; \
|
||||||
return rc; \
|
return rc; \
|
||||||
} \
|
} \
|
||||||
if (resp->error_code) { \
|
if (resp->error_code) { \
|
||||||
@ -241,8 +247,14 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
|
|||||||
rte_spinlock_unlock(&bp->hwrm_lock); \
|
rte_spinlock_unlock(&bp->hwrm_lock); \
|
||||||
if (rc == HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED) \
|
if (rc == HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED) \
|
||||||
rc = -EACCES; \
|
rc = -EACCES; \
|
||||||
else if (rc > 0) \
|
else if (rc == HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR) \
|
||||||
|
rc = -ENOSPC; \
|
||||||
|
else if (rc == HWRM_ERR_CODE_INVALID_PARAMS) \
|
||||||
rc = -EINVAL; \
|
rc = -EINVAL; \
|
||||||
|
else if (rc == HWRM_ERR_CODE_CMD_NOT_SUPPORTED) \
|
||||||
|
rc = -ENOTSUP; \
|
||||||
|
else if (rc > 0) \
|
||||||
|
rc = -EIO; \
|
||||||
return rc; \
|
return rc; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user