Skip to content

Commit 600bb03

Browse files
committed
Merge branch 'bond-mpls'
Ariel Levkovich says: ==================== Support MPLS features in bonding and vlan net devices Netdevice HW MPLS features are not passed from device driver's netdevice to upper netdevice, specifically VLAN and bonding netdevice which are created by the kernel when needed. This prevents enablement and usage of HW offloads, such as TSO and checksumming for MPLS tagged traffic when running via VLAN or bonding interface. The patches introduce changes to the initialization steps of the VLAN and bonding netdevices to inherit the MPLS features from lower netdevices to allow the HW offloads. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents b20ac8d + 8b6912a commit 600bb03

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,12 +1077,16 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
10771077
#define BOND_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
10781078
NETIF_F_RXCSUM | NETIF_F_ALL_TSO)
10791079

1080+
#define BOND_MPLS_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
1081+
NETIF_F_ALL_TSO)
1082+
10801083
static void bond_compute_features(struct bonding *bond)
10811084
{
10821085
unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
10831086
IFF_XMIT_DST_RELEASE_PERM;
10841087
netdev_features_t vlan_features = BOND_VLAN_FEATURES;
10851088
netdev_features_t enc_features = BOND_ENC_FEATURES;
1089+
netdev_features_t mpls_features = BOND_MPLS_FEATURES;
10861090
struct net_device *bond_dev = bond->dev;
10871091
struct list_head *iter;
10881092
struct slave *slave;
@@ -1093,6 +1097,7 @@ static void bond_compute_features(struct bonding *bond)
10931097
if (!bond_has_slaves(bond))
10941098
goto done;
10951099
vlan_features &= NETIF_F_ALL_FOR_ALL;
1100+
mpls_features &= NETIF_F_ALL_FOR_ALL;
10961101

10971102
bond_for_each_slave(bond, slave, iter) {
10981103
vlan_features = netdev_increment_features(vlan_features,
@@ -1101,6 +1106,11 @@ static void bond_compute_features(struct bonding *bond)
11011106
enc_features = netdev_increment_features(enc_features,
11021107
slave->dev->hw_enc_features,
11031108
BOND_ENC_FEATURES);
1109+
1110+
mpls_features = netdev_increment_features(mpls_features,
1111+
slave->dev->mpls_features,
1112+
BOND_MPLS_FEATURES);
1113+
11041114
dst_release_flag &= slave->dev->priv_flags;
11051115
if (slave->dev->hard_header_len > max_hard_header_len)
11061116
max_hard_header_len = slave->dev->hard_header_len;
@@ -1114,6 +1124,7 @@ static void bond_compute_features(struct bonding *bond)
11141124
bond_dev->vlan_features = vlan_features;
11151125
bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
11161126
NETIF_F_GSO_UDP_L4;
1127+
bond_dev->mpls_features = mpls_features;
11171128
bond_dev->gso_max_segs = gso_max_segs;
11181129
netif_set_gso_max_size(bond_dev, gso_max_size);
11191130

net/8021q/vlan_dev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ static int vlan_dev_init(struct net_device *dev)
585585

586586
dev->vlan_features = real_dev->vlan_features & ~NETIF_F_ALL_FCOE;
587587
dev->hw_enc_features = vlan_tnl_features(real_dev);
588+
dev->mpls_features = real_dev->mpls_features;
588589

589590
/* ipv6 shared card related stuff */
590591
dev->dev_id = real_dev->dev_id;

0 commit comments

Comments
 (0)