All of lore.kernel.org
 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

* Re: Question about the hash used in XOR mode
  2003-09-21 13:37 Question about the hash used in XOR mode Shmulik Hen
@ 2003-09-23 20:31 ` Jay Vosburgh
  0 siblings, 0 replies; 2+ messages in thread
From: Jay Vosburgh @ 2003-09-23 20:31 UTC (permalink / raw)
  To: shmulik.hen; +Cc: bonding-devel, netdev


>slave_no = (data->h_dest[5]^slave->dev->dev_addr[5]) % bond->slave_cnt;
[...]
>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;

	I asked Janice Girouard about this...  The theory is to mimic
the way Cisco etherchannel load balancing modes operate (in particular
I think the "src-dst-mac" mode).

	The Cisco 6000 series switch (and maybe others) documentation
shows the algorithm (in an example; it doesn't go into detail).

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

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