🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14020

Re: [PATCH v33 net-next 4/8] net/nebula-matrix: add chip-wide hardware init/deinit implementation

#14020
From: netdev-bot+sashiko
Date: Tue, 10 Nov 2026 14:51
122 lines
12272 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] nbl_dvn_init() and nbl_uvn_init() in nbl_hw_leonis.c turn the
  relaxed-ordering (RO) enables in two chip-wide registers on or off:…

--

net/nebula-matrix: add chip-wide hardware init/deinit implementation

This adds the Leonis chip-wide init_module() and deinit_module() hooks
in the hw and resource layers. They run only on the control PF. They
program the DP datapath registers (DPED, UPED, SHAPING, DSCH, USTORE,
DSTORE, DVN, UVN, UQM, PADPT) and drive the driver_status handshake
with firmware.

> diff --git a/drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_hw_leonis/nbl_hw_leonis.c b/drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_hw_leonis/nbl_hw_leonis.c
> index 75d6982ae1e83..2b55f2c2518b4 100644
> --- a/drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_hw_leonis/nbl_hw_leonis.c
> +++ b/drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_hw_leonis/nbl_hw_leonis.c

[ ... ]

> @@ -150,6 +175,719 @@ static void nbl_hw_get_fw_eth_map(struct nbl_hw_mgt *hw_mgt, u32 *eth_map)

[ ... ]

> +static void nbl_dvn_init(struct nbl_hw_mgt *hw_mgt, u8 speed)
> +{
> +	u32 timeout = 0;
> +	u32 ro_flag = 0;
> +

[ ... ]

> +	spin_lock(&hw_mgt->reg_lock);
> +	nbl_hw_rd_regs(hw_mgt, NBL_DVN_DIF_REQ_RD_RO_FLAG, &ro_flag,
> +		       sizeof(ro_flag));
> +	if (pcie_relaxed_ordering_enabled(hw_mgt->common->pdev)) {
> +		ro_flag |=
> +			FIELD_PREP(NBL_DVN_DIF_REQ_RD_RO_FLAG_DESC_RO_EN_MASK,
> +				   1) |
> +			FIELD_PREP(NBL_DVN_DIF_REQ_RD_RO_FLAG_DATA_RO_EN_MASK,
> +				   1) |
> +			FIELD_PREP(NBL_DVN_DIF_REQ_RD_RO_FLAG_AVRING_RO_EN_MASK,
> +				   1);
> +	} else {

[ ... ]

> +	}
> +	nbl_hw_wr_regs(hw_mgt, NBL_DVN_DIF_REQ_RD_RO_FLAG, &ro_flag,
> +		       sizeof(ro_flag));
> +	spin_unlock(&hw_mgt->reg_lock);

[ ... ]

> +static void nbl_uvn_init(struct nbl_hw_mgt *hw_mgt)
> +{

[ ... ]

> +	ro_enabled = pcie_relaxed_ordering_enabled(hw_mgt->common->pdev);
> +
> +	nbl_hw_rd_regs(hw_mgt, NBL_UVN_DIF_REQ_RO_FLAG, &flag, sizeof(flag));
> +	if (ro_enabled) {
> +		flag |= FIELD_PREP(NBL_UVN_DIF_REQ_RO_FLAG_AVAIL_RD_MASK, 1) |
> +		FIELD_PREP(NBL_UVN_DIF_REQ_RO_FLAG_DESC_RD_MASK, 1) |
> +		FIELD_PREP(NBL_UVN_DIF_REQ_RO_FLAG_PKT_WR_MASK, 1);
> +		flag &= ~FIELD_PREP(NBL_UVN_DIF_REQ_RO_FLAG_DESC_WR_MASK, 1);
> +	} else {

[ ... ]

> +	}
> +	nbl_hw_wr_regs(hw_mgt, NBL_UVN_DIF_REQ_RO_FLAG, &flag, sizeof(flag));

[Severity: Medium]
Both of these RO flag registers seem to be single chip-wide registers
in the DP block, not per-function ones:

#define NBL_DVN_DIF_REQ_RD_RO_FLAG		(NBL_DP_DVN_BASE + 0x0000045C)
#define NBL_UVN_DIF_REQ_RO_FLAG			(NBL_DP_UVN_BASE + 0x00000250)

nbl_res_chip_init_module() in nbl_chip.c runs this only on the
control PF:

	if (!common->has_ctrl)
		return -EINVAL;

That means nbl_dvn_init() and nbl_uvn_init() check
PCI_EXP_DEVCTL_RELAX_EN only on the control PF's pdev, and that one bit
sets relaxed ordering for every function's queues on the chip.

In PCIe, Enable Relaxed Ordering is a per-function permission. Suppose
a sibling PF has RO cleared in its own DEVCTL, for example by a guest
that owns it through vfio-pci, by setpci, or by a driver applying an
erratum. If the control PF has RO enabled, would the DVN/UVN engines
still issue RO-tagged descriptor and avail-ring reads, and RO packet
writes, for that sibling's queues?

The value is also read only once, here. deinit_module() leaves it
programmed, so later DEVCTL changes on any function are never picked
up.

Does the hardware also gate the RO attribute on each requester
function's own DEVCTL? If not, could this use the AND of RO enable
across all functions on the chip, or program RO per function if the
hardware supports that? If the hardware does gate it per function,
could a comment here say so?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261106045631.2224-1-illusion.wang%40nebula-matrix.com
Technical Details
Message-ID: <179432230546.994134.4294945675510273127@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360354-linux-kernel-netdev=dewy.ru
References: <20261106045631.2224-5-illusion.wang@nebula-matrix.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360354-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v33 net-next 4/8] net/nebula-matrix: add chip-wide
 hardware init/deinit implementation
Date: Tue, 10 Nov 2026 14:51:45 +0000
Organization: Usenet Network
Message-ID: <179432230546.994134.4294945675510273127@kernel.org>
References: <20261106045631.2224-5-illusion.wang@nebula-matrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="644208"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ld6sbCM8dS1aq5Q6Qvzei+f53Xg= sha256:0aEwWuZRBVInhstzFhhKQouyIb1U5XjAfg/y3tRcmkg=
	sha1:rt8ejUi7El/iS06SnjnbVHE/+L8= sha256:zK2YmifzbC74opJT4XratCdlr8W5/E4YDU1cSI3yzoI=
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 17633113C3E; Tue, 10 Nov 2026 19:04:09 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
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 JIiyx_9BEG9v;
	Tue, 10 Nov 2026 19:04:05 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-360354-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 2EAF1113C31; Tue, 10 Nov 2026 19:03:54 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 967EC1669BF; Tue, 10 Nov 2026 14:52:05 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794322307;
	b=Xd+MtMsDBpythg6mIepAd/LzSyeGjWHM9zrAnROeXFIesfABxJt4x/0vFhbRgoR7B9Xn
	 a5MRJOxRJ9n1p/vqgs7olqLgx6RIkWDVY60HXVe3n7T2l4hP7k78a84LzOI4ofr6hDRF2
	 gUDfBtctNMBx4/Bw7cCmxtAJrEYy93VlU+iFLP2RH7yK/rDF/1Apzr6c2aukx0rSITE/h
	 GYZCKurkO4shvOqnyqeLMwu8vkA4Y5h5jcZo9ualtfGkhsJwHDL0hGc+qE6nEKBPrp4yL
	 mnbCcP+UYuF9QL56mOOKQrVVu6+QHUo+EBWfVnDiUyMp7nrZTy9eYCI8NW4ONOYdvCg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794322307;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=buqZEZjWv/CuOhvpfn3bLKl+wDA/z75kMCodt1O5PGo=;
	b=0UooPex+UGrSzWc01ps7cRIk4R/9noNTBPqfQkBno+Zr4Pdl/ln5k8TtnMaaHtKbkKXV
	 qLACeS6Jh3liq+Q2M4OkKl6GbmXYCxKl2KuzlSU93UIEGEoem2RezQhA3IHN8SSBMIxSN
	 RePYF+fRNIvzNkoEAa1za4ATufACyai6C7UBCmyKPKAQBS3gmG6Y+rHA2q7ghWq3fAiTQ
	 UmaGFkY2jEgTNTxun49FgI2/X0hhNCryWV/55KCTLdgk79dS4HChTcZICupT2GRHe7Tqa
	 773tMtuVexv1GYvBZH4qd025XbvKzdn8tePO4HV5poMioILTj5oioVfDD4LBjhEv8cg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mU0EHLUP;
	arc=pass header.oldest-pass=0 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 B528860A262C;
	Tue, 10 Nov 2026 14:51:47 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mU0EHLUP
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794322306;
	b=RbKwdUGxjX+qpPCwMxRbsx+Jv222n3yVKhTNCbPwkJqKWL9kwA4cP3b1qAAhm+LAPKdu
	 IsteObnhHd+FQlY2Wyq+6VlzOM9yG2qyqT9Kr2+qwk7A7/P5OT9L0O9WNUIYigDiwTON2
	 ZVkoo5Qgl6ZcJcxVWFP1pbYvQ1KQqq3vu5EU1DYFRNI0npL1zAhB3H9x1kf2OKF4Nyx5n
	 f6L18v+5cRE6fP6Gz8jvGmR8+Pyr5fYTk0uniMnfQHkJ5rhQtg2OgT8TbgQQxnmNCvAyq
	 zIQMkpjHORDdwYOxF9MENW0bFaTA7uwkgzurzDObEZFoljMzE/G1zVy9TIrGQ7FZI6Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794322306;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=buqZEZjWv/CuOhvpfn3bLKl+wDA/z75kMCodt1O5PGo=;
	b=GfXOJjnyUKwvyuQg8kEAcm2UD0dSOjL0e1Jgp1Q244yV34WXOz2gJFuEKiIJksBRSEDH
	 WDwCO4TQYp2+R0Oro2xpAYjLacO3Ng461HE3NXJxyFwSJnEqRuDKmS/1++gBYGqA9f1If
	 P45ozQ4asVAgXjP1IUO4moAhNeIqDjewYHrfzY3AQ3Fuwb7Q8qq7L/1zpcBUsS7uhQIsX
	 04joY5Kl7fxX/pIeeSsxcvqCJeP9rDgiqJDAMSNCi3/gMtP9RPEDHUAyO6EG50VTpd4a2
	 +z56bzLAfAIwuT1HlqLAZhx+fpBnTBMdnwoNAtdIeov3+MeojRPT3AzvWCUx9epAE0w==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mU0EHLUP;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9048C60A2611;
	Tue, 10 Nov 2026 14:51:46 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D81361F008A1;
	Tue, 10 Nov 2026 14:51:45 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794322306;
	bh=buqZEZjWv/CuOhvpfn3bLKl+wDA/z75kMCodt1O5PGo=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=mU0EHLUPFtdTnlLMSRLnbhxj3OS4Xny+JOYThVKdO2oogPcfSma425HAgbaz2oLs4
	 L/8TRf9s4HSBQXxWvNB8OMKk9hA7hvzxeO7buoLF5jKKD4a+ckQKFNaoIj3epppmVS
	 NdkDJ7LgVKaosR/i7xUFUB6amSMafh6IwPuO9XqVwKvhGnydEufVJEgyPtebnC2chG
	 R5odv2RRQ7uNoZEbKnfdk0WD2bbVlBAYQfcDB4dm9VGcLHNmdEYTp7+d5puX/y7Sbx
	 UHQSyuMC6PCoWhrzaDPEfKiT0r0Fw+OFyZ9V32vvhVKrNhctWDuU8mH5Bc/7uxSKZT
	 ksg7SrakSMGaA==
X-Cc: dimon.zhao@nebula-matrix.com, alvin.wang@nebula-matrix.com,
 sam.chen@nebula-matrix.com, netdev@vger.kernel.org, kuba@kernel.org,
 andrew+netdev@lunn.ch, pabeni@redhat.com, edumazet@google.com,
 horms@kernel.org, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261106045631.2224-5-illusion.wang@nebula-matrix.com>
X-sashiko-severity: Medium
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