From: sashiko-bot@kernel.org
To: "Long Li" <longli@microsoft.com>
Cc: linux-hyperv@vger.kernel.org
Subject: Re: [PATCH net-next v11 1/6] net: mana: Create separate EQs for each vPort
Date: Sat, 30 May 2026 00:46:57 +0000 [thread overview]
Message-ID: <20260530004657.D1B531F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260523020258.1107742-2-longli@microsoft.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing rollback of `mana_pf_register_hw_vport()` on failure in `mana_create_vport()` leads to hardware resource leak.
- [High] Destroying an RSS QP disables RX steering for the entire physical vport, breaking any other active QPs.
--
commit 81a114514be59954addf46b0c28014c7c1c47694
Author: Long Li <longli@microsoft.com>
Subject: net: mana: Create separate EQs for each vPort
The patch moves EQ definition from mana_context to mana_port_context and
removes EQ sharing among vPorts to prepare for dedicated MSI-X vectors. It
also ensures RSS QPs take a vport reference to guarantee EQs outlive QP
consumers. Finally, cross-port PD sharing is explicitly rejected and
mana_set_channels is serialized against RDMA vport configuration.
> diff --git a/drivers/infiniband/hw/mana/qp.c b/drivers/infiniband/hw/mana/qp.c
> index 0fbcf449c134b..d9a0bf8b2bc9c 100644
> --- a/drivers/infiniband/hw/mana/qp.c
> +++ b/drivers/infiniband/hw/mana/qp.c
[ ... ]
> @@ -817,6 +841,8 @@ static int mana_ib_destroy_qp_rss(struct mana_ib_qp *qp,
> mana_destroy_wq_obj(mpc, GDMA_RQ, wq->rx_object);
> }
>
> + mana_ib_uncfg_vport(mdev, pd, qp->port);
> +
[Severity: High]
This is a pre-existing issue, but since this patch explicitly adds
vport_use_count refcounting to allow multiple QPs to share the same physical
vport, does the unconditional call to mana_disable_vport_rx() earlier in this
function break other active QPs?
If multiple QPs are active, destroying a single RSS QP will globally disable
receive steering for the entire hardware vport. Will this silently blackhole
all receive traffic for the remaining QPs on that port?
> return 0;
> }
>
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index 82f1461a48e93..7c776f115f5aa 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
[ ... ]
> @@ -2913,11 +2922,7 @@ static int mana_create_vport(struct mana_port_context *apc,
> return err;
> }
>
> - err = mana_cfg_vport(apc, gd->pdid, gd->doorbell);
> - if (err)
> - return err;
> -
> - return mana_create_txq(apc, net);
> + return mana_cfg_vport(apc, gd->pdid, gd->doorbell, false);
> }
[Severity: High]
This isn't a bug introduced by this patch, but the new exclusivity logic
makes it deterministically triggerable. If mana_cfg_vport() fails (which it
now will with -EBUSY if the RDMA driver currently holds the vport), does this
leak the hardware vport registration?
The function returns the error directly without rolling back
mana_pf_register_hw_vport() on failure. Because mana_cfg_vport() can now be
forced to fail deterministically, could a user with CAP_NET_ADMIN repeatedly
toggle the Ethernet interface state while holding a raw QP, leaking a hardware
vport registration each time and exhausting firmware resources?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260523020258.1107742-1-longli@microsoft.com?part=1
next prev parent reply other threads:[~2026-05-30 0:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-23 2:02 [PATCH net-next v11 0/6] net: mana: Per-vPort EQ and MSI-X management Long Li
2026-05-23 2:02 ` [PATCH net-next v11 1/6] net: mana: Create separate EQs for each vPort Long Li
2026-05-30 0:46 ` sashiko-bot [this message]
2026-05-23 2:02 ` [PATCH net-next v11 2/6] net: mana: Query device capabilities and configure MSI-X sharing for EQs Long Li
2026-05-23 2:02 ` [PATCH net-next v11 3/6] net: mana: Introduce GIC context with refcounting for interrupt management Long Li
2026-05-23 2:02 ` [PATCH net-next v11 4/6] net: mana: Use GIC functions to allocate global EQs Long Li
2026-05-23 2:02 ` [PATCH net-next v11 5/6] net: mana: Allocate interrupt context for each EQ when creating vPort Long Li
2026-05-23 2:02 ` [PATCH net-next v11 6/6] RDMA/mana_ib: Allocate interrupt contexts on EQs Long Li
2026-05-28 2:27 ` [PATCH net-next v11 0/6] net: mana: Per-vPort EQ and MSI-X management Jakub Kicinski
2026-05-28 22:05 ` [EXTERNAL] " Long Li
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=20260530004657.D1B531F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=sashiko-reviews@lists.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