From: Simon Horman <simon.horman@corigine.com>
To: Ivan Vecera <ivecera@redhat.com>
Cc: netdev@vger.kernel.org, Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
Paul Blakey <paulb@nvidia.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net/sched: flower: Fix wrong handle assignment during filter change
Date: Wed, 26 Apr 2023 11:29:02 +0200 [thread overview]
Message-ID: <ZEju3l897gB3IvJR@corigine.com> (raw)
In-Reply-To: <20230425140604.169881-1-ivecera@redhat.com>
On Tue, Apr 25, 2023 at 04:06:04PM +0200, Ivan Vecera wrote:
> Commit 08a0063df3ae ("net/sched: flower: Move filter handle initialization
> earlier") moved filter handle initialization but an assignment of
> the handle to fnew->handle is done regardless of fold value. This is wrong
> because if fold != NULL (so fold->handle == handle) no new handle is
> allocated and passed handle is assigned to fnew->handle. Then if any
> subsequent action in fl_change() fails then the handle value is
> removed from IDR that is incorrect as we will have still valid old filter
> instance with handle that is not present in IDR.
> Fix this issue by moving the assignment so it is done only when passed
> fold == NULL.
>
> Prior the patch:
> [root@machine tc-testing]# ./tdc.py -d enp1s0f0np0 -e 14be
> Test 14be: Concurrently replace same range of 100k flower filters from 10 tc instances
> exit: 123
> exit: 0
> RTNETLINK answers: Invalid argument
> We have an error talking to the kernel
> Command failed tmp/replace_6:1885
>
>
> All test results:
>
> 1..1
> not ok 1 14be - Concurrently replace same range of 100k flower filters from 10 tc instances
> Command exited with 123, expected 0
> RTNETLINK answers: Invalid argument
> We have an error talking to the kernel
> Command failed tmp/replace_6:1885
>
> After the patch:
> [root@machine tc-testing]# ./tdc.py -d enp1s0f0np0 -e 14be
> Test 14be: Concurrently replace same range of 100k flower filters from 10 tc instances
>
> All test results:
>
> 1..1
> ok 1 14be - Concurrently replace same range of 100k flower filters from 10 tc instances
>
> Fixes: 08a0063df3ae ("net/sched: flower: Move filter handle initialization earlier")
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
next prev parent reply other threads:[~2023-04-26 9:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-25 14:06 [PATCH net] net/sched: flower: Fix wrong handle assignment during filter change Ivan Vecera
2023-04-26 9:29 ` Simon Horman [this message]
2023-04-27 8:40 ` patchwork-bot+netdevbpf
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=ZEju3l897gB3IvJR@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ivecera@redhat.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.leitner@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paulb@nvidia.com \
--cc=xiyou.wangcong@gmail.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).