Commit 6027c20d authored by Selvin Xavier's avatar Selvin Xavier Committed by Leon Romanovsky

RDMA/bnxt_re: Get the toggle bits from CQ completions

Get the toggle bits from CQ completions. For older adapters
these values are 0.
Signed-off-by: default avatarSelvin Xavier <selvin.xavier@broadcom.com>
Link: https://lore.kernel.org/r/1701946060-13931-5-git-send-email-selvin.xavier@broadcom.comSigned-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 880a5dd1
...@@ -330,6 +330,9 @@ static void bnxt_qplib_service_nq(struct tasklet_struct *t) ...@@ -330,6 +330,9 @@ static void bnxt_qplib_service_nq(struct tasklet_struct *t)
cq = (struct bnxt_qplib_cq *)(unsigned long)q_handle; cq = (struct bnxt_qplib_cq *)(unsigned long)q_handle;
if (!cq) if (!cq)
break; break;
cq->toggle = (le16_to_cpu(nqe->info10_type) &
NQ_CN_TOGGLE_MASK) >> NQ_CN_TOGGLE_SFT;
cq->dbinfo.toggle = cq->toggle;
bnxt_qplib_armen_db(&cq->dbinfo, bnxt_qplib_armen_db(&cq->dbinfo,
DBC_DBC_TYPE_CQ_ARMENA); DBC_DBC_TYPE_CQ_ARMENA);
spin_lock_bh(&cq->compl_lock); spin_lock_bh(&cq->compl_lock);
...@@ -2124,6 +2127,8 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq) ...@@ -2124,6 +2127,8 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq)
cq->dbinfo.xid = cq->id; cq->dbinfo.xid = cq->id;
cq->dbinfo.db = cq->dpi->dbr; cq->dbinfo.db = cq->dpi->dbr;
cq->dbinfo.priv_db = res->dpi_tbl.priv_db; cq->dbinfo.priv_db = res->dpi_tbl.priv_db;
cq->dbinfo.flags = 0;
cq->dbinfo.toggle = 0;
bnxt_qplib_armen_db(&cq->dbinfo, DBC_DBC_TYPE_CQ_ARMENA); bnxt_qplib_armen_db(&cq->dbinfo, DBC_DBC_TYPE_CQ_ARMENA);
...@@ -3018,6 +3023,7 @@ int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe, ...@@ -3018,6 +3023,7 @@ int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe,
void bnxt_qplib_req_notify_cq(struct bnxt_qplib_cq *cq, u32 arm_type) void bnxt_qplib_req_notify_cq(struct bnxt_qplib_cq *cq, u32 arm_type)
{ {
cq->dbinfo.toggle = cq->toggle;
if (arm_type) if (arm_type)
bnxt_qplib_ring_db(&cq->dbinfo, arm_type); bnxt_qplib_ring_db(&cq->dbinfo, arm_type);
/* Using cq->arm_state variable to track whether to issue cq handler */ /* Using cq->arm_state variable to track whether to issue cq handler */
......
...@@ -418,6 +418,7 @@ struct bnxt_qplib_cq { ...@@ -418,6 +418,7 @@ struct bnxt_qplib_cq {
bool resize_in_progress; bool resize_in_progress;
struct bnxt_qplib_sg_info sg_info; struct bnxt_qplib_sg_info sg_info;
u64 cq_handle; u64 cq_handle;
u8 toggle;
#define CQ_RESIZE_WAIT_TIME_MS 500 #define CQ_RESIZE_WAIT_TIME_MS 500
unsigned long flags; unsigned long flags;
......
...@@ -190,6 +190,7 @@ struct bnxt_qplib_db_info { ...@@ -190,6 +190,7 @@ struct bnxt_qplib_db_info {
u32 xid; u32 xid;
u32 max_slot; u32 max_slot;
u32 flags; u32 flags;
u8 toggle;
}; };
enum bnxt_qplib_db_info_flags_mask { enum bnxt_qplib_db_info_flags_mask {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment