All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] net: dsa: hellcreek: 802.1Qbv Fixes
@ 2021-08-25 13:58 Kurt Kanzenbach
  2021-08-25 13:58 ` [PATCH net 1/2] net: dsa: hellcreek: Fix incorrect setting of GCL Kurt Kanzenbach
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Kurt Kanzenbach @ 2021-08-25 13:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, Vladimir Oltean,
	netdev, Sebastian Andrzej Siewior, Kurt Kanzenbach

Hi,

while using TAPRIO offloading on the Hirschmann hellcreek switch, I've noticed
two issues in the current implementation:

1. The gate control list is incorrectly programmed
2. The admin base time is not set properly

Fix it.

Thanks,
Kurt

Kurt Kanzenbach (2):
  net: dsa: hellcreek: Fix incorrect setting of GCL
  net: dsa: hellcreek: Adjust schedule look ahead window

 drivers/net/dsa/hirschmann/hellcreek.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.30.2


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

* [PATCH net 1/2] net: dsa: hellcreek: Fix incorrect setting of GCL
  2021-08-25 13:58 [PATCH net 0/2] net: dsa: hellcreek: 802.1Qbv Fixes Kurt Kanzenbach
@ 2021-08-25 13:58 ` Kurt Kanzenbach
  2021-08-25 16:33   ` Florian Fainelli
  2021-08-25 13:58 ` [PATCH net 2/2] net: dsa: hellcreek: Adjust schedule look ahead window Kurt Kanzenbach
  2021-08-26  9:30 ` [PATCH net 0/2] net: dsa: hellcreek: 802.1Qbv Fixes patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Kurt Kanzenbach @ 2021-08-25 13:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, Vladimir Oltean,
	netdev, Sebastian Andrzej Siewior, Kurt Kanzenbach

Currently the gate control list which is programmed into the hardware is
incorrect resulting in wrong traffic schedules. The problem is the loop
variables are incremented before they are referenced. Therefore, move the
increment to the end of the loop.

Fixes: 24dfc6eb39b2 ("net: dsa: hellcreek: Add TAPRIO offloading support")
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
---
 drivers/net/dsa/hirschmann/hellcreek.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c
index 5c54ae1be62c..b57aea92684b 100644
--- a/drivers/net/dsa/hirschmann/hellcreek.c
+++ b/drivers/net/dsa/hirschmann/hellcreek.c
@@ -1472,9 +1472,6 @@ static void hellcreek_setup_gcl(struct hellcreek *hellcreek, int port,
 		u16 data;
 		u8 gates;
 
-		cur++;
-		next++;
-
 		if (i == schedule->num_entries)
 			gates = initial->gate_mask ^
 				cur->gate_mask;
@@ -1503,6 +1500,9 @@ static void hellcreek_setup_gcl(struct hellcreek *hellcreek, int port,
 			(initial->gate_mask <<
 			 TR_GCLCMD_INIT_GATE_STATES_SHIFT);
 		hellcreek_write(hellcreek, data, TR_GCLCMD);
+
+		cur++;
+		next++;
 	}
 }
 
-- 
2.30.2


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

* [PATCH net 2/2] net: dsa: hellcreek: Adjust schedule look ahead window
  2021-08-25 13:58 [PATCH net 0/2] net: dsa: hellcreek: 802.1Qbv Fixes Kurt Kanzenbach
  2021-08-25 13:58 ` [PATCH net 1/2] net: dsa: hellcreek: Fix incorrect setting of GCL Kurt Kanzenbach
@ 2021-08-25 13:58 ` Kurt Kanzenbach
  2021-08-25 16:34   ` Florian Fainelli
  2021-08-26  9:30 ` [PATCH net 0/2] net: dsa: hellcreek: 802.1Qbv Fixes patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Kurt Kanzenbach @ 2021-08-25 13:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, Vladimir Oltean,
	netdev, Sebastian Andrzej Siewior, Kurt Kanzenbach

Traffic schedules can only be started up to eight seconds within the
future. Therefore, the driver periodically checks every two seconds whether the
admin base time provided by the user is inside that window. If so the schedule
is started. Otherwise the check is deferred.

However, according to the programming manual the look ahead window size should
be four - not eight - seconds. By using the proposed value of four seconds
starting a schedule at a specified admin base time actually works as expected.

Fixes: 24dfc6eb39b2 ("net: dsa: hellcreek: Add TAPRIO offloading support")
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
---
 drivers/net/dsa/hirschmann/hellcreek.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c
index b57aea92684b..7062db6a083c 100644
--- a/drivers/net/dsa/hirschmann/hellcreek.c
+++ b/drivers/net/dsa/hirschmann/hellcreek.c
@@ -1550,7 +1550,7 @@ static bool hellcreek_schedule_startable(struct hellcreek *hellcreek, int port)
 	/* Calculate difference to admin base time */
 	base_time_ns = ktime_to_ns(hellcreek_port->current_schedule->base_time);
 
-	return base_time_ns - current_ns < (s64)8 * NSEC_PER_SEC;
+	return base_time_ns - current_ns < (s64)4 * NSEC_PER_SEC;
 }
 
 static void hellcreek_start_schedule(struct hellcreek *hellcreek, int port)
-- 
2.30.2


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

* Re: [PATCH net 1/2] net: dsa: hellcreek: Fix incorrect setting of GCL
  2021-08-25 13:58 ` [PATCH net 1/2] net: dsa: hellcreek: Fix incorrect setting of GCL Kurt Kanzenbach
@ 2021-08-25 16:33   ` Florian Fainelli
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2021-08-25 16:33 UTC (permalink / raw)
  To: Kurt Kanzenbach, David S. Miller, Jakub Kicinski
  Cc: Andrew Lunn, Vivien Didelot, Vladimir Oltean, netdev,
	Sebastian Andrzej Siewior



On 8/25/2021 3:58 PM, Kurt Kanzenbach wrote:
> Currently the gate control list which is programmed into the hardware is
> incorrect resulting in wrong traffic schedules. The problem is the loop
> variables are incremented before they are referenced. Therefore, move the
> increment to the end of the loop.
> 
> Fixes: 24dfc6eb39b2 ("net: dsa: hellcreek: Add TAPRIO offloading support")
> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH net 2/2] net: dsa: hellcreek: Adjust schedule look ahead window
  2021-08-25 13:58 ` [PATCH net 2/2] net: dsa: hellcreek: Adjust schedule look ahead window Kurt Kanzenbach
@ 2021-08-25 16:34   ` Florian Fainelli
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2021-08-25 16:34 UTC (permalink / raw)
  To: Kurt Kanzenbach, David S. Miller, Jakub Kicinski
  Cc: Andrew Lunn, Vivien Didelot, Vladimir Oltean, netdev,
	Sebastian Andrzej Siewior



On 8/25/2021 3:58 PM, Kurt Kanzenbach wrote:
> Traffic schedules can only be started up to eight seconds within the
> future. Therefore, the driver periodically checks every two seconds whether the
> admin base time provided by the user is inside that window. If so the schedule
> is started. Otherwise the check is deferred.

Uber nit: this probably ought to be just one sentence starting from 
"Therefore" and ending at deferred.

> 
> However, according to the programming manual the look ahead window size should
> be four - not eight - seconds. By using the proposed value of four seconds
> starting a schedule at a specified admin base time actually works as expected.
> 
> Fixes: 24dfc6eb39b2 ("net: dsa: hellcreek: Add TAPRIO offloading support")
> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH net 0/2] net: dsa: hellcreek: 802.1Qbv Fixes
  2021-08-25 13:58 [PATCH net 0/2] net: dsa: hellcreek: 802.1Qbv Fixes Kurt Kanzenbach
  2021-08-25 13:58 ` [PATCH net 1/2] net: dsa: hellcreek: Fix incorrect setting of GCL Kurt Kanzenbach
  2021-08-25 13:58 ` [PATCH net 2/2] net: dsa: hellcreek: Adjust schedule look ahead window Kurt Kanzenbach
@ 2021-08-26  9:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-26  9:30 UTC (permalink / raw)
  To: Kurt Kanzenbach
  Cc: davem, kuba, andrew, vivien.didelot, f.fainelli, olteanv, netdev,
	bigeasy

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Wed, 25 Aug 2021 15:58:11 +0200 you wrote:
> Hi,
> 
> while using TAPRIO offloading on the Hirschmann hellcreek switch, I've noticed
> two issues in the current implementation:
> 
> 1. The gate control list is incorrectly programmed
> 2. The admin base time is not set properly
> 
> [...]

Here is the summary with links:
  - [net,1/2] net: dsa: hellcreek: Fix incorrect setting of GCL
    https://git.kernel.org/netdev/net/c/a7db5ed8632c
  - [net,2/2] net: dsa: hellcreek: Adjust schedule look ahead window
    https://git.kernel.org/netdev/net/c/b7658ed35a5f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-08-26  9:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 13:58 [PATCH net 0/2] net: dsa: hellcreek: 802.1Qbv Fixes Kurt Kanzenbach
2021-08-25 13:58 ` [PATCH net 1/2] net: dsa: hellcreek: Fix incorrect setting of GCL Kurt Kanzenbach
2021-08-25 16:33   ` Florian Fainelli
2021-08-25 13:58 ` [PATCH net 2/2] net: dsa: hellcreek: Adjust schedule look ahead window Kurt Kanzenbach
2021-08-25 16:34   ` Florian Fainelli
2021-08-26  9:30 ` [PATCH net 0/2] net: dsa: hellcreek: 802.1Qbv Fixes patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.