Skip to content

Commit 448269f

Browse files
Amit Cohenkuba-moo
Amit Cohen
authored andcommitted
mlxsw: Do not store Tx header length as driver parameter
Tx header handling was moved to PCI code, as there is no several drivers which configure Tx header differently. Tx header length is stored as driver parameter, this is not really necessary as it always stores the same value. Remove this field and use the macro MLXSW_TXHDR_LEN explicitly. Signed-off-by: Amit Cohen <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Link: https://patch.msgid.link/1fb7b3f007de4d311e559c8a954b673d0895d5e9.1737044384.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6ce1aac commit 448269f

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

drivers/net/ethernet/mellanox/mlxsw/core.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "reg.h"
3636
#include "resources.h"
3737
#include "../mlxfw/mlxfw.h"
38+
#include "txheader.h"
3839

3940
static LIST_HEAD(mlxsw_core_driver_list);
4041
static DEFINE_SPINLOCK(mlxsw_core_driver_list_lock);
@@ -943,7 +944,7 @@ static struct sk_buff *mlxsw_emad_alloc(const struct mlxsw_core *mlxsw_core,
943944

944945
emad_len = (reg_len + sizeof(u32) + MLXSW_EMAD_ETH_HDR_LEN +
945946
(MLXSW_EMAD_OP_TLV_LEN + MLXSW_EMAD_END_TLV_LEN) *
946-
sizeof(u32) + mlxsw_core->driver->txhdr_len);
947+
sizeof(u32) + MLXSW_TXHDR_LEN);
947948
if (mlxsw_core->emad.enable_string_tlv)
948949
emad_len += MLXSW_EMAD_STRING_TLV_LEN * sizeof(u32);
949950
if (mlxsw_core->emad.enable_latency_tlv)

drivers/net/ethernet/mellanox/mlxsw/core.h

-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ struct mlxsw_driver {
444444
void (*ptp_transmitted)(struct mlxsw_core *mlxsw_core,
445445
struct sk_buff *skb, u16 local_port);
446446

447-
u8 txhdr_len;
448447
const struct mlxsw_config_profile *profile;
449448
bool sdq_supports_cqe_v2;
450449
};

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

-4
Original file line numberDiff line numberDiff line change
@@ -3890,7 +3890,6 @@ static struct mlxsw_driver mlxsw_sp1_driver = {
38903890
.resources_register = mlxsw_sp1_resources_register,
38913891
.kvd_sizes_get = mlxsw_sp_kvd_sizes_get,
38923892
.ptp_transmitted = mlxsw_sp_ptp_transmitted,
3893-
.txhdr_len = MLXSW_TXHDR_LEN,
38943893
.profile = &mlxsw_sp1_config_profile,
38953894
.sdq_supports_cqe_v2 = false,
38963895
};
@@ -3926,7 +3925,6 @@ static struct mlxsw_driver mlxsw_sp2_driver = {
39263925
.trap_policer_counter_get = mlxsw_sp_trap_policer_counter_get,
39273926
.resources_register = mlxsw_sp2_resources_register,
39283927
.ptp_transmitted = mlxsw_sp_ptp_transmitted,
3929-
.txhdr_len = MLXSW_TXHDR_LEN,
39303928
.profile = &mlxsw_sp2_config_profile,
39313929
.sdq_supports_cqe_v2 = true,
39323930
};
@@ -3962,7 +3960,6 @@ static struct mlxsw_driver mlxsw_sp3_driver = {
39623960
.trap_policer_counter_get = mlxsw_sp_trap_policer_counter_get,
39633961
.resources_register = mlxsw_sp2_resources_register,
39643962
.ptp_transmitted = mlxsw_sp_ptp_transmitted,
3965-
.txhdr_len = MLXSW_TXHDR_LEN,
39663963
.profile = &mlxsw_sp2_config_profile,
39673964
.sdq_supports_cqe_v2 = true,
39683965
};
@@ -3996,7 +3993,6 @@ static struct mlxsw_driver mlxsw_sp4_driver = {
39963993
.trap_policer_counter_get = mlxsw_sp_trap_policer_counter_get,
39973994
.resources_register = mlxsw_sp2_resources_register,
39983995
.ptp_transmitted = mlxsw_sp_ptp_transmitted,
3999-
.txhdr_len = MLXSW_TXHDR_LEN,
40003996
.profile = &mlxsw_sp4_config_profile,
40013997
.sdq_supports_cqe_v2 = true,
40023998
};

0 commit comments

Comments
 (0)