qed: Use accurate error num in qed_cxt_dynamic_ilt_alloc
PATCH 1/2 qed: Use accurate error num in qed_cxt_dynamic_ilt_alloc
To have more accurate error return type use -EOPNOTSUPP instead of -EINVAL.
Signed-off-by Shai Malin <[email protected]>
Signed-off-by Ariel Elior <[email protected]>
Signed-off-by Prabhakar Kushwaha <[email protected]>
--- drivers/net/ethernet/qlogic/qed/qed_cxt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_cxt.c +2 -2
@@ -2226,8 +2226,8 @@ qed_cxt_dynamic_ilt_alloc(struct qed_hwfn *p_hwfn, p_blk = &p_cli->pf_blks[CDUT_SEG_BLK (QED_CXT_ROCE_TID_SEG )];break ;default : -DP_NOTICE (p_hwfn,"-EINVALID elem type = %d" , elem_type); -return -EINVAL ; +DP_NOTICE (p_hwfn,"-EOPNOTSUPP elem type = %d" , elem_type); +return -EOPNOTSUPP ; }/* Calculate line in ilt */
Signature · 1 line
2.24.1
PATCH 2/2 qedr: Improve error logs for rdma_alloc_tid error return
Use -EINVAL return type to identify whether error is returned because of "Out of MR resources" or any other error types.
Signed-off-by Shai Malin <[email protected]>
Signed-off-by Ariel Elior <[email protected]>
Signed-off-by Prabhakar Kushwaha <[email protected]>
--- drivers/infiniband/hw/qedr/verbs.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
drivers/infiniband/hw/qedr/verbs.c +15 -3
@@ -2996,7 +2996,11 @@ struct ib_mr *qedr_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len, rc = dev->ops->rdma_alloc_tid (dev->rdma_ctx, &mr->hw_mr.itid);if (rc) { -DP_ERR (dev,"roce alloc tid returned an error %d\n" , rc); +if (rc == -EINVAL ) +DP_ERR (dev,"Out of MR resources\n" ); +else +DP_ERR (dev,"roce alloc tid returned error %d\n" , rc); + goto err1; }
@@ -3091,7 +3095,11 @@ static struct qedr_mr *__qedr_alloc_mr(struct ib_pd *ibpd, rc = dev->ops->rdma_alloc_tid (dev->rdma_ctx, &mr->hw_mr.itid);if (rc) { -DP_ERR (dev,"roce alloc tid returned an error %d\n" , rc); +if (rc == -EINVAL ) +DP_ERR (dev,"Out of MR resources\n" ); +else +DP_ERR (dev,"roce alloc tid returned error %d\n" , rc); + goto err0; }
@@ -3221,7 +3229,11 @@ struct ib_mr *qedr_get_dma_mr(struct ib_pd *ibpd, int acc) rc = dev->ops->rdma_alloc_tid (dev->rdma_ctx, &mr->hw_mr.itid);if (rc) { -DP_ERR (dev,"roce alloc tid returned an error %d\n" , rc); +if (rc == -EINVAL ) +DP_ERR (dev,"Out of MR resources\n" ); +else +DP_ERR (dev,"roce alloc tid returned error %d\n" , rc); + goto err1; }
Signature · 1 line
2.24.1
Jason Gunthorpe
maintainerQuoted 9 lines · Prabhakar Kushwaha
To have more accurate error return type use
-EOPNOTSUPPinstead of-EINVAL.Signed-off-by Shai Malin <[email protected]>Signed-off-by Ariel Elior <[email protected]>Signed-off-by Prabhakar Kushwaha <[email protected]>--- drivers/net/ethernet/qlogic/qed/qed_cxt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Both applied to for-next, thanks
Jason