The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Wei Hu <weh@linux.microsoft.com>
To: netdev-bot+sashiko@kernel.org
Cc: longli@kernel.org, kotaranov@microsoft.com, kuba@kernel.org,
	davem@davemloft.net, pabeni@redhat.com, edumazet@google.com,
	andrew+netdev@lunn.ch, jgg@ziepe.ca, leon@kernel.org,
	haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com,
	shradhagupta@linux.microsoft.com, horms@kernel.org,
	ernis@linux.microsoft.com, stephen@networkplumber.org,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
	gargaditya@linux.microsoft.com, kees+treewide@kernel.org,
	kees@kernel.org, mawasthi@linux.microsoft.com, weh@microsoft.com,
	edumazet@kernel.org
Subject: Re: [PATCH net-next v11 3/4] net: mana: support concurrent HWC requests
Date: Mon, 23 Nov 2026 15:21:45 +0000	[thread overview]
Message-ID: <20261122064231.hwc-v11-netdev-p3.weh@linux.microsoft.com> (raw)
In-Reply-To: <179527857180.3135.15262062177473658662@kernel.org>

On Sat, Nov 21, 2026, netdev-bot+sashiko wrote:
> Can this leave a dangling CQ callback for kernel CQs, which then runs on
> freed memory?

Yes. ib_free_cq() can free the CQ even when destroy returns an error.
I removed the v11 early return so the normal CQ teardown withdraws the
callback. This doesn't fix the separate upstream race with a reader of
the RDMA CQ table.

> Can a rejected destroy here leave the driver tracking a QP that the
> RDMA core then frees anyway?

Yes. V12 also drops the QP early return: teardown removes the QP from
the driver's table and CQ lists rather than relying on a retry.

> Does this leak the GIC reference when the rejected command was not the
> EQ disable?

Yes. V12 restores the upstream EQ-create unwind. If creating the EQ
fails, its caller drops the IRQ-context reference; it doesn't use the
HWC error code to decide whether to keep it.

> What releases this retained GIC reference later?

V12 doesn't retain that extra reference on EQ teardown. The last
mana_gd_put_gic() unregisters the handler before freeing a dynamic
MSI-X vector.

> After the continue, what still points to the retained tx_qp[i]?

Nothing in v11 once the parent is freed. V12 keeps the upstream
Ethernet TX, RX and EQ teardown instead of retaining those queues.

At the normal response timeout of a posted HWC command, the PF has
drained DMA to the old queues and packet buffers, as well as interrupt
writes. Unanswered commands haven't taken effect. V12 stops posting on
that HWC and won't accept a handle from a late reply. A reset notice,
a failed post or a wait for a free slot gives no such guarantee. The
HWC's own rings and buffers still require a DESTROY_HWC ack.

Thanks,
Wei

pw-bot: cr

  reply	other threads:[~2026-11-23 15:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 16:00 [PATCH net-next v11 0/4] net: mana: concurrent HWC requests and dynamic queue depth Wei Hu
2026-11-17 16:00 ` [PATCH net-next v11 1/4] net: mana: prepare HWC ownership for safe reinitialization Wei Hu
2026-11-21 16:29   ` netdev-bot+sashiko
2026-11-23 15:21     ` Wei Hu
2026-11-17 16:00 ` [PATCH net-next v11 2/4] net: mana: give each HWC message slot its own completion state Wei Hu
2026-11-21 16:29   ` netdev-bot+sashiko
2026-11-17 16:01 ` [PATCH net-next v11 3/4] net: mana: support concurrent HWC requests Wei Hu
2026-11-17 18:07   ` Leon Romanovsky
2026-11-23 14:53     ` Wei Hu
2026-11-21 16:29   ` netdev-bot+sashiko
2026-11-23 15:21     ` Wei Hu [this message]
2026-11-17 16:01 ` [PATCH net-next v11 4/4] net: mana: add dynamic HWC queue depth with reinit path Wei Hu
2026-11-17 18:09   ` Leon Romanovsky
2026-11-23 14:54     ` Wei Hu
2026-11-21 16:29   ` netdev-bot+sashiko
2026-11-23 15:21     ` Wei Hu
2026-11-17 16:03 ` [PATCH net-next v11 0/4] net: mana: concurrent HWC requests and dynamic queue depth netdev-bot+sinfo

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=20261122064231.hwc-v11-netdev-p3.weh@linux.microsoft.com \
    --to=weh@linux.microsoft.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=edumazet@kernel.org \
    --cc=ernis@linux.microsoft.com \
    --cc=gargaditya@linux.microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=horms@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=kees+treewide@kernel.org \
    --cc=kees@kernel.org \
    --cc=kotaranov@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=longli@kernel.org \
    --cc=mawasthi@linux.microsoft.com \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shradhagupta@linux.microsoft.com \
    --cc=stephen@networkplumber.org \
    --cc=weh@microsoft.com \
    --cc=wei.liu@kernel.org \
    /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