From: Alexander Duyck <alexander.duyck@gmail.com>
To: "Peter Nørlund" <pch@ordbogen.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>
Subject: Re: [PATCH net-next] Fixes: 0e884c7 ipv4: L3 hash-based multipath: tag
Date: Mon, 5 Oct 2015 15:23:10 -0700 [thread overview]
Message-ID: <5612F84E.1030709@gmail.com> (raw)
In-Reply-To: <1444083297-3454-1-git-send-email-pch@ordbogen.com>
On 10/05/2015 03:14 PM, Peter Nørlund wrote:
> commit 0e884c78ee19e902f300ed147083c28a0c6302f0 ("ipv4: L3 hash-based
> multipath") broke compilation for i386 and arm due to dependency on
> 64-bit division.
>
> The problem is simply solved by using the proper macro for 64-bit
> divison.
>
> Signed-off-by: Peter Nørlund <pch@ordbogen.com>
> ---
> net/ipv4/fib_semantics.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
> index 0c49d2f..52254e8 100644
> --- a/net/ipv4/fib_semantics.c
> +++ b/net/ipv4/fib_semantics.c
> @@ -569,8 +569,8 @@ static void fib_rebalance(struct fib_info *fi)
> upper_bound = -1;
> } else {
> w += nexthop_nh->nh_weight;
> - upper_bound = DIV_ROUND_CLOSEST(2147483648LL * w,
> - total) - 1;
> + upper_bound = DIV_ROUND_CLOSEST_ULL(2147483648ULL * w,
> + total) - 1;
> }
>
> atomic_set(&nexthop_nh->nh_upper_bound, upper_bound);
Normally the correct comment would include something like the following
just before the signed-off-by line.
Fixes: 0e884c78ee19 ("ipv4: L3 hash-based multipath")
I'm also kind of curious. Why use 2147483648LL instead of just casting
w as a u64 and shifting by 31? It seems like that would be more readable.
Thanks.
- Alex
next prev parent reply other threads:[~2015-10-05 22:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-05 22:14 [PATCH net-next] Fixes: 0e884c7 ipv4: L3 hash-based multipath: tag Peter Nørlund
2015-10-05 22:23 ` Alexander Duyck [this message]
2015-10-05 23:35 ` Tom Herbert
2015-10-06 5:21 ` Peter Nørlund
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=5612F84E.1030709@gmail.com \
--to=alexander.duyck@gmail.com \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=pch@ordbogen.com \
--cc=yoshfuji@linux-ipv6.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.