From: netdev-bot+sashiko@kernel.org
To: illusion.wang@nebula-matrix.com
Cc: dimon.zhao@nebula-matrix.com, alvin.wang@nebula-matrix.com,
sam.chen@nebula-matrix.com, netdev@vger.kernel.org,
andrew+netdev@lunn.ch, corbet@lwn.net, kuba@kernel.org,
horms@kernel.org, linux-doc@vger.kernel.org, pabeni@redhat.com,
vadim.fedorenko@linux.dev, lukas.bulwahn@redhat.com,
edumazet@google.com, enelsonmoore@gmail.com,
skhan@linuxfoundation.org, hkallweit1@gmail.com,
linux-kernel@vger.kernel.org
Subject: Re: [v26,net-next,02/10] net/nebula-matrix: add core driver architecture and HW layer initialization
Date: Thu, 03 Sep 2026 17:18:34 +0000 [thread overview]
Message-ID: <178845591416.3394541.11052822581750086704@kernel.org> (raw)
In-Reply-To: <20260831021408.2325-3-illusion.wang@nebula-matrix.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider:
Critical: 0 · High: 0 · Medium: 1 · Low: 0
- [Medium] In `nbl_hw_init_leonis()` (drivers/net/ethernet/nebula-
matrix/nbl/nbl_hw/nbl_hw_leonis/nbl_hw_leonis.c) two error paths print…
--
net/nebula-matrix: add core driver architecture and HW layer initialization
This adds the nbl_adapter/nbl_core/nbl_common_info device context, the PCI
probe/remove entry points with basic capability parsing, and the Leonis
hardware layer that requests the BARs and ioremaps them. One question
below about the BAR size error paths.
> 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
> new file mode 100644
> index 000000000000..a67d1a674466
> --- /dev/null
> +++ b/drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_hw_leonis/nbl_hw_leonis.c
> @@ -0,0 +1,152 @@
[ ... ]
> +int nbl_hw_init_leonis(struct nbl_adapter *adapter)
> +{
> + resource_size_t expect_sz = NBL_MEM_BAR_TOTAL_SIZE;
> + struct nbl_common_info *common = &adapter->common;
> + struct pci_dev *pdev = common->pdev;
> + struct nbl_hw_mgt *hw_mgt = NULL;
> + resource_size_t bar_len;
[ ... ]
> + if (bar_len < NBL_MEM_BAR_TOTAL_SIZE) {
> + dev_err(&pdev->dev,
> + "MEMORY BAR len %pr smaller than expected %pr\n",
> + &bar_len, &expect_sz);
[Severity: Medium]
Should these two be %pa rather than %pr?
Both bar_len and expect_sz are plain resource_size_t locals on the stack,
but %pr is the struct resource specifier. vsprintf hands it to
resource_string(), which dereferences the argument as a struct resource:
lib/vsprintf.c:resource_string() {
...
if (res->flags & IORESOURCE_IO) {
...
p = hex_range(p, pend, res->start, res->end, *specp);
...
}
struct resource places flags at offset 24 on 64-bit, so does this read
roughly 32 bytes past the end of each 8-byte local and print adjacent
kernel stack contents (both the decoded resource type and the second hex
value) into dmesg?
Nothing warns at build time because every %p variant just consumes a
void *. Documentation/core-api/printk-formats.rst lists %pa[p] for
phys_addr_t / resource_size_t, so %pa &bar_len (or a cast to
unsigned long long with %llu) would seem to be what is wanted here.
The path is reached from nbl_probe() -> nbl_core_init() ->
nbl_hw_init_leonis() whenever common->has_ctrl is set (function 0, not a
VF) and pci_resource_len(pdev, NBL_MEMORY_BAR) is below 64MiB.
> + ret = -EINVAL;
> + goto setup_mgt_fail;
> + }
[ ... ]
> + } else {
> + if (bar_len < NBL_REG_NET_ONLY_LEN) {
> + dev_err(&pdev->dev,
> + "MEMORY BAR len %pr too small for net only reg space\n",
> + &bar_len);
[Severity: Medium]
Same %pr versus %pa question on this second site in nbl_hw_init_leonis(),
which fires on a non-ctrl function when the MEMORY BAR is reported smaller
than 8KiB.
This one still appears unchanged at the end of the series, so no later
patch in the set seems to address it.
> + ret = -EINVAL;
> + goto setup_mgt_fail;
> + }
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260831021408.2325-1-illusion.wang%40nebula-matrix.com
next prev parent reply other threads:[~2026-09-03 17:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 2:13 [PATCH v26 net-next 00/10] nbl driver for Nebulamatrix NICs illusion.wang
2026-08-31 2:13 ` [PATCH v26 net-next 01/10] net/nebula-matrix: add minimum nbl build framework illusion.wang
2026-09-03 17:18 ` [v26,net-next,01/10] " netdev-bot+sashiko
2026-08-31 2:13 ` [PATCH v26 net-next 02/10] net/nebula-matrix: add core driver architecture and HW layer initialization illusion.wang
2026-09-03 17:18 ` netdev-bot+sashiko [this message]
2026-08-31 2:13 ` [PATCH v26 net-next 03/10] net/nebula-matrix: add channel layer illusion.wang
2026-09-03 17:18 ` [v26,net-next,03/10] " netdev-bot+sashiko
2026-08-31 2:13 ` [PATCH v26 net-next 04/10] net/nebula-matrix: add common resource implementation illusion.wang
2026-09-03 17:18 ` [v26,net-next,04/10] " netdev-bot+sashiko
2026-08-31 2:13 ` [PATCH v26 net-next 05/10] net/nebula-matrix: add intr " illusion.wang
2026-09-03 17:18 ` [v26,net-next,05/10] " netdev-bot+sashiko
2026-08-31 2:13 ` [PATCH v26 net-next 06/10] net/nebula-matrix: add chip-wide hardware init/deinit implementation illusion.wang
2026-09-03 17:18 ` [v26,net-next,06/10] " netdev-bot+sashiko
2026-08-31 2:13 ` [PATCH v26 net-next 07/10] net/nebula-matrix: dispatch: add control-level routing core infrastructure illusion.wang
2026-08-31 2:13 ` [PATCH v26 net-next 08/10] net/nebula-matrix: dispatch: implement channel RPC framework and serialize hardware ops illusion.wang
2026-09-03 17:18 ` [v26,net-next,08/10] " netdev-bot+sashiko
2026-08-31 2:14 ` [PATCH v26 net-next 09/10] net/nebula-matrix: add common/ctrl dev init/remove operation illusion.wang
2026-09-03 17:18 ` [v26,net-next,09/10] " netdev-bot+sashiko
2026-08-31 2:14 ` [PATCH v26 net-next 10/10] net/nebula-matrix: add common dev start/stop operation illusion.wang
2026-09-03 17:18 ` [v26,net-next,10/10] " netdev-bot+sashiko
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=178845591416.3394541.11052822581750086704@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=alvin.wang@nebula-matrix.com \
--cc=andrew+netdev@lunn.ch \
--cc=corbet@lwn.net \
--cc=dimon.zhao@nebula-matrix.com \
--cc=edumazet@google.com \
--cc=enelsonmoore@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=illusion.wang@nebula-matrix.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sam.chen@nebula-matrix.com \
--cc=skhan@linuxfoundation.org \
--cc=vadim.fedorenko@linux.dev \
/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
all inboxes | Powered by JetHome®