Re: [PATCH net-next v03 4/4] hinic3: Ensure that the value of max_qps is not changed
From: netdev-bot+sashiko
Date: Mon Nov 16 2026 - 08:53:04 EST
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