Commit 73cfd947 authored by Elad Yifee's avatar Elad Yifee Committed by Paolo Abeni

net: ethernet: mtk_eth_soc: ppe: prevent ppe update for non-mtk devices

Introduce an additional validation to ensure that the PPE index
is modified exclusively for mtk_eth ingress devices.
This primarily addresses the issue related
to WED operation with multiple PPEs.

Fixes: dee4dd10 ("net: ethernet: mtk_eth_soc: ppe: add support for multiple PPEs")
Signed-off-by: default avatarElad Yifee <eladwf@gmail.com>
Link: https://lore.kernel.org/r/20240623175113.24437-1-eladwf@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 1d706875
...@@ -266,7 +266,7 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f, ...@@ -266,7 +266,7 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f,
flow_rule_match_meta(rule, &match); flow_rule_match_meta(rule, &match);
if (mtk_is_netsys_v2_or_greater(eth)) { if (mtk_is_netsys_v2_or_greater(eth)) {
idev = __dev_get_by_index(&init_net, match.key->ingress_ifindex); idev = __dev_get_by_index(&init_net, match.key->ingress_ifindex);
if (idev) { if (idev && idev->netdev_ops == eth->netdev[0]->netdev_ops) {
struct mtk_mac *mac = netdev_priv(idev); struct mtk_mac *mac = netdev_priv(idev);
if (WARN_ON(mac->ppe_idx >= eth->soc->ppe_num)) if (WARN_ON(mac->ppe_idx >= eth->soc->ppe_num))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment