From: netdev-bot+sashiko@kernel.org
To: gongfan1@huawei.com
Cc: wudi234@huawei.com, tengpeisen@huawei.com,
netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
andrew+netdev@lunn.ch, ioana.ciornei@nxp.com,
maxime.chevallier@bootlin.com, mohsin.bashr@gmail.com,
dimitri.daskalakis1@gmail.com, hramamurthy@google.com,
larysa.zaremba@intel.com, vadim.fedorenko@linux.dev,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
zhoushuai28@huawei.com, wulike1@huawei.com
Subject: Re: [PATCH net-next v03 4/4] hinic3: Ensure that the value of max_qps is not changed
Date: Mon, 16 Nov 2026 13:51:04 +0000 [thread overview]
Message-ID: <179483706434.3136.8532436488402631937@kernel.org> (raw)
In-Reply-To: <75d0140471d5f48801d6ad565ccd1829f337e35d.1794467919.git.gongfan1@huawei.com>
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] The patch is presented as a bug fix (it carries `Fixes:
1f3838b84a63 ("hinic3: Add Rss function")`), but I could not find any…
--
hinic3: Ensure that the value of max_qps is not changed
This patch stops hinic3_try_to_enable_rss() from setting nic_dev->max_qps
to 1 when RSS is unsupported or its setup fails. On those paths it now
sets nic_dev->q_params.num_qps to 1 directly. It also changes the check
on the function's queue count from "<= 1" to "== 1".
> diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_rss.c b/drivers/net/ethernet/huawei/hinic3/hinic3_rss.c
> index 25db74d8c7ddb..75dc0c044071c 100644
> --- a/drivers/net/ethernet/huawei/hinic3/hinic3_rss.c
> +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_rss.c
> @@ -307,15 +307,13 @@ void hinic3_try_to_enable_rss(struct net_device *netdev)
> int err;
>
> nic_dev->max_qps = hinic3_func_max_qnum(hwdev);
> - if (nic_dev->max_qps <= 1 ||
> + if (nic_dev->max_qps == 1 ||
> !hinic3_test_support(nic_dev, HINIC3_NIC_F_RSS))
> goto err_reset_q_params;
>
> err = alloc_rss_resource(netdev);
> - if (err) {
> - nic_dev->max_qps = 1;
> + if (err)
> goto err_reset_q_params;
> - }
[ ... ]
> @@ -332,5 +329,5 @@ void hinic3_try_to_enable_rss(struct net_device *netdev)
>
> err_reset_q_params:
> clear_bit(HINIC3_RSS_ENABLE, &nic_dev->flags);
> - nic_dev->q_params.num_qps = nic_dev->max_qps;
> + nic_dev->q_params.num_qps = 1;
> }
[Severity: Medium]
Which bug does this fix? The patch has a Fixes: tag for 1f3838b84a63
("hinic3: Add Rss function"), but I couldn't find a reachable problem
in the old fallback.
The only caller of hinic3_try_to_enable_rss() is hinic3_sw_init(). Every
allocation sized from nic_dev->max_qps happens after that call, so the
value is already final when it is used:
hinic3_sw_init()
hinic3_try_to_enable_rss() <- max_qps settled here
hinic3_alloc_txrxqs()
hinic3_alloc_txqs() <- num_txqs = nic_dev->max_qps
hinic3_alloc_rxqs() <- num_rxqs = nic_dev->max_qps
hinic3_init_intr_coalesce()
ndo_open
hinic3_setup_num_qps() <- qps_msix_entries sized by max_qps
With the old code, an RSS failure gave a consistent single-queue setup:
max_qps = 1, one txq and one rxq, one coalesce entry, one msix entry and
num_qps = 1.
The commit message says:
"However, the value of nic_dev->q_params.num_qps can be dynamically
changed."
Does that hold at this commit? hinic3_config_num_qps() already forces a
single queue when RSS is off:
if (!test_bit(HINIC3_RSS_ENABLE, &nic_dev->flags))
q_params->num_qps = 1;
The driver also has no ethtool set_channels or set_rxfh callback, so
nothing can turn RSS on or raise the queue count later.
The commit message also says:
"nic_dev->max_qps is used to allocate hardware resources. Therefore,
it is assigned the value 1 only when its value is abnormal."
The diff removes both "nic_dev->max_qps = 1" assignments and adds none,
so after this patch nothing ever sets max_qps to 1.
On the hardware side, the limit is nic_io->max_qps, which
hinic3_init_nic_io() sets separately and this function never changed.
nic_dev->max_qps only sizes software arrays. alloc_etherdev_mq() in
hinic3_nic_probe() uses its own local max_qps.
The commit message also doesn't mention the "<= 1" to "== 1" change. It
looks harmless, because max_sqs is computed as
min(nic_max_sq_id + 1, HINIC3_CFG_MAX_QP) and is always at least 1.
As far as I can tell, the only change in behaviour is on the RSS failure
path. There, txqs, rxqs, intr_coalesce and qps_msix_entries are now
sized for the full hardware maximum while the device still runs on one
queue.
Is this meant as a design change rather than a fix? If so, could the
commit message say so, and could the Fixes: tag be dropped so this
doesn't get backported to stable?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794467919.git.gongfan1%40huawei.com
prev parent reply other threads:[~2026-11-16 13:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 7:06 [PATCH net-next v03 0/4] net: hinic3: Bugfix for later patch-set Fan Gong
2026-11-12 7:06 ` [PATCH net-next v03 1/4] hinic3: Solve an stall issue in hinic3_rx_poll() Fan Gong
2026-11-16 13:51 ` netdev-bot+sashiko
2026-11-12 7:06 ` [PATCH net-next v03 2/4] hinic3: Avoid concurrent updates on 32-bit systems Fan Gong
2026-11-16 13:51 ` netdev-bot+sashiko
2026-11-12 7:06 ` [PATCH net-next v03 3/4] hinic3: fix some checkpatchs Fan Gong
2026-11-12 7:06 ` [PATCH net-next v03 4/4] hinic3: Ensure that the value of max_qps is not changed Fan Gong
2026-11-16 13:51 ` netdev-bot+sashiko [this message]
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=179483706434.3136.8532436488402631937@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dimitri.daskalakis1@gmail.com \
--cc=edumazet@google.com \
--cc=gongfan1@huawei.com \
--cc=horms@kernel.org \
--cc=hramamurthy@google.com \
--cc=ioana.ciornei@nxp.com \
--cc=kuba@kernel.org \
--cc=larysa.zaremba@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=mohsin.bashr@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tengpeisen@huawei.com \
--cc=vadim.fedorenko@linux.dev \
--cc=wudi234@huawei.com \
--cc=wulike1@huawei.com \
--cc=zhoushuai28@huawei.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
all inboxes | Powered by JetHome®