EVT_NET_ADAPTER_RECEIVE_SCALING_SET_HASH_SECRET_KEY callback function (netreceivescaling.h)

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

Syntax

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
)
{...}

Parameters

[_In_] Adapter

The NETADAPTER object the client driver obtained in a previous call to NetAdapterCreate.

[_In_] HashSecretKey

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.

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

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.25
Header netreceivescaling.h (include netadaptercx.h)
IRQL PASSIVE_LEVEL

See also

NET_ADAPTER_RECEIVE_SCALING_HASH_SECRET_KEY

NetAdapterCx Receive Side Scaling