Commit dc905951 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

team: refine IFF_XMIT_DST_RELEASE capability

Cloned patch of Eric Dumazet for bonding.

Some workloads greatly benefit of IFF_XMIT_DST_RELEASE capability
on output net device, avoiding dirtying dst refcount.

team currently disables IFF_XMIT_DST_RELEASE unconditionally.

If all ports have the IFF_XMIT_DST_RELEASE bit set, then
team dev can also have it in its priv_flags.
Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f150bd7f
...@@ -733,12 +733,14 @@ static void __team_compute_features(struct team *team) ...@@ -733,12 +733,14 @@ static void __team_compute_features(struct team *team)
struct team_port *port; struct team_port *port;
u32 vlan_features = TEAM_VLAN_FEATURES; u32 vlan_features = TEAM_VLAN_FEATURES;
unsigned short max_hard_header_len = ETH_HLEN; unsigned short max_hard_header_len = ETH_HLEN;
unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;
list_for_each_entry(port, &team->port_list, list) { list_for_each_entry(port, &team->port_list, list) {
vlan_features = netdev_increment_features(vlan_features, vlan_features = netdev_increment_features(vlan_features,
port->dev->vlan_features, port->dev->vlan_features,
TEAM_VLAN_FEATURES); TEAM_VLAN_FEATURES);
dst_release_flag &= port->dev->priv_flags;
if (port->dev->hard_header_len > max_hard_header_len) if (port->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = port->dev->hard_header_len; max_hard_header_len = port->dev->hard_header_len;
} }
...@@ -746,6 +748,9 @@ static void __team_compute_features(struct team *team) ...@@ -746,6 +748,9 @@ static void __team_compute_features(struct team *team)
team->dev->vlan_features = vlan_features; team->dev->vlan_features = vlan_features;
team->dev->hard_header_len = max_hard_header_len; team->dev->hard_header_len = max_hard_header_len;
flags = team->dev->priv_flags & ~IFF_XMIT_DST_RELEASE;
team->dev->priv_flags = flags | dst_release_flag;
netdev_change_features(team->dev); netdev_change_features(team->dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment