From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:58198 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751170AbdIOGVa (ORCPT ); Fri, 15 Sep 2017 02:21:30 -0400 Subject: Patch "bridge: switchdev: Clear forward mark when transmitting packet" has been added to the 4.12-stable tree To: idosch@mellanox.com, davem@davemloft.net, gregkh@linuxfoundation.org, jiri@mellanox.com, nikolay@cumulusnetworks.com, yotamg@mellanox.com Cc: , From: Date: Thu, 14 Sep 2017 23:21:27 -0700 Message-ID: <150545648712084@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 know about it. >>From foo@baz Thu Sep 14 23:20:23 PDT 2017 From: Ido Schimmel Date: Fri, 1 Sep 2017 12:22:25 +0300 Subject: bridge: switchdev: Clear forward mark when transmitting packet From: Ido Schimmel [ 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") Signed-off-by: Ido Schimmel Reported-by: Yotam Gigi Tested-by: Yotam Gigi Reviewed-by: Jiri Pirko Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/bridge/br_device.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c @@ -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 idosch@mellanox.com 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