@@ -769,9 +769,6 @@ static inline int efa_poll_sub_cqs(struct efa_cq *cq, struct ibv_wc *wc,
769
769
sub_cq = & cq -> sub_cq_arr [cq -> next_poll_idx ++ ];
770
770
cq -> next_poll_idx %= num_sub_cqs ;
771
771
772
- if (!sub_cq -> ref_cnt )
773
- continue ;
774
-
775
772
err = efa_poll_sub_cq (cq , sub_cq , & qp , wc , extended );
776
773
if (err != ENOENT ) {
777
774
cq -> cc ++ ;
@@ -896,7 +893,6 @@ static void efa_sub_cq_initialize(struct efa_sub_cq *sub_cq, uint8_t *buf,
896
893
sub_cq -> buf = buf ;
897
894
sub_cq -> qmask = sub_cq_size - 1 ;
898
895
sub_cq -> cqe_size = cqe_size ;
899
- sub_cq -> ref_cnt = 0 ;
900
896
}
901
897
902
898
static struct ibv_cq_ex * create_cq (struct ibv_context * ibvctx ,
@@ -1084,16 +1080,6 @@ int efa_destroy_cq(struct ibv_cq *ibvcq)
1084
1080
return 0 ;
1085
1081
}
1086
1082
1087
- static void efa_cq_inc_ref_cnt (struct efa_cq * cq , uint8_t sub_cq_idx )
1088
- {
1089
- cq -> sub_cq_arr [sub_cq_idx ].ref_cnt ++ ;
1090
- }
1091
-
1092
- static void efa_cq_dec_ref_cnt (struct efa_cq * cq , uint8_t sub_cq_idx )
1093
- {
1094
- cq -> sub_cq_arr [sub_cq_idx ].ref_cnt -- ;
1095
- }
1096
-
1097
1083
static void efa_wq_terminate (struct efa_wq * wq , int pgsz )
1098
1084
{
1099
1085
void * db_aligned ;
@@ -1476,8 +1462,6 @@ static struct ibv_qp *create_qp(struct ibv_context *ibvctx,
1476
1462
struct efa_dev * dev = to_efa_dev (ibvctx -> device );
1477
1463
struct efa_create_qp_resp resp = {};
1478
1464
struct efa_create_qp req = {};
1479
- struct efa_cq * send_cq ;
1480
- struct efa_cq * recv_cq ;
1481
1465
struct ibv_qp * ibvqp ;
1482
1466
struct efa_qp * qp ;
1483
1467
int err ;
@@ -1535,16 +1519,6 @@ static struct ibv_qp *create_qp(struct ibv_context *ibvctx,
1535
1519
ctx -> qp_table [ibvqp -> qp_num & ctx -> qp_table_sz_m1 ] = qp ;
1536
1520
pthread_spin_unlock (& ctx -> qp_table_lock );
1537
1521
1538
- send_cq = to_efa_cq (attr -> send_cq );
1539
- pthread_spin_lock (& send_cq -> lock );
1540
- efa_cq_inc_ref_cnt (send_cq , resp .send_sub_cq_idx );
1541
- pthread_spin_unlock (& send_cq -> lock );
1542
-
1543
- recv_cq = to_efa_cq (attr -> recv_cq );
1544
- pthread_spin_lock (& recv_cq -> lock );
1545
- efa_cq_inc_ref_cnt (recv_cq , resp .recv_sub_cq_idx );
1546
- pthread_spin_unlock (& recv_cq -> lock );
1547
-
1548
1522
if (attr -> comp_mask & IBV_QP_INIT_ATTR_SEND_OPS_FLAGS ) {
1549
1523
efa_qp_fill_wr_pfns (& qp -> verbs_qp .qp_ex , attr );
1550
1524
qp -> verbs_qp .comp_mask |= VERBS_QP_EX ;
@@ -1725,9 +1699,6 @@ int efa_destroy_qp(struct ibv_qp *ibvqp)
1725
1699
pthread_spin_lock (& ctx -> qp_table_lock );
1726
1700
efa_lock_cqs (ibvqp );
1727
1701
1728
- efa_cq_dec_ref_cnt (to_efa_cq (ibvqp -> send_cq ), qp -> sq .wq .sub_cq_idx );
1729
- efa_cq_dec_ref_cnt (to_efa_cq (ibvqp -> recv_cq ), qp -> rq .wq .sub_cq_idx );
1730
-
1731
1702
ctx -> qp_table [ibvqp -> qp_num & ctx -> qp_table_sz_m1 ] = NULL ;
1732
1703
1733
1704
efa_unlock_cqs (ibvqp );
0 commit comments