Commit 3912e804 authored by Lad Prabhakar's avatar Lad Prabhakar Committed by Jakub Kicinski
Browse files

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: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://patch.msgid.link/20251023112111.215198-3-prabhakar.mahadev-lad.rj@bp.renesas.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 9078e6c5
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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;