NDK_FN_BIND callback function (ndkpi.h)

The NdkBind (NDK_FN_BIND) function binds a memory window to a specific sub-region of a memory region (MR).

Syntax

NDK_FN_BIND NdkFnBind;

NTSTATUS NdkFnBind(
  [in]           NDK_QP *pNdkQp,
  [in, optional] PVOID RequestContext,
  [in]           NDK_MR *pMr,
  [in]           NDK_MW *pMw,
  [in]           PVOID VirtualAddress,
  [in]           SIZE_T Length,
  [in]           ULONG Flags
)
{...}

Parameters

[in] pNdkQp

A pointer to an NDK queue pair (QP) object (NDK_QP).

[in, optional] RequestContext

A context value to return in the RequestContext member of the NDK_RESULT structure for this request.

[in] pMr

A pointer to an NDK memory region (MR) object (NDK_MR).

[in] pMw

A pointer to an NDK memory window (MW) object (NDK_MW).

[in] VirtualAddress

A virtual address that must be greater than or equal to the virtual address of the MDL for the MR and less than the virtual address of the MDL for the MR plus the value in the Length parameter.

Use the MmGetMdlVirtualAddress macro to obtain the virtual address of the MDL for the MR.

[in] Length

The length of the MR to bind to the MW.

[in] Flags

A bitwise OR of flags which specifies the operations that are allowed. The following flags are supported:

Value Meaning
NDK_OP_FLAG_SILENT_SUCCESS
0x00000001
Indicates the successful completion of this request does not generate a completion event in the outbound completion queue. However, requests that fail do generate a completion in the completion queue.
NDK_OP_FLAG_READ_FENCE
0x00000002
Indicates that all prior read requests must be complete before the hardware begins processing this request.
NDK_OP_FLAG_ALLOW_REMOTE_READ
0x00000008
Enable read access to the memory window for any connected peer. To access the memory window, the connected peers must have a valid token.
NDK_OP_FLAG_ALLOW_REMOTE_WRITE
0x00000030
Enable write access to the memory window for any connected peer. To access the memory window, the connected peers must have a valid token.
NDK_OP_FLAG_DEFER
0x00000200
Indicates to the NDK provider that it may defer indicating the request to hardware for processing. For more information about this flag, see NDKPI Deferred Processing Scheme.

Note  This flag is supported only in NDKPI 1.2 (Windows Server 2012 R2) and later.

Return value

The NdkBind function returns one of the following NTSTATUS codes.

Return code Description
STATUS_SUCCESS
The request was posted successfully. A completion entry will be queued to the CQ when the work request is completed.
STATUS_CONNECTION_INVALID
The queue pair (QP) is not connected.
STATUS_ACCESS_VIOLATION
The memory region does not allow the type of access requested for the memory window. The NDK_OP_FLAG_ALLOW_WRITE flag requires a memory region that was registered with the NDK_MR_FLAG_ALLOW_LOCAL_WRITE flag.
Other status codes
An error occurred.

Remarks

NdkBind binds a memory window (MW) to a specific sub-region of a memory region (MR).

The address in the VirtualAddress parameter must be an address within the virtually contiguous region that is described by the MDL chain that was specified during memory registration. The address must be treated by the provider as an index into the memory region. The address must not be used by the provider as a valid virtual address for reading or writing buffer contents.

After this call returns, the remote token will be available with the NdkGetRemotetokenFromMw function (NDK_FN_GET_REMOTE_TOKEN_FROM_MW).

This function does not support a zero-based virtual address.

Requirements

Requirement Value
Minimum supported client None supported,Supported in NDIS 6.30 and later.
Minimum supported server Windows Server 2012
Target Platform Windows
Header ndkpi.h (include Ndkpi.h)
IRQL <=DISPATCH_LEVEL

See also

MmGetMdlVirtualAddress

NDKPI Deferred Processing Scheme

NDKPI Work Request Posting Requirements

NDK_FN_GET_REMOTE_TOKEN_FROM_MW

NDK_MR

NDK_MW

NDK_QP

NDK_RESULT