All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Dave Jones <davej@redhat.com>,
	Chuck Wolber <chuckw@quantumlinux.com>,
	torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk,
	fubar@us.ibm.com, linville@tuxdriver.com
Subject: [patch 19/26] bonding: fix feature consolidation
Date: Tue, 13 Dec 2005 00:23:26 -0800	[thread overview]
Message-ID: <20051213082326.GS5823@kroah.com> (raw)
In-Reply-To: <20051213082143.GA5823@kroah.com>

[-- Attachment #1: bonding-fix-feature-consolidation.patch --]
[-- Type: text/plain, Size: 3378 bytes --]

-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Jay Vosburgh <fubar@us.ibm.com>

[PATCH] bonding: fix feature consolidation

This should resolve http://bugzilla.kernel.org/show_bug.cgi?id=5519

The current feature computation loses bits that it doesn't know about,
resulting in an inability to add VLANs and possibly other havoc.
Rewrote function to preserve bits it doesn't know about, remove an
unneeded state variable, and simplify the code.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/bonding/bond_main.c |   32 +++++++++++---------------------
 drivers/net/bonding/bonding.h   |    7 ++-----
 2 files changed, 13 insertions(+), 26 deletions(-)

--- linux-2.6.14.3.orig/drivers/net/bonding/bond_main.c
+++ linux-2.6.14.3/drivers/net/bonding/bond_main.c
@@ -1604,35 +1604,27 @@ static int bond_sethwaddr(struct net_dev
 	(NETIF_F_SG|NETIF_F_IP_CSUM|NETIF_F_NO_CSUM|NETIF_F_HW_CSUM)
 
 /* 
- * Compute the features available to the bonding device by 
- * intersection of all of the slave devices' BOND_INTERSECT_FEATURES.
- * Call this after attaching or detaching a slave to update the 
- * bond's features.
+ * Compute the common dev->feature set available to all slaves.  Some
+ * feature bits are managed elsewhere, so preserve feature bits set on
+ * master device that are not part of the examined set.
  */
 static int bond_compute_features(struct bonding *bond)
 {
-	int i;
+	unsigned long features = BOND_INTERSECT_FEATURES;
 	struct slave *slave;
 	struct net_device *bond_dev = bond->dev;
-	int features = bond->bond_features;
+	int i;
 
-	bond_for_each_slave(bond, slave, i) {
-		struct net_device * slave_dev = slave->dev;
-		if (i == 0) {
-			features |= BOND_INTERSECT_FEATURES;
-		}
-		features &=
-			~(~slave_dev->features & BOND_INTERSECT_FEATURES);
-	}
+	bond_for_each_slave(bond, slave, i)
+		features &= (slave->dev->features & BOND_INTERSECT_FEATURES);
 
-	/* turn off NETIF_F_SG if we need a csum and h/w can't do it */
 	if ((features & NETIF_F_SG) && 
-		!(features & (NETIF_F_IP_CSUM |
-			      NETIF_F_NO_CSUM |
-			      NETIF_F_HW_CSUM))) {
+	    !(features & (NETIF_F_IP_CSUM |
+			  NETIF_F_NO_CSUM |
+			  NETIF_F_HW_CSUM)))
 		features &= ~NETIF_F_SG;
-	}
 
+	features |= (bond_dev->features & ~BOND_INTERSECT_FEATURES);
 	bond_dev->features = features;
 
 	return 0;
@@ -4508,8 +4500,6 @@ static int __init bond_init(struct net_d
 			       NETIF_F_HW_VLAN_RX |
 			       NETIF_F_HW_VLAN_FILTER);
 
-	bond->bond_features = bond_dev->features;
-
 #ifdef CONFIG_PROC_FS
 	bond_create_proc_entry(bond);
 #endif
--- linux-2.6.14.3.orig/drivers/net/bonding/bonding.h
+++ linux-2.6.14.3/drivers/net/bonding/bonding.h
@@ -40,8 +40,8 @@
 #include "bond_3ad.h"
 #include "bond_alb.h"
 
-#define DRV_VERSION	"2.6.4"
-#define DRV_RELDATE	"September 26, 2005"
+#define DRV_VERSION	"2.6.5"
+#define DRV_RELDATE	"November 4, 2005"
 #define DRV_NAME	"bonding"
 #define DRV_DESCRIPTION	"Ethernet Channel Bonding Driver"
 
@@ -211,9 +211,6 @@ struct bonding {
 	struct   bond_params params;
 	struct   list_head vlan_list;
 	struct   vlan_group *vlgrp;
-	/* the features the bonding device supports, independently 
-	 * of any slaves */
-	int	 bond_features; 
 };
 
 /**

--

  parent reply	other threads:[~2005-12-13  8:25 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20051213073430.558435000@press.kroah.org>
2005-12-13  8:21 ` [patch 00/26] - stable review Greg KH
2005-12-13  8:22   ` [patch 01/26] drivers/scsi/dpt_i2o.c: fix a user-after-free Greg KH
2005-12-13  8:22   ` [patch 02/26] drivers/message/i2o/pci.c: fix a use-after-free Greg KH
2005-12-13  8:22   ` [patch 03/26] drivers/infiniband/core/mad.c: " Greg KH
2005-12-13  8:22   ` [patch 04/26] Fix crash when ptrace poking hugepage areas Greg KH
2005-12-13  8:22   ` [patch 05/26] USB: Adapt microtek driver to new scsi features Greg KH
2005-12-13  8:22   ` [patch 06/26] setkeys needs root Greg KH
2005-12-13  8:22   ` [patch 07/26] [NETLINK]: Fix processing of fib_lookup netlink messages Greg KH
2005-12-13  8:22   ` [patch 08/26] Fix listxattr() for generic security attributes Greg KH
2005-12-13  8:22   ` [patch 09/26] DVB: BUDGET CI card depends on STV0297 demodulator Greg KH
2005-12-13 15:50     ` Daniel Drake
2005-12-13 18:12       ` [stable] " Greg KH
2005-12-13  8:22   ` [patch 10/26] ACPI: Prefer _CST over FADT for C-state capabilities Greg KH
2005-12-13 16:00     ` Daniel Drake
2005-12-13 18:11       ` [stable] " Greg KH
2005-12-13  8:22   ` [patch 11/26] ACPI: fix HP nx8220 boot hang regression Greg KH
2005-12-13  8:22   ` [patch 12/26] ACPI: Add support for FADT P_LVL2_UP flag Greg KH
2005-12-13  8:23   ` [patch 13/26] 32bit integer overflow in invalidate_inode_pages2() Greg KH
2005-12-13  8:23   ` [patch 14/26] V4L/DVB (3135) Fix tuner init for Pinnacle PCTV Stereo Greg KH
2005-12-13  8:23   ` [patch 15/26] V4L/DVB: Fix analog NTSC for Thomson DTT 761X hybrid tuner Greg KH
2005-12-13  8:23   ` [patch 17/26] i82365: release all resources if no devices are found Greg KH
2005-12-13  8:23   ` [patch 18/26] [AGPGART] Fix serverworks TLB flush Greg KH
2005-12-13  8:23   ` Greg KH [this message]
2005-12-13  8:23   ` [patch 20/26] [BRIDGE]: recompute features when adding a new device Greg KH
2005-12-13  8:23   ` [patch 16/26] [ALSA] nm256: reset workaround for Latitude CSx Greg KH
2005-12-13  8:23   ` [patch 21/26] [libata] locking rewrite (== fix) Greg KH
2005-12-13  8:23   ` [patch 22/26] I8K: fix /proc reporting of blank service tags Greg KH
2005-12-13  8:23   ` [patch 23/26] ide-floppy: software eject not working with LS-120 drive Greg KH
2005-12-13  8:23   ` [patch 24/26] - stable review cciss: bug fix for hpacucli Greg KH
2005-12-13  8:23   ` [patch 25/26] cciss: bug fix for BIG_PASS_THRU Greg KH
2005-12-13  8:24   ` [patch 26/26] Add try_to_freeze to kauditd Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051213082326.GS5823@kroah.com \
    --to=gregkh@suse.de \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=chuckw@quantumlinux.com \
    --cc=davej@redhat.com \
    --cc=fubar@us.ibm.com \
    --cc=jmforbes@linuxtx.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rdunlap@xenotime.net \
    --cc=stable@kernel.org \
    --cc=torvalds@osdl.org \
    --cc=tytso@mit.edu \
    --cc=zwane@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.