Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] net: stmmac: stm32: Set TSO/TBS Tx queues default settings
@ 2026-08-12  6:28 Kurt Kanzenbach
  2026-08-17 17:33 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Kurt Kanzenbach @ 2026-08-12  6:28 UTC (permalink / raw)
  To: Maxime Chevallier, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue
  Cc: netdev, linux-stm32, linux-arm-kernel, Kurt Kanzenbach

TSO and TBS cannot coexist. Use the first queue with TSO and the rest for
TBS. Tx queues with TBS can support etf qdisc hw offload. This is done
similar to dwmac-imx and dwmac-intel.

Tested on stm32mp257f-dk with AF_XDP and Tx Launch Time on queue 1.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
index e1b260ed4790..8e15094eeab9 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
@@ -557,6 +557,12 @@ static int stm32_dwmac_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	/* Default TX Q0 to use TSO and rest TXQ for TBS */
+	if (dwmac->ops->is_mp2) {
+		for (int i = 1; i < plat_dat->tx_queues_to_use; i++)
+			plat_dat->tx_queues_cfg[i].tbs_en = 1;
+	}
+
 	plat_dat->flags |= STMMAC_FLAG_EN_TX_LPI_CLK_PHY_CAP;
 	plat_dat->bsp_priv = dwmac;
 	plat_dat->suspend = stm32_dwmac_suspend;

---
base-commit: ac155a26750a595703e7dadff84735456d75a479
change-id: 20260811-stm32mp2_txtime-6bf9e01c968e

Best regards,
--  
Kurt Kanzenbach <kurt@linutronix.de>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: stmmac: stm32: Set TSO/TBS Tx queues default settings
  2026-08-12  6:28 [PATCH net-next] net: stmmac: stm32: Set TSO/TBS Tx queues default settings Kurt Kanzenbach
@ 2026-08-17 17:33 ` Jakub Kicinski
  2026-08-18  6:57   ` Kurt Kanzenbach
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2026-08-17 17:33 UTC (permalink / raw)
  To: Kurt Kanzenbach
  Cc: Maxime Chevallier, Andrew Lunn, David S. Miller, Eric Dumazet,
	Paolo Abeni, Maxime Coquelin, Alexandre Torgue, netdev,
	linux-stm32, linux-arm-kernel, Lorenzo Bianconi

On Wed, 12 Aug 2026 08:28:57 +0200 Kurt Kanzenbach wrote:
> TSO and TBS cannot coexist. Use the first queue with TSO and the rest for
> TBS. Tx queues with TBS can support etf qdisc hw offload. This is done
> similar to dwmac-imx and dwmac-intel.

Can you explain your use case? And how many queues the device has 
in total?

You say "TSO and TBS cannot coexist" but can any queue on your
platform be configured to support either feature? If yes why are
we configuring this statically instead of making appropriate
configuration based on qdisc or some other uAPI knob?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: stmmac: stm32: Set TSO/TBS Tx queues default settings
  2026-08-17 17:33 ` Jakub Kicinski
@ 2026-08-18  6:57   ` Kurt Kanzenbach
  0 siblings, 0 replies; 3+ messages in thread
From: Kurt Kanzenbach @ 2026-08-18  6:57 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Maxime Chevallier, Andrew Lunn, David S. Miller, Eric Dumazet,
	Paolo Abeni, Maxime Coquelin, Alexandre Torgue, netdev,
	linux-stm32, linux-arm-kernel, Lorenzo Bianconi

[-- Attachment #1: Type: text/plain, Size: 1453 bytes --]

On Mon Aug 17 2026, Jakub Kicinski wrote:
> On Wed, 12 Aug 2026 08:28:57 +0200 Kurt Kanzenbach wrote:
>> TSO and TBS cannot coexist. Use the first queue with TSO and the rest for
>> TBS. Tx queues with TBS can support etf qdisc hw offload. This is done
>> similar to dwmac-imx and dwmac-intel.
>
> Can you explain your use case?

I want to use ETF Qdisc with hardware offload, which is currently not
possible on the stm32mp2.

> And how many queues the device has in total?

The stm32mp2 has four Tx and two Rx queues.

>
> You say "TSO and TBS cannot coexist" but can any queue on your
> platform be configured to support either feature?

I think so. The data sheet says: "Do not enable time-based scheduling for
channels on which the TSO feature is enabled.". But, I didn't find any
limitations on what queue/channel can enable TBS.

> If yes why are we configuring this statically instead of making
> appropriate configuration based on qdisc or some other uAPI knob?

It seems like a static configuration in the driver today. I basically
followed the same convention as dwmac-imx, dwmac-intel, dwmac-mediatek
and dwmac-qcom-ethqos. Only dwmac-socfpga does it differently.

Tx Launch Time requires a different DMA descriptor layout. Currently
tc_setup_etf() just returns -EINVAL if the DMA configuration is not
setup appropriately. I guess a dynamic configuration requires to change
the DMA config and perform a full release/open cycle.

Thanks,
Kurt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-18  6:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-12  6:28 [PATCH net-next] net: stmmac: stm32: Set TSO/TBS Tx queues default settings Kurt Kanzenbach
2026-08-17 17:33 ` Jakub Kicinski
2026-08-18  6:57   ` Kurt Kanzenbach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox