Skip to content

Allow bridge to function in non-promisc mode

Vlad Yasevich bridge netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/26 patches 15 repliesIn review
  2. v2 RFC posting 1/23 patches 5 repliesSuperseded
  3. v1 RFC3 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- Dynamic promisc mode selection. Almost complete re-write.

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6bridge: Allow an ability to designate an uplink portinclude/uapi/linux/if_link.h net/bridge/br_netlink.c net/bridge/br_private.h +1 more+6 -00 replies
2/6bridge: make flags sysfs interface a little bit more extensiblenet/bridge/br_sysfs_if.c+28 -114 replies
3/6bridge: Implement IFF_UNICAST_FLT.net/bridge/br_device.c net/bridge/br_if.c net/bridge/br_netlink.c +2 more+62 -40 replies
4/6bridge: Allow user to program hw addresses to uplink devices.include/uapi/linux/neighbour.h net/bridge/br_fdb.c net/core/rtnetlink.c+40 -200 replies
5/6bridge: Automatically set promisc on uplink ports.net/bridge/br_device.c net/bridge/br_fdb.c net/bridge/br_if.c +2 more+123 -330 replies
6/6bridge: Store bridge mac to uplinksnet/bridge/br_device.c net/bridge/br_private.h net/bridge/br_stp_if.c+23 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 net-next 0/6] Allow bridge to function in non-promisc mode

This series is an almost complete rework of the prior attempt to make the bridge function in non-promisc mode. In this series the "promiscuity" of an interface is dynamically determined and the interface may transition from/to promiscuous mode based on bridge configuration.

The series keeps an idea of an "uplink" port. That is still user designated.
The series also adds a concept of "dynamic" bridge port. This is the default state of the port and means that the user has not specified any static FDBs for that port.
Once a user has added a static FDB entry to port and also specified an "uplink" flag for that FDB, the mac address from that FDB is added to the bridge hw address list and synched down to uplinks. "Uplinks" are always considered dynamic ports even if a static entry has been added for them.
Promiscuity is determined by the number of dynamic ports. If there are no dynamic ports (i.e all ports have static FDBs set), then we know all the neighbors and can switch promisc off on all of the ports. If we have only 1 dynamic port and its an uplink, we can synch all static hw addresses to this port and mark it non-promisc. If we have more then 1 dynamic port, then all ports have to be promiscuouse.
This is the algorith that Michael Tsirkin proposed earlier.

Changes since v1:
- Dynamic promisc mode selection. Almost complete re-write.

Vlad Yasevich (6):
bridge: Allow an ability to designate an uplink port
bridge: make flags sysfs interface a little bit more extensible
bridge: Implement IFF_UNICAST_FLT.
bridge: Allow user to program hw addresses to uplink devices.
bridge: Automatically set promisc on uplink ports.
bridge: Store bridge mac to uplinks

 include/uapi/linux/if_link.h   |    1 +
 include/uapi/linux/neighbour.h |    6 +-
 net/bridge/br_device.c         |   69 ++++++++++++++++++++++++--
 net/bridge/br_fdb.c            |  108 +++++++++++++++++++++++++++++++---------
 net/bridge/br_if.c             |   50 +++++++++++++++---
 net/bridge/br_netlink.c        |    5 ++
 net/bridge/br_private.h        |   12 ++++-
 net/bridge/br_stp_if.c         |    2 +-
 net/bridge/br_sysfs_if.c       |   60 ++++++++++++++++++----
 net/core/dev.c                 |    1 +
 net/core/rtnetlink.c           |    4 +-
 11 files changed, 265 insertions(+), 53 deletions(-)
Signature · 1 line
1.7.7.6