lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1344369904.2688.53.camel@bwh-desktop.uk.solarflarecom.com>
Date:	Tue, 7 Aug 2012 21:05:04 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
CC:	David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] fib: use __fls() on non null argument

On Tue, 2012-08-07 at 15:30 +0200, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
> 
> __fls(x) is a bit faster than fls(x), granted we know x is non null.

And it doesn't have the +1 bias, so this change is not correct.

Ben.

> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> ---
>  net/ipv4/fib_trie.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
> index f0cdb30..0bb20c4 100644
> --- a/net/ipv4/fib_trie.c
> +++ b/net/ipv4/fib_trie.c
> @@ -1550,7 +1550,7 @@ int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp,
>  		 * state.directly.
>  		 */
>  		if (pref_mismatch) {
> -			int mp = KEYLENGTH - fls(pref_mismatch);
> +			int mp = KEYLENGTH - __fls(pref_mismatch);
>  
>  			if (tkey_extract_bits(cn->key, mp, cn->pos - mp) != 0)
>  				goto backtrace;
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ