Skip to content

Commit 8dbf0c7

Browse files
chenhuacaikuba-moo
authored andcommitted
net: stmmac: dwmac-loongson: Set correct {tx,rx}_fifo_size
Now for dwmac-loongson {tx,rx}_fifo_size are uninitialised, which means zero. This means dwmac-loongson doesn't support changing MTU because in stmmac_change_mtu() it requires the fifo size be no less than MTU. Thus, set the correct tx_fifo_size and rx_fifo_size for it (16KB multiplied by queue counts). Here {tx,rx}_fifo_size is initialised with the initial value (also the maximum value) of {tx,rx}_queues_to_use. So it will keep as 16KB if we don't change the queue count, and will be larger than 16KB if we change (decrease) the queue count. However stmmac_change_mtu() still work well with current logic (MTU cannot be larger than 16KB for stmmac). Note: the Fixes tag picked here is the oldest commit and key commit of the dwmac-loongson series "stmmac: Add Loongson platform support". Acked-by: Yanteng Si <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Chong Qiao <[email protected]> Signed-off-by: Huacai Chen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 23fc931 commit 8dbf0c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,9 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
574574
if (ret)
575575
goto err_disable_device;
576576

577+
plat->tx_fifo_size = SZ_16K * plat->tx_queues_to_use;
578+
plat->rx_fifo_size = SZ_16K * plat->rx_queues_to_use;
579+
577580
if (dev_of_node(&pdev->dev))
578581
ret = loongson_dwmac_dt_config(pdev, plat, &res);
579582
else

0 commit comments

Comments
 (0)