Skip to content

Commit

Permalink
RDMA/irdma: Report correct WC error when there are MW bind errors
Browse files Browse the repository at this point in the history
Report the correct WC error when MW bind error related asynchronous events
are generated by HW.

Fixes: b48c24c ("RDMA/irdma: Implement device supported verb APIs")
Link: https://lore.kernel.org/r/20210916191222.824-5-shiraz.saleem@intel.com
Signed-off-by: Sindhu Devale <sindhu.devale@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
  • Loading branch information
Sindhu-Devale authored and jgunthorpe committed Sep 20, 2021
1 parent d3bdcd5 commit 9f7fa37
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/infiniband/hw/irdma/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ static void irdma_set_flush_fields(struct irdma_sc_qp *qp,
case IRDMA_AE_LLP_TOO_MANY_RETRIES:
qp->flush_code = FLUSH_RETRY_EXC_ERR;
break;
case IRDMA_AE_AMP_MWBIND_INVALID_RIGHTS:
case IRDMA_AE_AMP_MWBIND_BIND_DISABLED:
case IRDMA_AE_AMP_MWBIND_INVALID_BOUNDS:
qp->flush_code = FLUSH_MW_BIND_ERR;
break;
default:
qp->flush_code = FLUSH_FATAL_ERR;
break;
Expand Down
1 change: 1 addition & 0 deletions drivers/infiniband/hw/irdma/user.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ enum irdma_flush_opcode {
FLUSH_LOC_LEN_ERR,
FLUSH_FATAL_ERR,
FLUSH_RETRY_EXC_ERR,
FLUSH_MW_BIND_ERR,
};

enum irdma_cmpl_status {
Expand Down
2 changes: 2 additions & 0 deletions drivers/infiniband/hw/irdma/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3354,6 +3354,8 @@ static enum ib_wc_status irdma_flush_err_to_ib_wc_status(enum irdma_flush_opcode
return IB_WC_WR_FLUSH_ERR;
case FLUSH_RETRY_EXC_ERR:
return IB_WC_RETRY_EXC_ERR;
case FLUSH_MW_BIND_ERR:
return IB_WC_MW_BIND_ERR;
case FLUSH_FATAL_ERR:
default:
return IB_WC_FATAL_ERR;
Expand Down

0 comments on commit 9f7fa37

Please sign in to comment.