net: dsa: add support for BRIDGE_MROUTER attribute
authorVivien Didelot <vivien.didelot@gmail.com>
Tue, 9 Jul 2019 03:31:13 +0000 (23:31 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Jul 2019 21:49:34 +0000 (14:49 -0700)
commit08cc83cc7fd8e6c3670ff545ef2bbfbc01a02d87
tree41c6023764ea942a7633cb1d369b84afea75af4a
parentfbc697796e358d1ed8ed25758b19bdb3a1f8e9f9
net: dsa: add support for BRIDGE_MROUTER attribute

This patch adds support for enabling or disabling the flooding of
unknown multicast traffic on the CPU ports, depending on the value
of the switchdev SWITCHDEV_ATTR_ID_BRIDGE_MROUTER attribute.

The current behavior is kept unchanged but a user can now prevent
the CPU conduit to be flooded with a lot of unregistered traffic that
the network stack needs to filter in software with e.g.:

    echo 0 > /sys/class/net/br0/multicast_router

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa_priv.h
net/dsa/port.c
net/dsa/slave.c