NDIS_RECEIVE_SCALE_PARAMETERS (NDIS 6.20) structure
The NDIS_RECEIVE_SCALE_PARAMETERS structure specifies the RSS parameters for a miniport adapter.
Syntax
typedef struct _NDIS_RECEIVE_SCALE_PARAMETERS {
NDIS_OBJECT_HEADER Header;
USHORT Flags;
USHORT BaseCpuNumber;
ULONG HashInformation;
USHORT IndirectionTableSize;
ULONG IndirectionTableOffset;
USHORT HashSecretKeySize;
ULONG HashSecretKeyOffset;
ULONG ProcessorMasksOffset;
ULONG NumberOfProcessorMasks;
ULONG ProcessorMasksEntrySize;
} NDIS_RECEIVE_SCALE_PARAMETERS, *PNDIS_RECEIVE_SCALE_PARAMETERS;
Members
Header
The NDIS_OBJECT_HEADER structure for the NDIS_RECEIVE_SCALE_PARAMETERS structure. Set the Type member of the structure that Header specifies to NDIS_OBJECT_TYPE_RSS_PARAMETERS.To indicate the version of the NDIS_RECEIVE_SCALE_PARAMETERS structure, set the Revision member to one of the following values:
NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2
Use this flag for NDIS 6.20 and later drivers.Added the ProcessorMasksOffset, NumberOfProcessorMasks, and ProcessorMasksEntrySize members.
Set the Size member to NDIS_SIZEOF_RECEIVE_SCALE_PARAMETERS_REVISION_2.
NDIS_SIZEOF_RECEIVE_SCALE_PARAMETERS_REVISION_1
Use this flag for NDIS 6.0 drivers.Set the Size member to NDIS_SIZEOF_RECEIVE_SCALE_PARAMETERS_REVISION_1.
Flags
A USHORT value that indicates what the miniport driver should do with the receive-scale parameters. The driver can use these flags to quickly determine which parameters have changed and update the RSS settings accordingly.In a set request, the flags are defined as follows:
NDIS_RSS_PARAM_FLAG_BASE_CPU_UNCHANGED
The BaseCpuNumber member has not changed.NDIS_RSS_PARAM_FLAG_HASH_INFO_UNCHANGED
The HashInformation member has not changed. The hash information includes the hash types and hash function.NDIS_RSS_PARAM_FLAG_ITABLE_UNCHANGED
The indirection table and associated data members have not changed.NDIS_RSS_PARAM_FLAG_HASH_KEY_UNCHANGED
The secret key and associated data members have not changed.NDIS_RSS_PARAM_FLAG_DISABLE_RSS
If this flag is set, the miniport driver should ignore all the other flags and settings and disable RSS on the NIC.
In a query request, set this member to zero.
BaseCpuNumber
The lowest number CPU to use for RSS. Because this value is incorporated into the indirection table, set BaseCpuNumber to zero.HashInformation
In a set request, the hash type and hash function that the NIC should use to compute the hash values for the incoming packets. If the hash function that is specified within the HashInformation member is zero, RSS is disabled.In a query request, this member is the hash type and hash function that the NIC is using.
Overlying drivers and NDIS can use the NDIS_RSS_HASH_INFO_FROM_TYPE_AND_FUNC macro to combine the hash type and hash function into hash information and set the HashInformation member.
Miniport drivers can use the NDIS_RSS_HASH_TYPE_FROM_HASH_INFO macro to obtain the hash type from HashInformation and the NDIS_RSS_HASH_FUNC_FROM_HASH_INFO macro to obtain the hash function.
IndirectionTableSize
The size of the indirection table, in bytes. This member must be a power of two.IndirectionTableOffset
The offset of the indirection table from the beginning of the NDIS_RECEIVE_SCALE_PARAMETERS structure. Use this offset to obtain the indirection table.HashSecretKeySize
The size of the secret key array of the hash function, in bytes. The size of the array is 16 bytes for IPv4 and 40 bytes for IPv6.HashSecretKeyOffset
The offset of the secret key array of the hash function from the beginning of the NDIS_RECEIVE_SCALE_PARAMETERS structure. Use this offset to obtain the 320-bit (40 bytes) secret key.In a set request, the secret key can contain any data that the overlying driver chooses.
In a query request, the secret key contains the data that the NIC is using.
ProcessorMasksOffset
The offset of an array of processor masks from the beginning of the NDIS_RECEIVE_SCALE_PARAMETERS structure.NumberOfProcessorMasks
The number of elements in an array of type GROUP_AFFINITY representing the processors used in the indirection table.ProcessorMasksEntrySize
The size, in bytes, of a processor mask array entry.
Remarks
The NDIS_RECEIVE_SCALE_PARAMETERS structure defines the RSS parameters for the OID_GEN_RECEIVE_SCALE_PARAMETERS OID.
Note The indirection table and secret key are appended after the NDIS_RECEIVE_SCALE_PARAMETERS structure members.
The indirection table has the following format for drivers earlier than NDIS 6.20:
CCHAR IndirectionTable[IndirectionTableSize];
For NDIS 6.20 and later versions, the indirection table has the following format:
PROCESSOR_NUMBER IndirectionTable[IndirectionTableSize/sizeof(PROCESSOR_NUMBER)];
NDIS automatically translates the table if there are older and newer drivers in a driver stack.
The miniport driver must examine the indirection table to determine the CPU numbers to associate with hardware queues. If the total number of different CPU numbers that appear in the indirection table is more than the number of hardware queues that the NIC supports, the miniport driver must select a subset of the CPU numbers from the indirection table. The subset is equal in number to the number of hardware queues.
The miniport driver specified the number of receive queue values in response to OID_GEN_RECEIVE_SCALE_CAPABILITIES.
To clear the receive scale parameters and disable RSS, NDIS sets the hash function that is specified within the HashInformation member to zero. NDIS can also disable RSS by setting the NDIS_RSS_PARAM_FLAG_DISABLE_RSS flag in the NDIS_RECEIVE_SCALE_PARAMETERS structure.
If RSS is disabled, the miniport driver should handle receive operations without performing RSS operations.
Requirements
Version |
Supported in NDIS 6.0 and later. |
Header |
Ntddndis.h (include Ndis.h) |
See also
NDIS_RSS_HASH_INFO_FROM_TYPE_AND_FUNC
NDIS_RSS_HASH_FUNC_FROM_HASH_INFO
NDIS_RSS_HASH_TYPE_FROM_HASH_INFO
OID_GEN_RECEIVE_SCALE_CAPABILITIES
OID_GEN_RECEIVE_SCALE_PARAMETERS
Send comments about this topic to Microsoft
Build date: 7/17/2013