Rediger

Del via


OID_NIC_SWITCH_CREATE_VPORT

An overlying driver issues an object identifier (OID) method request of OID_NIC_SWITCH_CREATE_VPORT to create a nondefault virtual port (VPort) on a network adapter's NIC switch. This OID method request also attaches the created VPort to the network adapter's PCI Express (PCIe) Physical Function (PF) or a previously allocated PCIe Virtual Function (VF).

Overlying drivers issue this OID method request to the miniport driver for the network adapter's PF. This OID method request is required for PF miniport drivers that support the single root I/O virtualization (SR-IOV) interface.

The InformationBuffer member of the NDIS_OID_REQUEST structure contains a pointer to the NDIS_NIC_SWITCH_VPORT_PARAMETERS structure.

Remarks

The overlying driver initializes the NDIS_NIC_SWITCH_VPORT_PARAMETERS structure with the configuration information about the nondefault VPort to be created. The configuration information includes the PCIe function to which the nondefault VPort is attached and the number of queue pairs for the nondefault VPort.

When the PF miniport driver is issued the OID request, the driver allocates the hardware and software resources associated with the specified nondefault VPort. After all the resources are successfully allocated, the PF miniport driver completes the OID successfully by returning NDIS_STATUS_SUCCESS from MiniportOidRequest.

If the OID_NIC_SWITCH_CREATE_VPORT request completes successfully, the PF miniport driver and the overlying driver must retain the VPortId value of the nondefault VPort for successive operations. The VPortId value is used during these operations:

For more information, see Creating a Virtual Port.

Note  The default VPort always exists and is not created though an OID request of OID_NIC_SWITCH_CREATE_VPORT. The default VPort has an identifier of NDIS_DEFAULT_VPORT_ID. When the PF miniport driver creates a NIC switch, the driver automatically attaches the default VPort to the PF of the network adapter.

Return Status Codes

NDIS or the PF miniport driver returns one of the following status codes for the OID method request of OID_NIC_SWITCH_CREATE_SWITCH.

Status Code Description

NDIS_STATUS_SUCCESS

The OID request completed successfully.

NDIS_STATUS_NOT_SUPPORTED

The PF miniport driver either does not support the SR-IOV interface or is not enabled to use the interface.

NDIS_STATUS_INVALID_PARAMETER

One or more of the members of the NDIS_NIC_SWITCH_VPORT_PARAMETERS structure have invalid values.

NDIS_STATUS_INVALID_LENGTH

The length of the information buffer is less than sizeof(NDIS_NIC_SWITCH_VPORT_PARAMETERS). The PF miniport driver must set the DATA.METHOD_INFORMATION.BytesNeeded member in the NDIS_OID_REQUEST structure to the minimum buffer size that is required.

NDIS_STATUS_FAILURE

The request failed for other reasons.

Requirements

Version

Supported in NDIS 6.30 and later.

Header

Ntddndis.h (include Ndis.h)

See also


MiniportOidRequest

NDIS_NIC_SWITCH_PARAMETERS

NDIS_NIC_SWITCH_VPORT_PARAMETERS

NDIS_OID_REQUEST

NET_BUFFER_LIST

OID_NIC_SWITCH_ALLOCATE_VF

OID_NIC_SWITCH_DELETE_VPORT

OID_NIC_SWITCH_PARAMETERS

OID_NIC_SWITCH_VPORT_PARAMETERS