Skip to content

Commit 5f36ca1

Browse files
nbd168kuba-moo
authored andcommitted
net: ethernet: mtk_eth_soc: fix L2 offloading with DSA untag offload
Check for skb metadata in order to detect the case where the DSA header is not present. Fixes: 2d7605a ("net: ethernet: mtk_eth_soc: enable hardware DSA untagging") Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Felix Fietkau <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8c1cb87 commit 5f36ca1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,9 +2057,6 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
20572057
skb_checksum_none_assert(skb);
20582058
skb->protocol = eth_type_trans(skb, netdev);
20592059

2060-
if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED)
2061-
mtk_ppe_check_skb(eth->ppe[0], skb, hash);
2062-
20632060
if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) {
20642061
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
20652062
if (trxd.rxd3 & RX_DMA_VTAG_V2) {
@@ -2087,6 +2084,9 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
20872084
__vlan_hwaccel_put_tag(skb, htons(vlan_proto), vlan_tci);
20882085
}
20892086

2087+
if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED)
2088+
mtk_ppe_check_skb(eth->ppe[0], skb, hash);
2089+
20902090
skb_record_rx_queue(skb, 0);
20912091
napi_gro_receive(napi, skb);
20922092

drivers/net/ethernet/mediatek/mtk_ppe.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/platform_device.h>
99
#include <linux/if_ether.h>
1010
#include <linux/if_vlan.h>
11+
#include <net/dst_metadata.h>
1112
#include <net/dsa.h>
1213
#include "mtk_eth_soc.h"
1314
#include "mtk_ppe.h"
@@ -699,7 +700,9 @@ void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash)
699700
skb->dev->dsa_ptr->tag_ops->proto != DSA_TAG_PROTO_MTK)
700701
goto out;
701702

702-
tag += 4;
703+
if (!skb_metadata_dst(skb))
704+
tag += 4;
705+
703706
if (get_unaligned_be16(tag) != ETH_P_8021Q)
704707
break;
705708

0 commit comments

Comments
 (0)