forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: dsa: track whether bridges have foreign interfaces in them
DSA switches send packets to the CPU for 2 reasons, either for local termination or for software forwarding. If the switch driver satisfies the requirements for IFF_UNICAST_FLT and also offloads the bridge local FDB entries, then there is no reason to send unknown traffic to the CPU for the purpose of local termination. This leaves software forwarding as the sole concern, and a place where certain optimizations can be made. In the case of a bridge where all bridge ports are offloaded DSA interfaces, there isn't any need to do software forwarding (and therefore, to enable host flooding). We approximate the need for a DSA port to enable host flooding by managing IFF_PROMISC, which ends up triggering dsa_port_manage_cpu_flood(). This isn't ideal, because IFF_PROMISC/dev->uc/dev->mc deal only with the standalone address database of a port, and not with the bridging database, but right now DSA doesn't have the poster-child hardware where flooding is a per-FID setting rather than per-port. So in current practice, there is no reason to make dsa_port_manage_cpu_flood() more complex by looking at anything other than IFF_PROMISC. To enable those optimizations, create a function called dsa_bridge_foreign_dev_update() which updates a new boolean of struct dsa_bridge called "have_foreign" whenever a DSA port joins/leaves a bridge, or a LAG that is already in a bridge, or any other interface joins/leaves a bridge in which a DSA port or LAG offloaded by a DSA port exists. Note that when dsa_port_bridge_create() is first called, dsa_bridge_foreign_dev_update() is not called right away. It is called slightly later (still under rtnl_mutex), leading to some DSA switch callbacks (->port_bridge_join) being called with a potentially not up-to-date "have_foreign" property. This can be changed if necessary, I deem it as "not a problem" for now. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
- Loading branch information
1 parent
025064d
commit f60f0d2
Showing
4 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters