Intel 324632-003 Switch User Manual


 
Intel
®
82575EB Gigabit Ethernet Controller — Multiple Receive Queues & Receive-Side Scaling
(RSS)
Intel
®
82575EB Gigabit Ethernet Controller 324632-003
Software Developer’s Manual and EEPROM Guide Revision: 2.1
124 January 2011
The 32-bit result of the hash computation is written into the packet descriptor and also provides an
index into the Indirection Table.
The following notation is used to describe the following hash functions:
Ordering is little endian in both bytes and bits. For example, the IP address 161.142.100.80
translates into A18E 6450h in the signature.
A “^” denotes bit-wise eXclusive OR (XOR) operation of same width vectors.
@x-y denotes bytes x through y (including both of them) of the incoming packet, where byte 0 is
the first byte of the IP header. In other words, we consider all byte offsets as offsets into a packet
where the framing layer header has been stripped out. Therefore, the source IPv4 address is
referred to as @12-15, while the destination v4 address is referred to as @16-19.
@x-y, @v-w denotes concatenation of bytes x-y followed by bytes v-w, preserving the order in
which they occurred in the packet.
All hash function variations (IPv4 and IPv6) follow the same general structure. Specific details for each
variation are described in the following section. The hash uses a random secret key of length 320 bits
(40 bytes). The key is generated and supplied through the RSS Random Key Register (RSSRK).
The algorithm works by examining each bit of the hash input from left to right. Our nomenclature
defines left and right for a byte array as follows:
Given an array K with k bytes, our nomenclature assumes that the array is laid out as:
K[0] K[1] K[2] … K[k-1]
K[0] is the left most byte, and the most significant bit of K[0] is the left most bit. K[k-1] is the right
most byte, and the least significant bit of K[k-1] is the right most bit.
ComputeHash(input[], N)
For hash-input input[] of length N bytes (8N bits) and a random secret key K of 320 bits
Result = 0;
For each bit b in input[] {
if (b == 1) then Result ^= (left-most 32 bits of K);
shift K left 1 bit position;
}
return Result;
The following four pseudo-code examples are intended to help clarify exactly how the hash is to be
performed in four cases: IPv4 with and without ability to parse the TCP header and IPv6 with and
without a TCP header.
5.4.2.1.1 Hash for IPv4 with TCP
Concatenate SourceAddress, DestinationAddress, SourcePort, DestinationPort into one
single byte-array, preserving the order in which they occurred in the packet: Input[12]
= @12-15, @16-19, @20-21, @22-23.
Result = ComputeHash(Input, 12);