Netdev List
 help / color / mirror / Atom feed
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,
	kuba@kernel.org, andrew+netdev@lunn.ch, pabeni@redhat.com,
	edumazet@google.com, horms@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v34 net-next 5/8] net/nebula-matrix: dispatch: add control-level routing core infrastructure
Date: Mon, 16 Nov 2026 13:54:45 +0000	[thread overview]
Message-ID: <179483728519.3136.7292669814858371820@kernel.org> (raw)
In-Reply-To: <20261112094925.6098-6-illusion.wang@nebula-matrix.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The -EOPNOTSUPP fallback in nbl_disp_init_module() can never run,
  and the kernel-doc describes it as if it could.

--

net/nebula-matrix: dispatch: add control-level routing core infrastructure

This patch adds the dispatch layer. It allocates the dispatch management
state and the ops table, and it wires the init_module and deinit_module
wrappers to the resource ops. It also adds a ctrl_lvl bitmap, with only
the MGT level defined, which is set only on the control PF.

> diff --git a/drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_dispatch.c b/drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_dispatch.c
> new file mode 100644
> index 0000000000000..966fee2dec8b0
> --- /dev/null
> +++ b/drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_dispatch.c
> @@ -0,0 +1,117 @@

[ ... ]

> +static void nbl_disp_deinit_module(struct nbl_dispatch_mgt *disp_mgt)
> +{
> +	struct nbl_resource_ops *res_ops = disp_mgt->res_ops_tbl->ops;
> +	struct nbl_resource_mgt *p = disp_mgt->res_ops_tbl->priv;
> +
> +	if (res_ops->deinit_module)
> +		res_ops->deinit_module(p);
> +}
> +
> +static int nbl_disp_init_module(struct nbl_dispatch_mgt *disp_mgt)
> +{
> +	struct nbl_resource_ops *res_ops = disp_mgt->res_ops_tbl->ops;
> +	struct nbl_resource_mgt *p = disp_mgt->res_ops_tbl->priv;
> +
> +	if (res_ops->init_module)
> +		return res_ops->init_module(p);
> +	return -EOPNOTSUPP;
> +}

[Severity: Low]
This isn't a bug, but can the -EOPNOTSUPP fallback in
nbl_disp_init_module() ever run? The same question applies to the NULL
check in nbl_disp_deinit_module().

nbl_res_setup_ops() in nbl_resource_leonis.c will not publish the
resource ops table if either op is missing:

nbl_res_setup_ops() {
    ...
	if (!res_ops.get_vsi_id || !res_ops.get_eth_id ||
	    !res_ops.cfg_msix_map || !res_ops.destroy_msix_map ||
	    !res_ops.set_mailbox_irq || !res_ops.init_module ||
	    !res_ops.deinit_module)
		return ERR_PTR(-EINVAL);
    ...
}

nbl_core_init() calls nbl_res_init_leonis() before nbl_disp_init(), so a
missing op fails probe before the dispatch wrappers are installed. The
static res_ops table also always sets nbl_res_chip_init_module and
nbl_res_chip_deinit_module.

Could these NULL branches be dropped? The kernel-doc below would then
need updating too.

[ ... ]

> diff --git a/drivers/net/ethernet/nebula-matrix/nbl/nbl_include/nbl_def_dispatch.h b/drivers/net/ethernet/nebula-matrix/nbl/nbl_include/nbl_def_dispatch.h
> new file mode 100644
> index 0000000000000..f52d8bd57cd2b
> --- /dev/null
> +++ b/drivers/net/ethernet/nebula-matrix/nbl/nbl_include/nbl_def_dispatch.h
> @@ -0,0 +1,54 @@

[ ... ]

> +/**
> + * struct nbl_dispatch_ops - dispatch control plane operation callbacks
> + * @init_module: chip-wide datapath init, forwarded to the resource layer
> + *               (res_ops->init_module() and then hw_ops->init_module());
> + *               on leonis it programs the chip-wide datapath registers and
> + *               sets driver_status=true.  Returns -EOPNOTSUPP if the
> + *               resource layer installs no init_module op.  Control-PF

This sentence documents an error return that no caller can get. It also
suggests the resource op is optional, while nbl_res_setup_ops() requires
it. This text is still unchanged at the end of the series.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112094925.6098-1-illusion.wang%40nebula-matrix.com

  reply	other threads:[~2026-11-16 13:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  9:49 [PATCH v34 net-next 0/8] nbl driver for Nebulamatrix NICs illusion.wang
2026-11-12  9:49 ` [PATCH v34 net-next 1/8] net/nebula-matrix: add channel layer illusion.wang
2026-11-12 12:01   ` Breno Leitao
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-12  9:49 ` [PATCH v34 net-next 2/8] net/nebula-matrix: add common resource implementation illusion.wang
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-12  9:49 ` [PATCH v34 net-next 3/8] net/nebula-matrix: add intr " illusion.wang
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-12  9:49 ` [PATCH v34 net-next 4/8] net/nebula-matrix: add chip-wide hardware init/deinit implementation illusion.wang
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-12  9:49 ` [PATCH v34 net-next 5/8] net/nebula-matrix: dispatch: add control-level routing core infrastructure illusion.wang
2026-11-16 13:54   ` netdev-bot+sashiko [this message]
2026-11-12  9:49 ` [PATCH v34 net-next 6/8] net/nebula-matrix: dispatch: add mailbox RPCs for msix map, mailbox irq and vsi/eth id illusion.wang
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-12  9:49 ` [PATCH v34 net-next 7/8] net/nebula-matrix: add common/ctrl dev init/remove operation illusion.wang
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-12  9:49 ` [PATCH v34 net-next 8/8] net/nebula-matrix: add common dev start/stop operation illusion.wang
2026-11-16 13:54   ` 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=179483728519.3136.7292669814858371820@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alvin.wang@nebula-matrix.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=dimon.zhao@nebula-matrix.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=illusion.wang@nebula-matrix.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sam.chen@nebula-matrix.com \
    /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