2021-04-24 00:19:22 +00:00
|
|
|
From 3f57d8c40fea9b20543cab4da12f4680d2ef182c Mon Sep 17 00:00:00 2001
|
2020-10-24 19:14:16 +00:00
|
|
|
From: Felix Fietkau <nbd@nbd.name>
|
2021-04-24 00:19:22 +00:00
|
|
|
Date: Thu, 22 Apr 2021 22:20:54 -0700
|
|
|
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: fix RX VLAN offload
|
2020-10-24 19:14:16 +00:00
|
|
|
|
2021-04-24 00:19:22 +00:00
|
|
|
The VLAN ID in the rx descriptor is only valid if the RX_DMA_VTAG bit is
|
|
|
|
set. Fixes frames wrongly marked with VLAN tags.
|
2020-10-24 19:14:16 +00:00
|
|
|
|
|
|
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
2021-04-24 00:19:22 +00:00
|
|
|
[Ilya: fix commit message]
|
|
|
|
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
|
|
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
2020-10-24 19:14:16 +00:00
|
|
|
---
|
2021-04-24 00:19:22 +00:00
|
|
|
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
|
|
|
|
drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 +
|
|
|
|
2 files changed, 2 insertions(+), 1 deletion(-)
|
2020-10-24 19:14:16 +00:00
|
|
|
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
2021-04-24 00:19:22 +00:00
|
|
|
@@ -1319,7 +1319,7 @@ static int mtk_poll_rx(struct napi_struc
|
2020-10-24 19:14:16 +00:00
|
|
|
skb->protocol = eth_type_trans(skb, netdev);
|
|
|
|
|
|
|
|
if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX &&
|
|
|
|
- RX_DMA_VID(trxd.rxd3))
|
|
|
|
+ (trxd.rxd2 & RX_DMA_VTAG))
|
|
|
|
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
|
|
|
|
RX_DMA_VID(trxd.rxd3));
|
|
|
|
skb_record_rx_queue(skb, 0);
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
|
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
2021-04-10 11:20:04 +00:00
|
|
|
@@ -300,6 +300,7 @@
|
2020-10-24 19:14:16 +00:00
|
|
|
#define RX_DMA_LSO BIT(30)
|
|
|
|
#define RX_DMA_PLEN0(_x) (((_x) & 0x3fff) << 16)
|
|
|
|
#define RX_DMA_GET_PLEN0(_x) (((_x) >> 16) & 0x3fff)
|
|
|
|
+#define RX_DMA_VTAG BIT(15)
|
|
|
|
|
|
|
|
/* QDMA descriptor rxd3 */
|
|
|
|
#define RX_DMA_VID(_x) ((_x) & 0xfff)
|