Re: [PATCH 2/3] net: ravb: Allocate correct number of queues based on SoC support
From: Niklas Söderlund
Date: Wed Oct 15 2025 - 11:45:18 EST
Hi Prabhakar,
Thanks for your work.
On 2025-10-15 16:00:25 +0100, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
>
> On SoCs that only support the best-effort queue and not the network
> control queue, calling alloc_etherdev_mqs() with fixed values for
> TX/RX queues is not appropriate. Use the nc_queues flag from the
> per-SoC match data to determine whether the network control queue
> is available, and fall back to a single TX/RX queue when it is not.
> This ensures correct queue allocation across all supported SoCs.
>
> Fixes: a92f4f0662bf ("ravb: Add nc_queue to struct ravb_hw_info")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
> ---
> drivers/net/ethernet/renesas/ravb_main.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index 69d382e8757d..a200e205825a 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -2926,13 +2926,14 @@ static int ravb_probe(struct platform_device *pdev)
> return dev_err_probe(&pdev->dev, PTR_ERR(rstc),
> "failed to get cpg reset\n");
>
> + info = of_device_get_match_data(&pdev->dev);
> +
> ndev = alloc_etherdev_mqs(sizeof(struct ravb_private),
> - NUM_TX_QUEUE, NUM_RX_QUEUE);
> + info->nc_queues ? NUM_TX_QUEUE : 1,
> + info->nc_queues ? NUM_RX_QUEUE : 1);
> if (!ndev)
> return -ENOMEM;
>
> - info = of_device_get_match_data(&pdev->dev);
> -
> ndev->features = info->net_features;
> ndev->hw_features = info->net_hw_features;
> ndev->vlan_features = info->vlan_features;
> --
> 2.43.0
>
--
Kind Regards,
Niklas Söderlund