All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] bonding: fix vlan_features computing
@ 2014-05-02 16:57 Michal Kubecek
  0 siblings, 0 replies; 11+ messages in thread
From: Michal Kubecek @ 2014-05-02 16:57 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, Jay Vosburgh, Veaceslav Falico, Andy Gospodarek,
	Michal Miroslaw

bond_compute_features() uses netdev_increment_features() to
combine vlan_features of slaves into vlan_features of the bond.
As netdev_increment_features() only adds most features and we
start with BOND_VLAN_FEATURES, we may end up with features none
of the slaves provided.

In particular, BOND_VLAN_FEATURES contains NETIF_F_HW_CSUM so
that netdev_increment_features() clears NETIF_F_IP{,V6}_CSUM and
if we only have slaves with NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
(e.g. ixgbe based cards), the same will be in features of the
bond and a vlan device on top of the bond would support no
checksumming, resulting in significant performance degradation.

If there is at least one slave, initialize vlan_features only
with the flags in NETIF_F_ALL_FOR_ALL. Right now there is none
in BOND_VLAN_FEATURES but stating it explicitely will make the
code more future proof.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
 drivers/net/bonding/bond_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 69aff72..34ca55d 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1038,6 +1038,7 @@ static void bond_compute_features(struct bonding *bond)
 
 	if (!bond_has_slaves(bond))
 		goto done;
+	vlan_features &= NETIF_F_ALL_FOR_ALL;
 
 	bond_for_each_slave(bond, slave, iter) {
 		vlan_features = netdev_increment_features(vlan_features,
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-05-22 19:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20140502165448.D8078E635B@unicorn.suse.cz>
2014-05-06  3:45 ` [PATCH net] bonding: fix vlan_features computing David Miller
2014-05-06  7:53   ` Jay Vosburgh
2014-05-06  8:44     ` Michal Kubecek
2014-05-06 13:03     ` Michal Kubecek
2014-05-07 18:08       ` David Miller
2014-05-20  6:29         ` [PATCH net-next v2 0/3] net: device features handling fixes Michal Kubecek
2014-05-20  6:29           ` [PATCH net-next v2 1/3] vlan: more careful checksum features handling Michal Kubecek
2014-05-20  6:29           ` [PATCH net-next v2 2/3] bonding: fix vlan_features computing Michal Kubecek
2014-05-20  6:29           ` [PATCH net-next v2 3/3] teaming: " Michal Kubecek
2014-05-22 19:07           ` [PATCH net-next v2 0/3] net: device features handling fixes David Miller
2014-05-02 16:57 [PATCH net] bonding: fix vlan_features computing Michal Kubecek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.