netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: sandr8@gmail.com
Cc: Dmitry Torokhov <dtor@vmware.com>,
	chetan loke <loke.chetan@gmail.com>,
	pv-drivers@vmware.com, zbiggy@o2.pl,
	netdev <netdev@vger.kernel.org>
Subject: Re: [Pv-drivers] vmxnet3 driver broken since 3.0?
Date: Wed, 14 Dec 2011 13:13:18 -0800	[thread overview]
Message-ID: <20111214131318.410a6a9d@s6510.linuxnetplumber.net> (raw)
In-Reply-To: <CAJeBh4unodegb1e-Og+kY9AC-+OiHE3Kq_6N=+TZ679CBoSu1w@mail.gmail.com>

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>

      reply	other threads:[~2011-12-14 21:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 message]

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=20111214131318.410a6a9d@s6510.linuxnetplumber.net \
    --to=shemminger@vyatta.com \
    --cc=dtor@vmware.com \
    --cc=loke.chetan@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pv-drivers@vmware.com \
    --cc=sandr8@gmail.com \
    --cc=zbiggy@o2.pl \
    /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 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).