// netreceivescaling.h
EVT_NET_ADAPTER_RECEIVE_SCALING_SET_HASH_SECRET_KEY EvtNetAdapterReceiveScalingSetHashSecretKey;
NTSTATUS EvtNetAdapterReceiveScalingSetHashSecretKey(
[_In_] NETADAPTER Adapter,
[_In_] const NET_ADAPTER_RECEIVE_SCALING_HASH_SECRET_KEY *HashSecretKey
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The EvtNetAdapterReceiveScalingSetHashSecretKey callback function is implemented by the client driver to set the hash secret key for the network interface controller (NIC).
Adapter [_In_]The NETADAPTER object the client driver obtained in a previous call to NetAdapterCreate.
HashSecretKey [_In_]A pointer to a NET_ADAPTER_RECEIVE_SCALING_HASH_SECRET_KEY structure that contains the hash secret key for validating hash calculations.
Returns STATUS_SUCCESS if the hash secret key was set successfully. Otherwise, returns an appropriate NTSTATUS error code.
//Declaration
EVT_NET_ADAPTER_RECEIVE_SCALING_SET_HASH_SECRET_KEY EvtNetAdapterReceiveScalingSetHashSecretKey;
// Definition
NTSTATUS EvtNetAdapterReceiveScalingSetHashSecretKey
(
_In_ NETADAPTER Adapter,
_In_ const NET_ADAPTER_RECEIVE_SCALING_HASH_SECRET_KEY * HashSecretKey
)
{...}
typedef EVT_NET_ADAPTER_RECEIVE_SCALING_SET_HASH_SECRET_KEY *PFN_NET_ADAPTER_RECEIVE_SCALING_SET_HASH_SECRET_KEY;
Register your implementation of this callback function by setting the appropriate member of the NET_ADAPTER_RECEIVE_SCALING_CAPABILITIES structure and then calling NetAdapterSetReceiveScalingCapabilities. Client drivers typically call NetAdapterSetReceiveScalingCapabilities when starting a net adapter, before calling NetAdapterStart.
In this callback, NIC client drivers program the supplied hash secret key to their hardware for use in verifying RSS hash calculations.
NTSTATUS
MyEvtNetAdapterReceiveScalingSetHashSecretKey(
_In_ NETADAPTER Adapter,
_In_ const NET_ADAPTER_RECEIVE_SCALING_HASH_SECRET_KEY * HashSecretKey
)
{
const UINT32* key = (const UINT32*)HashSecretKey->Key;
if(!MyHardwareRssSetHashSecretKey)
{
WdfDeviceSetFailed(Adapter->WdfDevice, WdfDeviceFailedAttemptRestart);
return STATUS_UNSUCCESSFUL;
}
return STATUS_SUCCESS;
}
NET_ADAPTER_RECEIVE_SCALING_HASH_SECRET_KEY
NetAdapterCx Receive Side Scaling