hinic3: Keep max_qps at the hardware maximum when RSS setup fails

nic_dev->max_qps sizes the per-queue software arrays: txqs, rxqs,
intr_coalesce and qps_msix_entries are allocated with one entry per
max_qps by hinic3_sw_init() and hinic3_open().  The number of queues the
driver uses is nic_dev->q_params.num_qps: decide_num_qps() clamps it to
max_qps and hinic3_config_num_qps() forces it to 1 on every open while
HINIC3_RSS_ENABLE is clear.

hinic3_try_to_enable_rss() also shrank max_qps to 1 on its error paths.
The netdev is created with alloc_etherdev_mq(..., max_qps) queues, while
netif_set_real_num_queues() only lowers real_num_{tx,rx}_queues on a
successful open, so between probe and the first open the queue count the
netdev advertises and the size of these arrays disagreed.

This is a design change, not a bug fix, so it carries no Fixes: tag: the
old fallback was self consistent (one txq, one rxq, one coalesce entry,
one MSI-X entry and num_qps = 1), and nothing can reach the mismatch
today.  hinic3_xmit_frame() is bounded by q_params.num_qps and
hinic3_get_stats64() by max_qps, and the queue count cannot grow later
either, as the driver has no ethtool set_channels or set_rxfh callback.
Keeping the arrays at the hardware maximum is what the per-queue
statistics that will walk real_num_*_queues need, since they must not be
able to index past the end of a one-element array.

After this change nothing sets max_qps to 1 any more.  Keep it at
hinic3_func_max_qnum() in every branch, which is also the value
hinic3_init_nic_io() uses for the hardware queue capacity, and reduce
only q_params.num_qps.  err_reset_q_params() now sets it to 1 explicitly
instead of copying max_qps, since one queue is what the device uses while
RSS is disabled.

Co-developed-by: Wu Di <wudi234@huawei.com>
Signed-off-by: Wu Di <wudi234@huawei.com>
Co-developed-by: Teng Peisen <tengpeisen@huawei.com>
Signed-off-by: Teng Peisen <tengpeisen@huawei.com>
Signed-off-by: Fan Gong <gongfan1@huawei.com>
Link: https://patch.msgid.link/42bd527d0000cfffe9a9924e588d80b0979d3559.1794917917.git.gongfan1@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 file changed