Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDMA/bnxt_re: Get the toggle bits from SRQ events

SRQ arming requires the toggle bits received from hardware.
Get the toggle bits from SRQ notification for the
gen p7 adapters. This value will be zero for the older adapters.

Signed-off-by: Hongguang Gao <hongguang.gao@broadcom.com>
Signed-off-by: Chandramohan Akula <chandramohan.akula@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Link: https://patch.msgid.link/1724945645-14989-2-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Hongguang Gao and committed by
Leon Romanovsky
640c2cf8 e012316d

+13
+1
drivers/infiniband/hw/bnxt_re/ib_verbs.h
··· 77 77 struct bnxt_qplib_srq qplib_srq; 78 78 struct ib_umem *umem; 79 79 spinlock_t lock; /* protect srq */ 80 + void *uctx_srq_page; 80 81 }; 81 82 82 83 struct bnxt_re_qp {
+11
drivers/infiniband/hw/bnxt_re/qplib_fp.c
··· 54 54 #include "qplib_rcfw.h" 55 55 #include "qplib_sp.h" 56 56 #include "qplib_fp.h" 57 + #include <rdma/ib_addr.h> 58 + #include "bnxt_ulp.h" 59 + #include "bnxt_re.h" 60 + #include "ib_verbs.h" 57 61 58 62 static void __clean_cq(struct bnxt_qplib_cq *cq, u64 qp); 59 63 ··· 351 347 case NQ_BASE_TYPE_SRQ_EVENT: 352 348 { 353 349 struct bnxt_qplib_srq *srq; 350 + struct bnxt_re_srq *srq_p; 354 351 struct nq_srq_event *nqsrqe = 355 352 (struct nq_srq_event *)nqe; 356 353 ··· 359 354 q_handle |= (u64)le32_to_cpu(nqsrqe->srq_handle_high) 360 355 << 32; 361 356 srq = (struct bnxt_qplib_srq *)q_handle; 357 + srq->toggle = (le16_to_cpu(nqe->info10_type) & NQ_CN_TOGGLE_MASK) 358 + >> NQ_CN_TOGGLE_SFT; 359 + srq->dbinfo.toggle = srq->toggle; 360 + srq_p = container_of(srq, struct bnxt_re_srq, qplib_srq); 361 + if (srq_p->uctx_srq_page) 362 + *((u32 *)srq_p->uctx_srq_page) = srq->toggle; 362 363 bnxt_qplib_armen_db(&srq->dbinfo, 363 364 DBC_DBC_TYPE_SRQ_ARMENA); 364 365 if (nq->srqn_handler(nq,
+1
drivers/infiniband/hw/bnxt_re/qplib_fp.h
··· 105 105 struct bnxt_qplib_sg_info sg_info; 106 106 u16 eventq_hw_ring_id; 107 107 spinlock_t lock; /* protect SRQE link list */ 108 + u8 toggle; 108 109 }; 109 110 110 111 struct bnxt_qplib_sge {