🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21116

Re: [PATCH net-next v11 3/4] net: mana: support concurrent HWC requests

#21116
From: Wei Hu
Date: Mon, 23 Nov 2026 15:21
45 lines
10324 bytes
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
Technical Details
Message-ID: <20261122064231.hwc-v11-netdev-p3.weh@linux.microsoft.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369524-linux-kernel-netdev=dewy.ru
References: <45db2acd8f03421191f5b3a9f4bd7ce9e9259b33.1794751992.git.weh@linux.microsoft.com> <179527857180.3135.15262062177473658662@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369524-linux-kernel-netdev=dewy.ru
From: weh@linux.microsoft.com (Wei Hu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v11 3/4] net: mana: support concurrent HWC requests
Date: Mon, 23 Nov 2026 15:21:45 +0000
Organization: Usenet Network
Message-ID: <20261122064231.hwc-v11-netdev-p3.weh@linux.microsoft.com>
References: <45db2acd8f03421191f5b3a9f4bd7ce9e9259b33.1794751992.git.weh@linux.microsoft.com> <179527857180.3135.15262062177473658662@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3912618"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:brPYY3Yf6BojX9Hk3DxPDx64cko= sha256:UQJ6Y0ZEwI8oruXAfgY68qu5MgnAQKGNtmMd87LuUb4=
	sha1:dARmq6d3G5Wap1h3WlVIdsBF3sA= sha256:b44BTOupsRba5eP2ck5E70YczXOmG9FPf4cJzZgruGU=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 8803D125DBC; Mon, 23 Nov 2026 18:22:58 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.microsoft.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id jpm-hv1QpT24;
	Mon, 23 Nov 2026 18:22:55 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369524-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 83A4C125DB9; Mon, 23 Nov 2026 18:22:43 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 1A13A36E9F; Mon, 23 Nov 2026 15:22:01 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
	t=1795447315;
	b=KxUVfTLXr4+Tcwk3k2hEWqANqiQGk9n2q6S7dPdmJLaTyaVqf2iul5876cxdA6EUBFx1
	 P+MBiL55FsLUoG0GgjhQwzLcjxqZCqEhFwPgtpFXG7j1l8Xkcex2cVOTS6sGxjXNR3FRb
	 /z7DxPQOknrmsayFHcvE8sP5fLHed6y1qFj513nsS6DEdAexjZCQY2++QhspCRdzkUTE2
	 gE8qRb1oEzomUpCPmNzs+wT8p5EBURAMLAnpCIA6+K/u8dJxBmbKR8GpfR+knIKng/2De
	 QcBS+WYCEslgMqsakaor5fVyqSTIhuePG/rqPGBXJe3icHOfEy7ulxsrCrpDtNNKiug==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795447315;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Filter:
	 DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 In-Reply-To:References:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=2Sx7YyQZhZSyc1/RwYOc4ocxELc/8nu4dZNulzsCBGA=;
	b=zSY14uukUUKZ3kvKTriQ3/wOA1ne1Bj3fK2Gi+ixKKaRuplQs9QI9asHr6zEJBDIyS59
	 pHpVK5lMBiU/vXgIdIVhZssGCB6PO6w/B83pfXk3/350n5+ktnm5NSTJ9Gx+bi+Arp95D
	 ERuf0YJb0PioQ46ORg8sJounauRiX7VVTNiRkGcVi1OBPGXWFAluwHteHy9Gs+TDx/5qe
	 jEMaWQieFr78qb/UA6+615Bsb74uEf0Y8kxYE8uwt1/hJ8xl+Wtgx/FbLyiU4vpULxSd0
	 Ut7jhSqQN3D2q6lhRyrTueAxW7hjnVRz/zUAWu1+V27qHKcwq/L08pBVOB8YEpJcJ3g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=gml5r+EH;
	dmarc=pass header.from=linux.microsoft.com;
	spf=pass smtp.mailfrom=linux.microsoft.com;
	arc=fail smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 8663E606A692;
	Mon, 23 Nov 2026 15:21:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=gml5r+EH
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=13.77.154.182
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795447314;
	b=UdW2g3awP7ha4ufMoikG6UQCgRjm7xY89SjimgP+3U3scHN4wbCdKS2VH2XhHQ75Kirp
	 kUFNJsyEoOkPTI477HNUPJ8xmJLDGNpd0vP1cX1tHqLGhEUyYYdJuAo9c896/UCQTNyGk
	 hSbOQNfO0mCmkbMQrWS/3I4xQR6++G5qcDB7wVCiLqXqLz/4JObFP7F4wYPEq9RsEHHdc
	 5pgq5iQ6hwaSfiFlEu9fi8hFBlRujAK52uA9042JrGTrZGkOfD4/As1ZlNjqntJkWZeBA
	 KiHioxtfS74esv7m+EArSUGcWl+npFdZ39JGcxwdksusHJw6aaMfqZjD63UNfKqg7Ug==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795447314;
	h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding:X-Spam-Status:X-Spam-Checker-Version;
	bh=2Sx7YyQZhZSyc1/RwYOc4ocxELc/8nu4dZNulzsCBGA=;
	b=p/8I1JJy5f+Ha5b0z169NoTvbR9LhhIhUfN5wiwI6Eyvrwa1ekXCyJHwnKOW9UYFZZEz
	 ll+zuzZeSR//wUx531/dvWxbIqYtr31iZMLLgPGGMSRCn151Cy18U1TdZX6kEsn4DXGXY
	 VpqOR6nfjmroFmpWKigu/YEGOq7w9pm6xhPg0uSKqwaMjJ1QJrGMrDbjTmmKydf9E2Tjw
	 tHi8Wwyq6dVKdKLpvXXf3qf4SrTCySX42/JxhU8mV9LRLLKTFUftRaCxOI3dexEpYjhWi
	 f1olQ96+1OEEgHIQEF05TbimuBB8iTeOVwXNdza1S7OniV7NoiSyHyDO5uJEJX9SJ3A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.microsoft.com;
	spf=pass smtp.mailfrom=linux.microsoft.com;
	dkim=pass header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=gml5r+EH;
	arc=none smtp.remote-ip=13.77.154.182
X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 62455606A693;
	Mon, 23 Nov 2026 15:21:54 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 62455606A693
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
X-Received: from weh-cvm-dev-vm.y50bckvjo0hefgfnzfztsfttff.phxx.internal.cloudapp.net (unknown [20.169.55.37])
	by linux.microsoft.com (Postfix) with ESMTPSA id 2D89720B7169;
	Mon, 23 Nov 2026 07:21:49 -0800 (PST)
X-DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2D89720B7169
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1795447310;
	bh=2Sx7YyQZhZSyc1/RwYOc4ocxELc/8nu4dZNulzsCBGA=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=gml5r+EH5ZpXCV/ikVL7acA1DS3gS53lk4MSyL8ogaPJvspgxwG3BnmuZdU02kHmi
	 t4DFQNL1hZ2BAWj+VATZbvcxoKdwuZPlGHX8WWDI37UV1oHvBHfyBOaLu148FZ4Oi/
	 CVmsRmGKGzIRibd8gL2eyOc7FcsOmEXvQ9Ts4JeU=
X-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
X-Mailer: git-send-email 2.43.0
X-In-Reply-To: <179527857180.3135.15262062177473658662@kernel.org>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list