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] [day] [month] [year] [list]
Message-Id: <20120723.183434.1181274244746651450.davem@davemloft.net>
Date:	Mon, 23 Jul 2012 18:34:34 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	ogerlitz@...lanox.com
Cc:	roland@...nel.org, linux-rdma@...r.kernel.org, erezsh@...lanox.com,
	netdev@...r.kernel.org, shlomop@...lanox.com
Subject: Re: [PATCH RESEND net/for-next V1 1/1] IB/ipoib: break linkage to
 neighbouring system

From: Or Gerlitz <ogerlitz@...lanox.com>
Date: Thu, 19 Jul 2012 19:15:02 +0300

> -static void neigh_add_path(struct sk_buff *skb, struct neighbour *n, struct net_device *dev)
> +static void neigh_add_path(struct sk_buff *skb, u8 *daddr,
> +				struct net_device *dev)

Please line up "struct net_device *dev" with the first column after the
openning parenthesis on the first line.

> +	return jhash(daddr+12, 8, 0xFFFFFF & *(u32 *) daddr) & htbl->mask;

It would be tons faster to go:

	u32 *daddr_32 = (u32 *) daddr;

	hv = jhash_3words(daddr_32[3], daddr_32[4], 0xFFFFFF & daddr_32[0], 0);
	hv &= htbl->mask;

Plain jhash() has loops and various conditions that are entirely
unnecessary when you know how much you are hashing ahead of time.
--
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