2
0

734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch 959 B

123456789101112131415161718192021222324252627282930313233
  1. From: Felix Fietkau <[email protected]>
  2. Date: Tue, 27 Dec 2022 15:02:51 +0100
  3. Subject: [PATCH] net: ethernet: mtk_eth_soc: ppe: fix L2 offloading with DSA
  4. untagging offload enabled
  5. Check for skb metadata in order to detect the case where the DSA header is not
  6. present.
  7. Fixes: 2d7605a72906 ("net: ethernet: mtk_eth_soc: enable hardware DSA untagging")
  8. Signed-off-by: Felix Fietkau <[email protected]>
  9. ---
  10. --- a/drivers/net/ethernet/mediatek/mtk_ppe.c
  11. +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
  12. @@ -8,6 +8,7 @@
  13. #include <linux/platform_device.h>
  14. #include <linux/if_ether.h>
  15. #include <linux/if_vlan.h>
  16. +#include <net/dst_metadata.h>
  17. #include <net/dsa.h>
  18. #include "mtk_eth_soc.h"
  19. #include "mtk_ppe.h"
  20. @@ -781,7 +782,9 @@ void __mtk_ppe_check_skb(struct mtk_ppe
  21. skb->dev->dsa_ptr->tag_ops->proto != DSA_TAG_PROTO_MTK)
  22. goto out;
  23. - tag += 4;
  24. + if (!skb_metadata_dst(skb))
  25. + tag += 4;
  26. +
  27. if (get_unaligned_be16(tag) != ETH_P_8021Q)
  28. break;