Skip to content

Commit 5a7baa7

Browse files
ogerlitzdavem330
authored andcommitted
bonding: Advertize vxlan offload features when supported
When the underlying device supports TCP offloads for VXLAN/UDP encapulated traffic, we need to reflect that through the hw_enc_features field of the bonding net-device. This will cause the xmit path in the core networking stack to provide bonding with encapsulated GSO frames to offload into the HW etc. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ee14eb7 commit 5a7baa7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,10 +1025,14 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
10251025
NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
10261026
NETIF_F_HIGHDMA | NETIF_F_LRO)
10271027

1028+
#define BOND_ENC_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | NETIF_F_RXCSUM |\
1029+
NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL)
1030+
10281031
static void bond_compute_features(struct bonding *bond)
10291032
{
10301033
unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;
10311034
netdev_features_t vlan_features = BOND_VLAN_FEATURES;
1035+
netdev_features_t enc_features = BOND_ENC_FEATURES;
10321036
struct net_device *bond_dev = bond->dev;
10331037
struct list_head *iter;
10341038
struct slave *slave;
@@ -1044,6 +1048,9 @@ static void bond_compute_features(struct bonding *bond)
10441048
vlan_features = netdev_increment_features(vlan_features,
10451049
slave->dev->vlan_features, BOND_VLAN_FEATURES);
10461050

1051+
enc_features = netdev_increment_features(enc_features,
1052+
slave->dev->hw_enc_features,
1053+
BOND_ENC_FEATURES);
10471054
dst_release_flag &= slave->dev->priv_flags;
10481055
if (slave->dev->hard_header_len > max_hard_header_len)
10491056
max_hard_header_len = slave->dev->hard_header_len;
@@ -1054,6 +1061,7 @@ static void bond_compute_features(struct bonding *bond)
10541061

10551062
done:
10561063
bond_dev->vlan_features = vlan_features;
1064+
bond_dev->hw_enc_features = enc_features;
10571065
bond_dev->hard_header_len = max_hard_header_len;
10581066
bond_dev->gso_max_segs = gso_max_segs;
10591067
netif_set_gso_max_size(bond_dev, gso_max_size);
@@ -3975,6 +3983,7 @@ void bond_setup(struct net_device *bond_dev)
39753983
NETIF_F_HW_VLAN_CTAG_FILTER;
39763984

39773985
bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM);
3986+
bond_dev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
39783987
bond_dev->features |= bond_dev->hw_features;
39793988
}
39803989

0 commit comments

Comments
 (0)