Linux Netfilter development
 help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Florian Westphal <fw@strlen.de>
Cc: <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH nf] selftests: nft_concat_range: add test for reload with no element add/del
Date: Wed, 26 Jan 2022 15:25:33 +0100	[thread overview]
Message-ID: <20220126152533.7d9b2cb7@elisabeth> (raw)
In-Reply-To: <20220126115454.31412-1-fw@strlen.de>

On Wed, 26 Jan 2022 12:54:54 +0100
Florian Westphal <fw@strlen.de> wrote:

> Add a specific test for the reload issue fixed with
> commit 23c54263efd7cb ("netfilter: nft_set_pipapo: allocate pcpu scratch maps on clone").
> 
> Add to set, then flush set content + restore without other add/remove in
> the transaction.
> 
> On kernels before the fix, this test case fails:
>   net,mac with reload    [FAIL]
> 
> Cc: Stefano Brivio <sbrivio@redhat.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>
> [...]
>
> +test_bug_reload() {
> +	setup veth send_"${proto}" set || return ${KSELFTEST_SKIP}
> +	rstart=${start}
> +
> +	range_size=1
> +	for i in $(seq "${start}" $((start + count))); do
> +		end=$((start + range_size))
> +
> +		# Avoid negative or zero-sized port ranges
> +		if [ $((end / 65534)) -gt $((start / 65534)) ]; then
> +			start=${end}
> +			end=$((end + 1))
> +		fi
> +		srcstart=$((start + src_delta))
> +		srcend=$((end + src_delta))
> +
> +		add "$(format)" || return 1
> +		range_size=$((range_size + 1))
> +		start=$((end + range_size))
> +	done
> +
> +	# check kernel does allocate pcpu sctrach map
> +	# for reload with no elemet add/delete
> +	( echo flush set inet filter test ;
> +	  nft list set inet filter test ) | nft -f -

Nice trick :) ...thanks for adding this case!

Reviewed-by: Stefano Brivio <sbrivio@redhat.com>

-- 
Stefano


      reply	other threads:[~2022-01-26 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26 11:54 [PATCH nf] selftests: nft_concat_range: add test for reload with no element add/del Florian Westphal
2022-01-26 14:25 ` Stefano Brivio [this message]

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=20220126152533.7d9b2cb7@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.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