diff options
| author | Eran Ben Elisha <eranbe@mellanox.com> | 2015-12-17 09:11:55 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-12-17 16:24:36 -0500 |
| commit | 3268e5cb494d8778a5a67a9fa2b1bdb0243b77ad (patch) | |
| tree | 03630df515cc70a1054e848c6496981bb5f91baa /drivers/net/team | |
| parent | 34a55d5e858e81a20d33fd9490149d6a1058be0c (diff) | |
team: Advertise tunneling offload features
When the underlying device supports offloads encapulated traffic,
we need to reflect that through the hw_enc_features field of the
team net-device.
This will cause the xmit path in the core networking stack to provide
team with encapsulated GSO frames to offload into the HW etc.
Using this over Mellanox ConnectX3-pro (mlx4 driver) card that supports
VXLAN offloads we got 36.0 Gbits/sec using eight iperf streams.
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/team')
| -rw-r--r-- | drivers/net/team/team.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 915f60fce186..2528331de193 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
| @@ -985,10 +985,14 @@ static void team_port_disable(struct team *team, | |||
| 985 | NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ | 985 | NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ |
| 986 | NETIF_F_HIGHDMA | NETIF_F_LRO) | 986 | NETIF_F_HIGHDMA | NETIF_F_LRO) |
| 987 | 987 | ||
| 988 | #define TEAM_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ | ||
| 989 | NETIF_F_RXCSUM | NETIF_F_ALL_TSO) | ||
| 990 | |||
| 988 | static void __team_compute_features(struct team *team) | 991 | static void __team_compute_features(struct team *team) |
| 989 | { | 992 | { |
| 990 | struct team_port *port; | 993 | struct team_port *port; |
| 991 | u32 vlan_features = TEAM_VLAN_FEATURES & NETIF_F_ALL_FOR_ALL; | 994 | u32 vlan_features = TEAM_VLAN_FEATURES & NETIF_F_ALL_FOR_ALL; |
| 995 | netdev_features_t enc_features = TEAM_ENC_FEATURES; | ||
| 992 | unsigned short max_hard_header_len = ETH_HLEN; | 996 | unsigned short max_hard_header_len = ETH_HLEN; |
| 993 | unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE | | 997 | unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE | |
| 994 | IFF_XMIT_DST_RELEASE_PERM; | 998 | IFF_XMIT_DST_RELEASE_PERM; |
| @@ -997,6 +1001,11 @@ static void __team_compute_features(struct team *team) | |||
| 997 | vlan_features = netdev_increment_features(vlan_features, | 1001 | vlan_features = netdev_increment_features(vlan_features, |
| 998 | port->dev->vlan_features, | 1002 | port->dev->vlan_features, |
| 999 | TEAM_VLAN_FEATURES); | 1003 | TEAM_VLAN_FEATURES); |
| 1004 | enc_features = | ||
| 1005 | netdev_increment_features(enc_features, | ||
| 1006 | port->dev->hw_enc_features, | ||
| 1007 | TEAM_ENC_FEATURES); | ||
| 1008 | |||
| 1000 | 1009 | ||
| 1001 | dst_release_flag &= port->dev->priv_flags; | 1010 | dst_release_flag &= port->dev->priv_flags; |
| 1002 | if (port->dev->hard_header_len > max_hard_header_len) | 1011 | if (port->dev->hard_header_len > max_hard_header_len) |
| @@ -1004,6 +1013,7 @@ static void __team_compute_features(struct team *team) | |||
| 1004 | } | 1013 | } |
| 1005 | 1014 | ||
| 1006 | team->dev->vlan_features = vlan_features; | 1015 | team->dev->vlan_features = vlan_features; |
| 1016 | team->dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL; | ||
| 1007 | team->dev->hard_header_len = max_hard_header_len; | 1017 | team->dev->hard_header_len = max_hard_header_len; |
| 1008 | 1018 | ||
| 1009 | team->dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; | 1019 | team->dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; |
| @@ -2091,6 +2101,7 @@ static void team_setup(struct net_device *dev) | |||
| 2091 | NETIF_F_HW_VLAN_CTAG_RX | | 2101 | NETIF_F_HW_VLAN_CTAG_RX | |
| 2092 | NETIF_F_HW_VLAN_CTAG_FILTER; | 2102 | NETIF_F_HW_VLAN_CTAG_FILTER; |
| 2093 | 2103 | ||
| 2104 | dev->hw_features |= NETIF_F_GSO_ENCAP_ALL; | ||
| 2094 | dev->features |= dev->hw_features; | 2105 | dev->features |= dev->hw_features; |
| 2095 | } | 2106 | } |
| 2096 | 2107 | ||
