diff mbox series

[1/3] selftests/net: Argument value mismatch when calling verify_counters()

Message ID 20240118-tcp-ao-test-key-mgmt-v1-1-3583ca147113@arista.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series selftests/net: A couple of typos fixes in key-management test | expand

Checks

Context Check Description
netdev/series_format warning Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 0 of 0 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-01-18--06-00 (tests: 403)

Commit Message

Dmitry Safonov Jan. 18, 2024, 2:51 a.m. UTC
From: Mohammad Nassiri <mnassiri@ciena.com>

The end_server() function only operates in the server thread
and always takes an accept socket instead of a listen socket as
its input argument. To align with this, invert the boolean values
used when calling verify_counters() within the end_server() function.

Fixes: 3c3ead555648 ("selftests/net: Add TCP-AO key-management test")
Signed-off-by: Mohammad Nassiri <mnassiri@ciena.com>
Link: https://lore.kernel.org/all/934627c5-eebb-4626-be23-cfb134c01d1a@arista.com/
[amended 'Fixes' tag and carried-over to lkml]
Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 tools/testing/selftests/net/tcp_ao/key-management.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Jan. 19, 2024, 4:26 p.m. UTC | #1
On Thu, Jan 18, 2024 at 02:51:34AM +0000, Dmitry Safonov wrote:
> From: Mohammad Nassiri <mnassiri@ciena.com>
> 
> The end_server() function only operates in the server thread
> and always takes an accept socket instead of a listen socket as
> its input argument. To align with this, invert the boolean values
> used when calling verify_counters() within the end_server() function.

Hi Dmitry,

I see that this is correct, but I am wondering
if it fixes a user-visible bug. If so, could
some text about that go here?

> 
> Fixes: 3c3ead555648 ("selftests/net: Add TCP-AO key-management test")
> Signed-off-by: Mohammad Nassiri <mnassiri@ciena.com>
> Link: https://lore.kernel.org/all/934627c5-eebb-4626-be23-cfb134c01d1a@arista.com/
> [amended 'Fixes' tag and carried-over to lkml]
> Signed-off-by: Dmitry Safonov <dima@arista.com>

...
Dmitry Safonov Jan. 19, 2024, 6:35 p.m. UTC | #2
Hi Simon,

On 1/19/24 16:26, Simon Horman wrote:
> On Thu, Jan 18, 2024 at 02:51:34AM +0000, Dmitry Safonov wrote:
>> From: Mohammad Nassiri <mnassiri@ciena.com>
>>
>> The end_server() function only operates in the server thread
>> and always takes an accept socket instead of a listen socket as
>> its input argument. To align with this, invert the boolean values
>> used when calling verify_counters() within the end_server() function.
> 
> Hi Dmitry,
> 
> I see that this is correct, but I am wondering
> if it fixes a user-visible bug. If so, could
> some text about that go here?

Yep. The test as the result doesn't correctly check tcp counters for
non-symmetrical scenario, where peer-A uses a key <a:a2> to send data,
but peer-B uses <b:b2> key to send its data. So, in simple terms,
different keys for TX and RX on peers.

I'll send v2 with an improved patch message.

>> Fixes: 3c3ead555648 ("selftests/net: Add TCP-AO key-management test")
>> Signed-off-by: Mohammad Nassiri <mnassiri@ciena.com>
>> Link: https://lore.kernel.org/all/934627c5-eebb-4626-be23-cfb134c01d1a@arista.com/
>> [amended 'Fixes' tag and carried-over to lkml]
>> Signed-off-by: Dmitry Safonov <dima@arista.com>
> 
> ...

Thanks,
           Dmitry
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/tcp_ao/key-management.c b/tools/testing/selftests/net/tcp_ao/key-management.c
index c48b4970ca17..f6a9395e3cd7 100644
--- a/tools/testing/selftests/net/tcp_ao/key-management.c
+++ b/tools/testing/selftests/net/tcp_ao/key-management.c
@@ -843,7 +843,7 @@  static void end_server(const char *tst_name, int sk,
 	synchronize_threads(); /* 4: verified => closed */
 	close(sk);
 
-	verify_counters(tst_name, true, false, begin, &end);
+	verify_counters(tst_name, false, true, begin, &end);
 	synchronize_threads(); /* 5: counters */
 }