EVT_NET_ADAPTER_RECEIVE_SCALING_SET_HASH_SECRET_KEY - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// 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 reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nc-netreceivescaling-evt_net_adapter_receive_scaling_set_hash_secret_key)

EVT_NET_ADAPTER_RECEIVE_SCALING_SET_HASH_SECRET_KEY callback function

Description

The EvtNetAdapterReceiveScalingSetHashSecretKey callback function is implemented by the client driver to set the hash secret key for the network interface controller (NIC).

Parameters

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.

Return value

Returns STATUS_SUCCESS if the hash secret key was set successfully. Otherwise, returns an appropriate NTSTATUS error code.

Prototype

//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;

Remarks

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.

Example

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;
}

See also

NET_ADAPTER_RECEIVE_SCALING_HASH_SECRET_KEY

NetAdapterCx Receive Side Scaling