Skip to content

Commit 640c2cf

Browse files
hgao656rleon
authored andcommitted
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 <[email protected]> Signed-off-by: Chandramohan Akula <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent e012316 commit 640c2cf

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

drivers/infiniband/hw/bnxt_re/ib_verbs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ struct bnxt_re_srq {
7777
struct bnxt_qplib_srq qplib_srq;
7878
struct ib_umem *umem;
7979
spinlock_t lock; /* protect srq */
80+
void *uctx_srq_page;
8081
};
8182

8283
struct bnxt_re_qp {

drivers/infiniband/hw/bnxt_re/qplib_fp.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
#include "qplib_rcfw.h"
5555
#include "qplib_sp.h"
5656
#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"
5761

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

@@ -347,13 +351,20 @@ static void bnxt_qplib_service_nq(struct tasklet_struct *t)
347351
case NQ_BASE_TYPE_SRQ_EVENT:
348352
{
349353
struct bnxt_qplib_srq *srq;
354+
struct bnxt_re_srq *srq_p;
350355
struct nq_srq_event *nqsrqe =
351356
(struct nq_srq_event *)nqe;
352357

353358
q_handle = le32_to_cpu(nqsrqe->srq_handle_low);
354359
q_handle |= (u64)le32_to_cpu(nqsrqe->srq_handle_high)
355360
<< 32;
356361
srq = (struct bnxt_qplib_srq *)q_handle;
362+
srq->toggle = (le16_to_cpu(nqe->info10_type) & NQ_CN_TOGGLE_MASK)
363+
>> NQ_CN_TOGGLE_SFT;
364+
srq->dbinfo.toggle = srq->toggle;
365+
srq_p = container_of(srq, struct bnxt_re_srq, qplib_srq);
366+
if (srq_p->uctx_srq_page)
367+
*((u32 *)srq_p->uctx_srq_page) = srq->toggle;
357368
bnxt_qplib_armen_db(&srq->dbinfo,
358369
DBC_DBC_TYPE_SRQ_ARMENA);
359370
if (nq->srqn_handler(nq,

drivers/infiniband/hw/bnxt_re/qplib_fp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ struct bnxt_qplib_srq {
105105
struct bnxt_qplib_sg_info sg_info;
106106
u16 eventq_hw_ring_id;
107107
spinlock_t lock; /* protect SRQE link list */
108+
u8 toggle;
108109
};
109110

110111
struct bnxt_qplib_sge {

0 commit comments

Comments
 (0)