* bond_compute_features() does not handle devices with different CSUM
@ 2007-05-30 0:41 Laurent Chavey
2007-05-30 2:47 ` Laurent Chavey
2007-05-30 16:27 ` Stephen Hemminger
0 siblings, 2 replies; 8+ messages in thread
From: Laurent Chavey @ 2007-05-30 0:41 UTC (permalink / raw)
To: netdev
kernel version <= 2.6.20.1
file drivers/net/bonding/bonding_main.c
function bond_compute_features()
-----------
Given a system with two different NIC. One driver sets
dev->features |= NETIF_F_HW_CSUM
the other driver sets
dev->features |= NETIF_F_IP_CSUM
when enslaving the 2 device above, bond_compute_features()
does not set the intersection of the 2 CSUM
features (should be NETIF_F_IP_CSUM)
-----------
should the bond features in the case above include NETIF_F_IP_CSUM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bond_compute_features() does not handle devices with different CSUM
2007-05-30 0:41 bond_compute_features() does not handle devices with different CSUM Laurent Chavey
@ 2007-05-30 2:47 ` Laurent Chavey
2007-05-30 11:03 ` Michael Buesch
2007-05-30 16:27 ` Stephen Hemminger
1 sibling, 1 reply; 8+ messages in thread
From: Laurent Chavey @ 2007-05-30 2:47 UTC (permalink / raw)
To: netdev
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;
+ features &= (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/29/07, Laurent Chavey <chavey@google.com> wrote:
> kernel version <= 2.6.20.1
> file drivers/net/bonding/bonding_main.c
> function bond_compute_features()
>
> -----------
> Given a system with two different NIC. One driver sets
> dev->features |= NETIF_F_HW_CSUM
> the other driver sets
> dev->features |= NETIF_F_IP_CSUM
>
> when enslaving the 2 device above, bond_compute_features()
> does not set the intersection of the 2 CSUM
> features (should be NETIF_F_IP_CSUM)
> -----------
>
> should the bond features in the case above include NETIF_F_IP_CSUM
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bond_compute_features() does not handle devices with different CSUM
2007-05-30 2:47 ` Laurent Chavey
@ 2007-05-30 11:03 ` Michael Buesch
2007-05-30 15:16 ` Laurent Chavey
0 siblings, 1 reply; 8+ messages in thread
From: Michael Buesch @ 2007-05-30 11:03 UTC (permalink / raw)
To: Laurent Chavey; +Cc: netdev
On Wednesday 30 May 2007 04:47:09 Laurent Chavey wrote:
> 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;
> + 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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bond_compute_features() does not handle devices with different CSUM
2007-05-30 11:03 ` Michael Buesch
@ 2007-05-30 15:16 ` Laurent Chavey
2007-05-30 15:18 ` Laurent Chavey
0 siblings, 1 reply; 8+ messages in thread
From: Laurent Chavey @ 2007-05-30 15:16 UTC (permalink / raw)
To: Michael Buesch; +Cc: netdev
features = features & (dev_features & BOND_INTERSECT_FEATURES);
On 5/30/07, Michael Buesch <mb@bu3sch.de> wrote:
> On Wednesday 30 May 2007 04:47:09 Laurent Chavey wrote:
> > 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;
>
>
> > + 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.
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bond_compute_features() does not handle devices with different CSUM
2007-05-30 15:16 ` Laurent Chavey
@ 2007-05-30 15:18 ` Laurent Chavey
0 siblings, 0 replies; 8+ messages in thread
From: Laurent Chavey @ 2007-05-30 15:18 UTC (permalink / raw)
To: Michael Buesch; +Cc: netdev
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 <chavey@google.com> wrote:
> features = features & (dev_features & BOND_INTERSECT_FEATURES);
>
> On 5/30/07, Michael Buesch <mb@bu3sch.de> wrote:
> > On Wednesday 30 May 2007 04:47:09 Laurent Chavey wrote:
> > > 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;
> >
> >
> > > + 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.
> >
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bond_compute_features() does not handle devices with different CSUM
2007-05-30 0:41 bond_compute_features() does not handle devices with different CSUM Laurent Chavey
2007-05-30 2:47 ` Laurent Chavey
@ 2007-05-30 16:27 ` Stephen Hemminger
2007-05-30 16:58 ` Laurent Chavey
1 sibling, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2007-05-30 16:27 UTC (permalink / raw)
To: Laurent Chavey; +Cc: netdev
On Tue, 29 May 2007 17:41:45 -0700
"Laurent Chavey" <chavey@google.com> wrote:
> kernel version <= 2.6.20.1
> file drivers/net/bonding/bonding_main.c
> function bond_compute_features()
>
> -----------
> Given a system with two different NIC. One driver sets
> dev->features |= NETIF_F_HW_CSUM
> the other driver sets
> dev->features |= NETIF_F_IP_CSUM
>
> when enslaving the 2 device above, bond_compute_features()
> does not set the intersection of the 2 CSUM
> features (should be NETIF_F_IP_CSUM)
> -----------
>
> should the bond features in the case above include NETIF_F_IP_CSUM
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
The bridge code already has a more complete/complex recompute
routine to handle this.
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bond_compute_features() does not handle devices with different CSUM
2007-05-30 16:27 ` Stephen Hemminger
@ 2007-05-30 16:58 ` Laurent Chavey
2007-05-30 17:19 ` Stephen Hemminger
0 siblings, 1 reply; 8+ messages in thread
From: Laurent Chavey @ 2007-05-30 16:58 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
should we then move/integrate that code as part of the bonding driver ?
On 5/30/07, Stephen Hemminger <shemminger@linux-foundation.org> wrote:
> On Tue, 29 May 2007 17:41:45 -0700
> "Laurent Chavey" <chavey@google.com> wrote:
>
> > kernel version <= 2.6.20.1
> > file drivers/net/bonding/bonding_main.c
> > function bond_compute_features()
> >
> > -----------
> > Given a system with two different NIC. One driver sets
> > dev->features |= NETIF_F_HW_CSUM
> > the other driver sets
> > dev->features |= NETIF_F_IP_CSUM
> >
> > when enslaving the 2 device above, bond_compute_features()
> > does not set the intersection of the 2 CSUM
> > features (should be NETIF_F_IP_CSUM)
> > -----------
> >
> > should the bond features in the case above include NETIF_F_IP_CSUM
> > -
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> The bridge code already has a more complete/complex recompute
> routine to handle this.
>
> --
> Stephen Hemminger <shemminger@linux-foundation.org>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bond_compute_features() does not handle devices with different CSUM
2007-05-30 16:58 ` Laurent Chavey
@ 2007-05-30 17:19 ` Stephen Hemminger
0 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2007-05-30 17:19 UTC (permalink / raw)
To: Laurent Chavey; +Cc: netdev
On Wed, 30 May 2007 09:58:38 -0700
"Laurent Chavey" <chavey@google.com> wrote:
> should we then move/integrate that code as part of the bonding driver ?
>
>
> On 5/30/07, Stephen Hemminger <shemminger@linux-foundation.org> wrote:
> > On Tue, 29 May 2007 17:41:45 -0700
> > "Laurent Chavey" <chavey@google.com> wrote:
> >
> > > kernel version <= 2.6.20.1
> > > file drivers/net/bonding/bonding_main.c
> > > function bond_compute_features()
> > >
> > > -----------
> > > Given a system with two different NIC. One driver sets
> > > dev->features |= NETIF_F_HW_CSUM
> > > the other driver sets
> > > dev->features |= NETIF_F_IP_CSUM
> > >
> > > when enslaving the 2 device above, bond_compute_features()
> > > does not set the intersection of the 2 CSUM
> > > features (should be NETIF_F_IP_CSUM)
> > > -----------
> > >
> > > should the bond features in the case above include NETIF_F_IP_CSUM
> > > -
> > > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
> > The bridge code already has a more complete/complex recompute
> > routine to handle this.
> >
> > --
> > Stephen Hemminger <shemminger@linux-foundation.org>
> >
Sure, that would be easier for maintenance.
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-05-30 17:30 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-30 0:41 bond_compute_features() does not handle devices with different CSUM Laurent Chavey
2007-05-30 2:47 ` Laurent Chavey
2007-05-30 11:03 ` Michael Buesch
2007-05-30 15:16 ` Laurent Chavey
2007-05-30 15:18 ` Laurent Chavey
2007-05-30 16:27 ` Stephen Hemminger
2007-05-30 16:58 ` Laurent Chavey
2007-05-30 17:19 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).