diff options
| author | Nikolay Aleksandrov <nikolay@redhat.com> | 2013-10-02 07:39:26 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2013-10-03 15:36:38 -0400 |
| commit | 7a6afab1de8526d1d6347fc33a7957ea3015ad82 (patch) | |
| tree | 726011355fb63db194ee061d8e2e7ab215b167df /Documentation/networking | |
| parent | 32819dc1834866cb9547cb75f81af9edd58d33cd (diff) | |
bonding: document the new xmit policy modes and update the changed ones
Add new documentation for encap2+3 and encap3+4, also update the formula
for the old modes due to the changes.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/networking')
| -rw-r--r-- | Documentation/networking/bonding.txt | 66 |
1 files changed, 36 insertions, 30 deletions
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index 9b28e714831a..3856ed2c45a9 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
| @@ -743,21 +743,16 @@ xmit_hash_policy | |||
| 743 | protocol information to generate the hash. | 743 | protocol information to generate the hash. |
| 744 | 744 | ||
| 745 | Uses XOR of hardware MAC addresses and IP addresses to | 745 | Uses XOR of hardware MAC addresses and IP addresses to |
| 746 | generate the hash. The IPv4 formula is | 746 | generate the hash. The formula is |
| 747 | 747 | ||
| 748 | (((source IP XOR dest IP) AND 0xffff) XOR | 748 | hash = source MAC XOR destination MAC |
| 749 | ( source MAC XOR destination MAC )) | 749 | hash = hash XOR source IP XOR destination IP |
| 750 | modulo slave count | 750 | hash = hash XOR (hash RSHIFT 16) |
| 751 | hash = hash XOR (hash RSHIFT 8) | ||
| 752 | And then hash is reduced modulo slave count. | ||
| 751 | 753 | ||
| 752 | The IPv6 formula is | 754 | If the protocol is IPv6 then the source and destination |
| 753 | 755 | addresses are first hashed using ipv6_addr_hash. | |
| 754 | hash = (source ip quad 2 XOR dest IP quad 2) XOR | ||
| 755 | (source ip quad 3 XOR dest IP quad 3) XOR | ||
| 756 | (source ip quad 4 XOR dest IP quad 4) | ||
| 757 | |||
| 758 | (((hash >> 24) XOR (hash >> 16) XOR (hash >> 8) XOR hash) | ||
| 759 | XOR (source MAC XOR destination MAC)) | ||
| 760 | modulo slave count | ||
| 761 | 756 | ||
| 762 | This algorithm will place all traffic to a particular | 757 | This algorithm will place all traffic to a particular |
| 763 | network peer on the same slave. For non-IP traffic, | 758 | network peer on the same slave. For non-IP traffic, |
| @@ -779,21 +774,16 @@ xmit_hash_policy | |||
| 779 | slaves, although a single connection will not span | 774 | slaves, although a single connection will not span |
| 780 | multiple slaves. | 775 | multiple slaves. |
| 781 | 776 | ||
| 782 | The formula for unfragmented IPv4 TCP and UDP packets is | 777 | The formula for unfragmented TCP and UDP packets is |
| 783 | |||
| 784 | ((source port XOR dest port) XOR | ||
| 785 | ((source IP XOR dest IP) AND 0xffff) | ||
| 786 | modulo slave count | ||
| 787 | 778 | ||
| 788 | The formula for unfragmented IPv6 TCP and UDP packets is | 779 | hash = source port, destination port (as in the header) |
| 780 | hash = hash XOR source IP XOR destination IP | ||
| 781 | hash = hash XOR (hash RSHIFT 16) | ||
| 782 | hash = hash XOR (hash RSHIFT 8) | ||
| 783 | And then hash is reduced modulo slave count. | ||
| 789 | 784 | ||
| 790 | hash = (source port XOR dest port) XOR | 785 | If the protocol is IPv6 then the source and destination |
| 791 | ((source ip quad 2 XOR dest IP quad 2) XOR | 786 | addresses are first hashed using ipv6_addr_hash. |
| 792 | (source ip quad 3 XOR dest IP quad 3) XOR | ||
| 793 | (source ip quad 4 XOR dest IP quad 4)) | ||
| 794 | |||
| 795 | ((hash >> 24) XOR (hash >> 16) XOR (hash >> 8) XOR hash) | ||
| 796 | modulo slave count | ||
| 797 | 787 | ||
| 798 | For fragmented TCP or UDP packets and all other IPv4 and | 788 | For fragmented TCP or UDP packets and all other IPv4 and |
| 799 | IPv6 protocol traffic, the source and destination port | 789 | IPv6 protocol traffic, the source and destination port |
| @@ -801,10 +791,6 @@ xmit_hash_policy | |||
| 801 | formula is the same as for the layer2 transmit hash | 791 | formula is the same as for the layer2 transmit hash |
| 802 | policy. | 792 | policy. |
| 803 | 793 | ||
| 804 | The IPv4 policy is intended to mimic the behavior of | ||
| 805 | certain switches, notably Cisco switches with PFC2 as | ||
| 806 | well as some Foundry and IBM products. | ||
| 807 | |||
| 808 | This algorithm is not fully 802.3ad compliant. A | 794 | This algorithm is not fully 802.3ad compliant. A |
| 809 | single TCP or UDP conversation containing both | 795 | single TCP or UDP conversation containing both |
| 810 | fragmented and unfragmented packets will see packets | 796 | fragmented and unfragmented packets will see packets |
| @@ -815,6 +801,26 @@ xmit_hash_policy | |||
| 815 | conversations. Other implementations of 802.3ad may | 801 | conversations. Other implementations of 802.3ad may |
| 816 | or may not tolerate this noncompliance. | 802 | or may not tolerate this noncompliance. |
| 817 | 803 | ||
| 804 | encap2+3 | ||
| 805 | |||
| 806 | This policy uses the same formula as layer2+3 but it | ||
| 807 | relies on skb_flow_dissect to obtain the header fields | ||
| 808 | which might result in the use of inner headers if an | ||
| 809 | encapsulation protocol is used. For example this will | ||
| 810 | improve the performance for tunnel users because the | ||
| 811 | packets will be distributed according to the encapsulated | ||
| 812 | flows. | ||
| 813 | |||
| 814 | encap3+4 | ||
| 815 | |||
| 816 | This policy uses the same formula as layer3+4 but it | ||
| 817 | relies on skb_flow_dissect to obtain the header fields | ||
| 818 | which might result in the use of inner headers if an | ||
| 819 | encapsulation protocol is used. For example this will | ||
| 820 | improve the performance for tunnel users because the | ||
| 821 | packets will be distributed according to the encapsulated | ||
| 822 | flows. | ||
| 823 | |||
| 818 | The default value is layer2. This option was added in bonding | 824 | The default value is layer2. This option was added in bonding |
| 819 | version 2.6.3. In earlier versions of bonding, this parameter | 825 | version 2.6.3. In earlier versions of bonding, this parameter |
| 820 | does not exist, and the layer2 policy is the only policy. The | 826 | does not exist, and the layer2 policy is the only policy. The |
