Skip to content

Commit a5dc694

Browse files
LorenzoBianconidavem330
authored andcommitted
net: ethernet: mtk_ppe: add MTK_FOE_ENTRY_V{1,2}_SIZE macros
Introduce MTK_FOE_ENTRY_V{1,2}_SIZE macros in order to make more explicit foe_entry size for different chipset revisions. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent bf837e8 commit a5dc694

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4804,7 +4804,7 @@ static const struct mtk_soc_data mt7621_data = {
48044804
.required_pctl = false,
48054805
.offload_version = 1,
48064806
.hash_offset = 2,
4807-
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
4807+
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
48084808
.txrx = {
48094809
.txd_size = sizeof(struct mtk_tx_dma),
48104810
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4825,7 +4825,7 @@ static const struct mtk_soc_data mt7622_data = {
48254825
.offload_version = 2,
48264826
.hash_offset = 2,
48274827
.has_accounting = true,
4828-
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
4828+
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
48294829
.txrx = {
48304830
.txd_size = sizeof(struct mtk_tx_dma),
48314831
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4844,7 +4844,7 @@ static const struct mtk_soc_data mt7623_data = {
48444844
.required_pctl = true,
48454845
.offload_version = 1,
48464846
.hash_offset = 2,
4847-
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
4847+
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
48484848
.txrx = {
48494849
.txd_size = sizeof(struct mtk_tx_dma),
48504850
.rxd_size = sizeof(struct mtk_rx_dma),
@@ -4882,8 +4882,8 @@ static const struct mtk_soc_data mt7981_data = {
48824882
.required_pctl = false,
48834883
.offload_version = 2,
48844884
.hash_offset = 4,
4885-
.foe_entry_size = sizeof(struct mtk_foe_entry),
48864885
.has_accounting = true,
4886+
.foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
48874887
.txrx = {
48884888
.txd_size = sizeof(struct mtk_tx_dma_v2),
48894889
.rxd_size = sizeof(struct mtk_rx_dma_v2),
@@ -4903,8 +4903,8 @@ static const struct mtk_soc_data mt7986_data = {
49034903
.required_pctl = false,
49044904
.offload_version = 2,
49054905
.hash_offset = 4,
4906-
.foe_entry_size = sizeof(struct mtk_foe_entry),
49074906
.has_accounting = true,
4907+
.foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
49084908
.txrx = {
49094909
.txd_size = sizeof(struct mtk_tx_dma_v2),
49104910
.rxd_size = sizeof(struct mtk_rx_dma_v2),

drivers/net/ethernet/mediatek/mtk_ppe.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ struct mtk_foe_ipv6_6rd {
216216
struct mtk_foe_mac_info l2;
217217
};
218218

219+
#define MTK_FOE_ENTRY_V1_SIZE 80
220+
#define MTK_FOE_ENTRY_V2_SIZE 96
221+
219222
struct mtk_foe_entry {
220223
u32 ib1;
221224

0 commit comments

Comments
 (0)