Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eric Dumazet and committed by
David S. Miller
b6fe83e9 1817e83d

+5
+5
drivers/net/bonding/bond_main.c
··· 1382 1382 netdev_features_t vlan_features = BOND_VLAN_FEATURES; 1383 1383 unsigned short max_hard_header_len = ETH_HLEN; 1384 1384 int i; 1385 + unsigned int flags, dst_release_flag = IFF_XMIT_DST_RELEASE; 1385 1386 1386 1387 read_lock(&bond->lock); 1387 1388 ··· 1393 1392 vlan_features = netdev_increment_features(vlan_features, 1394 1393 slave->dev->vlan_features, BOND_VLAN_FEATURES); 1395 1394 1395 + dst_release_flag &= slave->dev->priv_flags; 1396 1396 if (slave->dev->hard_header_len > max_hard_header_len) 1397 1397 max_hard_header_len = slave->dev->hard_header_len; 1398 1398 } ··· 1401 1399 done: 1402 1400 bond_dev->vlan_features = vlan_features; 1403 1401 bond_dev->hard_header_len = max_hard_header_len; 1402 + 1403 + flags = bond_dev->priv_flags & ~IFF_XMIT_DST_RELEASE; 1404 + bond_dev->priv_flags = flags | dst_release_flag; 1404 1405 1405 1406 read_unlock(&bond->lock); 1406 1407