From: Jakub Kicinski <kuba@kernel.org>
To: illusion.wang@nebula-matrix.com
Cc: Jakub Kicinski <kuba@kernel.org>,
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, 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: [PATCH v22 net-next 09/12] net/nebula-matrix: dispatch: add cross-version channel message framework
Date: Thu, 30 Jul 2026 18:30:33 -0700 [thread overview]
Message-ID: <20260731013033.745204-1-kuba@kernel.org> (raw)
In-Reply-To: <20260723040110.91410-10-illusion.wang@nebula-matrix.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
--- Patch [9]: [PATCH v22 net-next 09/12] net/nebula-matrix: dispatch: add cross-version channel message framework ---
commit d32035d9a9bd3114eb253cf0283172847c233d7d
Author: illusion wang <illusion.wang@nebula-matrix.com>
net/nebula-matrix: dispatch: add cross-version channel message framework
Implement bidirectional channel request/response RPC handlers for 5 dispatch
resource operations: get_vsi_id, get_eth_id, configure_msix_map,
destroy_msix_map, set_mailbox_irq.
> 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
> index 8116643859c79..c82c336f50e5e 100644
> --- a/drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_dispatch.c
> +++ b/drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_dispatch.c
[ ... ]
> +static int nbl_disp_configure_msix_map(struct nbl_dispatch_mgt *disp_mgt,
> + u16 num_net_msix, u16 num_others_msix,
> + bool net_msix_mask_en)
> +{
> + struct nbl_resource_ops *res_ops = disp_mgt->res_ops_tbl->ops;
> + struct nbl_resource_mgt *p = disp_mgt->res_ops_tbl->priv;
> + struct nbl_common_info *common = disp_mgt->common;
> +
> + return NBL_OPS_CALL_RET(res_ops->configure_msix_map, (p,
> + common->mgt_pf, num_net_msix,
> + num_others_msix, net_msix_mask_en));
> +}
[Severity: High]
Does nbl_disp_configure_msix_map() need to take a mutex lock before invoking
res_ops->configure_msix_map()?
Calling this resource operation without synchronization might lead to data races
and hardware state corruption if multiple requests arrive simultaneously.
[ ... ]
> +static void nbl_disp_chan_configure_msix_map_resp(void *priv, u16 src_id,
> + u16 msg_id, void *data,
> + u32 data_len)
> +{
[ ... ]
> + if (!res_ops->configure_msix_map) {
> + err = NBL_CHAN_RESP_UNIMPLEMENTED;
> + } else {
> + ret = NBL_OPS_CALL_RET(res_ops->configure_msix_map,
> + (p, src_id,
> + le16_to_cpu(param.num_net_msix),
> + le16_to_cpu(param.num_others_msix),
> + le16_to_cpu(param.msix_mask_en)));
> + if (ret)
> + err = NBL_CHAN_RESP_ERR;
> + }
[Severity: High]
Should nbl_disp_chan_configure_msix_map_resp() also use locking when invoking
res_ops->configure_msix_map()?
Since this response handler can run from a workqueue context concurrently with
other operations, this might also lead to hardware state corruption.
[ ... ]
> +static void nbl_disp_chan_set_mailbox_irq_resp(void *priv, u16 src_id,
> + u16 msg_id, void *data,
> + u32 data_len)
> +{
[ ... ]
> + if (!res_ops->set_mailbox_irq) {
> + err = NBL_CHAN_RESP_UNIMPLEMENTED;
> + } else {
> + ret = NBL_OPS_CALL_RET(res_ops->set_mailbox_irq,
> + (p, src_id, vector_id, enable_msix));
> + if (ret)
[Severity: High]
Similarly, should nbl_disp_chan_set_mailbox_irq_resp() be protected by a lock
when modifying the mailbox IRQ hardware state?
[ ... ]
> @@ -126,6 +562,10 @@ int nbl_disp_init(struct nbl_adapter *adapter)
> adapter->core.disp_mgt = disp_mgt;
> adapter->intf.dispatch_ops_tbl = disp_ops_tbl;
>
> + ret = nbl_disp_setup_msg(disp_mgt);
> + if (ret)
> + return ret;
> +
> if (common->has_ctrl)
> nbl_disp_setup_ctrl_lvl(disp_mgt, NBL_DISP_CTRL_LVL_MGT);
>
[Severity: High]
Does the dispatch operations table remain uninitialized for non-control PFs
here?
Since nbl_disp_setup_ctrl_lvl() is responsible for populating the disp_ops
table (including setting up the remote message request handlers as fallbacks
when testing control levels), skipping this step when common->has_ctrl is false
might leave the function pointers as NULL.
Could this lead to a NULL pointer dereference when a regular non-control PF
subsequently attempts to invoke a dispatch operation like get_vsi_id or
get_eth_id?
next prev parent reply other threads:[~2026-07-31 1:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 4:00 [PATCH v22 net-next 00/12] nbl driver for Nebulamatrix NICs illusion.wang
2026-07-23 4:00 ` [PATCH v22 net-next 01/12] net/nebula-matrix: add minimum nbl build framework illusion.wang
2026-07-31 1:10 ` Jakub Kicinski
2026-07-23 4:00 ` [PATCH v22 net-next 02/12] net/nebula-matrix: add core driver architecture and HW layer initialization illusion.wang
2026-07-30 9:18 ` 回复:[PATCH " Illusion Wang
2026-07-31 1:13 ` [PATCH " Jakub Kicinski
2026-07-31 1:30 ` Jakub Kicinski
2026-07-23 4:00 ` [PATCH v22 net-next 03/12] net/nebula-matrix: add channel wire opcode enum definitions illusion.wang
2026-07-23 4:00 ` [PATCH v22 net-next 04/12] net/nebula-matrix: add channel layer illusion.wang
2026-07-31 1:27 ` Jakub Kicinski
2026-07-31 1:30 ` Jakub Kicinski
2026-07-23 4:00 ` [PATCH v22 net-next 05/12] net/nebula-matrix: add common resource implementation illusion.wang
2026-07-31 1:30 ` Jakub Kicinski
2026-07-23 4:00 ` [PATCH v22 net-next 06/12] net/nebula-matrix: add intr " illusion.wang
2026-07-31 1:30 ` Jakub Kicinski
2026-07-23 4:00 ` [PATCH v22 net-next 07/12] net/nebula-matrix: add chip-wide hardware init/deinit implementation illusion.wang
2026-07-31 1:30 ` Jakub Kicinski
2026-07-23 4:01 ` [PATCH v22 net-next 08/12] net/nebula-matrix: dispatch: add control-level routing core infrastructure illusion.wang
2026-07-23 4:01 ` [PATCH v22 net-next 09/12] net/nebula-matrix: dispatch: add cross-version channel message framework illusion.wang
2026-07-31 1:30 ` Jakub Kicinski [this message]
2026-07-23 4:01 ` [PATCH v22 net-next 10/12] net/nebula-matrix: dispatch: add mutual exclusion lock for shared hardware resource ops illusion.wang
2026-07-31 1:30 ` Jakub Kicinski
2026-07-23 4:01 ` [PATCH v22 net-next 11/12] net/nebula-matrix: add common/ctrl dev init/remove operation illusion.wang
2026-07-31 1:30 ` Jakub Kicinski
2026-07-23 4:01 ` [PATCH v22 net-next 12/12] net/nebula-matrix: add common dev start/stop operation illusion.wang
2026-07-31 1:30 ` Jakub Kicinski
2026-07-31 1:29 ` [PATCH v22 net-next 00/12] nbl driver for Nebulamatrix NICs Jakub Kicinski
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=20260731013033.745204-1-kuba@kernel.org \
--to=kuba@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=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