@@ -420,14 +420,17 @@ static void bnxt_re_resize_cq_complete(struct bnxt_re_cq *cq)
420420 cq -> resize_mem = NULL ;
421421 cq -> cqq -> va = cq -> mem -> va_head ;
422422
423+ /* mark the CQ resize flag and save the old head index */
424+ cq -> cqq -> cq_resized = true;
425+ cq -> cqq -> old_head = cq -> cqq -> head ;
426+
423427 cq -> cqq -> depth = cq -> mem -> pad ;
424428 cq -> cqq -> stride = cntx -> rdev -> cqe_size ;
425429 cq -> cqq -> head = 0 ;
426430 cq -> cqq -> tail = 0 ;
427431 cq -> phase = BNXT_RE_QUEUE_START_PHASE ;
428432 /* Reset epoch portion of the flags */
429- cq -> cqq -> flags &= ~(BNXT_RE_FLAG_EPOCH_TAIL_MASK |
430- BNXT_RE_FLAG_EPOCH_HEAD_MASK );
433+ cq -> cqq -> flags &= ~(BNXT_RE_FLAG_EPOCH_TAIL_MASK );
431434 bnxt_re_ring_cq_arm_db (cq , BNXT_RE_QUE_TYPE_CQ_CUT_ACK );
432435}
433436
@@ -438,6 +441,8 @@ int bnxt_re_resize_cq(struct ibv_cq *ibvcq, int ncqe)
438441 struct bnxt_re_cq * cq = to_bnxt_re_cq (ibvcq );
439442 struct ib_uverbs_resize_cq_resp resp = {};
440443 struct ubnxt_re_resize_cq cmd = {};
444+ uint16_t msec_wait = 100 ;
445+ uint16_t exit_cnt = 20 ;
441446 int rc = 0 ;
442447
443448 if (ncqe > dev -> max_cq_depth )
@@ -488,6 +493,13 @@ int bnxt_re_resize_cq(struct ibv_cq *ibvcq, int ncqe)
488493 list_add_tail (& cq -> prev_cq_head , & compl -> list );
489494 compl = NULL ;
490495 memset (& tmp_wc , 0 , sizeof (tmp_wc ));
496+ } else {
497+ exit_cnt -- ;
498+ if (unlikely (!exit_cnt )) {
499+ rc = - EIO ;
500+ break ;
501+ }
502+ bnxt_re_sub_sec_busy_wait (msec_wait * 1000000 );
491503 }
492504 }
493505done :
@@ -544,6 +556,7 @@ static uint8_t bnxt_re_poll_err_scqe(struct bnxt_re_qp *qp,
544556 status = (le32toh (hdr -> flg_st_typ_ph ) >> BNXT_RE_BCQE_STATUS_SHIFT ) &
545557 BNXT_RE_BCQE_STATUS_MASK ;
546558 ibvwc -> status = bnxt_re_to_ibv_wc_status (status , true);
559+ ibvwc -> vendor_err = status ;
547560 ibvwc -> wc_flags = 0 ;
548561 ibvwc -> wr_id = swrid -> wrid ;
549562 ibvwc -> qp_num = qp -> qpid ;
@@ -663,6 +676,7 @@ static int bnxt_re_poll_err_rcqe(struct bnxt_re_qp *qp, struct ibv_wc *ibvwc,
663676 return 0 ;
664677
665678 ibvwc -> status = bnxt_re_to_ibv_wc_status (status , false);
679+ ibvwc -> vendor_err = status ;
666680 ibvwc -> qp_num = qp -> qpid ;
667681 ibvwc -> opcode = IBV_WC_RECV ;
668682 ibvwc -> byte_len = 0 ;
0 commit comments