From: Roopa Prabhu <roopa@nvidia.com>
To: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>,
Nikolay Aleksandrov <razor@blackwall.org>
Cc: aroulin@nvidia.com, sbrivio@redhat.com,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bridge@lists.linux-foundation.org
Subject: Re: [PATCH net-next 0/3] net: vlan: fix bridge binding behavior and add selftests
Date: Sat, 30 Jul 2022 18:54:52 -0700 [thread overview]
Message-ID: <8e0a0ceb-5816-60a6-6219-7306e75ce006@nvidia.com> (raw)
In-Reply-To: <CAMWRUK5TZ5iZWZJO7Bbn-b43ZbT7mRzUDr4LdseLCne8qvG6pw@mail.gmail.com>
On 7/30/22 09:48, Sevinj Aghayeva wrote:
> (Resending this because the first email was rejected due to being in HTML.)
>
>
> On Sat, Jul 30, 2022 at 12:46 PM Sevinj Aghayeva
> <sevinj.aghayeva@gmail.com> wrote:
>>
>>
>> On Sat, Jul 30, 2022 at 12:22 PM Nikolay Aleksandrov <razor@blackwall.org> wrote:
>>> On 7/30/22 19:03, Sevinj Aghayeva wrote:
>>>> When bridge binding is enabled for a vlan interface, it is expected
>>>> that the link state of the vlan interface will track the subset of the
>>>> ports that are also members of the corresponding vlan, rather than
>>>> that of all ports.
>>>>
>>>> Currently, this feature works as expected when a vlan interface is
>>>> created with bridge binding enabled:
>>>>
>>>> ip link add link br name vlan10 type vlan id 10 protocol 802.1q \
>>>> bridge_binding on
>>>>
>>>> However, the feature does not work when a vlan interface is created
>>>> with bridge binding disabled, and then enabled later:
>>>>
>>>> ip link add link br name vlan10 type vlan id 10 protocol 802.1q \
>>>> bridge_binding off
>>>> ip link set vlan10 type vlan bridge_binding on
>>>>
>>>> After these two commands, the link state of the vlan interface
>>>> continues to track that of all ports, which is inconsistent and
>>>> confusing to users. This series fixes this bug and introduces two
>>>> tests for the valid behavior.
>>>>
>>>> Sevinj Aghayeva (3):
>>>> net: bridge: export br_vlan_upper_change
>>>> net: 8021q: fix bridge binding behavior for vlan interfaces
>>>> selftests: net: tests for bridge binding behavior
>>>>
>>>> include/linux/if_bridge.h | 9 ++
>>>> net/8021q/vlan.h | 2 +-
>>>> net/8021q/vlan_dev.c | 21 ++-
>>>> net/bridge/br_vlan.c | 7 +-
>>>> tools/testing/selftests/net/Makefile | 1 +
>>>> .../selftests/net/bridge_vlan_binding_test.sh | 143 ++++++++++++++++++
>>>> 6 files changed, 176 insertions(+), 7 deletions(-)
>>>> create mode 100755 tools/testing/selftests/net/bridge_vlan_binding_test.sh
>>>>
>>> Hmm.. I don't like this and don't think this bridge function should be
>>> exported at all.
>>>
>>> Calling bridge state changing functions from 8021q module is not the
>>> proper way to solve this. The problem is that the bridge doesn't know
>>> that the state has changed, so you can process NETDEV_CHANGE events and
>>> check for the bridge vlan which got its state changed and react based on
>>> it. I haven't checked in detail, but I think it should be doable. So all
>>> the logic is kept inside the bridge.
>>
>> Hi Nik,
>>
>> Can please elaborate on where I should process NETDEV_CHANGE events? I'm doing this as part of outreachy project and this is my first kernel task, so I don't know the bridging code that well.
>>
>> Thanks!
good point Nikolay.
Sevinj, see br_vlan_bridge_event and __vlan_device_event for how both
drivers react to netdev change events.
I have not looked at it in detail yet, but lets explore and discuss if
we can make use of events to achieve same results.
prev parent reply other threads:[~2022-07-31 1:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-30 16:03 Sevinj Aghayeva
2022-07-30 16:03 ` [PATCH net-next 1/3] net: bridge: export br_vlan_upper_change Sevinj Aghayeva
2022-07-30 16:03 ` [PATCH net-next 2/3] net: 8021q: fix bridge binding behavior for vlan interfaces Sevinj Aghayeva
2022-07-30 19:58 ` kernel test robot
2022-07-30 20:18 ` kernel test robot
2022-07-30 20:18 ` kernel test robot
2022-07-30 16:03 ` [PATCH net-next 3/3] selftests: net: tests for bridge binding behavior Sevinj Aghayeva
2022-07-30 16:21 ` [PATCH net-next 0/3] net: vlan: fix bridge binding behavior and add selftests Nikolay Aleksandrov
[not found] ` <CAMWRUK5j4UAwjw4UGN=SVbbDbut0zWg5e03wupAXCPwT8K8zzQ@mail.gmail.com>
2022-07-30 16:48 ` Sevinj Aghayeva
2022-07-31 1:54 ` Roopa Prabhu [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=8e0a0ceb-5816-60a6-6219-7306e75ce006@nvidia.com \
--to=roopa@nvidia.com \
--cc=aroulin@nvidia.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=sbrivio@redhat.com \
--cc=sevinj.aghayeva@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
all inboxes | Powered by JetHome®