aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/networking
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2016-08-25 12:42:37 -0400
committerDavid S. Miller <davem@davemloft.net>2016-08-26 16:13:36 -0400
commit6bc506b4fb065eac3d89ca1ce37082e174493d9e (patch)
treeb2ce45bcdf47c388d9d0977af7bf511685a00e6e /Documentation/networking
parent5c326ab49e5ee014ba5314c076fe9b93fd8b0406 (diff)
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>
Diffstat (limited to 'Documentation/networking')
-rw-r--r--Documentation/networking/switchdev.txt13
1 files changed, 4 insertions, 9 deletions
diff --git a/Documentation/networking/switchdev.txt b/Documentation/networking/switchdev.txt
index 31c39115834d..44235e83799b 100644
--- a/Documentation/networking/switchdev.txt
+++ b/Documentation/networking/switchdev.txt
@@ -283,15 +283,10 @@ be sent to the port netdev for processing by the bridge driver. The
283bridge should not reflood the packet to the same ports the device flooded, 283bridge should not reflood the packet to the same ports the device flooded,
284otherwise there will be duplicate packets on the wire. 284otherwise there will be duplicate packets on the wire.
285 285
286To avoid duplicate packets, the device/driver should mark a packet as already 286To avoid duplicate packets, the switch driver should mark a packet as already
287forwarded using skb->offload_fwd_mark. The same mark is set on the device 287forwarded by setting the skb->offload_fwd_mark bit. The bridge driver will mark
288ports in the domain using dev->offload_fwd_mark. If the skb->offload_fwd_mark 288the skb using the ingress bridge port's mark and prevent it from being forwarded
289is non-zero and matches the forwarding egress port's dev->skb_mark, the kernel 289through any bridge port with the same mark.
290will drop the skb right before transmit on the egress port, with the
291understanding that the device already forwarded the packet on same egress port.
292The driver can use switchdev_port_fwd_mark_set() to set a globally unique mark
293for port's dev->offload_fwd_mark, based on the port's parent ID (switch ID) and
294a group ifindex.
295 290
296It is possible for the switch device to not handle flooding and push the 291It is possible for the switch device to not handle flooding and push the
297packets up to the bridge driver for flooding. This is not ideal as the number 292packets up to the bridge driver for flooding. This is not ideal as the number