/[linux-patches]/genpatches-2.6/trunk/2.6.14/1139_4_bonding-features.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1139_4_bonding-features.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 232 - (hide annotations) (download) (as text)
Thu Dec 15 16:22:43 2005 UTC (14 years, 11 months ago) by dsd
Original Path: genpatches-2.6/trunk/2.6.14/1039_4_bonding-features.patch
File MIME type: text/x-diff
File size: 3588 byte(s)
Linux 2.6.14.4
1 dsd 232 From stable-bounces@linux.kernel.org Mon Dec 12 12:26:42 2005
2     Date: Wed, 9 Nov 2005 10:02:38 -0800
3     Message-Id: <200511091802.jA9I2csb003326@hera.kernel.org>
4     From: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
5     To: git-commits-head@vger.kernel.org
6     Cc:
7     Subject: bonding: fix feature consolidation
8    
9     From: Jay Vosburgh <fubar@us.ibm.com>
10    
11     [PATCH] bonding: fix feature consolidation
12    
13     This should resolve http://bugzilla.kernel.org/show_bug.cgi?id=5519
14    
15     The current feature computation loses bits that it doesn't know about,
16     resulting in an inability to add VLANs and possibly other havoc.
17     Rewrote function to preserve bits it doesn't know about, remove an
18     unneeded state variable, and simplify the code.
19    
20     Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
21     Signed-off-by: John W. Linville <linville@tuxdriver.com>
22     Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
23    
24     ---
25     drivers/net/bonding/bond_main.c | 32 +++++++++++---------------------
26     drivers/net/bonding/bonding.h | 7 ++-----
27     2 files changed, 13 insertions(+), 26 deletions(-)
28    
29     --- linux-2.6.14.3.orig/drivers/net/bonding/bond_main.c
30     +++ linux-2.6.14.3/drivers/net/bonding/bond_main.c
31     @@ -1604,35 +1604,27 @@ static int bond_sethwaddr(struct net_dev
32     (NETIF_F_SG|NETIF_F_IP_CSUM|NETIF_F_NO_CSUM|NETIF_F_HW_CSUM)
33    
34     /*
35     - * Compute the features available to the bonding device by
36     - * intersection of all of the slave devices' BOND_INTERSECT_FEATURES.
37     - * Call this after attaching or detaching a slave to update the
38     - * bond's features.
39     + * Compute the common dev->feature set available to all slaves. Some
40     + * feature bits are managed elsewhere, so preserve feature bits set on
41     + * master device that are not part of the examined set.
42     */
43     static int bond_compute_features(struct bonding *bond)
44     {
45     - int i;
46     + unsigned long features = BOND_INTERSECT_FEATURES;
47     struct slave *slave;
48     struct net_device *bond_dev = bond->dev;
49     - int features = bond->bond_features;
50     + int i;
51    
52     - bond_for_each_slave(bond, slave, i) {
53     - struct net_device * slave_dev = slave->dev;
54     - if (i == 0) {
55     - features |= BOND_INTERSECT_FEATURES;
56     - }
57     - features &=
58     - ~(~slave_dev->features & BOND_INTERSECT_FEATURES);
59     - }
60     + bond_for_each_slave(bond, slave, i)
61     + features &= (slave->dev->features & BOND_INTERSECT_FEATURES);
62    
63     - /* turn off NETIF_F_SG if we need a csum and h/w can't do it */
64     if ((features & NETIF_F_SG) &&
65     - !(features & (NETIF_F_IP_CSUM |
66     - NETIF_F_NO_CSUM |
67     - NETIF_F_HW_CSUM))) {
68     + !(features & (NETIF_F_IP_CSUM |
69     + NETIF_F_NO_CSUM |
70     + NETIF_F_HW_CSUM)))
71     features &= ~NETIF_F_SG;
72     - }
73    
74     + features |= (bond_dev->features & ~BOND_INTERSECT_FEATURES);
75     bond_dev->features = features;
76    
77     return 0;
78     @@ -4508,8 +4500,6 @@ static int __init bond_init(struct net_d
79     NETIF_F_HW_VLAN_RX |
80     NETIF_F_HW_VLAN_FILTER);
81    
82     - bond->bond_features = bond_dev->features;
83     -
84     #ifdef CONFIG_PROC_FS
85     bond_create_proc_entry(bond);
86     #endif
87     --- linux-2.6.14.3.orig/drivers/net/bonding/bonding.h
88     +++ linux-2.6.14.3/drivers/net/bonding/bonding.h
89     @@ -40,8 +40,8 @@
90     #include "bond_3ad.h"
91     #include "bond_alb.h"
92    
93     -#define DRV_VERSION "2.6.4"
94     -#define DRV_RELDATE "September 26, 2005"
95     +#define DRV_VERSION "2.6.5"
96     +#define DRV_RELDATE "November 4, 2005"
97     #define DRV_NAME "bonding"
98     #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"
99    
100     @@ -211,9 +211,6 @@ struct bonding {
101     struct bond_params params;
102     struct list_head vlan_list;
103     struct vlan_group *vlgrp;
104     - /* the features the bonding device supports, independently
105     - * of any slaves */
106     - int bond_features;
107     };
108    
109     /**

  ViewVC Help
Powered by ViewVC 1.1.20