| From 1d799d5548538dcf501f7fb99b1f529ef001b4c8 Mon Sep 17 00:00:00 2001 |
| From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| Date: Fri, 26 Jul 2024 09:27:45 +0800 |
| Subject: [PATCH 009/199] mtk: mt76: mt7996: fix rxd checksum offload offset |
| |
| Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> |
| --- |
| mt76_connac3_mac.h | 4 ++-- |
| mt7996/mac.c | 4 ++-- |
| 2 files changed, 4 insertions(+), 4 deletions(-) |
| |
| diff --git a/mt76_connac3_mac.h b/mt76_connac3_mac.h |
| index 3fc94bd7..db0c29e6 100644 |
| --- a/mt76_connac3_mac.h |
| +++ b/mt76_connac3_mac.h |
| @@ -28,8 +28,6 @@ enum { |
| #define MT_RXD0_MESH BIT(18) |
| #define MT_RXD0_MHCP BIT(19) |
| #define MT_RXD0_NORMAL_ETH_TYPE_OFS GENMASK(22, 16) |
| -#define MT_RXD0_NORMAL_IP_SUM BIT(23) |
| -#define MT_RXD0_NORMAL_UDP_TCP_SUM BIT(24) |
| |
| #define MT_RXD0_SW_PKT_TYPE_MASK GENMASK(31, 16) |
| #define MT_RXD0_SW_PKT_TYPE_MAP 0x380F |
| @@ -80,6 +78,8 @@ enum { |
| #define MT_RXD3_NORMAL_BEACON_UC BIT(21) |
| #define MT_RXD3_NORMAL_CO_ANT BIT(22) |
| #define MT_RXD3_NORMAL_FCS_ERR BIT(24) |
| +#define MT_RXD3_NORMAL_IP_SUM BIT(26) |
| +#define MT_RXD3_NORMAL_UDP_TCP_SUM BIT(27) |
| #define MT_RXD3_NORMAL_VLAN2ETH BIT(31) |
| |
| /* RXD DW4 */ |
| diff --git a/mt7996/mac.c b/mt7996/mac.c |
| index b3f9591f..109a74a9 100644 |
| --- a/mt7996/mac.c |
| +++ b/mt7996/mac.c |
| @@ -435,7 +435,7 @@ mt7996_mac_fill_rx(struct mt7996_dev *dev, enum mt76_rxq_id q, |
| u32 rxd2 = le32_to_cpu(rxd[2]); |
| u32 rxd3 = le32_to_cpu(rxd[3]); |
| u32 rxd4 = le32_to_cpu(rxd[4]); |
| - u32 csum_mask = MT_RXD0_NORMAL_IP_SUM | MT_RXD0_NORMAL_UDP_TCP_SUM; |
| + u32 csum_mask = MT_RXD3_NORMAL_IP_SUM | MT_RXD3_NORMAL_UDP_TCP_SUM; |
| u32 csum_status = *(u32 *)skb->cb; |
| u32 mesh_mask = MT_RXD0_MESH | MT_RXD0_MHCP; |
| bool is_mesh = (rxd0 & mesh_mask) == mesh_mask; |
| @@ -497,7 +497,7 @@ mt7996_mac_fill_rx(struct mt7996_dev *dev, enum mt76_rxq_id q, |
| if (!sband->channels) |
| return -EINVAL; |
| |
| - if ((rxd0 & csum_mask) == csum_mask && |
| + if ((rxd3 & csum_mask) == csum_mask && |
| !(csum_status & (BIT(0) | BIT(2) | BIT(3)))) |
| skb->ip_summed = CHECKSUM_UNNECESSARY; |
| |
| -- |
| 2.18.0 |
| |