Thread (8 messages) 8 messages, 3 authors, 2007-05-30

Re: bond_compute_features() does not handle devices with different CSUM

From: Laurent Chavey <hidden>
Date: 2007-05-30 15:19:03

corrected diff.
--- 2.6.20/drivers/net/bonding/bond_main.c      2007-05-29
19:43:39.010565000 -0700
+++ 2.6.20.fix/drivers/net/bonding/bond_main.c  2007-05-30
08:18:24.018322000 -0700
@@ -1227,7 +1227,14 @@
        int i;

        bond_for_each_slave(bond, slave, i) {
-               features &= (slave->dev->features & BOND_INTERSECT_FEATURES);
+               /* NETIF_F_HW_CSUM includes support for NET_IF_IP_CSUM
+                * as such when looking for the intersection we need to
+                * add it to the device supported features
+                */
+               unsigned long dev_features = slave->dev->features;
+               if (slave->dev->features & NETIF_F_HW_CSUM)
+                       dev_features |= NETIF_F_IP_CSUM;
+               features &= (dev_features & BOND_INTERSECT_FEATURES);
                if (slave->dev->hard_header_len > max_hard_header_len)
                        max_hard_header_len = slave->dev->hard_header_len;
        }
On 5/30/07, Laurent Chavey [off-list ref] wrote:
features = features & (dev_features & BOND_INTERSECT_FEATURES);

On 5/30/07, Michael Buesch [off-list ref] wrote:
quoted
On Wednesday 30 May 2007 04:47:09 Laurent Chavey wrote:
quoted
proposed change.
--- 2.6.20/drivers/net/bonding/bond_main.c      2007-05-29
19:43:39.010565000 -0700
+++ 2.6.20.fix/drivers/net/bonding/bond_main.c  2007-05-29
19:46:12.376980000 -0700
@@ -1227,7 +1227,14 @@
        int i;

        bond_for_each_slave(bond, slave, i) {
-               features &= (slave->dev->features & BOND_INTERSECT_FEATURES);
+               /* NETIF_F_HW_CSUM includes support for NET_IF_IP_CSUM
+                * as such when looking for the intersection we need to
+                * add it to the device supported features
+                */
+               unsigned long dev_features = slave->dev->features;
+               if (slave->dev->features & NETIF_F_HW_CSUM)
+                       dev_features |= NETIF_F_IP_CSUM;
quoted
+               features &= (features & BOND_INTERSECT_FEATURES);
Is this statement correct?
It's the same as
        features = features & (features & BOND_INTERSECT_FEATURES);
which looks strange to me.
Did you mean something like
        features |= (dev_features & BOND_INTERSECT_FEATURES);
?

--
Greetings Michael.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help