NDK_FN_CREATE_CQ callback function

The NdkCreateCq (NDK_FN_CREATE_CQ) function creates an NDK completion queue (CQ) object.

Syntax


NDK_FN_CREATE_CQ NdkCreateCq;

NTSTATUS NdkCreateCq(
  _In_     NDK_ADAPTER                     *pNdkAdapter,
  _In_     ULONG                           CqDepth,
  _In_     NDK_FN_CQ_NOTIFICATION_CALLBACK CqNotification,
  _In_opt_ PVOID                           CqNotificationContext,
  _In_opt_ GROUP_AFFINITY                  *Affinity,
  _In_     NDK_FN_CREATE_COMPLETION        CreateCompletion,
  _In_opt_ PVOID                           RequestContext,
           _Outptr_ NDK_CQ                 **ppNdkCq
)
{ ... }

Parameters

pNdkAdapter [in]

A pointer to an NDK adapter object (NDK_ADAPTER).

CqDepth [in]

The maximum number of completion entries that the CQ can hold. This value must be less than or equal to the MaxCqDepth value that is specified in the NDK_ADAPTER_INFO structure.

CqNotification [in]

A pointer to the NdkCqNotificationCallback function (NDK_FN_CQ_NOTIFICATION_CALLBACK) that the provider uses to notify the consumer when request completions are queued in the CQ. The provider will not call NdkCqNotificationCallback unless the consumer arms the notification with the NdkArmCq (NDK_FN_ARM_CQ) function.

CqNotificationContext [in, optional]

A context value that the NDK provider passes back to the NdkCqNotificationCallback function that is specified in the CqNotification parameter.

Affinity [in, optional]

An affinity mask (GROUP_AFFINITY) that provides preferred processors that the consumer would choose to run the NdkCqNotificationCallback callbacks. Providers should honor the processor preferences if their underlying hardware allows it, but consumers cannot assume that NdkCqNotificationCallback callbacks will occur only on the preferred processors. Set Affinity to NULL if there are no preferred processors.

CreateCompletion [in]

A pointer to an NdkCreateCompletion (NDK_FN_CREATE_COMPLETION) function that completes the creation of an NDK object.

RequestContext [in, optional]

A context value that the NDK provider passes back to the NdkCreateCompletion function that is specified in the CreateCompletion parameter.

ppNdkCq

A pointer to a completion queue (CQ) object (NDK_CQ) is returned in this location if the request succeeds without returning STATUS_PENDING. If NdkCreateCq returns STATUS_PENDING this parameter is ignored and the created object is returned with the callback that is specified in the CreateCompletion parameter.

Return value

The NDK_FN_CREATE_CQ function returns one of the following NTSTATUS codes.

Return codeDescription
STATUS_SUCCESS

The CQ object was created successfully and returned with the *ppNdkCq parameter.

STATUS_PENDING

The operation is pending and will be completed later. The provider will call the function specified in the CreateCompletion parameter(NDK_FN_CREATE_COMPLETION) to complete the pending operation.

STATUS_INVALID_PARAMETER

The request failed because the requested CqDepth value is greater than the MaxCqDepth value that is specified in the NDK_ADAPTER_INFO structure.

STATUS_INSUFFICIENT_RESOURCES

The request failed due to insufficient resources.

Important  The request can fail inline as well as asynchronously with this status code.
 
Other status codes

An error occurred.

 

Remarks

The NdkCreateCq function creates an NDK completion queue (CQ) object. If the function returns STATUS_SUCCESS, the created object is returned in the ppNdkCq parameter. If NdkCreateCq returns STATUS_PENDING, the created object is returned by the NdkCreateCompletion (NDK_FN_CREATE_COMPLETION) function that is specified in the CreateCompletion parameter.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2012

Version

Supported in NDIS 6.30 and later.

Header

Ndkpi.h (include Ndkpi.h)

IRQL

<=DISPATCH_LEVEL

See also

GROUP_AFFINITY
NDK_ADAPTER
NDK_ADAPTER_DISPATCH
NDK_ADAPTER_INFO
NDK_CQ
NDK_FN_ARM_CQ
NDK_FN_CQ_NOTIFICATION_CALLBACK
NDK_FN_CREATE_COMPLETION
NDKPI Object Lifetime Requirements

 

 

Send comments about this topic to Microsoft

Show: