public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Aditya Garg <gargaditya@linux•microsoft.com>
To: kys@microsoft•com, haiyangz@microsoft•com, wei.liu@kernel•org,
	decui@microsoft•com, longli@microsoft•com, andrew+netdev@lunn•ch,
	davem@davemloft•net, edumazet@google•com, kuba@kernel•org,
	pabeni@redhat•com, horms@kernel•org,
	shradhagupta@linux•microsoft.com, dipayanroy@linux•microsoft.com,
	ernis@linux•microsoft.com, kees@kernel•org,
	shacharr@microsoft•com, stephen@networkplumber•org,
	gargaditya@microsoft•com, gargaditya@linux•microsoft.com,
	ssengar@linux•microsoft.com, linux-hyperv@vger•kernel.org,
	netdev@vger•kernel.org, linux-kernel@vger•kernel.org
Subject: [PATCH net 2/2] net: mana: guard TX wq object destroy with INVALID_MANA_HANDLE check
Date: Thu,  4 Jun 2026 01:01:26 -0700	[thread overview]
Message-ID: <20260604080137.1995269-3-gargaditya@linux.microsoft.com> (raw)
In-Reply-To: <20260604080137.1995269-1-gargaditya@linux.microsoft.com>

mana_create_txq() has several error paths (after mana_alloc_queues() or
mana_create_wq_obj() failure) where tx_qp[i]->tx_object stays as the
INVALID_MANA_HANDLE sentinel set at allocation. mana_destroy_txq() then
unconditionally calls mana_destroy_wq_obj() with (u64)-1, which firmware
rejects and logs an error.

Mirror the RX-side pattern in mana_destroy_rxq() and skip the destroy
when the handle is still INVALID_MANA_HANDLE.

Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Signed-off-by: Aditya Garg <gargaditya@linux•microsoft.com>
Reviewed-by: Dipayaan Roy <dipayanroy@linux•microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft•com>
---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index db14357d3732..4a2cd800111e 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -2351,7 +2351,8 @@ static void mana_destroy_txq(struct mana_port_context *apc)
 			netif_napi_del_locked(napi);
 			apc->tx_qp[i]->txq.napi_initialized = false;
 		}
-		mana_destroy_wq_obj(apc, GDMA_SQ, apc->tx_qp[i]->tx_object);
+		if (apc->tx_qp[i]->tx_object != INVALID_MANA_HANDLE)
+			mana_destroy_wq_obj(apc, GDMA_SQ, apc->tx_qp[i]->tx_object);
 
 		mana_deinit_cq(apc, &apc->tx_qp[i]->tx_cq);
 
-- 
2.43.0


  parent reply	other threads:[~2026-06-04  8:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04  8:01 [PATCH net 0/2] net: mana: fix error-path issues in queue setup Aditya Garg
2026-06-04  8:01 ` [PATCH net 1/2] net: mana: initialize gdma queue id to INVALID_QUEUE_ID Aditya Garg
2026-06-04  8:01 ` Aditya Garg [this message]
2026-06-06  1:27 ` [PATCH net 0/2] net: mana: fix error-path issues in queue setup Jakub Kicinski

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=20260604080137.1995269-3-gargaditya@linux.microsoft.com \
    --to=gargaditya@linux$(echo .)microsoft.com \
    --cc=andrew+netdev@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=decui@microsoft$(echo .)com \
    --cc=dipayanroy@linux$(echo .)microsoft.com \
    --cc=edumazet@google$(echo .)com \
    --cc=ernis@linux$(echo .)microsoft.com \
    --cc=gargaditya@microsoft$(echo .)com \
    --cc=haiyangz@microsoft$(echo .)com \
    --cc=horms@kernel$(echo .)org \
    --cc=kees@kernel$(echo .)org \
    --cc=kuba@kernel$(echo .)org \
    --cc=kys@microsoft$(echo .)com \
    --cc=linux-hyperv@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=longli@microsoft$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=shacharr@microsoft$(echo .)com \
    --cc=shradhagupta@linux$(echo .)microsoft.com \
    --cc=ssengar@linux$(echo .)microsoft.com \
    --cc=stephen@networkplumber$(echo .)org \
    --cc=wei.liu@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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