Commit 640c2cf8 authored by Hongguang Gao's avatar Hongguang Gao Committed by Leon Romanovsky
Browse files

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: default avatarHongguang Gao <hongguang.gao@broadcom.com>
Signed-off-by: default avatarChandramohan Akula <chandramohan.akula@broadcom.com>
Signed-off-by: default avatarSelvin Xavier <selvin.xavier@broadcom.com>
Link: https://patch.msgid.link/1724945645-14989-2-git-send-email-selvin.xavier@broadcom.com


Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent e012316d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ struct bnxt_re_srq {
	struct bnxt_qplib_srq	qplib_srq;
	struct ib_umem		*umem;
	spinlock_t		lock;		/* protect srq */
	void			*uctx_srq_page;
};

struct bnxt_re_qp {
+11 −0
Original line number Diff line number Diff line
@@ -54,6 +54,10 @@
#include "qplib_rcfw.h"
#include "qplib_sp.h"
#include "qplib_fp.h"
#include <rdma/ib_addr.h>
#include "bnxt_ulp.h"
#include "bnxt_re.h"
#include "ib_verbs.h"

static void __clean_cq(struct bnxt_qplib_cq *cq, u64 qp);

@@ -347,6 +351,7 @@ static void bnxt_qplib_service_nq(struct tasklet_struct *t)
		case NQ_BASE_TYPE_SRQ_EVENT:
		{
			struct bnxt_qplib_srq *srq;
			struct bnxt_re_srq *srq_p;
			struct nq_srq_event *nqsrqe =
						(struct nq_srq_event *)nqe;

@@ -354,6 +359,12 @@ static void bnxt_qplib_service_nq(struct tasklet_struct *t)
			q_handle |= (u64)le32_to_cpu(nqsrqe->srq_handle_high)
				     << 32;
			srq = (struct bnxt_qplib_srq *)q_handle;
			srq->toggle = (le16_to_cpu(nqe->info10_type) & NQ_CN_TOGGLE_MASK)
				      >> NQ_CN_TOGGLE_SFT;
			srq->dbinfo.toggle = srq->toggle;
			srq_p = container_of(srq, struct bnxt_re_srq, qplib_srq);
			if (srq_p->uctx_srq_page)
				*((u32 *)srq_p->uctx_srq_page) = srq->toggle;
			bnxt_qplib_armen_db(&srq->dbinfo,
					    DBC_DBC_TYPE_SRQ_ARMENA);
			if (nq->srqn_handler(nq,
+1 −0
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ struct bnxt_qplib_srq {
	struct bnxt_qplib_sg_info	sg_info;
	u16				eventq_hw_ring_id;
	spinlock_t			lock; /* protect SRQE link list */
	u8				toggle;
};

struct bnxt_qplib_sge {