Skip to content

Commit 2e770b5

Browse files
Awik84davem330
authored andcommitted
net: bonding: Inherit MPLS features from slave devices
When setting the bonding interface net device features, the kernel code doesn't address the slaves' MPLS features and doesn't inherit them. Therefore, HW offloads that enhance performance such as checksumming and TSO are disabled for MPLS tagged traffic flowing via the bonding interface. The patch add the inheritance of the MPLS features from the slave devices with a similar logic to setting the bonding device's VLAN and encapsulation features. CC: Jay Vosburgh <[email protected]> CC: Veaceslav Falico <[email protected]> CC: Andy Gospodarek <[email protected]> Signed-off-by: Ariel Levkovich <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b20ac8d commit 2e770b5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-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

0 commit comments

Comments
 (0)