dbf574d80ac274dfe7afeda9ac5925bf97e6216a
[openwrt/staging/wigyori.git] /
1 From 73cfd947dbdb25ef9863ac49c4596a7d53ad4025 Mon Sep 17 00:00:00 2001
2 From: Elad Yifee <eladwf@gmail.com>
3 Date: Sun, 23 Jun 2024 20:51:09 +0300
4 Subject: [PATCH] net: ethernet: mtk_eth_soc: ppe: prevent ppe update for
5 non-mtk devices
6
7 Introduce an additional validation to ensure that the PPE index
8 is modified exclusively for mtk_eth ingress devices.
9 This primarily addresses the issue related
10 to WED operation with multiple PPEs.
11
12 Fixes: dee4dd10c79a ("net: ethernet: mtk_eth_soc: ppe: add support for multiple PPEs")
13 Signed-off-by: Elad Yifee <eladwf@gmail.com>
14 Link: https://lore.kernel.org/r/20240623175113.24437-1-eladwf@gmail.com
15 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
16 ---
17 drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20 --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
21 +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
22 @@ -266,7 +266,7 @@ mtk_flow_offload_replace(struct mtk_eth
23 flow_rule_match_meta(rule, &match);
24 if (mtk_is_netsys_v2_or_greater(eth)) {
25 idev = __dev_get_by_index(&init_net, match.key->ingress_ifindex);
26 - if (idev) {
27 + if (idev && idev->netdev_ops == eth->netdev[0]->netdev_ops) {
28 struct mtk_mac *mac = netdev_priv(idev);
29
30 if (WARN_ON(mac->ppe_idx >= eth->soc->ppe_num))