[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220215000534.y6lhn2uvdtepx2v3@skbuf>
Date: Tue, 15 Feb 2022 00:05:35 +0000
From: Vladimir Oltean <vladimir.oltean@....com>
To: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
Roopa Prabhu <roopa@...dia.com>,
Nikolay Aleksandrov <nikolay@...dia.com>,
Jiri Pirko <jiri@...dia.com>, Ido Schimmel <idosch@...dia.com>,
Rafael Richter <rafael.richter@....de>,
Daniel Klauer <daniel.klauer@....de>,
Tobias Waldekranz <tobias@...dekranz.com>
Subject: Re: [PATCH v2 net-next 1/8] net: bridge: vlan: notify switchdev only
when something changed
On Tue, Feb 15, 2022 at 01:31:04AM +0200, Vladimir Oltean wrote:
> +/* return true if anything will change as a result of __vlan_add_flags,
> + * false otherwise
> + */
> +static bool __vlan_flags_would_change(struct net_bridge_vlan *v, u16 flags)
> +{
> + struct net_bridge_vlan_group *vg;
> + u16 old_flags = v->flags;
> + bool pvid_changed;
>
> - return ret || !!(old_flags ^ v->flags);
> + if (br_vlan_is_master(v))
> + vg = br_vlan_group(v->br);
> + else
> + vg = nbp_vlan_group(v->port);
> +
> + if (flags & BRIDGE_VLAN_INFO_PVID)
> + pvid_changed = (vg->pvid == v->vid);
> + else
> + pvid_changed = (vg->pvid != v->vid);
Yikes, I was planning to fix this but I forgot. The conditions are in
reverse, it should be:
if (flags & BRIDGE_VLAN_INFO_PVID)
pvid_changed = (vg->pvid != v->vid);
else
pvid_changed = (vg->pvid == v->vid);
> +
> + return pvid_changed || !!(old_flags ^ v->flags);
> }
Powered by blists - more mailing lists