mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
	Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH net 4/7] selftests/net: Add mixed select()+polling mode to TCP-AO tests
Date: Tue, 18 Mar 2025 15:47:13 +0100	[thread overview]
Message-ID: <a360fcbc-19e5-4ee6-9b80-2621fefd9ad6@redhat.com> (raw)
In-Reply-To: <20250312-tcp-ao-selftests-polling-v1-4-72a642b855d5@gmail.com>

On 3/12/25 10:10 AM, Dmitry Safonov wrote:
> Currently, tcp_ao tests have two timeouts: TEST_RETRANSMIT_SEC and
> TEST_TIMEOUT_SEC [by default 1 and 5 seconds]. The first one,
> TEST_RETRANSMIT_SEC is used for operations that are expected to succeed
> in order for a test to pass. It is usually not consumed and exists only
> to avoid indefinite test run if the operation didn't complete.
> The second one, TEST_RETRANSMIT_SEC exists for the tests that checking
> operations, that are expected to fail/timeout. It is shorter as it is
> fully consumed, with an expectation that if operation didn't succeed
> during that period, it will timeout. And the related test that expects
> the timeout is passing. The actual operation failure is then
> cross-verified by other means like counters checks.
> 
> The issue with TEST_RETRANSMIT_SEC timeout is that 1 second is the exact
> initial TCP timeout. So, in case the initial segment gets lost (quite
> unlikely on local veth interface between two net namespaces, yet happens
> in slow VMs), the retransmission never happens and as a result, the test
> is not actually testing the functionality. Which in the end fails
> counters checks.
> 
> As I want tcp_ao selftests to be fast and finishing in a reasonable
> amount of time on manual run, I didn't consider increasing
> TEST_RETRANSMIT_SEC.
> 
> Rather, initially, BPF_SOCK_OPS_TIMEOUT_INIT looked promising as a lever
> to make the initial TCP timeout shorter. But as it's not a socket bpf
> attached thing, but sock_ops (attaches to cgroups), the selftests would
> have to use libbpf, which I wanted to avoid if not absolutely required.
> 
> Instead, use a mixed select() and counters polling mode with the longer
> TEST_TIMEOUT_SEC timeout to detect running-away failed tests. It
> actually not only allows losing segments and succeeding after
> the previous TEST_RETRANSMIT_SEC timeout was consumed, but makes
> the tests expecting timeout/failure pass faster.
> 
> The only test case taking longer (TEST_TIMEOUT_SEC) now is connect-deny
> "wrong snd id", which checks for no key on SYN-ACK for which there is no
> counter in the kernel (see tcp_make_synack()). Yet it can be speed up
> by poking skpair from the trace event (see trace_tcp_ao_synack_no_key).
> 
> Reported-by: Jakub Kicinski <kuba@kernel.org>
> Closes: https://lore.kernel.org/netdev/20241205070656.6ef344d7@kernel.org/
> Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>

Could you please provide a suitable Fixes tag here?

Also given a good slices of the patches here are refactor, I think the
whole series could land on net-next - so that we avoid putting a bit of
stuff in the last 6.14-net PR - WDYT?

Thanks,

Paolo


  reply	other threads:[~2025-03-18 14:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12  9:10 [PATCH net 0/7] selftests/net: Mixed select()+polling mode for " Dmitry Safonov via B4 Relay
2025-03-12  9:10 ` [PATCH net 1/7] selftests/net: Print TCP flags in more common format Dmitry Safonov via B4 Relay
2025-03-12  9:10 ` [PATCH net 2/7] selftests/net: Provide tcp-ao counters comparison helper Dmitry Safonov via B4 Relay
2025-03-12  9:10 ` [PATCH net 3/7] selftests/net: Fetch and check TCP-MD5 counters Dmitry Safonov via B4 Relay
2025-03-12  9:10 ` [PATCH net 4/7] selftests/net: Add mixed select()+polling mode to TCP-AO tests Dmitry Safonov via B4 Relay
2025-03-18 14:47   ` Paolo Abeni [this message]
2025-03-18 23:04     ` Dmitry Safonov
2025-03-12  9:10 ` [PATCH net 5/7] selftests/net: Print the testing side in unsigned-md5 Dmitry Safonov via B4 Relay
2025-03-12  9:11 ` [PATCH net 6/7] selftests/net: Delete timeout from test_connect_socket() Dmitry Safonov via B4 Relay
2025-03-12  9:11 ` [PATCH net 7/7] selftests/net: Drop timeout argument from test_client_verify() Dmitry Safonov via B4 Relay
2025-03-19  3:20 ` [PATCH net 0/7] selftests/net: Mixed select()+polling mode for TCP-AO tests Dmitry Safonov
2025-03-19  3:26   ` Dmitry Safonov
2025-03-19 13:18     ` Konstantin Ryabitsev
2025-03-20 13:51       ` Konstantin Ryabitsev
2025-03-21  2:57         ` Dmitry Safonov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a360fcbc-19e5-4ee6-9b80-2621fefd9ad6@redhat.com \
    --to=pabeni@redhat.com \
    --cc=0x7f454c46@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®