From 169a3e66637c667b43dab7c319ffd5c99804cad8 Mon Sep 17 00:00:00 2001 From: Jay Vosburgh Date: Sun, 26 Jun 2005 17:54:11 -0400 Subject: bonding: xor/802.3ad improved slave hash Add support for alternate slave selection algorithms to bonding balance-xor and 802.3ad modes. Default mode (what we have now: xor of MAC addresses) is "layer2", new choice is "layer3+4", using IP and port information for hashing to select peer. Originally submitted by Jason Gabler for balance-xor mode; modified by Jay Vosburgh to additionally support 802.3ad mode. Jason's original comment is as follows: The attached patch to the Linux Etherchannel Bonding driver modifies the driver's "balance-xor" mode as follows: - alternate hashing policy support for mode 2 * Added kernel parameter "xmit_policy" to allow the specification of different hashing policies for mode 2. The original mode 2 policy is the default, now found in xmit_hash_policy_layer2(). * Added xmit_hash_policy_layer34() This patch was inspired by hashing policies implemented by Cisco, Foundry and IBM, which are explained in Foundry documentation found at: http://www.foundrynet.com/services/documentation/sribcg/Trunking.html#112750 Signed-off-by: Jason Gabler Signed-off-by: Jay Vosburgh --- include/linux/if_bonding.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/linux/if_bonding.h') diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h index 57024ce2c74..84598fa2e9d 100644 --- a/include/linux/if_bonding.h +++ b/include/linux/if_bonding.h @@ -35,6 +35,9 @@ * * 2003/12/01 - Shmulik Hen * - Code cleanup and style changes + * + * 2005/05/05 - Jason Gabler + * - added definitions for various XOR hashing policies */ #ifndef _LINUX_IF_BONDING_H @@ -80,6 +83,10 @@ #define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */ +/* hashing types */ +#define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */ +#define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ MAC) */ + typedef struct ifbond { __s32 bond_mode; __s32 num_slaves; -- cgit v1.2.3