This patch adds "per destination" and "per source" XOR hashing methods to "balance-xor" mode of "bonding" kernel module + and sysfs option to shift outgoing port selection.
http://igorsd.ru/kernel/bonding.xor_modes_3.11_with_shift.diff After installing patched kernel, load module as follows:
for "per layer 3 destination" balancing: modprobe bonding mode=2 xmit_hash_policy=3 ..other params..
for "per layer 3 source" balancing: modprobe bonding mode=2 xmit_hash_policy=4 ..other params..
mode=2 is required for "balance-xor" mode of operation.
After bond interface creation use echo N > /sys/devices/virtual/net/bondX/bonding/port_shift to shift port selection algorithm if needed.
E.g.:
bond0 consists of 4 links: eth0-3
Default port selection (ip based):
x.x.x.0 - eth0
x.x.x.1 - eth1
x.x.x.2 - eth2
x.x.x.3 - eth3
x.x.x.4 - eth0
....
After "echo 2 > /sys/devices/virtual/net/bond0/bonding/port_shift":
x.x.x.0 - eth2
x.x.x.1 - eth3
x.x.x.2 - eth0
x.x.x.3 - eth1
x.x.x.4 - eth2
....