[OpenWrt-Devel] [PATCH 2/3] ramips: ethernet: Fix NAPI weight for non mt7621 devices

Rosen Penev rosenp at gmail.com
Wed Mar 13 17:05:43 EDT 2019


My original fix was to make the code do 16 * 4 as 64 is the limit for NAPI
weight. However this also reduces the weight for non mt7621 devices.

Changed the multiplier to 2 instead.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 .../drivers/net/ethernet/mediatek/mtk_eth_soc.c           | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index d110787731..934ed010bc 100644
--- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1624,11 +1624,11 @@ static int fe_probe(struct platform_device *pdev)
 	INIT_WORK(&priv->pending_work, fe_pending_work);
 	u64_stats_init(&priv->hw_stats->syncp);
 
-	napi_weight = 16;
+	napi_weight = 32;
 	if (priv->flags & FE_FLAG_NAPI_WEIGHT) {
-		napi_weight *= 4;
-		priv->tx_ring.tx_ring_size *= 4;
-		priv->rx_ring.rx_ring_size *= 4;
+		napi_weight *= 2;
+		priv->tx_ring.tx_ring_size *= 2;
+		priv->rx_ring.rx_ring_size *= 2;
 	}
 	netif_napi_add(netdev, &priv->rx_napi, fe_poll, napi_weight);
 	fe_set_ethtool_ops(netdev);
-- 
2.17.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list