Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RDMA support for Intel IPU E2000 (GEN 3) #1486

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
providers/irdma: Flush changes for GEN 3
Modify cq_poll_compl() to poll flushed CQEs for GEN 3

Add IBV_WC_RETRY_EXC_ERR and FLUSH_RNR_RETRY_EXC_ERR to the returned
ibv_wc_status errors

Signed-off-by: Shiraz Saleem <[email protected]>
Signed-off-by: Tatyana Nikolova <[email protected]>
  • Loading branch information
shirazsaleem authored and tatyana-en committed Jul 26, 2024
commit 3f2992d9435355b9c5dba602ca06dfca8a9a618f
42 changes: 32 additions & 10 deletions providers/irdma/uk.c
Original file line number Diff line number Diff line change
@@ -1152,23 +1152,42 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq,
info->ud_vlan_valid = false;
}

get_64bit_val(cqe, 8, &comp_ctx);
qp = (struct irdma_qp_uk *)(uintptr_t)comp_ctx;

info->q_type = (__u8)FIELD_GET(IRDMA_CQ_SQ, qword3);
info->error = (bool)FIELD_GET(IRDMA_CQ_ERROR, qword3);
info->push_dropped = (bool)FIELD_GET(IRDMACQ_PSHDROP, qword3);
info->ipv4 = (bool)FIELD_GET(IRDMACQ_IPV4, qword3);
if (info->error) {
info->major_err = FIELD_GET(IRDMA_CQ_MAJERR, qword3);
info->minor_err = FIELD_GET(IRDMA_CQ_MINERR, qword3);
if (info->major_err == IRDMA_FLUSH_MAJOR_ERR) {
info->comp_status = IRDMA_COMPL_STATUS_FLUSHED;
switch (info->major_err) {
case IRDMA_FLUSH_MAJOR_ERR:
/* Set the min error to standard flush error code for remaining cqes */
if (info->minor_err != FLUSH_GENERAL_ERR) {
qword3 &= ~IRDMA_CQ_MINERR;
qword3 |= FIELD_PREP(IRDMA_CQ_MINERR, FLUSH_GENERAL_ERR);
set_64bit_val(cqe, 24, qword3);
}
} else {
info->comp_status = IRDMA_COMPL_STATUS_UNKNOWN;
info->comp_status = IRDMA_COMPL_STATUS_FLUSHED;
break;
default:
#define IRDMA_CIE_SIGNATURE 0xE
#define IRDMA_CQMAJERR_HIGH_NIBBLE GENMASK(15, 12)
/* For UD SQ, certain non-fatal async errors are indicated through CQEs and need to be ignored */
if (info->q_type == IRDMA_CQE_QTYPE_SQ &&
qp->qp_type == IRDMA_QP_TYPE_ROCE_UD &&
FIELD_GET(IRDMA_CQMAJERR_HIGH_NIBBLE, info->major_err)
== IRDMA_CIE_SIGNATURE) {
info->error = 0;
info->major_err = 0;
info->minor_err = 0;
info->comp_status = IRDMA_COMPL_STATUS_SUCCESS;
} else {
info->comp_status = IRDMA_COMPL_STATUS_UNKNOWN;
}
break;
}
} else {
info->comp_status = IRDMA_COMPL_STATUS_SUCCESS;
@@ -1180,11 +1199,8 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq,
info->tcp_seq_num_rtt = (__u32)FIELD_GET(IRDMACQ_TCPSEQNUMRTT, qword0);
info->qp_id = (__u32)FIELD_GET(IRDMACQ_QPID, qword2);
info->ud_src_qpn = (__u32)FIELD_GET(IRDMACQ_UDSRCQPN, qword2);

get_64bit_val(cqe, 8, &comp_ctx);

info->solicited_event = (bool)FIELD_GET(IRDMACQ_SOEVENT, qword3);
qp = (struct irdma_qp_uk *)(uintptr_t)comp_ctx;

if (!qp || qp->destroy_pending) {
ret_code = EFAULT;
goto exit;
@@ -1289,9 +1305,15 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq,
ret_code = 0;

exit:
if (!ret_code && info->comp_status == IRDMA_COMPL_STATUS_FLUSHED)
if (!ret_code && info->comp_status == IRDMA_COMPL_STATUS_FLUSHED) {
if (pring && IRDMA_RING_MORE_WORK(*pring))
move_cq_head = false;
/* Park CQ head during a flush to generate additional CQEs
* from SW for all unprocessed WQEs. For GEN3 and beyond
* FW will generate/flush these CQEs so move to the next CQE
*/
move_cq_head = qp->uk_attrs->hw_rev <= IRDMA_GEN_2 ?
false : true;
}

if (move_cq_head) {
IRDMA_RING_MOVE_HEAD_NOCHECK(cq->cq_ring);
1 change: 1 addition & 0 deletions providers/irdma/user.h
Original file line number Diff line number Diff line change
@@ -106,6 +106,7 @@ enum irdma_flush_opcode {
FLUSH_RETRY_EXC_ERR,
FLUSH_MW_BIND_ERR,
FLUSH_REM_INV_REQ_ERR,
FLUSH_RNR_RETRY_EXC_ERR,
};

enum irdma_cmpl_status {
6 changes: 4 additions & 2 deletions providers/irdma/uverbs.c
Original file line number Diff line number Diff line change
@@ -612,12 +612,14 @@ static enum ibv_wc_status irdma_flush_err_to_ib_wc_status(enum irdma_flush_opcod
return IBV_WC_LOC_LEN_ERR;
case FLUSH_GENERAL_ERR:
return IBV_WC_WR_FLUSH_ERR;
case FLUSH_RETRY_EXC_ERR:
return IBV_WC_RETRY_EXC_ERR;
case FLUSH_MW_BIND_ERR:
return IBV_WC_MW_BIND_ERR;
case FLUSH_REM_INV_REQ_ERR:
return IBV_WC_REM_INV_REQ_ERR;
case FLUSH_RETRY_EXC_ERR:
return IBV_WC_RETRY_EXC_ERR;
case FLUSH_RNR_RETRY_EXC_ERR:
return IBV_WC_RNR_RETRY_EXC_ERR;
case FLUSH_FATAL_ERR:
default:
return IBV_WC_FATAL_ERR;