Skip to content

Commit 478bd31

Browse files
committed
libxscale: Add support for posting verbs
This patch adds support for post_send and post_recv routines. Signed-off-by: Tian Xin <tianx@yunsilicon.com> Signed-off-by: Wei Honggang <weihg@yunsilicon.com> Signed-off-by: Zhao Qianwei <zhaoqw@yunsilicon.com> Signed-off-by: Li Qiang <liq@yunsilicon.com> Signed-off-by: Yan Lei <jacky@yunsilicon.com>
1 parent fbeac06 commit 478bd31

File tree

3 files changed

+496
-40
lines changed

3 files changed

+496
-40
lines changed

providers/xscale/cq.c

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ static void *get_sw_cqe(struct xsc_cq *cq, int n)
112112
return NULL;
113113
}
114114

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-
120115
static void update_cons_index(struct xsc_cq *cq)
121116
{
122117
struct xsc_context *ctx =
@@ -519,38 +514,11 @@ int xsc_free_cq_buf(struct xsc_context *ctx, struct xsc_buf *buf)
519514
return xsc_free_actual_buf(ctx, buf);
520515
}
521516

522-
static int is_equal_rsn(struct xsc_cqe64 *cqe64, uint32_t rsn)
523-
{
524-
return rsn == (be32toh(cqe64->sop_drop_qpn) & 0xffffff);
525-
}
526-
527-
static inline int is_equal_uidx(struct xsc_cqe64 *cqe64, uint32_t uidx)
528-
{
529-
return uidx == (be32toh(cqe64->srqn_uidx) & 0xffffff);
530-
}
531-
532-
static inline int free_res_cqe(struct xsc_cqe64 *cqe64, uint32_t rsn,
533-
int cqe_version)
534-
{
535-
if (cqe_version) {
536-
if (is_equal_uidx(cqe64, rsn))
537-
return 1;
538-
} else {
539-
if (is_equal_rsn(cqe64, rsn))
540-
return 1;
541-
}
542-
543-
return 0;
544-
}
545-
546-
void __xsc_cq_clean(struct xsc_cq *cq, u32 rsn)
517+
void __xsc_cq_clean(struct xsc_cq *cq, u32 qpn)
547518
{
548519
u32 prod_index;
549520
int nfreed = 0;
550-
struct xsc_cqe64 *cqe64, *dest64;
551521
void *cqe, *dest;
552-
u8 owner_bit;
553-
int cqe_version;
554522

555523
if (!cq || cq->flags & XSC_CQ_FLAGS_DV_OWNED)
556524
return;
@@ -572,21 +540,15 @@ void __xsc_cq_clean(struct xsc_cq *cq, u32 rsn)
572540
* Now sweep backwards through the CQ, removing CQ entries
573541
* that match our QP by copying older entries on top of them.
574542
*/
575-
cqe_version = (to_xctx(cq->verbs_cq.cq_ex.context))->cqe_version;
576543
while ((int)(--prod_index) - (int)cq->cons_index >= 0) {
577544
cqe = get_cqe(cq, prod_index & (cq->verbs_cq.cq_ex.cqe - 1));
578-
cqe64 = (cq->cqe_sz == 64) ? cqe : cqe + 64;
579-
if (free_res_cqe(cqe64, rsn, cqe_version)) {
545+
if (qpn == __le32_to_cpu(((struct xsc_cqe *)cqe)->qp_id)) {
580546
++nfreed;
581547
} else if (nfreed) {
582548
dest = get_cqe(cq,
583549
(prod_index + nfreed) &
584550
(cq->verbs_cq.cq_ex.cqe - 1));
585-
dest64 = (cq->cqe_sz == 64) ? dest : dest + 64;
586-
owner_bit = dest64->op_own & XSC_CQE_OWNER_MASK;
587551
memcpy(dest, cqe, cq->cqe_sz);
588-
dest64->op_own = owner_bit |
589-
(dest64->op_own & ~XSC_CQE_OWNER_MASK);
590552
}
591553
}
592554

0 commit comments

Comments
 (0)