1 From 5ea0e1312bcfebc06b5f91d1bb82b823d6395125 Mon Sep 17 00:00:00 2001
2 From: Lorenzo Bianconi <lorenzo@kernel.org>
3 Date: Wed, 19 Jul 2023 12:29:49 +0200
4 Subject: [PATCH 095/250] net: ethernet: mtk_ppe: add MTK_FOE_ENTRY_V{1,2}_SIZE
7 Introduce MTK_FOE_ENTRY_V{1,2}_SIZE macros in order to make more
8 explicit foe_entry size for different chipset revisions.
10 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
11 Reviewed-by: Simon Horman <simon.horman@corigine.com>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
14 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 10 +++++-----
15 drivers/net/ethernet/mediatek/mtk_ppe.h | 3 +++
16 2 files changed, 8 insertions(+), 5 deletions(-)
18 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
19 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
20 @@ -4713,7 +4713,7 @@ static const struct mtk_soc_data mt7621_
21 .required_pctl = false,
24 - .foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
25 + .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
27 .txd_size = sizeof(struct mtk_tx_dma),
28 .rxd_size = sizeof(struct mtk_rx_dma),
29 @@ -4734,7 +4734,7 @@ static const struct mtk_soc_data mt7622_
32 .has_accounting = true,
33 - .foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
34 + .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
36 .txd_size = sizeof(struct mtk_tx_dma),
37 .rxd_size = sizeof(struct mtk_rx_dma),
38 @@ -4753,7 +4753,7 @@ static const struct mtk_soc_data mt7623_
39 .required_pctl = true,
42 - .foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
43 + .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
45 .txd_size = sizeof(struct mtk_tx_dma),
46 .rxd_size = sizeof(struct mtk_rx_dma),
47 @@ -4791,8 +4791,8 @@ static const struct mtk_soc_data mt7981_
48 .required_pctl = false,
51 - .foe_entry_size = sizeof(struct mtk_foe_entry),
52 .has_accounting = true,
53 + .foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
55 .txd_size = sizeof(struct mtk_tx_dma_v2),
56 .rxd_size = sizeof(struct mtk_rx_dma_v2),
57 @@ -4812,8 +4812,8 @@ static const struct mtk_soc_data mt7986_
58 .required_pctl = false,
61 - .foe_entry_size = sizeof(struct mtk_foe_entry),
62 .has_accounting = true,
63 + .foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
65 .txd_size = sizeof(struct mtk_tx_dma_v2),
66 .rxd_size = sizeof(struct mtk_rx_dma_v2),
67 --- a/drivers/net/ethernet/mediatek/mtk_ppe.h
68 +++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
69 @@ -216,6 +216,9 @@ struct mtk_foe_ipv6_6rd {
70 struct mtk_foe_mac_info l2;
73 +#define MTK_FOE_ENTRY_V1_SIZE 80
74 +#define MTK_FOE_ENTRY_V2_SIZE 96
76 struct mtk_foe_entry {