From: Lad Prabhakar Date: Thu, 23 Oct 2025 11:21:11 +0000 (+0100) Subject: net: ravb: Allocate correct number of queues based on SoC support X-Git-Tag: v6.19-rc1~170^2~314^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3912e804ff6a03693cc50d801ab840479f7b20ac;p=thirdparty%2Fkernel%2Flinux.git net: ravb: Allocate correct number of queues based on SoC support Use the per-SoC match data flag `nc_queues` to decide how many TX/RX queues to allocate. If the SoC does not provide a network-control queue, fall back to a single TX/RX queue. Obtain the match data before calling alloc_etherdev_mqs() so the allocation is sized correctly. Signed-off-by: Lad Prabhakar Reviewed-by: Niklas Söderlund Link: https://patch.msgid.link/20251023112111.215198-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index cb5ae9f85252b..c3fc15f9ec852 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2946,13 +2946,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;