All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Nikolay Aleksandrov <razor@blackwall.org>, netdev@vger.kernel.org
Cc: donaldsharp72@gmail.com, philippe.guibert@outlook.com,
	kuba@kernel.org, davem@davemloft.net, idosch@idosch.org
Subject: Re: [PATCH net 2/2] selftests: net: add delete nexthop route warning test
Date: Thu, 31 Mar 2022 19:35:05 -0600	[thread overview]
Message-ID: <5bd7ae86-8676-ffa9-d422-7557461721ad@kernel.org> (raw)
In-Reply-To: <20220331154615.108214-3-razor@blackwall.org>

On 3/31/22 9:46 AM, Nikolay Aleksandrov wrote:
> Add a test which causes a WARNING on kernels which treat a
> nexthop route like a normal route when comparing for deletion and a
> device is specified. That is, a route is found but we hit a warning while
> matching it. The warning is from fib_info_nh() in include/net/nexthop.h
> because we run it on a fib_info with nexthop object. The call chain is:
>  inet_rtm_delroute -> fib_table_delete -> fib_nh_match (called with a
> nexthop fib_info and also with fc_oif set thus calling fib_info_nh on
> the fib_info and triggering the warning).
> 
> Repro steps:
>  $ ip nexthop add id 12 via 172.16.1.3 dev veth1
>  $ ip route add 172.16.101.1/32 nhid 12
>  $ ip route delete 172.16.101.1/32 dev veth1
> 
> Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
> ---
>  tools/testing/selftests/net/fib_nexthops.sh | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/fib_nexthops.sh b/tools/testing/selftests/net/fib_nexthops.sh
> index d444ee6aa3cb..371e3e0c91b7 100755
> --- a/tools/testing/selftests/net/fib_nexthops.sh
> +++ b/tools/testing/selftests/net/fib_nexthops.sh
> @@ -1208,6 +1208,19 @@ ipv4_fcnal()
>  	set +e
>  	check_nexthop "dev veth1" ""
>  	log_test $? 0 "Nexthops removed on admin down"
> +
> +	# nexthop route delete warning
> +	run_cmd "$IP li set dev veth1 up"
> +	run_cmd "$IP nexthop add id 12 via 172.16.1.3 dev veth1"
> +	out1=`dmesg | grep "WARNING:.*fib_nh_match.*" | wc -l`
> +	run_cmd "$IP route add 172.16.101.1/32 nhid 12"
> +	run_cmd "$IP route delete 172.16.101.1/32 dev veth1"
> +	out2=`dmesg | grep "WARNING:.*fib_nh_match.*" | wc -l`
> +	[ $out1 -eq $out2 ]
> +	rc=$?
> +	log_test $rc 0 "Delete nexthop route warning"
> +	run_cmd "$IP ip route delete 172.16.101.1/32 nhid 12"
> +	run_cmd "$IP ip nexthop del id 12"
>  }
>  
>  ipv4_grp_fcnal()

Reviewed-by: David Ahern <dsahern@kernel.org>


  reply	other threads:[~2022-04-01  1:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 15:46 [PATCH net 0/2] net: ipv4: fix nexthop route delete warning Nikolay Aleksandrov
2022-03-31 15:46 ` [PATCH net 1/2] net: ipv4: fix route with nexthop object " Nikolay Aleksandrov
2022-03-31 17:05   ` David Ahern
2022-03-31 17:17     ` Nikolay Aleksandrov
2022-03-31 17:34       ` Nikolay Aleksandrov
2022-03-31 19:31         ` Nikolay Aleksandrov
2022-04-01  1:33   ` David Ahern
2022-03-31 15:46 ` [PATCH net 2/2] selftests: net: add delete nexthop route warning test Nikolay Aleksandrov
2022-04-01  1:35   ` David Ahern [this message]
2022-04-01  7:18 ` [PATCH net 0/2] net: ipv4: fix nexthop route delete warning Nikolay Aleksandrov

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=5bd7ae86-8676-ffa9-d422-7557461721ad@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=donaldsharp72@gmail.com \
    --cc=idosch@idosch.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=philippe.guibert@outlook.com \
    --cc=razor@blackwall.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.