From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: kernel test robot <lkp@intel.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"llvm@lists.linux.dev" <llvm@lists.linux.dev>,
"kbuild-all@lists.01.org" <kbuild-all@lists.01.org>,
Jakub Kicinski <kuba@kernel.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
Paolo Abeni <pabeni@redhat.com>, Roopa Prabhu <roopa@nvidia.com>,
Nikolay Aleksandrov <razor@blackwall.org>,
Jiri Pirko <jiri@nvidia.com>, Ido Schimmel <idosch@nvidia.com>,
Tobias Waldekranz <tobias@waldekranz.com>,
Mattias Forsblad <mattias.forsblad@gmail.com>
Subject: Re: [PATCH net-next 6/6] net: bridge: avoid uselessly making offloaded ports promiscuous
Date: Sat, 9 Apr 2022 11:04:45 +0000 [thread overview]
Message-ID: <20220409110444.5uf62kg5xjuvwysk@skbuf> (raw)
In-Reply-To: <202204091856.0PBgeBSa-lkp@intel.com>
On Sat, Apr 09, 2022 at 06:17:15PM +0800, kernel test robot wrote:
> >> net/bridge/br_if.c:145:10: error: no member named 'offload_count' in 'struct net_bridge_port'
> if (p->offload_count) {
> ~ ^
> 130 /* When a port is added or removed or when certain port flags
> 131 * change, this function is called to automatically manage
> 132 * promiscuity setting of all the bridge ports. We are always called
> 133 * under RTNL so can skip using rcu primitives.
> 134 */
> 135 void br_manage_promisc(struct net_bridge *br)
> 136 {
> 137 struct net_bridge_port *p;
> 138
> 139 list_for_each_entry(p, &br->port_list, list) {
> 140 /* Offloaded ports have a separate address database for
> 141 * forwarding, which is managed through switchdev and not
> 142 * through dev_uc_add(), so the promiscuous concept makes no
> 143 * sense for them. Avoid updating promiscuity in that case.
> 144 */
> > 145 if (p->offload_count) {
Good point. Please imagine there's a static inline nbp_get_offload_count()
that returns 0 when CONFIG_NET_SWITCHDEV=n. I'll address this for v2.
> 146 br_port_clear_promisc(p);
> 147 continue;
> 148 }
> 149
> 150 /* If bridge is promiscuous, unconditionally place all ports
> 151 * in promiscuous mode too. This allows the bridge device to
> 152 * locally receive all unknown traffic.
> 153 */
> 154 if (br->dev->flags & IFF_PROMISC) {
> 155 br_port_set_promisc(p);
> 156 continue;
> 157 }
> 158
> 159 /* If vlan filtering is disabled, place all ports in
> 160 * promiscuous mode.
> 161 */
> 162 if (!br_vlan_enabled(br->dev)) {
> 163 br_port_set_promisc(p);
> 164 continue;
> 165 }
> 166
> 167 /* If the number of auto-ports is <= 1, then all other ports
> 168 * will have their output configuration statically specified
> 169 * through fdbs. Since ingress on the auto-port becomes
> 170 * forwarding/egress to other ports and egress configuration is
> 171 * statically known, we can say that ingress configuration of
> 172 * the auto-port is also statically known.
> 173 * This lets us disable promiscuous mode and write this config
> 174 * to hw.
> 175 */
> 176 if (br->auto_cnt == 0 ||
> 177 (br->auto_cnt == 1 && br_auto_port(p)))
> 178 br_port_clear_promisc(p);
> 179 else
> 180 br_port_set_promisc(p);
> 181 }
> 182 }
> 183
next prev parent reply other threads:[~2022-04-09 11:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 20:03 [PATCH net-next 0/6] Disable host flooding for DSA ports under a bridge Vladimir Oltean
2022-04-08 20:03 ` [PATCH net-next 1/6] net: refactor all NETDEV_CHANGE notifier calls to a single function Vladimir Oltean
2022-04-08 20:03 ` [PATCH net-next 2/6] net: emit NETDEV_CHANGE for changes to IFF_PROMISC | IFF_ALLMULTI Vladimir Oltean
2022-04-08 20:03 ` [PATCH net-next 3/6] net: dsa: walk through all changeupper notifier functions Vladimir Oltean
2022-04-08 20:03 ` [PATCH net-next 4/6] net: dsa: track whether bridges have foreign interfaces in them Vladimir Oltean
2022-04-08 20:03 ` [PATCH net-next 5/6] net: dsa: monitor changes to bridge promiscuity Vladimir Oltean
2022-04-08 20:03 ` [PATCH net-next 6/6] net: bridge: avoid uselessly making offloaded ports promiscuous Vladimir Oltean
2022-04-09 10:17 ` kernel test robot
2022-04-09 11:04 ` Vladimir Oltean [this message]
2022-04-14 13:53 ` kernel test robot
2022-04-08 20:14 ` [PATCH net-next 0/6] Disable host flooding for DSA ports under a bridge Vladimir Oltean
2022-04-08 20:52 ` Nikolay Aleksandrov
2022-04-09 19:46 ` Tobias Waldekranz
2022-04-09 20:45 ` Vladimir Oltean
2022-04-10 18:02 ` Tobias Waldekranz
2022-04-10 22:03 ` Vladimir Oltean
2022-04-11 9:33 ` Tobias Waldekranz
2022-04-11 10:55 ` Vladimir Oltean
2022-04-11 13:14 ` Tobias Waldekranz
2022-04-11 13:55 ` Vladimir Oltean
2022-04-11 14:24 ` Vladimir Oltean
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=20220409110444.5uf62kg5xjuvwysk@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=idosch@nvidia.com \
--cc=jiri@nvidia.com \
--cc=kbuild-all@lists.01.org \
--cc=kuba@kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=mattias.forsblad@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=roopa@nvidia.com \
--cc=tobias@waldekranz.com \
--cc=vivien.didelot@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