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]
Date:	Mon, 31 Mar 2014 16:00:52 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Eric Dumazet' <eric.dumazet@...il.com>,
	Mahesh Bandewar <maheshb@...gle.com>
CC:	Jay Vosburgh <fubar@...ibm.com>,
	Veaceslav Falico <vfalico@...hat.com>,
	Andy Gospodarek <andy@...yhouse.net>,
	David Miller <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>,
	Eric Dumazet <edumazet@...gle.com>,
	"Maciej Zenczykowski" <maze@...gle.com>
Subject: RE: [PATCH 4/5] bonding: Added bond_tlb_xmit() for tlb mode.

From: Eric Dumazet
...
> > +	if (!is_multicast_ether_addr(eth_data->h_dest)) {
> > +		switch (ntohs(skb->protocol)) {
> 
> Nit :
> 
> You can avoid the ntohs(skb->protocol)
> 
> > +		case ETH_P_IP:
> 
> by using "   case htons(ETH_P_IP)
> 
> 
> > +		case ETH_P_IPX: /* In case of IPX, it will falback to L2 hash */
> > +		case ETH_P_IPV6:
> > +			hash_index = bond_xmit_hash(bond, skb);
> > +			tx_slave = tlb_choose_channel(bond, hash_index & 0xFF, skb->len);
> > +			break;
> > +		}
> > +	}

Which may or not be faster...
As coded the case labels may be dense enough to generate a jump table.
If byte reversed the generated code will be a branch tree.

A deep branch tree will be worse, a match on the first item of a branch
tree will almost certainly be better.
I'm not going to guess where the breakeven point is for any modern cpus.

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ