From 1e3b4d665e59408d590997abf19370082a7ebe20 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Wed, 25 Oct 2023 01:02:35 -0700 Subject: [PATCH] bnxt_re/lib: Populate vendor_err in the work completion [ Upstream commit 5ac2b2fd3e786742b65c010a10952fbed7ef81aa ] In case of error completion, it is observed that vendor error code is always set to zero. Update to populate vendor error along with IB completions. Also, modified the log to display vendor error. Fixes: f158e23c99c7 ("libbnxt_re: Allow apps to poll for flushed completions") Signed-off-by: Kalesh AP Reviewed-by: Selvin Xavier Signed-off-by: Selvin Xavier Signed-off-by: Nicolas Morey --- providers/bnxt_re/verbs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c index c7e6e6d9b..a2f9c94d6 100644 --- a/providers/bnxt_re/verbs.c +++ b/providers/bnxt_re/verbs.c @@ -261,6 +261,7 @@ static uint8_t bnxt_re_poll_err_scqe(struct bnxt_re_qp *qp, status = (le32toh(hdr->flg_st_typ_ph) >> BNXT_RE_BCQE_STATUS_SHIFT) & BNXT_RE_BCQE_STATUS_MASK; ibvwc->status = bnxt_re_to_ibv_wc_status(status, true); + ibvwc->vendor_err = status; ibvwc->wc_flags = 0; ibvwc->wr_id = swrid->wrid; ibvwc->qp_num = qp->qpid; @@ -393,6 +394,7 @@ static int bnxt_re_poll_err_rcqe(struct bnxt_re_qp *qp, struct ibv_wc *ibvwc, return 0; ibvwc->status = bnxt_re_to_ibv_wc_status(status, false); + ibvwc->vendor_err = status; ibvwc->qp_num = qp->qpid; ibvwc->opcode = IBV_WC_RECV; ibvwc->byte_len = 0;