Skip to contentSkip to conversation

selftests/net: fin_ack_lat: fix latency threshold typo

PATCH New Brian Grech 3 participants 6 messages Jul 31 – Aug 10

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/net: fin_ack_lat: fix latency threshold typo

The FIN-ACK latency threshold was written as 100000 (100ms) instead of the intended 1000000 (1 second). Connections completing between 100ms and 1 second were incorrectly flagged as high-latency outliers and printed as failures on loaded systems.

Add the missing zero to restore the intended 1 second threshold.

---
 tools/testing/selftests/net/fin_ack_lat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/fin_ack_lat.c +1 -1
index 70187494b57a..4117332eb1a9 100644
@@ -69,7 +69,7 @@ static void client(int port)
 		lat = timediff(start, end);
 		sum_lat += lat;
 		nr_lat++;
-		if (lat < 100000)
+		if (lat < 1000000)
 			goto close;
 
 		if (getsockname(sock, (struct sockaddr *)&laddr, &len) == -1)
Signature · 1 line
2.55.0
#1 lore raw

PATCH 1/1 selftests/net: fin_ack_lat: fix latency threshold typo

The FIN-ACK latency threshold was written as 100000 (100ms) instead of the intended 1000000 (1 second). Connections completing between 100ms and 1 second were incorrectly flagged as high-latency outliers and printed as failures on loaded systems.

Add the missing zero to restore the intended 1 second threshold.

---
v2: Added missing maintainer CCs

 tools/testing/selftests/net/fin_ack_lat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/fin_ack_lat.c +1 -1
index 70187494b57a..4117332eb1a9 100644
@@ -69,7 +69,7 @@ static void client(int port)
 		lat = timediff(start, end);
 		sum_lat += lat;
 		nr_lat++;
-		if (lat < 100000)
+		if (lat < 1000000)
 			goto close;
 
 		if (getsockname(sock, (struct sockaddr *)&laddr, &len) == -1)
Signature · 1 line
2.55.0
reviewer Reviewed-by on v1 1/1
#2 lore raw
Quoted 10 lines · Brian Grech

The FIN-ACK latency threshold was written as 100000 (100ms) instead of the intended 1000000 (1 second). Connections completing between 100ms and 1 second were incorrectly flagged as high-latency outliers and printed as failures on loaded systems.

Add the missing zero to restore the intended 1 second threshold.

---
v2: Added missing maintainer CCs

Hi Brian,

It might be nice to include some information on why 1s is intended. But I don't think that is strictly necessary.

Also, if this is a fix to be backported (I am unsure) then it should have a Fixes tag and be targeted at the net branch.

The above notwithstanding, this looks good to me.

#3 lore raw

Hi Simon,

Thank you, yes I can fixup the message and resubmit.

Quoted 25 lines · Simon Horman
Quoted 10 lines · Brian Grech

The FIN-ACK latency threshold was written as 100000 (100ms) instead of the intended 1000000 (1 second). Connections completing between 100ms and 1 second were incorrectly flagged as high-latency outliers and printed as failures on loaded systems.

Add the missing zero to restore the intended 1 second threshold.

---
v2: Added missing maintainer CCs

Hi Brian,

It might be nice to include some information on why 1s is intended. But I don't think that is strictly necessary.

Also, if this is a fix to be backported (I am unsure) then it should have a Fixes tag and be targeted at the net branch.

The above notwithstanding, this looks good to me.

Signature · 1 line
-Brian
#4 lore raw

PATCH v3 1/1 selftests/net: fin_ack_lat: fix latency threshold typo

In reply to Brian Grech

The commit message for af8c8a450bf4 ("selftests: net: Add FIN_ACK processing order related latency spike test") states: "if the latency is larger than 1 second (spike), print a message". However the code uses a threshold of 100000 us (100 ms), not 1000000 us (1 s).

The lower threshold causes false positives on slower hardware where normal connection latency occasionally exceeds 100 ms but never approaches the 1 s spike that indicates the actual FIN/ACK race bug.

Fix the threshold to match the documented intent.

Fixes af8c8a450bf4 ("selftests: net: Add FIN_ACK processing order related latency spike test")

---
v3: Added Fixes tag, referenced original commit message wording per reviewer feedback
v2: Added missing maintainer CCs

 tools/testing/selftests/net/fin_ack_lat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/fin_ack_lat.c +1 -1
index 70187494b57a..4117332eb1a9 100644
@@ -69,7 +69,7 @@ static void client(int port)
 		lat = timediff(start, end);
 		sum_lat += lat;
 		nr_lat++;
-		if (lat < 100000)
+		if (lat < 1000000)
 			goto close;
 
 		if (getsockname(sock, (struct sockaddr *)&laddr, &len) == -1)
Signature · 1 line
2.55.0
#5 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Thu, 6 Aug 2026 10:16:45 -0500 you wrote:

The commit message for af8c8a450bf4 ("selftests: net: Add FIN_ACK processing order related latency spike test") states: "if the latency is larger than 1 second (spike), print a message". However the code uses a threshold of 100000 us (100 ms), not 1000000 us (1 s).

The lower threshold causes false positives on slower hardware where normal connection latency occasionally exceeds 100 ms but never approaches the 1 s spike that indicates the actual FIN/ACK race bug.

[...]

Here is the summary with links:
- [net,v3] selftests/net: fin_ack_lat: fix latency threshold typo

    https://git.kernel.org/netdev/net-next/c/2373107782a9

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html