netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: thinker.li@gmail.com, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com,
	martin.lau@linux.dev, kernel-team@meta.com, yhs@meta.com
Cc: sinquersw@gmail.com, kuifeng@meta.com
Subject: Re: [PATCH net-next v5 2/2] selftests: fib_tests: Add a test case for IPv6 garbage collection
Date: Wed, 2 Aug 2023 20:06:46 -0600	[thread overview]
Message-ID: <85c6c94e-1243-33ae-dadd-9bcdd7d328d1@kernel.org> (raw)
In-Reply-To: <20230802004303.567266-3-thinker.li@gmail.com>

On 8/1/23 6:43 PM, thinker.li@gmail.com wrote:
\> @@ -747,6 +750,97 @@ fib_notify_test()
>  	cleanup &> /dev/null
>  }
>  
> +fib6_gc_test()
> +{
> +	echo
> +	echo "Fib6 garbage collection test"
> +
> +	STRACE=$(which strace)
> +	if [ -z "$STRACE" ]; then
> +	    echo "    SKIP: strace not found"
> +	    ret=$ksft_skip
> +	    return
> +	fi
> +
> +	EXPIRE=10
> +
> +	setup
> +
> +	set -e
> +
> +	# Check expiration of routes every 3 seconds (GC)
> +	$NS_EXEC sysctl -wq net.ipv6.route.gc_interval=300
> +
> +	$IP link add dummy_10 type dummy
> +	$IP link set dev dummy_10 up
> +	$IP -6 address add 2001:10::1/64 dev dummy_10
> +
> +	$NS_EXEC sysctl -wq net.ipv6.route.flush=1
> +
> +	# Temporary routes
> +	for i in $(seq 1 1000); do
> +	    # Expire route after $EXPIRE seconds
> +	    $IP -6 route add 2001:20::$i \
> +		via 2001:10::2 dev dummy_10 expires $EXPIRE
> +	done
> +	N_EXP=$($IP -6 route list |grep expires|wc -l)
> +	if [ $N_EXP -ne 1000 ]; then

race condition here ... that you can install all 1000 routes and then
run this command before any expire. 10 seconds is normally more than
enough time, but on a loaded server it might not be. And really it does
not matter. What matters is that you install routes with an expires and
they disappear when expected - and I believe the flush below should not
be needed to validate they have been removed.



  reply	other threads:[~2023-08-03  2:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02  0:43 [PATCH net-next v5 0/2] Remove expired routes with a separated list of routes thinker.li
2023-08-02  0:43 ` [PATCH net-next v5 1/2] net/ipv6: " thinker.li
2023-08-03  2:00   ` David Ahern
2023-08-03  4:19     ` Kui-Feng Lee
2023-08-02  0:43 ` [PATCH net-next v5 2/2] selftests: fib_tests: Add a test case for IPv6 garbage collection thinker.li
2023-08-03  2:06   ` David Ahern [this message]
2023-08-03  4:09     ` Kui-Feng Lee
2023-08-03 19:49       ` David Ahern
2023-08-03 20:04         ` Kui-Feng Lee

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=85c6c94e-1243-33ae-dadd-9bcdd7d328d1@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=kuifeng@meta.com \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sinquersw@gmail.com \
    --cc=thinker.li@gmail.com \
    --cc=yhs@meta.com \
    /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;
as well as URLs for NNTP newsgroup(s).