Backpot upstream patch for Flow Offload support for AN7581 and refresh all affected patch. To correctly work a dedicated firmware is needed to use the dedicated Network Coprocessor (NPU). This also introduce good cleanup and moves the driver in a dedicated Airoha directory. While currently not totally usable (due to lack of firmware blob) this is needed to backport support for external PHY/SFP support. Refresh all affected patch. Tested-by: Aleksander Jan Bajkowski <olek2@wp.pl> # tested on Quantum W1700k Tested-by: Andrew LaMarche <andrewjlamarche@gmail.com> Link: https://github.com/openwrt/openwrt/pull/18166 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
42 lines
1.4 KiB
Diff
42 lines
1.4 KiB
Diff
From c9f947769b77c8e8f318bfc8a0777e5d20c44d8d Mon Sep 17 00:00:00 2001
|
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
Date: Thu, 17 Oct 2024 16:01:41 +0200
|
|
Subject: [PATCH] net: airoha: Reset BQL stopping the netdevice
|
|
|
|
Run airoha_qdma_cleanup_tx_queue() in ndo_stop callback in order to
|
|
unmap pending skbs. Moreover, reset BQL txq state stopping the netdevice,
|
|
|
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
Reviewed-by: Hariprasad Kelam <hkelam@marvell.com>
|
|
Message-ID: <20241017-airoha-en7581-reset-bql-v1-1-08c0c9888de5@kernel.org>
|
|
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
|
|
---
|
|
drivers/net/ethernet/mediatek/airoha_eth.c | 10 +++++++++-
|
|
1 file changed, 9 insertions(+), 1 deletion(-)
|
|
|
|
--- a/drivers/net/ethernet/mediatek/airoha_eth.c
|
|
+++ b/drivers/net/ethernet/mediatek/airoha_eth.c
|
|
@@ -2469,7 +2469,7 @@ static int airoha_dev_stop(struct net_de
|
|
{
|
|
struct airoha_gdm_port *port = netdev_priv(dev);
|
|
struct airoha_qdma *qdma = port->qdma;
|
|
- int err;
|
|
+ int i, err;
|
|
|
|
netif_tx_disable(dev);
|
|
err = airoha_set_gdm_ports(qdma->eth, false);
|
|
@@ -2480,6 +2480,14 @@ static int airoha_dev_stop(struct net_de
|
|
GLOBAL_CFG_TX_DMA_EN_MASK |
|
|
GLOBAL_CFG_RX_DMA_EN_MASK);
|
|
|
|
+ for (i = 0; i < ARRAY_SIZE(qdma->q_tx); i++) {
|
|
+ if (!qdma->q_tx[i].ndesc)
|
|
+ continue;
|
|
+
|
|
+ airoha_qdma_cleanup_tx_queue(&qdma->q_tx[i]);
|
|
+ netdev_tx_reset_subqueue(dev, i);
|
|
+ }
|
|
+
|
|
return 0;
|
|
}
|
|
|