diff options
| -rw-r--r-- | Documentation/networking/switchdev.txt | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Documentation/networking/switchdev.txt b/Documentation/networking/switchdev.txt index c5d7ade10ff2..9825f32a8634 100644 --- a/Documentation/networking/switchdev.txt +++ b/Documentation/networking/switchdev.txt | |||
| @@ -279,8 +279,18 @@ and unknown unicast packets to all ports in domain, if allowed by port's | |||
| 279 | current STP state. The switch driver, knowing which ports are within which | 279 | current STP state. The switch driver, knowing which ports are within which |
| 280 | vlan L2 domain, can program the switch device for flooding. The packet should | 280 | vlan L2 domain, can program the switch device for flooding. The packet should |
| 281 | also be sent to the port netdev for processing by the bridge driver. The | 281 | also be sent to the port netdev for processing by the bridge driver. The |
| 282 | bridge should not reflood the packet to the same ports the device flooded. | 282 | bridge should not reflood the packet to the same ports the device flooded, |
| 283 | XXX: the mechanism to avoid duplicate flood packets is being discuseed. | 283 | otherwise there will be duplicate packets on the wire. |
| 284 | |||
| 285 | To avoid duplicate packets, the device/driver should mark a packet as already | ||
| 286 | forwarded using skb->offload_fwd_mark. The same mark is set on the device | ||
| 287 | ports in the domain using dev->offload_fwd_mark. If the skb->offload_fwd_mark | ||
| 288 | is non-zero and matches the forwarding egress port's dev->skb_mark, the kernel | ||
| 289 | will drop the skb right before transmit on the egress port, with the | ||
| 290 | understanding that the device already forwarded the packet on same egress port. | ||
| 291 | The driver can use switchdev_port_fwd_mark_set() to set a globally unique mark | ||
| 292 | for port's dev->offload_fwd_mark, based on the port's parent ID (switch ID) and | ||
| 293 | a group ifindex. | ||
| 284 | 294 | ||
| 285 | It is possible for the switch device to not handle flooding and push the | 295 | It is possible for the switch device to not handle flooding and push the |
| 286 | packets up to the bridge driver for flooding. This is not ideal as the number | 296 | packets up to the bridge driver for flooding. This is not ideal as the number |
