🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16653

Re: [PATCH net-next v10 1/4] net: mana: prepare HWC ownership for safe reinitialization

#16653
From: Wei Hu
Date: Sun, 15 Nov 2026 12:34
99 lines
13205 bytes
Thanks for the review.

Below are my responses, including the small follow-ups planned for v11.

> mana_hwc_establish_channel() passes &hwc->setup_active as submitted. What
> happens when the PF explicitly rejects ESTABLISH_HWC?

setup_active records that the PF may own the queues, not that ESTABLISH
succeeded. A nonzero status indicates failure, but I do not have a protocol
guarantee that a rejected ESTABLISH leaves no partially installed mappings.
Also, -EPROTO covers malformed replies as well as a reported failure.

I plan to leave this unchanged. Clearing ownership on that error would
allow freeing or reusing DMA without an acknowledged teardown or another
proven quiescence point. Distinguishing a validated rejection would only
justify that change if the PF guarantees transactional rollback.

> Is there anything that bounds this leak? On the PCI probe path, a failure
> with -ETIMEDOUT or -EPROTO frees gc via mana_gd_free_context() at free_gc.

The leak is real. Final disposal loses the allocation metadata, and it is
not bounded to one bundle across repeated fresh failed probes.

Retention is intentional when DESTROY_HWC has not been acknowledged:
freeing the allocations could expose reused pages to outstanding PF DMA.
I do not have a confirmed PF-side quiescence guarantee for these paths
merely from the calls that disable bus mastering.

I do not plan to add unconditional DMA freeing in this respin. A bounded
recovery or reclamation policy is a worthwhile separate improvement, but
it needs a verified quiescence contract. This is a safety trade-off, not a
claim that the allocation loss is harmless.

> What happens to a retained context across a device reset? Only an
> acknowledged DESTROY_HWC in mana_smc_teardown_hwc_locked() clears
> setup_active, but a reset discards the PF-side HWC state anyway.

The final premise is not established by the cited mana_serv_reset() path.
That path suspends, waits, and resumes; it does not itself execute or
confirm a hardware reset on every invocation. An all-ones aperture or the
service delay also does not acknowledge that all old PF mappings are gone.

I therefore plan to keep ownership tracking unchanged rather than clear
setup_active or switch reset_vf on this assumption. A confirmed reset that
invalidates those mappings could provide a reclamation point, but that
requires the corresponding PF/SMC reset contract.

> The commit is described as preparation for dynamic HWC sizing. Several of
> the changes, though, look like fixes for bugs that can be hit in the current
> driver:

Agreed that the existing failure-path and malformed-init bugs should be
identified explicitly. I will clarify that in the commit description and
include applicable, verified Fixes metadata. A stable backport needs the
dependency-complete fix subset, not an automatic backport of the whole
feature stack. I do not plan to restructure the series solely for this
Low finding.

> Two cases that used to WARN are now dropped silently: a completion for a CQ
> id at or above max_num_cqs, and an empty cq_table slot. The commit message
> does not mention this.

I will document the intended quiet drops and correct the stale WARN
reference in mana_destroy_txq(). That is a small description/comment
correction; I will not restore WARNs for these cases during teardown.

> Does this comment match the teardown order? In mana_hwc_destroy_channel()
> the table is withdrawn and freed before the HWC EQ is fenced:

The comment is misleading. Pointer withdrawal and the RCU grace period
protect the table before the later EQ fencing. I will correct the comment
to describe that ordering, without changing the teardown sequence.

> This is a pre-existing issue and was not introduced by this patch. Now that
> the RCU protection of cq_table is documented here, though, mana_ib does not
> seem to follow it.

The independent RDMA CQ callback publication/lifetime issue is
pre-existing. We will address it separately. The comment clarification
above is not a claim that the separate RDMA lifetime issue is fixed.

Regards,
Wei
Technical Details
Message-ID: <179457550417.109246.13409427822482979137.hwc-v10-all-reviews-p1@linux.microsoft.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-lon.pugleaf.net!srl.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-363697-linux-kernel-netdev=dewy.ru
References: <df083dc6ad8a8958398e04afe66ca2c5f4bfb040.1794208055.git.weh@linux.microsoft.com> <179455239601.2199510.13335902064048081755@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-lon.pugleaf.net!srl.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-363697-linux-kernel-netdev=dewy.ru
From: weh@linux.microsoft.com (Wei Hu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v10 1/4] net: mana: prepare HWC ownership for safe reinitialization
Date: Sun, 15 Nov 2026 12:34:10 +0000
Organization: Usenet Network
Message-ID: <179457550417.109246.13409427822482979137.hwc-v10-all-reviews-p1@linux.microsoft.com>
References: <df083dc6ad8a8958398e04afe66ca2c5f4bfb040.1794208055.git.weh@linux.microsoft.com>  <179455239601.2199510.13335902064048081755@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="1796531"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:BHnriu7Xcp8PS+8NoyQ51BR6sHY= sha256:gJ+Xkh5GSA/7qfgSCo/GQnersM3nFBbpdGTgeh5MKug=
	sha1:7pkgs+6thj1fJue+gOOd5/LQZo8= sha256:2OIL0vfh60krg48wwgwy9SrnOeMEmmfjq/yB5zLAsVs=
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 4E7421149CC; Sun, 15 Nov 2026 15:35:17 +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 Vg-vWz2-4J-F;
	Sun, 15 Nov 2026 15:35:14 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363697-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 1BAA81149C6; Sun, 15 Nov 2026 15:35:06 +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 5662343797; Sun, 15 Nov 2026 12:34:46 +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=1794746083;
	b=nBj4rAP8XSap5NYqQlyN0odGx0GmdFsLJra2qbnrj7Gbbb8p2qpa0ExsHb7OI17JJTik
	 G2aDAVU5ZFq6PU6YaGE3amWIRCxr9zqkHckShmbJnVOQc2lcixoozGb4LV1iVlzP+RBT8
	 zGtEl9+u5S/j7bmK3wrU/DwyPHPt/xI8nKAqJdO7wt0KGz0B95v7tD0qybuyGjlgfaq8V
	 K3YbvnNxXoyvGJNutZKDbwYtxiYomoVe5TuqkwVbRcmSFMp4jH0ZB/e31vS5eUaL+rA9f
	 +gXpTxulKZmUYTbR7fJZmeepPvecH5xPnGO/oUFt5r5tnBh3+yG8gkMNbHM4rfQnnzA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794746083;
	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:Content-Type:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Transfer-Encoding;
	bh=Id9vGSlrDL1t4zwGiCOP4s5P1oMz9WDj7RNi2TTJ84g=;
	b=PMmgFNJ6C2FubXL9hmRB3B0jdsuxNGFHHW/h7hLh/JP6yCyrMmJaKTzZt8gA+PGBKmoB
	 Vz/SWORQLVdQa8/w+eXHhRU+JOk1kwgdnhITE6ec86opT6qDajK3QJiwdgNnlvojjdaM/
	 RN45HTFdF+4JAZp5s3D9zlDA7XjZMaQGnCIiljduQAuUBjo4zXZ3ZUhPjqJgFBoZGuP82
	 S1G4GNR6J4oSEpN0RKpz3zejK91SIow6zhKgRmQ/WfLwS2QMMZ6HYrDhziV862o+nUhg9
	 7iHU8K7DqmC6skJjQiLHewHKrJ9hn//muQoKKWEfNLU1lEwh/awY9MTskAujsBpWUuw==
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=PODBvZRz;
	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 6BCB1606A890;
	Sun, 15 Nov 2026 12:34:43 +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=PODBvZRz
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=1794746072;
	b=kCvfNQEtMo4bwSB5KJ/B2IrJRMGSltY7CE5c2tiUg9d9PovNFbVMB8l+vnFkf/Ac4UCc
	 DN6/o5UySlx+Z8hPMVKMtVWK+Eq195g2/ECiPwKCJx5kTc6Vq2lfoveFXtDHKHxJ+D0a/
	 03I+QPMfXQFFPqB6VHtZMtdUCYpGy1mkzmj39qpZ+9goivahCaKhXWoJUdCitFyFXkbfa
	 KPSEQqU+oYL0wWvVm1hnZ1N8L5AAIlu4WdU9IreNTFCNOkWCskBVUoCA0zG6jvPIIlpr6
	 sg4YZv3Di3SvM0H+Vbqt1lklM6ojovaktJMtlmRpdACrM4dUjt/BvLfozcb6iDGq5tg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794746072;
	h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:Content-Type:
	 MIME-Version:Content-Transfer-Encoding:X-Spam-Status:
	 X-Spam-Checker-Version;
	bh=Id9vGSlrDL1t4zwGiCOP4s5P1oMz9WDj7RNi2TTJ84g=;
	b=LzgVY7O8xQvRN6WOzjxW5RSX0ONwY9myOCXDJn7CNh0HAVXfOSbor5VlEx0I+4ZSRn75
	 9rAWJzOyLKcxR+YP2OGQgLZ7BCsV6joelyDSIswZ/qXjTKWXEmP5CJ04ZloAgXK74bLRk
	 +Z/8ejZE9MM0Lfn22In/Ii5F/MliHR9kUIHYFEI2xTU8tCCklJZbsxWuqtLVZl+GvBWnX
	 HJjG9gokp8pTjNVZblXmcAWAz3Z5xR3KUMCmWrz4BYp/t2F+2st004YxIxYWa5v1jBW0X
	 E5bm/lgp8lfqhifo1YxQla52YZ71XXepQDWz3CueM7ZaBlUnnwwMg88zTY5ECLDojGg==
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=PODBvZRz;
	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 3D4A8606A31D;
	Sun, 15 Nov 2026 12:34:32 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3D4A8606A31D
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 A542220B7167;
	Sun, 15 Nov 2026 04:34:19 -0800 (PST)
X-DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A542220B7167
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1794746060;
	bh=Id9vGSlrDL1t4zwGiCOP4s5P1oMz9WDj7RNi2TTJ84g=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=PODBvZRzHERt9jxgzknYwqnmqDvJ/Xbszs8JdXm4J8+O80okHH/xGYKaTRzRp7IyR
	 MmF2+acGDujDsSFt9gTeo8cSZwghh5y5ni4Sr74RKnc325d/3Q2OpRCkNQQ9DaYcKJ
	 wWF7ArpfgpSLKEUT32IT75sClCBvk0vo9CnwOsOo=
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: <179455239601.2199510.13335902064048081755@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