[B][SRU][PATCH 2/4] net: vlan: Inherit MPLS features from parent device

Po-Hsu Lin po-hsu.lin at canonical.com
Wed Apr 8 06:55:59 UTC 2020


From: Ariel Levkovich <lariel at mellanox.com>

BugLink: https://bugs.launchpad.net/bugs/1851446

During the creation of the VLAN interface net device,
the various device features and offloads are being set based
on the parent device's features.
The code initiates the basic, vlan and encapsulation features
but doesn't address the MPLS features set and they remain blank.
As a result, all device offloads that have significant performance
effect are disabled for MPLS traffic going via this VLAN device such
as checksumming and TSO.

This patch makes sure that MPLS features are also set for the
VLAN device based on the parent which will allow HW offloads of
checksumming and TSO to be performed on MPLS tagged packets.

Signed-off-by: Ariel Levkovich <lariel at mellanox.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
(backported from commit 8b6912a5019356d7adb1b8a146c9eef5e679bf98)
[PHLin: context adjustment]
Signed-off-by: Po-Hsu Lin <po-hsu.lin at canonical.com>
---
 net/8021q/vlan_dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index ac4c93c..ce6ef20 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -572,6 +572,7 @@ static int vlan_dev_init(struct net_device *dev)
 		netdev_warn(real_dev, "VLAN features are set incorrectly.  Q-in-Q configurations may not work correctly.\n");
 
 	dev->vlan_features = real_dev->vlan_features & ~NETIF_F_ALL_FCOE;
+	dev->mpls_features = real_dev->mpls_features;
 
 	/* ipv6 shared card related stuff */
 	dev->dev_id = real_dev->dev_id;
-- 
2.7.4




More information about the kernel-team mailing list