From: ALOK TIWARI <alok.a.tiwari@oracle.com>
To: sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com,
bbhushan2@marvell.com, Hariprasad Kelam <hkelam@marvell.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: [bug query] octeontx2/cn10k: CPT LF IQ drain loop compares DQ_PTR twice
Date: Tue, 13 Jan 2026 22:24:48 +0530 [thread overview]
Message-ID: <a3fd45b2-bfed-4780-8351-a99f640df87f@oracle.com> (raw)
Hi Bharat,
In cn10k_outb_cptlf_iq_disable(), there is a potential issue in the
instruction queue drain loop.
The code reads CN10K_CPT_LF_Q_GRP_PTR and compares nq_ptr and dq_ptr to
check whether the queue is empty.
However, both values are extracted using CPT_LF_Q_GRP_PTR_DQ_PTR, so the
comparison is ineffective and may allow the loop to exit while entries
are still pending.
The fix extracts nq_ptr using CPT_LF_Q_GRP_PTR_NQ_PTR, which correctly
compares the enqueue and dequeue pointers.
Diff:
- nq_ptr = FIELD_GET(CPT_LF_Q_GRP_PTR_DQ_PTR, reg_val);
+ nq_ptr = FIELD_GET(CPT_LF_Q_GRP_PTR_NQ_PTR, reg_val);
Please confirm whether CPT_LF_Q_GRP_PTR_NQ_PTR is the correct enqueue
pointer for CN10K CPT LF.
Fixes: fe079ab05d49 ("cn10k-ipsec: Init hardware for outbound ipsec
crypto offload")
Thanks,
Alok
---
--- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c
@@ -195,7 +195,7 @@ static void cn10k_outb_cptlf_iq_disable(struct
otx2_nic *pf)
else
cnt++;
reg_val = otx2_read64(pf, CN10K_CPT_LF_Q_GRP_PTR);
- nq_ptr = FIELD_GET(CPT_LF_Q_GRP_PTR_DQ_PTR, reg_val);
+ nq_ptr = FIELD_GET(CPT_LF_Q_GRP_PTR_NQ_PTR, reg_val);
dq_ptr = FIELD_GET(CPT_LF_Q_GRP_PTR_DQ_PTR, reg_val);
} while ((cnt < 10) && (nq_ptr != dq_ptr));
reply other threads:[~2026-01-13 16:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a3fd45b2-bfed-4780-8351-a99f640df87f@oracle.com \
--to=alok.a.tiwari@oracle.com \
--cc=andrew+netdev@lunn.ch \
--cc=bbhushan2@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox