public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/3] net: stmmac: do not clear TBS enable bit on link up/down
@ 2024-01-24 14:32 Esben Haabendal
  2024-01-24 14:33 ` [PATCH 3/3] net: stmmac: Time Based Scheduling support for OF platforms Esben Haabendal
  0 siblings, 1 reply; 4+ messages in thread
From: Esben Haabendal @ 2024-01-24 14:32 UTC (permalink / raw)
  To: netdev, Alexandre Torgue, Jose Abreu, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
	Christian Marangi
  Cc: stable, linux-stm32, linux-arm-kernel, linux-kernel

With the dma conf being reallocated on each call to stmmac_open(), any
information in there is lost, unless we specifically handle it.

The STMMAC_TBS_EN bit is set when adding an etf qdisc, and the etf qdisc
therefore would stop working when link was set down and then back up.

Fixes: ba39b344e924 ("net: ethernet: stmicro: stmmac: generate stmmac dma conf before open")
Cc: stable@vger.kernel.org
Signed-off-by: Esben Haabendal <esben@geanix.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index a0e46369ae15..691bf3ef5e30 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3932,6 +3932,9 @@ static int __stmmac_open(struct net_device *dev,
 	priv->rx_copybreak = STMMAC_RX_COPYBREAK;
 
 	buf_sz = dma_conf->dma_buf_sz;
+	for (int i = 0; i < MTL_MAX_TX_QUEUES; i++)
+		if (priv->dma_conf.tx_queue[i].tbs & STMMAC_TBS_EN)
+			dma_conf->tx_queue[i].tbs = priv->dma_conf.tx_queue[i].tbs;
 	memcpy(&priv->dma_conf, dma_conf, sizeof(*dma_conf));
 
 	stmmac_reset_queues_param(priv);
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/3] net: stmmac: Time Based Scheduling support for OF platforms
  2024-01-24 14:32 [PATCH 1/3] net: stmmac: do not clear TBS enable bit on link up/down Esben Haabendal
@ 2024-01-24 14:33 ` Esben Haabendal
  2024-01-25 11:03   ` Kurt Kanzenbach
  0 siblings, 1 reply; 4+ messages in thread
From: Esben Haabendal @ 2024-01-24 14:33 UTC (permalink / raw)
  To: netdev, Alexandre Torgue, Jose Abreu, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin
  Cc: linux-stm32, linux-arm-kernel, linux-kernel

This allows enabling TBS for TX queues by adding the
snps,time-based-scheduling property. You should check for support for this
on your particular controller before enabling. Typically, TX queue 0 does
not support TBS.

Signed-off-by: Esben Haabendal <esben@geanix.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 70eadc83ca68..f0bb49b0f41c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -278,6 +278,8 @@ static int stmmac_mtl_setup(struct platform_device *pdev,
 
 		plat->tx_queues_cfg[queue].coe_unsupported =
 			of_property_read_bool(q_node, "snps,coe-unsupported");
+		plat->tx_queues_cfg[queue].tbs_en =
+			of_property_read_bool(q_node, "snps,time-based-scheduling");
 
 		queue++;
 	}
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/3] net: stmmac: Time Based Scheduling support for OF platforms
  2024-01-24 14:33 ` [PATCH 3/3] net: stmmac: Time Based Scheduling support for OF platforms Esben Haabendal
@ 2024-01-25 11:03   ` Kurt Kanzenbach
  2024-01-25 11:58     ` esben
  0 siblings, 1 reply; 4+ messages in thread
From: Kurt Kanzenbach @ 2024-01-25 11:03 UTC (permalink / raw)
  To: Esben Haabendal, netdev, Alexandre Torgue, Jose Abreu,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Maxime Coquelin
  Cc: linux-stm32, linux-arm-kernel, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 504 bytes --]

Hi,

On Wed Jan 24 2024, Esben Haabendal wrote:
> This allows enabling TBS for TX queues by adding the
> snps,time-based-scheduling property. You should check for support for this
> on your particular controller before enabling. Typically, TX queue 0 does
> not support TBS.

More a general question: Do i see that correctly that Launch Time does
not work for OF platforms (such as an imx93) at the moment, because the
tbs_en property is not configured? Or why are these patches necessary?

Thanks,
Kurt

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

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/3] net: stmmac: Time Based Scheduling support for OF platforms
  2024-01-25 11:03   ` Kurt Kanzenbach
@ 2024-01-25 11:58     ` esben
  0 siblings, 0 replies; 4+ messages in thread
From: esben @ 2024-01-25 11:58 UTC (permalink / raw)
  To: Kurt Kanzenbach
  Cc: netdev, Alexandre Torgue, Jose Abreu, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
	linux-stm32, linux-arm-kernel, linux-kernel

Kurt Kanzenbach <kurt.kanzenbach@linutronix.de> writes:

> Hi,
>
> On Wed Jan 24 2024, Esben Haabendal wrote:
>> This allows enabling TBS for TX queues by adding the
>> snps,time-based-scheduling property. You should check for support for this
>> on your particular controller before enabling. Typically, TX queue 0 does
>> not support TBS.
>
> More a general question: Do i see that correctly that Launch Time does
> not work for OF platforms (such as an imx93) at the moment, because the
> tbs_en property is not configured? Or why are these patches necessary?

Correct.  You cannot use etf qdisc with "offload" on for OF platforms,
including imx93.
Doing that will end with "return -EINVAL" in tc_setup_etf().

I am working with imx98mp, but there should not be any difference for
imx93.

/Esben

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2024-01-25 13:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 14:32 [PATCH 1/3] net: stmmac: do not clear TBS enable bit on link up/down Esben Haabendal
2024-01-24 14:33 ` [PATCH 3/3] net: stmmac: Time Based Scheduling support for OF platforms Esben Haabendal
2024-01-25 11:03   ` Kurt Kanzenbach
2024-01-25 11:58     ` esben

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