Skip to content

Commit 71ba8e4

Browse files
nbd168kuba-moo
authored andcommitted
net: ethernet: mtk_eth_soc: avoid port_mg assignment on MT7622 and newer
On newer chips, this field is unused and contains some bits related to queue assignment. Initialize it to 0 in those cases. Fix offload_version on MT7621 and MT7623, which still need the previous value. Signed-off-by: Felix Fietkau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f4b2fa2 commit 71ba8e4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4324,7 +4324,7 @@ static const struct mtk_soc_data mt7621_data = {
43244324
.hw_features = MTK_HW_FEATURES,
43254325
.required_clks = MT7621_CLKS_BITMAP,
43264326
.required_pctl = false,
4327-
.offload_version = 2,
4327+
.offload_version = 1,
43284328
.hash_offset = 2,
43294329
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
43304330
.txrx = {
@@ -4363,7 +4363,7 @@ static const struct mtk_soc_data mt7623_data = {
43634363
.hw_features = MTK_HW_FEATURES,
43644364
.required_clks = MT7623_CLKS_BITMAP,
43654365
.required_pctl = true,
4366-
.offload_version = 2,
4366+
.offload_version = 1,
43674367
.hash_offset = 2,
43684368
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
43694369
.txrx = {

drivers/net/ethernet/mediatek/mtk_ppe.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,16 @@ int mtk_foe_entry_prepare(struct mtk_eth *eth, struct mtk_foe_entry *entry,
175175
val = FIELD_PREP(MTK_FOE_IB2_DEST_PORT_V2, pse_port) |
176176
FIELD_PREP(MTK_FOE_IB2_PORT_AG_V2, 0xf);
177177
} else {
178+
int port_mg = eth->soc->offload_version > 1 ? 0 : 0x3f;
179+
178180
val = FIELD_PREP(MTK_FOE_IB1_STATE, MTK_FOE_STATE_BIND) |
179181
FIELD_PREP(MTK_FOE_IB1_PACKET_TYPE, type) |
180182
FIELD_PREP(MTK_FOE_IB1_UDP, l4proto == IPPROTO_UDP) |
181183
MTK_FOE_IB1_BIND_CACHE | MTK_FOE_IB1_BIND_TTL;
182184
entry->ib1 = val;
183185

184186
val = FIELD_PREP(MTK_FOE_IB2_DEST_PORT, pse_port) |
185-
FIELD_PREP(MTK_FOE_IB2_PORT_MG, 0x3f) |
187+
FIELD_PREP(MTK_FOE_IB2_PORT_MG, port_mg) |
186188
FIELD_PREP(MTK_FOE_IB2_PORT_AG, 0x1f);
187189
}
188190

0 commit comments

Comments
 (0)