netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: vmxnet3 driver broken since 3.0?
       [not found] <D3F292ADF945FB49B35E96C94C2061B9150914BA@nsmail.netscout.com>
@ 2011-12-12 17:09 ` chetan loke
  2011-12-12 17:42   ` [Pv-drivers] " Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: chetan loke @ 2011-12-12 17:09 UTC (permalink / raw)
  To: pv-drivers, sandr8, zbiggy, netdev

> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Alessandro Salvatori
> Sent: December 12, 2011 2:55 AM
> To: Zbigniew Luszpinski
> Cc: netdev@vger.kernel.org
> Subject: Re: vmxnet3 driver broken since 3.0?
>
> I guess this is the change that was introduced in 3.0 and that breaks vmxnet3:
>
> commit 55513fb4281464e97aa1ff2b9c906ca5aed917c5
> Author: Tom Herbert <therbert@google.com>
> Date:   Mon Oct 18 17:55:58 2010 +0000
>
>    net: fail alloc_netdev_mq if queue count < 1
>
>    In alloc_netdev_mq fail if requested queue_count < 1.
>
>    Signed-off-by: Tom Herbert <therbert@google.com>
>    Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
>    Signed-off-by: David S. Miller <davem@davemloft.net>
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 04972a4..f44d29a 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -5511,6 +5511,12 @@ struct net_device *alloc_netdev_mq(int
> sizeof_priv, const char *name,
>
>        BUG_ON(strlen(name) >= sizeof(dev->name));
>
> +       if (queue_count < 1) {
> +               pr_err("alloc_netdev: Unable to allocate device "
> +                      "with zero queues.\n");
> +               return NULL;
> +       }
> +
>        alloc_size = sizeof(struct net_device);
>        if (sizeof_priv) {
>                /* ensure 32-byte alignment of private area */
>
> thanks!
> -Alessandro-


CC'd VMware.

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

* Re: [Pv-drivers] vmxnet3 driver broken since 3.0?
  2011-12-12 17:09 ` vmxnet3 driver broken since 3.0? chetan loke
@ 2011-12-12 17:42   ` Dmitry Torokhov
  2011-12-12 23:29     ` Alessandro Salvatori
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2011-12-12 17:42 UTC (permalink / raw)
  To: chetan loke; +Cc: pv-drivers, sandr8, zbiggy, netdev

On Mon, Dec 12, 2011 at 12:09:33PM -0500, chetan loke wrote:
> > From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Alessandro Salvatori
> > Sent: December 12, 2011 2:55 AM
> > To: Zbigniew Luszpinski
> > Cc: netdev@vger.kernel.org
> > Subject: Re: vmxnet3 driver broken since 3.0?
> >
> > I guess this is the change that was introduced in 3.0 and that breaks vmxnet3:
> >
> > commit 55513fb4281464e97aa1ff2b9c906ca5aed917c5
> > Author: Tom Herbert <therbert@google.com>
> > Date:   Mon Oct 18 17:55:58 2010 +0000
> >
> >    net: fail alloc_netdev_mq if queue count < 1
> >
> >    In alloc_netdev_mq fail if requested queue_count < 1.
> >
> >    Signed-off-by: Tom Herbert <therbert@google.com>
> >    Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
> >    Signed-off-by: David S. Miller <davem@davemloft.net>
> >
> > diff --git a/net/core/dev.c b/net/core/dev.c
> > index 04972a4..f44d29a 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -5511,6 +5511,12 @@ struct net_device *alloc_netdev_mq(int
> > sizeof_priv, const char *name,
> >
> >        BUG_ON(strlen(name) >= sizeof(dev->name));
> >
> > +       if (queue_count < 1) {
> > +               pr_err("alloc_netdev: Unable to allocate device "
> > +                      "with zero queues.\n");
> > +               return NULL;
> > +       }
> > +
> >        alloc_size = sizeof(struct net_device);
> >        if (sizeof_priv) {
> >                /* ensure 32-byte alignment of private area */
> >
> > thanks!
> > -Alessandro-
> 

Hmm, apparently patch from https://lkml.org/lkml/2011/11/16/387 is not
in mailine yet... I am going to forward it to Linus/Andrew.

Thanks,
Dmitry

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

* Re: [Pv-drivers] vmxnet3 driver broken since 3.0?
  2011-12-12 17:42   ` [Pv-drivers] " Dmitry Torokhov
@ 2011-12-12 23:29     ` Alessandro Salvatori
  2011-12-14 21:13       ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Alessandro Salvatori @ 2011-12-12 23:29 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: chetan loke, pv-drivers, zbiggy, netdev

can you please make sure this also goes into linux-stable for 3.0.x and 3.1.x?

thanks!
-Alessandro-
 Here i am, A young man,
 A crashing computer program,
 Here is a pen, write out my name...

(from: The Servant - Orchestra)



On Mon, Dec 12, 2011 at 09:42, Dmitry Torokhov <dtor@vmware.com> wrote:
> On Mon, Dec 12, 2011 at 12:09:33PM -0500, chetan loke wrote:
>> > From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Alessandro Salvatori
>> > Sent: December 12, 2011 2:55 AM
>> > To: Zbigniew Luszpinski
>> > Cc: netdev@vger.kernel.org
>> > Subject: Re: vmxnet3 driver broken since 3.0?
>> >
>> > I guess this is the change that was introduced in 3.0 and that breaks vmxnet3:
>> >
>> > commit 55513fb4281464e97aa1ff2b9c906ca5aed917c5
>> > Author: Tom Herbert <therbert@google.com>
>> > Date:   Mon Oct 18 17:55:58 2010 +0000
>> >
>> >    net: fail alloc_netdev_mq if queue count < 1
>> >
>> >    In alloc_netdev_mq fail if requested queue_count < 1.
>> >
>> >    Signed-off-by: Tom Herbert <therbert@google.com>
>> >    Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
>> >    Signed-off-by: David S. Miller <davem@davemloft.net>
>> >
>> > diff --git a/net/core/dev.c b/net/core/dev.c
>> > index 04972a4..f44d29a 100644
>> > --- a/net/core/dev.c
>> > +++ b/net/core/dev.c
>> > @@ -5511,6 +5511,12 @@ struct net_device *alloc_netdev_mq(int
>> > sizeof_priv, const char *name,
>> >
>> >        BUG_ON(strlen(name) >= sizeof(dev->name));
>> >
>> > +       if (queue_count < 1) {
>> > +               pr_err("alloc_netdev: Unable to allocate device "
>> > +                      "with zero queues.\n");
>> > +               return NULL;
>> > +       }
>> > +
>> >        alloc_size = sizeof(struct net_device);
>> >        if (sizeof_priv) {
>> >                /* ensure 32-byte alignment of private area */
>> >
>> > thanks!
>> > -Alessandro-
>>
>
> Hmm, apparently patch from https://lkml.org/lkml/2011/11/16/387 is not
> in mailine yet... I am going to forward it to Linus/Andrew.
>
> Thanks,
> Dmitry
>

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

* Re: [Pv-drivers] vmxnet3 driver broken since 3.0?
  2011-12-12 23:29     ` Alessandro Salvatori
@ 2011-12-14 21:13       ` Stephen Hemminger
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2011-12-14 21:13 UTC (permalink / raw)
  To: sandr8; +Cc: Dmitry Torokhov, chetan loke, pv-drivers, zbiggy, netdev

Lastest 3.2 has this fix which should eliminate the problem.


commit 13c07b0286d340275f2d97adf085cecda37ede37
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Mon Dec 12 22:06:55 2011 -0800

    linux/log2.h: Fix rounddown_pow_of_two(1)
    
    Exactly like roundup_pow_of_two(1), the rounddown version was buggy for
    the case of a compile-time constant '1' argument.  Probably because it
    originated from the same code, sharing history with the roundup version
    from before the bugfix (for that one, see commit 1a06a52ee1b0: "Fix
    roundup_pow_of_two(1)").
    
    However, unlike the roundup version, the fix for rounddown is to just
    remove the broken special case entirely.  It's simply not needed - the
    generic code
    
        1UL << ilog2(n)
    
    does the right thing for the constant '1' argment too.  The only reason
    roundup needed that special case was because rounding up does so by
    subtracting one from the argument (and then adding one to the result)
    causing the obvious problems with "ilog2(0)".
    
    But rounddown doesn't do any of that, since ilog2() naturally truncates
    (ie "rounds down") to the right rounded down value.  And without the
    ilog2(0) case, there's no reason for the special case that had the wrong
    value.
    
    tl;dr: rounddown_pow_of_two(1) should be 1, not 0.
    
    Acked-by: Dmitry Torokhov <dtor@vmware.com>
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

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

end of thread, other threads:[~2011-12-14 21:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <D3F292ADF945FB49B35E96C94C2061B9150914BA@nsmail.netscout.com>
2011-12-12 17:09 ` vmxnet3 driver broken since 3.0? chetan loke
2011-12-12 17:42   ` [Pv-drivers] " Dmitry Torokhov
2011-12-12 23:29     ` Alessandro Salvatori
2011-12-14 21:13       ` 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).