]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
bridge: switchdev: Add forward mark support for stacked devices
authorIdo Schimmel <idosch@mellanox.com>
Thu, 25 Aug 2016 16:42:37 +0000 (18:42 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Aug 2016 20:13:36 +0000 (13:13 -0700)
commit6bc506b4fb065eac3d89ca1ce37082e174493d9e
treeb2ce45bcdf47c388d9d0977af7bf511685a00e6e
parent5c326ab49e5ee014ba5314c076fe9b93fd8b0406
bridge: switchdev: Add forward mark support for stacked devices

switchdev_port_fwd_mark_set() is used to set the 'offload_fwd_mark' of
port netdevs so that packets being flooded by the device won't be
flooded twice.

It works by assigning a unique identifier (the ifindex of the first
bridge port) to bridge ports sharing the same parent ID. This prevents
packets from being flooded twice by the same switch, but will flood
packets through bridge ports belonging to a different switch.

This method is problematic when stacked devices are taken into account,
such as VLANs. In such cases, a physical port netdev can have upper
devices being members in two different bridges, thus requiring two
different 'offload_fwd_mark's to be configured on the port netdev, which
is impossible.

The main problem is that packet and netdev marking is performed at the
physical netdev level, whereas flooding occurs between bridge ports,
which are not necessarily port netdevs.

Instead, packet and netdev marking should really be done in the bridge
driver with the switch driver only telling it which packets it already
forwarded. The bridge driver will mark such packets using the mark
assigned to the ingress bridge port and will prevent the packet from
being forwarded through any bridge port sharing the same mark (i.e.
having the same parent ID).

Remove the current switchdev 'offload_fwd_mark' implementation and
instead implement the proposed method. In addition, make rocker - the
sole user of the mark - use the proposed method.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 files changed:
Documentation/networking/switchdev.txt
drivers/net/ethernet/rocker/rocker_main.c
drivers/net/ethernet/rocker/rocker_ofdpa.c
include/linux/netdevice.h
include/linux/skbuff.h
include/net/switchdev.h
net/bridge/Makefile
net/bridge/br_forward.c
net/bridge/br_if.c
net/bridge/br_input.c
net/bridge/br_private.h
net/bridge/br_switchdev.c [new file with mode: 0644]
net/core/dev.c
net/switchdev/switchdev.c