@@ -658,13 +658,6 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res,
658658 rc = bnxt_qplib_alloc_init_hwq (& srq -> hwq , & hwq_attr );
659659 if (rc )
660660 return rc ;
661-
662- srq -> swq = kcalloc (srq -> hwq .max_elements , sizeof (* srq -> swq ),
663- GFP_KERNEL );
664- if (!srq -> swq ) {
665- rc = - ENOMEM ;
666- goto fail ;
667- }
668661 srq -> dbinfo .flags = 0 ;
669662 bnxt_qplib_rcfw_cmd_prep ((struct cmdq_base * )& req ,
670663 CMDQ_BASE_OPCODE_CREATE_SRQ ,
@@ -693,9 +686,17 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res,
693686 spin_lock_init (& srq -> lock );
694687 srq -> start_idx = 0 ;
695688 srq -> last_idx = srq -> hwq .max_elements - 1 ;
696- for (idx = 0 ; idx < srq -> hwq .max_elements ; idx ++ )
697- srq -> swq [idx ].next_idx = idx + 1 ;
698- srq -> swq [srq -> last_idx ].next_idx = -1 ;
689+ if (!srq -> hwq .is_user ) {
690+ srq -> swq = kcalloc (srq -> hwq .max_elements , sizeof (* srq -> swq ),
691+ GFP_KERNEL );
692+ if (!srq -> swq ) {
693+ rc = - ENOMEM ;
694+ goto fail ;
695+ }
696+ for (idx = 0 ; idx < srq -> hwq .max_elements ; idx ++ )
697+ srq -> swq [idx ].next_idx = idx + 1 ;
698+ srq -> swq [srq -> last_idx ].next_idx = -1 ;
699+ }
699700
700701 srq -> id = le32_to_cpu (resp .xid );
701702 srq -> dbinfo .hwq = & srq -> hwq ;
@@ -999,9 +1000,7 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
9991000 u32 tbl_indx ;
10001001 u16 nsge ;
10011002
1002- if (res -> dattr )
1003- qp -> is_host_msn_tbl = _is_host_msn_table (res -> dattr -> dev_cap_flags2 );
1004-
1003+ qp -> is_host_msn_tbl = _is_host_msn_table (res -> dattr -> dev_cap_flags2 );
10051004 sq -> dbinfo .flags = 0 ;
10061005 bnxt_qplib_rcfw_cmd_prep ((struct cmdq_base * )& req ,
10071006 CMDQ_BASE_OPCODE_CREATE_QP ,
@@ -1043,13 +1042,14 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
10431042 if (rc )
10441043 return rc ;
10451044
1046- rc = bnxt_qplib_alloc_init_swq (sq );
1047- if (rc )
1048- goto fail_sq ;
1049-
1050- if (psn_sz )
1051- bnxt_qplib_init_psn_ptr (qp , psn_sz );
1045+ if (!sq -> hwq .is_user ) {
1046+ rc = bnxt_qplib_alloc_init_swq (sq );
1047+ if (rc )
1048+ goto fail_sq ;
10521049
1050+ if (psn_sz )
1051+ bnxt_qplib_init_psn_ptr (qp , psn_sz );
1052+ }
10531053 req .sq_size = cpu_to_le32 (bnxt_qplib_set_sq_size (sq , qp -> wqe_mode ));
10541054 pbl = & sq -> hwq .pbl [PBL_LVL_0 ];
10551055 req .sq_pbl = cpu_to_le64 (pbl -> pg_map_arr [0 ]);
@@ -1075,9 +1075,11 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
10751075 rc = bnxt_qplib_alloc_init_hwq (& rq -> hwq , & hwq_attr );
10761076 if (rc )
10771077 goto sq_swq ;
1078- rc = bnxt_qplib_alloc_init_swq (rq );
1079- if (rc )
1080- goto fail_rq ;
1078+ if (!rq -> hwq .is_user ) {
1079+ rc = bnxt_qplib_alloc_init_swq (rq );
1080+ if (rc )
1081+ goto fail_rq ;
1082+ }
10811083
10821084 req .rq_size = cpu_to_le32 (rq -> max_wqe );
10831085 pbl = & rq -> hwq .pbl [PBL_LVL_0 ];
@@ -1173,9 +1175,11 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
11731175 rq -> dbinfo .db = qp -> dpi -> dbr ;
11741176 rq -> dbinfo .max_slot = bnxt_qplib_set_rq_max_slot (rq -> wqe_size );
11751177 }
1178+ spin_lock_bh (& rcfw -> tbl_lock );
11761179 tbl_indx = map_qp_id_to_tbl_indx (qp -> id , rcfw );
11771180 rcfw -> qp_tbl [tbl_indx ].qp_id = qp -> id ;
11781181 rcfw -> qp_tbl [tbl_indx ].qp_handle = (void * )qp ;
1182+ spin_unlock_bh (& rcfw -> tbl_lock );
11791183
11801184 return 0 ;
11811185fail :
@@ -2596,10 +2600,12 @@ static int bnxt_qplib_cq_process_req(struct bnxt_qplib_cq *cq,
25962600 bnxt_qplib_add_flush_qp (qp );
25972601 } else {
25982602 /* Before we complete, do WA 9060 */
2599- if (do_wa9060 (qp , cq , cq_cons , sq -> swq_last ,
2600- cqe_sq_cons )) {
2601- * lib_qp = qp ;
2602- goto out ;
2603+ if (!bnxt_qplib_is_chip_gen_p5_p7 (qp -> cctx )) {
2604+ if (do_wa9060 (qp , cq , cq_cons , sq -> swq_last ,
2605+ cqe_sq_cons )) {
2606+ * lib_qp = qp ;
2607+ goto out ;
2608+ }
26032609 }
26042610 if (swq -> flags & SQ_SEND_FLAGS_SIGNAL_COMP ) {
26052611 cqe -> status = CQ_REQ_STATUS_OK ;
0 commit comments