@@ -112,11 +112,6 @@ static void *get_sw_cqe(struct xsc_cq *cq, int n)
112
112
return NULL ;
113
113
}
114
114
115
- void * xsc_get_send_wqe (struct xsc_qp * qp , int n )
116
- {
117
- return qp -> sq_start + (n << qp -> sq .wqe_shift );
118
- }
119
-
120
115
static void update_cons_index (struct xsc_cq * cq )
121
116
{
122
117
struct xsc_context * ctx =
@@ -520,38 +515,11 @@ int xsc_free_cq_buf(struct xsc_context *ctx, struct xsc_buf *buf)
520
515
return xsc_free_actual_buf (ctx , buf );
521
516
}
522
517
523
- static int is_equal_rsn (struct xsc_cqe64 * cqe64 , uint32_t rsn )
524
- {
525
- return rsn == (be32toh (cqe64 -> sop_drop_qpn ) & 0xffffff );
526
- }
527
-
528
- static inline int is_equal_uidx (struct xsc_cqe64 * cqe64 , uint32_t uidx )
529
- {
530
- return uidx == (be32toh (cqe64 -> srqn_uidx ) & 0xffffff );
531
- }
532
-
533
- static inline int free_res_cqe (struct xsc_cqe64 * cqe64 , uint32_t rsn ,
534
- int cqe_version )
535
- {
536
- if (cqe_version ) {
537
- if (is_equal_uidx (cqe64 , rsn ))
538
- return 1 ;
539
- } else {
540
- if (is_equal_rsn (cqe64 , rsn ))
541
- return 1 ;
542
- }
543
-
544
- return 0 ;
545
- }
546
-
547
- void __xsc_cq_clean (struct xsc_cq * cq , u32 rsn )
518
+ void __xsc_cq_clean (struct xsc_cq * cq , u32 qpn )
548
519
{
549
520
u32 prod_index ;
550
521
int nfreed = 0 ;
551
- struct xsc_cqe64 * cqe64 , * dest64 ;
552
522
void * cqe , * dest ;
553
- u8 owner_bit ;
554
- int cqe_version ;
555
523
556
524
if (!cq || cq -> flags & XSC_CQ_FLAGS_DV_OWNED )
557
525
return ;
@@ -573,21 +541,20 @@ void __xsc_cq_clean(struct xsc_cq *cq, u32 rsn)
573
541
* Now sweep backwards through the CQ, removing CQ entries
574
542
* that match our QP by copying older entries on top of them.
575
543
*/
576
- cqe_version = (to_xctx (cq -> verbs_cq .cq_ex .context ))-> cqe_version ;
577
544
while ((int )(-- prod_index ) - (int )cq -> cons_index >= 0 ) {
545
+ u16 qp_id_combined ;
546
+ u32 qp_id ;
547
+
578
548
cqe = get_cqe (cq , prod_index & (cq -> verbs_cq .cq_ex .cqe - 1 ));
579
- cqe64 = (cq -> cqe_sz == 64 ) ? cqe : cqe + 64 ;
580
- if (free_res_cqe (cqe64 , rsn , cqe_version )) {
549
+ qp_id_combined = __le16_to_cpu (* (u16 * )((void * )cqe + 1 ));
550
+ qp_id = qp_id_combined & 0x7fff ;
551
+ if (qpn == qp_id ) {
581
552
++ nfreed ;
582
553
} else if (nfreed ) {
583
554
dest = get_cqe (cq ,
584
555
(prod_index + nfreed ) &
585
556
(cq -> verbs_cq .cq_ex .cqe - 1 ));
586
- dest64 = (cq -> cqe_sz == 64 ) ? dest : dest + 64 ;
587
- owner_bit = dest64 -> op_own & XSC_CQE_OWNER_MASK ;
588
557
memcpy (dest , cqe , cq -> cqe_sz );
589
- dest64 -> op_own = owner_bit |
590
- (dest64 -> op_own & ~XSC_CQE_OWNER_MASK );
591
558
}
592
559
}
593
560
0 commit comments