From: Nikolay Aleksandrov <razor@blackwall.org>
To: Joseph Huang <joseph.huang.2024@gmail.com>,
Joseph Huang <Joseph.Huang@garmin.com>,
netdev@vger.kernel.org
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Roopa Prabhu <roopa@nvidia.com>, Simon Horman <horms@kernel.org>,
linux-kernel@vger.kernel.org, bridge@lists.linux.dev
Subject: Re: [Patch net-next 1/3] net: bridge: mcast: Add offload failed mdb flag
Date: Fri, 28 Mar 2025 00:52:57 +0200 [thread overview]
Message-ID: <ffe6f6cc-7157-48ad-9cde-dc38d8427849@blackwall.org> (raw)
In-Reply-To: <85a52bd9-8107-4cb8-b967-2646d0e74ab4@gmail.com>
On 3/27/25 00:38, Joseph Huang wrote:
> On 3/21/2025 4:19 AM, Nikolay Aleksandrov wrote:
>>> @@ -516,11 +513,14 @@ static void br_switchdev_mdb_complete(struct
>>> net_device *dev, int err, void *pri
>>> pp = &p->next) {
>>> if (p->key.port != port)
>>> continue;
>>> - p->flags |= MDB_PG_FLAGS_OFFLOAD;
>>> +
>>> + if (err)
>>> + p->flags |= MDB_PG_FLAGS_OFFLOAD_FAILED;
>>> + else
>>> + p->flags |= MDB_PG_FLAGS_OFFLOAD;
>>
>> These two should be mutually exclusive, either it's offloaded or it
>> failed an offload,
>> shouldn't be possible to have both set. I'd recommend adding some
>> helper that takes
>> care of that.
>
> It is true that these two are mutually exclusive, but strictly speaking
> there are four types of entries:
>
> 1. Entries which are not offload-able (i.e., the ports are not backed by
> switchdev)
> 2. Entries which are being offloaded, but results yet unknown
> 3. Entries which are successfully offloaded, and
> 4. Entries which failed to be offloaded
>
> Even if we ignore the ones which are being offloaded (type 2 is
> transient), we still need two flags, otherwise we won't be able to tell
> type 1 from type 4 entries.
>
> If we need two flags anyway, having separate flags for type 3 and type 4
> simplifies the logic.
>
> Or did I misunderstood your comments?
>
> Thanks,
> Joseph
I think you misunderstood me, I don't mind having the two flags. :)
My point is that they must be managed correctly and shouldn't be allowed
to be set simultaneously.
Cheers,
Nik
next prev parent reply other threads:[~2025-03-27 22:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-18 22:42 [Patch net-next 0/3] Add support for mdb offload failure notification Joseph Huang
2025-03-18 22:42 ` [Patch net-next 1/3] net: bridge: mcast: Add offload failed mdb flag Joseph Huang
2025-03-21 8:19 ` Nikolay Aleksandrov
2025-03-26 22:38 ` Joseph Huang
2025-03-27 22:52 ` Nikolay Aleksandrov [this message]
2025-03-28 15:53 ` Joseph Huang
2025-03-31 12:51 ` Nikolay Aleksandrov
2025-03-18 22:42 ` [Patch net-next 2/3] net: bridge: mcast: Notify on offload flag change Joseph Huang
2025-03-21 8:47 ` Nikolay Aleksandrov
2025-03-31 20:11 ` Joseph Huang
2025-04-01 12:49 ` Nikolay Aleksandrov
2025-04-01 13:37 ` Nikolay Aleksandrov
2025-03-18 22:42 ` [Patch net-next 3/3] net: bridge: Add notify on flag change netlink i/f Joseph Huang
2025-03-20 6:17 ` [Patch net-next 0/3] Add support for mdb offload failure notification Nikolay Aleksandrov
2025-03-20 21:14 ` Joseph Huang
2025-03-21 8:47 ` 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=ffe6f6cc-7157-48ad-9cde-dc38d8427849@blackwall.org \
--to=razor@blackwall.org \
--cc=Joseph.Huang@garmin.com \
--cc=andrew+netdev@lunn.ch \
--cc=bridge@lists.linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=joseph.huang.2024@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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
all inboxes | Powered by JetHome®