]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
mlxsw: Do not store Tx header length as driver parameter
authorAmit Cohen <amcohen@nvidia.com>
Thu, 16 Jan 2025 16:38:18 +0000 (17:38 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 18 Jan 2025 03:58:00 +0000 (19:58 -0800)
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 <amcohen@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Link: https://patch.msgid.link/1fb7b3f007de4d311e559c8a954b673d0895d5e9.1737044384.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/core.c
drivers/net/ethernet/mellanox/mlxsw/core.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.c

index 39888678a2bd835c4c6aa01685590fb7e7618ace..2bb2b77351bd5f557d591c6ae36f728d712dc579 100644 (file)
@@ -35,6 +35,7 @@
 #include "reg.h"
 #include "resources.h"
 #include "../mlxfw/mlxfw.h"
+#include "txheader.h"
 
 static LIST_HEAD(mlxsw_core_driver_list);
 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,
 
        emad_len = (reg_len + sizeof(u32) + MLXSW_EMAD_ETH_HDR_LEN +
                    (MLXSW_EMAD_OP_TLV_LEN + MLXSW_EMAD_END_TLV_LEN) *
-                   sizeof(u32) + mlxsw_core->driver->txhdr_len);
+                   sizeof(u32) + MLXSW_TXHDR_LEN);
        if (mlxsw_core->emad.enable_string_tlv)
                emad_len += MLXSW_EMAD_STRING_TLV_LEN * sizeof(u32);
        if (mlxsw_core->emad.enable_latency_tlv)
index d842af24465db05c238a8bdc9973353c8da692ea..1a871397a6dfb092b0e36fda54ed038eac6f76c0 100644 (file)
@@ -444,7 +444,6 @@ struct mlxsw_driver {
        void (*ptp_transmitted)(struct mlxsw_core *mlxsw_core,
                                struct sk_buff *skb, u16 local_port);
 
-       u8 txhdr_len;
        const struct mlxsw_config_profile *profile;
        bool sdq_supports_cqe_v2;
 };
index d2886a8db83d9916055748e2c004ad8d38c6faa4..d714311fd884e3c81a1a73b8f3c38fb799f8884f 100644 (file)
@@ -3890,7 +3890,6 @@ static struct mlxsw_driver mlxsw_sp1_driver = {
        .resources_register             = mlxsw_sp1_resources_register,
        .kvd_sizes_get                  = mlxsw_sp_kvd_sizes_get,
        .ptp_transmitted                = mlxsw_sp_ptp_transmitted,
-       .txhdr_len                      = MLXSW_TXHDR_LEN,
        .profile                        = &mlxsw_sp1_config_profile,
        .sdq_supports_cqe_v2            = false,
 };
@@ -3926,7 +3925,6 @@ static struct mlxsw_driver mlxsw_sp2_driver = {
        .trap_policer_counter_get       = mlxsw_sp_trap_policer_counter_get,
        .resources_register             = mlxsw_sp2_resources_register,
        .ptp_transmitted                = mlxsw_sp_ptp_transmitted,
-       .txhdr_len                      = MLXSW_TXHDR_LEN,
        .profile                        = &mlxsw_sp2_config_profile,
        .sdq_supports_cqe_v2            = true,
 };
@@ -3962,7 +3960,6 @@ static struct mlxsw_driver mlxsw_sp3_driver = {
        .trap_policer_counter_get       = mlxsw_sp_trap_policer_counter_get,
        .resources_register             = mlxsw_sp2_resources_register,
        .ptp_transmitted                = mlxsw_sp_ptp_transmitted,
-       .txhdr_len                      = MLXSW_TXHDR_LEN,
        .profile                        = &mlxsw_sp2_config_profile,
        .sdq_supports_cqe_v2            = true,
 };
@@ -3996,7 +3993,6 @@ static struct mlxsw_driver mlxsw_sp4_driver = {
        .trap_policer_counter_get       = mlxsw_sp_trap_policer_counter_get,
        .resources_register             = mlxsw_sp2_resources_register,
        .ptp_transmitted                = mlxsw_sp_ptp_transmitted,
-       .txhdr_len                      = MLXSW_TXHDR_LEN,
        .profile                        = &mlxsw_sp4_config_profile,
        .sdq_supports_cqe_v2            = true,
 };