Ethernet Bridge development
 help / color / mirror / Atom feed
From: Joseph Huang <joseph.huang.2024@gmail.com>
To: Nikolay Aleksandrov <razor@blackwall.org>,
	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 v2 net-next 3/3] net: bridge: mcast: Notify on mdb offload failure
Date: Fri, 4 Apr 2025 16:11:50 -0400	[thread overview]
Message-ID: <9e7f6c4c-cabe-46e9-b59f-6638b4ae25e3@gmail.com> (raw)
In-Reply-To: <abb9e2c1-c4b5-4ffa-b2e3-8b204da5efca@blackwall.org>

On 4/4/2025 4:04 PM, Nikolay Aleksandrov wrote:
> On 4/4/25 18:25, Joseph Huang wrote:
>> On 4/4/2025 6:29 AM, Nikolay Aleksandrov wrote:
>>> On 4/4/25 02:44, Joseph Huang wrote:
>>>> Notify user space on mdb offload failure if mdb_offload_fail_notification
>>>> is set.
>>>>
>>>> Signed-off-by: Joseph Huang <Joseph.Huang@garmin.com>
>>>> ---
>>>>    net/bridge/br_mdb.c       | 26 +++++++++++++++++++++-----
>>>>    net/bridge/br_private.h   |  9 +++++++++
>>>>    net/bridge/br_switchdev.c |  4 ++++
>>>>    3 files changed, 34 insertions(+), 5 deletions(-)
>>>>
>>>
>>> The patch looks good, but one question - it seems we'll mark mdb entries with
>>> "offload failed" when we get -EOPNOTSUPP as an error as well. Is that intended?
>>>
>>> That is, if the option is enabled and we have mixed bridge ports, we'll mark mdbs
>>> to the non-switch ports as offload failed, but it is not due to a switch offload
>>> error.
>>
>> Good catch. No, that was not intended.
>>
>> What if we short-circuit and just return like you'd suggested initially if err == -EOPNOTSUPP?
>>
>>>> diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c
>>>> index 40f0b16e4df8..9b5005d0742a 100644
>>>> --- a/net/bridge/br_switchdev.c
>>>> +++ b/net/bridge/br_switchdev.c
>>>> @@ -504,6 +504,7 @@ static void br_switchdev_mdb_complete(struct net_device *dev, int err, void *pri
>>>>        struct net_bridge_mdb_entry *mp;
>>>>        struct net_bridge_port *port = data->port;
>>>>        struct net_bridge *br = port->br;
>>>> +    u8 old_flags;
>>>>    
>>
>> +    if (err == -EOPNOTSUPP)
>> +        goto notsupp;
>>
>>>>        spin_lock_bh(&br->multicast_lock);
>>>>        mp = br_mdb_ip_get(br, &data->ip);
>>>> @@ -514,7 +515,10 @@ static void br_switchdev_mdb_complete(struct net_device *dev, int err, void *pri
>>>>            if (p->key.port != port)
>>>>                continue;
>>>>    +        old_flags = p->flags;
>>>>            br_multicast_set_pg_offload_flags(p, !err);
>>>> +        if (br_mdb_should_notify(br, old_flags ^ p->flags))
>>>> +            br_mdb_flag_change_notify(br->dev, mp, p);
>>>>        }
>>>>    out:
>>>>        spin_unlock_bh(&br->multicast_lock);
>>>
>>
>> + notsupp:
>>      kfree(priv);
> 
> Looks good to me. Thanks!

Thanks for the review!

And a logistic question. Now that part 1 and part 2 are ack'd (thanks 
again for the review), when I send out v3, should I resend those 
(unmodified part 1 and part 2) with my v3 patch series, or should I 
break this one off and only send part 3 v3 as a separate patch?

Thanks,
Joseph

  reply	other threads:[~2025-04-04 20:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03 23:44 [Patch v2 net-next 0/3] Add support for mdb offload failure notification Joseph Huang
2025-04-03 23:44 ` [Patch v2 net-next 1/3] net: bridge: mcast: Add offload failed mdb flag Joseph Huang
2025-04-04 10:30   ` Nikolay Aleksandrov
2025-04-03 23:44 ` [Patch v2 net-next 2/3] net: bridge: Add offload_fail_notification bopt Joseph Huang
2025-04-04 10:30   ` Nikolay Aleksandrov
2025-04-03 23:44 ` [Patch v2 net-next 3/3] net: bridge: mcast: Notify on mdb offload failure Joseph Huang
2025-04-04 10:29   ` Nikolay Aleksandrov
2025-04-04 15:25     ` Joseph Huang
2025-04-04 20:04       ` Nikolay Aleksandrov
2025-04-04 20:11         ` Joseph Huang [this message]
2025-04-04 20:15           ` 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=9e7f6c4c-cabe-46e9-b59f-6638b4ae25e3@gmail.com \
    --to=joseph.huang.2024@gmail.com \
    --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=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --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