Re: [PATCH net-next v05 08/14] hinic3: Queue pair resource initialization

Simon Horman
2025-09-11T12:32:40Z

On Tue, Sep 09, 2025 at 03:33:33PM +0800, Fan Gong wrote:
> Add Tx & Rx queue resources and functions for packet transmission
> and reception.
>
> Co-developed-by: Zhu Yikai <zhuyikai1@h-partners.com>
> Signed-off-by: Zhu Yikai <zhuyikai1@h-partners.com>
> Signed-off-by: Fan Gong <gongfan1@huawei.com>

...

> +static void hinic3_config_num_qps(struct net_device *netdev,
> + struct hinic3_dyna_txrxq_params *q_params)
> +{
> + struct hinic3_nic_dev *nic_dev = netdev_priv(netdev);
> + u16 alloc_num_irq, cur_num_irq;
> + u16 dst_num_irq;
> +
> + if (!test_bit(HINIC3_RSS_ENABLE, &nic_dev->flags))
> + q_params->num_qps = 1;
> +
> + if (nic_dev->num_qp_irq >= q_params->num_qps)
> + goto out;
> +
> + cur_num_irq = nic_dev->num_qp_irq;
> +
> + alloc_num_irq = hinic3_qp_irq_change(netdev, q_params->num_qps);
> + if (alloc_num_irq < q_params->num_qps) {
> + q_params->num_qps = alloc_num_irq;
> + netdev_warn(netdev, "Can not get enough irqs, adjust num_qps to %u\n",
> + q_params->num_qps);
> +
> + /* The current irq may be in use, we must keep it */
> + dst_num_irq = max_t(u16, cur_num_irq, q_params->num_qps);
> + hinic3_qp_irq_change(netdev, dst_num_irq);
> + }
> +
> +out:
> + netdev_dbg(netdev, "Finally num_qps: %u\n", q_params->num_qps);

I'm not sure that "Finally" will be readily understood
(or, for that matter, that I readily understand it).
Could this be clarified somehow?

> +}