History

bonding: add a vlan+srcmac tx hashing option

This comes from an end-user request, where they're running multiple VMs on hosts with bonded interfaces connected to some interest switch topologies, where 802.3ad isn't an option. They're currently running a proprietary solution that effectively achieves load-balancing of VMs and bandwidth utilization improvements with a similar form of transmission algorithm. Basically, each VM has it's own vlan, so it always sends its traffic out the same interface, unless that interface fails. Traffic gets split between the interfaces, maintaining a consistent path, with failover still available if an interface goes down. Unlike bond_eth_hash(), this hash function is using the full source MAC address instead of just the last byte, as there are so few components to the hash, and in the no-vlan case, we would be returning just the last byte of the source MAC as the hash value. It's entirely possible to have two NICs in a bond with the same last byte of their MAC, but not the same MAC, so this adjustment should guarantee distinct hashes in all cases. This has been rudimetarily tested to provide similar results to the proprietary solution it is aiming to replace. A patch for iproute2 is also posted, to properly support the new mode there as well.

Jarod Wilson committed 5 years ago

Commit 7b8fc011 parent 00b229f5 files · +54 −8Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/linux/if_bonding.h+1−0
@@ -94,6 +94,7 @@ · 93 unmodified lines
94#define BOND_XMIT_POLICY_LAYER23 2 /* layer 2+3 (IP ^ MAC) */94#define BOND_XMIT_POLICY_LAYER23 2 /* layer 2+3 (IP ^ MAC) */
95#define BOND_XMIT_POLICY_ENCAP23 3 /* encapsulated layer 2+3 */95#define BOND_XMIT_POLICY_ENCAP23 3 /* encapsulated layer 2+3 */
96#define BOND_XMIT_POLICY_ENCAP34 4 /* encapsulated layer 3+4 */96#define BOND_XMIT_POLICY_ENCAP34 4 /* encapsulated layer 3+4 */
97#define BOND_XMIT_POLICY_VLAN_SRCMAC 5 /* vlan + source MAC */
97 98
98/* 802.3ad port state definitions (43.4.2.2 in the 802.3ad standard) */99/* 802.3ad port state definitions (43.4.2.2 in the 802.3ad standard) */
99#define LACP_STATE_LACP_ACTIVITY 0x1100#define LACP_STATE_LACP_ACTIVITY 0x1