]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/mana_ib: implement req_notify_cq
authorKonstantin Taranov <kotaranov@microsoft.com>
Mon, 20 Jan 2025 17:27:16 +0000 (09:27 -0800)
committerLeon Romanovsky <leon@kernel.org>
Tue, 4 Feb 2025 13:27:03 +0000 (08:27 -0500)
Arm a CQ when req_notify_cq is called.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Link: https://patch.msgid.link/1737394039-28772-11-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Shiraz Saleem <shirazsaleem@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mana/cq.c
drivers/infiniband/hw/mana/device.c
drivers/infiniband/hw/mana/mana_ib.h
drivers/net/ethernet/microsoft/mana/gdma_main.c

index d26d82d9f8ce6457d5d7e31882c2b4b5dad9cd93..82f14623f83c3fc38d907d67d36fa142fab47319 100644 (file)
@@ -168,3 +168,15 @@ void mana_ib_remove_cq_cb(struct mana_ib_dev *mdev, struct mana_ib_cq *cq)
        kfree(gc->cq_table[cq->queue.id]);
        gc->cq_table[cq->queue.id] = NULL;
 }
+
+int mana_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
+{
+       struct mana_ib_cq *cq = container_of(ibcq, struct mana_ib_cq, ibcq);
+       struct gdma_queue *gdma_cq = cq->queue.kmem;
+
+       if (!gdma_cq)
+               return -EINVAL;
+
+       mana_gd_ring_cq(gdma_cq, SET_ARM_BIT);
+       return 0;
+}
index 6fa5d7e2d0edf2f2205c3c2fb7b528c1ee45c873..637bc9833325a513e7882590f67674b804f63f67 100644 (file)
@@ -47,6 +47,7 @@ static const struct ib_device_ops mana_ib_dev_ops = {
        .query_pkey = mana_ib_query_pkey,
        .query_port = mana_ib_query_port,
        .reg_user_mr = mana_ib_reg_user_mr,
+       .req_notify_cq = mana_ib_arm_cq,
 
        INIT_RDMA_OBJ_SIZE(ib_ah, mana_ib_ah, ibah),
        INIT_RDMA_OBJ_SIZE(ib_cq, mana_ib_cq, ibcq),
index 6265c39eeff6d3aa577b35d8acd66b24e8aaedc6..bd34ad608a37921d6eb087dc337567981101c2e3 100644 (file)
@@ -595,4 +595,6 @@ int mana_ib_post_recv(struct ib_qp *ibqp, const struct ib_recv_wr *wr,
                      const struct ib_recv_wr **bad_wr);
 int mana_ib_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr,
                      const struct ib_send_wr **bad_wr);
+
+int mana_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags);
 #endif
index a67d4d16c6a7276bfa548c0dfaae42caa3daab90..e032c9f9f7c24d8d2c6c7724cf407885aac505ed 100644 (file)
@@ -344,6 +344,7 @@ void mana_gd_ring_cq(struct gdma_queue *cq, u8 arm_bit)
        mana_gd_ring_doorbell(gc, cq->gdma_dev->doorbell, cq->type, cq->id,
                              head, arm_bit);
 }
+EXPORT_SYMBOL_NS(mana_gd_ring_cq, "NET_MANA");
 
 static void mana_gd_process_eqe(struct gdma_queue *eq)
 {