From: Nikolay Aleksandrov <razor@blackwall.org>
To: Ido Schimmel <idosch@nvidia.com>
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, roopa@nvidia.com, horms@kernel.org,
petrm@nvidia.com, aroulin@nvidia.com
Subject: Re: [PATCH net-next] bridge: Allow deleting FDB entries with non-existent VLAN
Date: Wed, 6 Nov 2024 12:44:34 +0200 [thread overview]
Message-ID: <ZytIkgDsKaallC7F@penguin> (raw)
In-Reply-To: <20241105133954.350479-1-idosch@nvidia.com>
On Tue, Nov 05, 2024 at 03:39:54PM +0200, Ido Schimmel wrote:
> It is currently impossible to delete individual FDB entries (as opposed
> to flushing) that were added with a VLAN that no longer exists:
>
> # ip link add name dummy1 up type dummy
> # ip link add name br1 up type bridge vlan_filtering 1
> # ip link set dev dummy1 master br1
> # bridge fdb add 00:11:22:33:44:55 dev dummy1 master static vlan 1
> # bridge vlan del vid 1 dev dummy1
> # bridge fdb get 00:11:22:33:44:55 br br1 vlan 1
> 00:11:22:33:44:55 dev dummy1 vlan 1 master br1 static
> # bridge fdb del 00:11:22:33:44:55 dev dummy1 master vlan 1
> RTNETLINK answers: Invalid argument
> # bridge fdb get 00:11:22:33:44:55 br br1 vlan 1
> 00:11:22:33:44:55 dev dummy1 vlan 1 master br1 static
>
> This is in contrast to MDB entries that can be deleted after the VLAN
> was deleted:
>
> # bridge vlan add vid 10 dev dummy1
> # bridge mdb add dev br1 port dummy1 grp 239.1.1.1 permanent vid 10
> # bridge vlan del vid 10 dev dummy1
> # bridge mdb get dev br1 grp 239.1.1.1 vid 10
> dev br1 port dummy1 grp 239.1.1.1 permanent vid 10
> # bridge mdb del dev br1 port dummy1 grp 239.1.1.1 permanent vid 10
> # bridge mdb get dev br1 grp 239.1.1.1 vid 10
> Error: bridge: MDB entry not found.
>
> Align the two interfaces and allow user space to delete FDB entries that
> were added with a VLAN that no longer exists:
>
> # ip link add name dummy1 up type dummy
> # ip link add name br1 up type bridge vlan_filtering 1
> # ip link set dev dummy1 master br1
> # bridge fdb add 00:11:22:33:44:55 dev dummy1 master static vlan 1
> # bridge vlan del vid 1 dev dummy1
> # bridge fdb get 00:11:22:33:44:55 br br1 vlan 1
> 00:11:22:33:44:55 dev dummy1 vlan 1 master br1 static
> # bridge fdb del 00:11:22:33:44:55 dev dummy1 master vlan 1
> # bridge fdb get 00:11:22:33:44:55 br br1 vlan 1
> Error: Fdb entry not found.
>
> Add a selftest to make sure this behavior does not regress:
>
> # ./rtnetlink.sh -t kci_test_fdb_del
> PASS: bridge fdb del
>
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> Reviewed-by: Andy Roulin <aroulin@nvidia.com>
> Reviewed-by: Petr Machata <petrm@nvidia.com>
> ---
> net/bridge/br_fdb.c | 9 ++----
> tools/testing/selftests/net/rtnetlink.sh | 40 ++++++++++++++++++++++++
> 2 files changed, 42 insertions(+), 7 deletions(-)
>
Nice catch, I'd even queue it for -net. :)
Of course we should be able to delete anything.
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
next prev parent reply other threads:[~2024-11-06 10:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 13:39 [PATCH net-next] bridge: Allow deleting FDB entries with non-existent VLAN Ido Schimmel
2024-11-06 10:44 ` Nikolay Aleksandrov [this message]
2024-11-10 0:30 ` 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=ZytIkgDsKaallC7F@penguin \
--to=razor@blackwall.org \
--cc=aroulin@nvidia.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=roopa@nvidia.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).