EVT_NET_ADAPTER_RECEIVE_SCALING_SET_HASH_SECRET_KEY callback function

Warning

Some information in this topic relates to prereleased product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

NetAdapterCx is preview only in Windows 10, version 1903.

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(
  NETADAPTER Adapter,
  const NET_ADAPTER_RECEIVE_SCALING_HASH_SECRET_KEY *HashSecretKey
)
{...}

Parameters

Adapter

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

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

   
Target Platform Universal
Minimum KMDF version 1.25
Header netreceivescaling.h
IRQL PASSIVE_LEVEL

See Also

NET_ADAPTER_RECEIVE_SCALING_HASH_SECRET_KEY

NetAdapterCx Receive Side Scaling