提交 5a7baa78 编写于 作者: O Or Gerlitz 提交者: David S. Miller

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: NOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ee14eb7b
...@@ -1025,10 +1025,14 @@ static netdev_features_t bond_fix_features(struct net_device *dev, ...@@ -1025,10 +1025,14 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
NETIF_F_HIGHDMA | NETIF_F_LRO) NETIF_F_HIGHDMA | NETIF_F_LRO)
#define BOND_ENC_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | NETIF_F_RXCSUM |\
NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL)
static void bond_compute_features(struct bonding *bond) static void bond_compute_features(struct bonding *bond)
{ {
unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE; unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;
netdev_features_t vlan_features = BOND_VLAN_FEATURES; netdev_features_t vlan_features = BOND_VLAN_FEATURES;
netdev_features_t enc_features = BOND_ENC_FEATURES;
struct net_device *bond_dev = bond->dev; struct net_device *bond_dev = bond->dev;
struct list_head *iter; struct list_head *iter;
struct slave *slave; struct slave *slave;
...@@ -1044,6 +1048,9 @@ static void bond_compute_features(struct bonding *bond) ...@@ -1044,6 +1048,9 @@ static void bond_compute_features(struct bonding *bond)
vlan_features = netdev_increment_features(vlan_features, vlan_features = netdev_increment_features(vlan_features,
slave->dev->vlan_features, BOND_VLAN_FEATURES); slave->dev->vlan_features, BOND_VLAN_FEATURES);
enc_features = netdev_increment_features(enc_features,
slave->dev->hw_enc_features,
BOND_ENC_FEATURES);
dst_release_flag &= slave->dev->priv_flags; dst_release_flag &= slave->dev->priv_flags;
if (slave->dev->hard_header_len > max_hard_header_len) if (slave->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = slave->dev->hard_header_len; max_hard_header_len = slave->dev->hard_header_len;
...@@ -1054,6 +1061,7 @@ static void bond_compute_features(struct bonding *bond) ...@@ -1054,6 +1061,7 @@ static void bond_compute_features(struct bonding *bond)
done: done:
bond_dev->vlan_features = vlan_features; bond_dev->vlan_features = vlan_features;
bond_dev->hw_enc_features = enc_features;
bond_dev->hard_header_len = max_hard_header_len; bond_dev->hard_header_len = max_hard_header_len;
bond_dev->gso_max_segs = gso_max_segs; bond_dev->gso_max_segs = gso_max_segs;
netif_set_gso_max_size(bond_dev, gso_max_size); netif_set_gso_max_size(bond_dev, gso_max_size);
...@@ -3975,6 +3983,7 @@ void bond_setup(struct net_device *bond_dev) ...@@ -3975,6 +3983,7 @@ void bond_setup(struct net_device *bond_dev)
NETIF_F_HW_VLAN_CTAG_FILTER; NETIF_F_HW_VLAN_CTAG_FILTER;
bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM); bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM);
bond_dev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
bond_dev->features |= bond_dev->hw_features; bond_dev->features |= bond_dev->hw_features;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册