Skip to contentSkip to conversation

Patch "bridge: switchdev: Clear forward mark when transmitting packet" has been added to the 4.12-stable tree

PATCH [email protected] 1 participant 1 message Sep 15, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

bridge: switchdev: Clear forward mark when transmitting packet

to the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
bridge-switchdev-clear-forward-mark-when-transmitting-packet.patch
and it can be found in the queue-4.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Thu Sep 14 23:20:23 PDT 2017

From: Ido Schimmel <[email protected]>
Date: Fri, 1 Sep 2017 12:22:25 +0300
Subject: bridge: switchdev: Clear forward mark when transmitting packet

From: Ido Schimmel <[email protected]>

[ Upstream commit 79e99bdd60b484af9afe0147e85a13e66d5c1cdb ]

Commit 6bc506b4fb06 ("bridge: switchdev: Add forward mark support for stacked devices") added the 'offload_fwd_mark' bit to the skb in order to allow drivers to indicate to the bridge driver that they already forwarded the packet in L2.

In case the bit is set, before transmitting the packet from each port, the port's mark is compared with the mark stored in the skb's control block. If both marks are equal, we know the packet arrived from a switch device that already forwarded the packet and it's not re-transmitted.

However, if the packet is transmitted from the bridge device itself (e.g., br0), we should clear the 'offload_fwd_mark' bit as the mark stored in the skb's control block isn't valid.

This scenario can happen in rare cases where a packet was trapped during L3 forwarding and forwarded by the kernel to a bridge device.

Fixes 6bc506b4fb06 ("bridge: switchdev: Add forward mark support for stacked devices")
---
 net/bridge/br_device.c |    3 +++
 1 file changed, 3 insertions(+)
net/bridge/br_device.c +3 -0
@@ -53,6 +53,9 @@ netdev_tx_t br_dev_xmit(struct sk_buff *
 	brstats->tx_bytes += skb->len;
 	u64_stats_update_end(&brstats->syncp);
 
+#ifdef CONFIG_NET_SWITCHDEV
+	skb->offload_fwd_mark = 0;
+#endif
 	BR_INPUT_SKB_CB(skb)->brdev = dev;
 
 	skb_reset_mac_header(skb);

Patches currently in stable-queue which might be from [email protected] are

queue-4.12/bridge-switchdev-clear-forward-mark-when-transmitting-packet.patch queue-4.12/mlxsw-spectrum-forbid-linking-to-devices-that-have-uppers.patch