[][kernel][common][eth][Correct LROv1 invalidate flow]

[Description]
Refactor LROv1 invalidate flow.

In the previous change [1], we refactored LRO and RSS configurations
to use the reg_map method, but mistakenly left an issue in the
mtk_hwlro_rx_uninit() function. This will cause Ring3 to not be invalidated while running LROv1.

[1] https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/
mtk-openwrt-feeds/+/83d1da717a59a9d35c30e9367d43e13fb43e0a26

Without this patch, the Ring3 will not be invalidated in the
mtk_hwlro_rx_uninit() while running the LROv1.

[Release-log]
N/A


Change-Id: I1fa4e03ff7da2d511be1b370c42eeabf482f74a6
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/9453648
diff --git a/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 16b7141..82f87b5 100644
--- a/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3248,8 +3248,11 @@
 	}
 
 	/* invalidate lro rings */
-	for (i = 0; i < MTK_HW_LRO_RING_NUM; i++)
-		mtk_w32(eth, 0, reg_map->pdma.lro_rx_ctrl_dw0 + 0x8 + (i * 0x40));
+	for (i = 0; i < MTK_HW_LRO_RING_NUM; i++) {
+		int idx = MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_RX_V2) ? i : i + 1;
+
+		mtk_w32(eth, 0, reg_map->pdma.lro_rx_ctrl_dw0 + 0x8 + (idx * 0x40));
+	}
 
 	/* disable HW LRO */
 	mtk_w32(eth, 0, reg_map->pdma.lro_ctrl_dw0);