netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question about the hash used in XOR mode
@ 2003-09-21 13:37 Shmulik Hen
  2003-09-23 20:31 ` Jay Vosburgh
  0 siblings, 1 reply; 2+ messages in thread
From: Shmulik Hen @ 2003-09-21 13:37 UTC (permalink / raw)
  To: bonding-devel, netdev

In bond_xmit_xor(), we have the following:

slave = bond->prev;
.
.
.
slave_no = (data->h_dest[5]^slave->dev->dev_addr[5]) % bond->slave_cnt;

Which should give us a number between 0 and slave_cnt-1 which is constant
per destination address, hence acts as a hash function. But, the fact is
slave->dev->dev_addr[5] is the same the whole time, and is actually the
same as bond->device->dev_addr[5].

Is there a special meaning for XORing with a constant ?
Wouldn't it be the same is we did just:
	slave_no = data->h_dest[5] % bond->slave_cnt;

-- 
| Shmulik Hen   Advanced Network Services  |
| Israel Design Center, Jerusalem          |
| LAN Access Division, Platform Networking |
| Intel Communications Group, Intel corp.  |

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-23 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-21 13:37 Question about the hash used in XOR mode Shmulik Hen
2003-09-23 20:31 ` Jay Vosburgh

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).