Skip to contentSkip to conversation

Add balance-xor-ip bonding mode

PATCH New Per Hedeland 1 participant 1 message Jan 7, 2004

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add balance-xor-ip bonding mode

This patch adds a new bonding policy, similar to the previously existing balance-xor, but using the IP addresses rather than MAC addresses for IP packets, with fallback to MAC-based balance-xor for non-IP packets.

The patch is against the netdev-2.4 tree (with Shmulik's 'update comment blocks' and Amir's 'using per-bond parameters' patches applied).

--Per Hedeland
[email protected]

Documentation/networking/bonding.txt +11 -0
diff -Nru a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
@@ -368,6 +368,17 @@
 		fails it's hw address is swapped with the new curr_active_slave
 		that was chosen.
 
+	balance-xor-ip or 7
+
+		XOR IP policy: Transmit based on [(source IP address
+		XOR'd with destination IP address) modula slave count].
+		I.e. similar to balance-xor, but uses the IP addresses
+		rather than MAC addresses for IP packets, which provides
+		better load balancing in some cases (e.g. most traffic
+		sent to a default gateway). For non-IP packets, it will
+		fall back to MAC-based balance-xor. This mode provides
+		load balancing and fault tolerance.
+
 primary
 
         A string (eth0, eth2, etc) to equate to a primary device. If this
drivers/net/bonding/bond_main.c +47 -7

109 lines not on this page · raw message

include/linux/if_bonding.h +1 -0
diff -Nru a/include/linux/if_bonding.h b/include/linux/if_bonding.h
@@ -67,6 +67,7 @@
 #define BOND_MODE_8023AD        4
 #define BOND_MODE_TLB           5
 #define BOND_MODE_ALB		6 /* TLB + RLB (receive load balancing) */
+#define BOND_MODE_XOR_IP	7
 
 /* each slave's link has 4 states */
 #define BOND_LINK_UP    0           /* link is up and running */