Skip to content

Commit b6fe83e

Browse files
edumazetdavem330
authored andcommitted
bonding: refine IFF_XMIT_DST_RELEASE capability
Some workloads greatly benefit of IFF_XMIT_DST_RELEASE capability on output net device, avoiding dirtying dst refcount. bonding currently disables IFF_XMIT_DST_RELEASE unconditionally. If all slaves have the IFF_XMIT_DST_RELEASE bit set, then bonding master can also have it in its priv_flags Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Jay Vosburgh <fubar@us.ibm.com> Cc: Andy Gospodarek <andy@greyhouse.net> Cc: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1817e83 commit b6fe83e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎drivers/net/bonding/bond_main.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,7 @@ static void bond_compute_features(struct bonding *bond)
13821382
netdev_features_t vlan_features = BOND_VLAN_FEATURES;
13831383
unsigned short max_hard_header_len = ETH_HLEN;
13841384
int i;
1385+
unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE;
13851386

13861387
read_lock(&bond->lock);
13871388

@@ -1392,6 +1393,7 @@ static void bond_compute_features(struct bonding *bond)
13921393
vlan_features = netdev_increment_features(vlan_features,
13931394
slave->dev->vlan_features, BOND_VLAN_FEATURES);
13941395

1396+
dst_release_flag &= slave->dev->priv_flags;
13951397
if (slave->dev->hard_header_len > max_hard_header_len)
13961398
max_hard_header_len = slave->dev->hard_header_len;
13971399
}
@@ -1400,6 +1402,9 @@ static void bond_compute_features(struct bonding *bond)
14001402
bond_dev->vlan_features = vlan_features;
14011403
bond_dev->hard_header_len = max_hard_header_len;
14021404

1405+
flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE;
1406+
bond_dev->priv_flags = flags | dst_release_flag;
1407+
14031408
read_unlock(&bond->lock);
14041409

14051410
netdev_change_features(bond_dev);

0 commit comments

Comments
 (0)