net: sparx5: configure TAS port link speed
Subsystems (4)
PATCH 1/1 net: sparx5: configure TAS port link speed
On the TSN and RED variants of LAN969x and SparX-5i TAS (Time-Aware Shaper) is present in the silicon.
Currently, the driver does not use configure it at all, which means that the TAS_PROFILE_CONFIG.LINK_SPEED[1] value is left at the default of 3 which means that its configured for 1 Gbps.
So, running iperf between two 10G switch ports will result in only 940-ish Mbps while we should be getting around 9.3 Gbps.
Correctly populating the TAS_PROFILE_CONFIG.LINK_SPEED[1] with the current port speed fixes this issue and we achieve around 9.4 Gbps between two 10G switch ports.
So, port the TAS port link speed setting from the vendor BSP 6.18 kernel[2]
[1] https://microchip-ung.github.io/lan969x-industrial_reginfo/reginfo_LAN969x-Industrial.html?select=hsch,tas_profile_cfg,tas_profile_config,link_speed
[2] https://github.com/microchip-ung/linux/tree/bsp-6.18-2026
--- .../microchip/sparx5/lan969x/lan969x_regs.c | 3 ++ .../microchip/sparx5/sparx5_main_regs.h | 12 +++++ .../ethernet/microchip/sparx5/sparx5_port.c | 4 ++ .../ethernet/microchip/sparx5/sparx5_qos.c | 49 +++++++++++++++++++ .../ethernet/microchip/sparx5/sparx5_qos.h | 1 + .../ethernet/microchip/sparx5/sparx5_regs.c | 3 ++ .../ethernet/microchip/sparx5/sparx5_regs.h | 3 ++ 7 files changed, 75 insertions(+)
drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_regs.c +3 -0
@@ -95,6 +95,7 @@ const unsigned int lan969x_gaddr[GADDR_LAST] = { [GA_HSCH_SYSTEM] = 37384, [GA_HSCH_MMGT] = 36260, [GA_HSCH_TAS_CONFIG] = 37696, + [GA_HSCH_TAS_PROFILE_CFG] = 37712, [GA_PTP_PTP_CFG] = 512, [GA_PTP_PTP_TOD_DOMAINS] = 528, [GA_PTP_PHASE_DETECTOR_CTRL] = 628,
@@ -129,6 +130,7 @@ const unsigned int lan969x_gcnt[GCNT_LAST] = { [GC_GCB_SIO_CTRL] = 1, [GC_HSCH_HSCH_CFG] = 1120, [GC_HSCH_HSCH_DWRR] = 32, + [GC_HSCH_TAS_PROFILE_CFG] = 30, [GC_PTP_PTP_PINS] = 8, [GC_PTP_PHASE_DETECTOR_CTRL] = 8, [GC_REW_PORT] = 35,
@@ -144,6 +146,7 @@ const unsigned int lan969x_gsize[GSIZE_LAST] = { [GW_FDMA_FDMA] = 448, [GW_GCB_CHIP_REGS] = 180, [GW_HSCH_TAS_CONFIG] = 16, + [GW_HSCH_TAS_PROFILE_CFG] = 68, [GW_PTP_PHASE_DETECTOR_CTRL] = 12, [GW_QSYS_PAUSE_CFG] = 988, };
drivers/net/ethernet/microchip/sparx5/sparx5_main_regs.h +12 -0
@@ -5369,6 +5369,18 @@ extern const struct sparx5_regs *regs;#define HSCH_TAS_STATEMACHINE_CFG_REVISIT_DLY_GET (x)\ FIELD_GET(HSCH_TAS_STATEMACHINE_CFG_REVISIT_DLY, x) +/* HSCH:TAS_PROFILE_CFG:TAS_PROFILE_CONFIG */ +#define HSCH_TAS_PROFILE_CONFIG (g) \ + __REG(TARGET_HSCH, 0, 1, regs->gaddr[GA_HSCH_TAS_PROFILE_CFG], g, \ + regs->gcnt[GC_HSCH_TAS_PROFILE_CFG], \ + regs->gsize[GW_HSCH_TAS_PROFILE_CFG], 32, 0, 1, 4) + +#define HSCH_TAS_PROFILE_CONFIG_LINK_SPEED GENMASK(10, 8) +#define HSCH_TAS_PROFILE_CONFIG_LINK_SPEED_SET (x)\ + FIELD_PREP(HSCH_TAS_PROFILE_CONFIG_LINK_SPEED, x) +#define HSCH_TAS_PROFILE_CONFIG_LINK_SPEED_GET (x)\ + FIELD_GET(HSCH_TAS_PROFILE_CONFIG_LINK_SPEED, x) +/* LAN969X ONLY */ /* HSIOWRAP:XMII_CFG:XMII_CFG */ #define HSIO_WRAP_XMII_CFG (g) \
drivers/net/ethernet/microchip/sparx5/sparx5_port.c +4 -0
@@ -11,6 +11,7 @@#include "sparx5_main_regs.h" #include "sparx5_main.h" #include "sparx5_port.h" +#include "sparx5_qos.h" #define SPX5_ETYPE_TAG_C 0x8100#define SPX5_ETYPE_TAG_S 0x88a8
@@ -1050,6 +1051,9 @@ int sparx5_port_config(struct sparx5 *sparx5, sparx5, QFWD_SWITCH_PORT_MODE(port->portno)); +/* Notify TAS about the speed. */ +sparx5_tas_speed (port, conf->speed); +/* Save the new values */ port->conf = *conf;
drivers/net/ethernet/microchip/sparx5/sparx5_qos.c +49 -0
58 lines not on this page · raw message
drivers/net/ethernet/microchip/sparx5/sparx5_qos.h +1 -0
@@ -60,6 +60,7 @@ struct sparx5_dwrr { };int sparx5_qos_init (struct sparx5 *sparx5); +void sparx5_tas_speed (struct sparx5_port *port,int speed);/* Multi-Queue Priority */ int sparx5_tc_mqprio_add (struct net_device *ndev,u8 num_tc);
drivers/net/ethernet/microchip/sparx5/sparx5_regs.c +3 -0
@@ -95,6 +95,7 @@ const unsigned int sparx5_gaddr[GADDR_LAST] = { [GA_HSCH_SYSTEM] = 184000, [GA_HSCH_MMGT] = 162368, [GA_HSCH_TAS_CONFIG] = 162384, + [GA_HSCH_TAS_PROFILE_CFG] = 188416, [GA_PTP_PTP_CFG] = 320, [GA_PTP_PTP_TOD_DOMAINS] = 336, [GA_PTP_PHASE_DETECTOR_CTRL] = 420,
@@ -129,6 +130,7 @@ const unsigned int sparx5_gcnt[GCNT_LAST] = { [GC_GCB_SIO_CTRL] = 3, [GC_HSCH_HSCH_CFG] = 5040, [GC_HSCH_HSCH_DWRR] = 72, + [GC_HSCH_TAS_PROFILE_CFG] = 100, [GC_PTP_PTP_PINS] = 5, [GC_PTP_PHASE_DETECTOR_CTRL] = 5, [GC_REW_PORT] = 70,
@@ -144,6 +146,7 @@ const unsigned int sparx5_gsize[GSIZE_LAST] = { [GW_FDMA_FDMA] = 428, [GW_GCB_CHIP_REGS] = 424, [GW_HSCH_TAS_CONFIG] = 12, + [GW_HSCH_TAS_PROFILE_CFG] = 64, [GW_PTP_PHASE_DETECTOR_CTRL] = 8, [GW_QSYS_PAUSE_CFG] = 1128, };
drivers/net/ethernet/microchip/sparx5/sparx5_regs.h +3 -0
@@ -104,6 +104,7 @@ enum sparx5_gaddr_enum {GA_HSCH_SYSTEM ,GA_HSCH_MMGT ,GA_HSCH_TAS_CONFIG , +GA_HSCH_TAS_PROFILE_CFG ,GA_PTP_PTP_CFG ,GA_PTP_PTP_TOD_DOMAINS , GA_PTP_PHASE_DETECTOR_CTRL,
@@ -139,6 +140,7 @@ enum sparx5_gcnt_enum {GC_GCB_SIO_CTRL ,GC_HSCH_HSCH_CFG ,GC_HSCH_HSCH_DWRR , +GC_HSCH_TAS_PROFILE_CFG ,GC_PTP_PTP_PINS ,GC_PTP_PHASE_DETECTOR_CTRL , GC_REW_PORT,
@@ -155,6 +157,7 @@ enum sparx5_gsize_enum {GW_FDMA_FDMA ,GW_GCB_CHIP_REGS ,GW_HSCH_TAS_CONFIG , +GW_HSCH_TAS_PROFILE_CFG ,GW_PTP_PHASE_DETECTOR_CTRL ,GW_QSYS_PAUSE_CFG , GSIZE_LAST,
Signature · 1 line
2.55.0
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 8 lines · On Tue, 7 Jul 2026 19:04:48 +0200 you wrote:
On the TSN and RED variants of LAN969x and SparX-5i TAS (Time-Aware Shaper) is present in the silicon.
Currently, the driver does not use configure it at all, which means that the TAS_PROFILE_CONFIG.LINK_SPEED[1] value is left at the default of 3 which means that its configured for 1 Gbps.
[...]
Here is the summary with links:
- [net-next] net: sparx5: configure TAS port link speed
https://git.kernel.org/netdev/net-next/c/80d8e1d428e8
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html