mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] octeontx2-af: skip CPT ctx flush command when no CPT LFs are attached
@ 2026-10-26  9:10 kmahammadraf
  2026-10-26  9:16 ` netdev-bot+sinfo
  0 siblings, 1 reply; 2+ messages in thread
From: kmahammadraf @ 2026-10-26  9:10 UTC (permalink / raw)
  To: linux-kernel, netdev
  Cc: Sunil Goutham, Ratheesh Kannoth, Geetha sowjanya,
	Subbaraya Sundeep, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Srujana Challa, kmahammadraf

From: Srujana Challa <schalla@marvell.com>

CPT inline inbound LF command submission was attempted even when no CPT
LFs were mapped to the CPT PF. In that case, sending the uplink mailbox
message is unnecessary and can lead to avoidable failures/timeouts during
CPT context flush flow.

Add a guard in cpt_inline_inb_lf_cmd_send() to check mapped CPT LF count
for the CPT PF and return early when it is zero.

Signed-off-by: kmahammadraf <kmahammadraf@marvell.com>
Signed-off-by: Srujana Challa <schalla@marvell.com>
---
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c
index f404117bf6c8..751643176c6d 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c
@@ -1144,15 +1144,23 @@ int rvu_cpt_lf_teardown(struct rvu *rvu, u16 pcifunc, int blkaddr, int lf, int s
 static int cpt_inline_inb_lf_cmd_send(struct rvu *rvu, int blkaddr,
 				      int nix_blkaddr)
 {
-	int cpt_pf_num = rvu->cpt_pf_num;
+	int cpt_pf_num = rvu->cpt_pf_num, num_lfs;
 	struct cpt_inst_lmtst_req *req;
 	dma_addr_t res_daddr;
 	int timeout = 3000;
+	u16 pcifunc;
 	u8 cpt_idx;
 	u64 *inst;
 	u16 *res;
 	int rc;
 
+	pcifunc = (cpt_pf_num & RVU_OTX2_PFVF_PF_MASK) <<
+	      RVU_OTX2_PFVF_PF_SHIFT;
+	num_lfs = rvu_get_rsrc_mapcount(rvu_get_pfvf(rvu, pcifunc),
+					blkaddr);
+	if (num_lfs == 0)
+		return 0;
+
 	res = kzalloc(CPT_RES_LEN, GFP_KERNEL);
 	if (!res)
 		return -ENOMEM;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-26  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26  9:10 [PATCH net] octeontx2-af: skip CPT ctx flush command when no CPT LFs are attached kmahammadraf
2026-10-26  9:16 ` netdev-bot+sinfo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®