Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Re: SR-IOV PF driver (questions about NDIS miniports)

Jake_OshinsJake_Oshins Member Posts: 1,058
In order to truly answer your question, you may have to explain how your
hardware works. Most NICs have a fixed number of
Tx and Rx queues in them, burned into silicon. Drivers couldn't "create" or
"destroy" them if they tried. Perhaps your NIC is built from an FPGA and
you can create queues on the fly. Please elaborate.

In any case, it's the job of your PF driver to expose queues to the VF
hardware interface. Some NICs have no choice in this. Each VF implies one
Tx and one Rx queue. Other NICs have some divider -- when you enable
virtualization, you pick how many Tx/Rx queue pairs go into each VF. As an
example, a NIC with 256 queues might allow 256 VFs with one queue pair each,
or 128 VFs with two queue pairs each, etc.

Other NICs are more useful, allowing each VF to exist separately from the
queue pairs. If, as above, you have 256 queue pairs, you might allocate one
to VF1 and eight to VF2. It must never be possible for VF1 or VF2 to
configure itself. This has to happen through the PF interface.

Your miniport exposes its capabilities. The OID you're confused by is there
to tell you what the virtualization stack chose, if you give it any
flexibility. If you give it no flexibility, and each VF is simply one queue
pair, then that OID will always tell you to create one queue pair. If you
do give it some flexibility, you will see the choices here.

Note that it's really useful to allow some VMs to have lots of queues and
other VMs to have fewer. In general, RSS works well when there's a queue
pair per processor. The same is true in a VM. If you can match the number
of queues in a VF to the number of virtual processors in a VM, you'll get
optimal performance. This all assumes, however, that you can do RSS from a
VF.

By the way, I changed the title of this post so that Jeffrey Tippet will
notice it. When you want an answer about how NDIS works, you should really
ask the NDIS guys. That's best done by getting past their filters and
putting NDIS in the title.

Jake Oshins
Windows Kernel Team

This message offers no warranties and confers no rights.
-----------------------------------------------------------------
wrote in message news:xxxxx@ntdev...

I am not really getting confused with the word "queue"...
OK let me explain it by using the MS OID calls

1. When PF driver get the call for OID_NIC_SWITCH_ALLOCATE_VF, PF driver
get the parameters like NIC name Mac address/Mac address length for VF..
This OID is clear, PF driver needs to make necessary calls to expose a
Virtual Function and set the value of the VF MAC address etc.
[No Doubts in this]
************************************************
My confusion is with the OID OID_NIC_SWITCH_CREATE_VPORT.
**************************************************
2 when PF driver gets the call for the OID OID_NIC_SWITCH_CREATE_VPORT, PF
driver gets the parameters as defined in the structure
NDIS_NIC_SWITCH_VPORT_PARAMETERS. If you see this struct it describes the
NumQueuePairs,InterruptModeration,ProcessorAffinity.
The description of
NumQueuePairs:
One or more queue pairs are configured on a nondefault VPort through an OID
method request of OID_NIC_SWITCH_CREATE_VPORT.

******************************
MY QUESTION IS : Do the above description mean that PF driver needs to
create the queues for the VF or is it that the value of this parameter has
to be some how passed to the VF driver so that VF driver reads this and
creates the Tx/Rx queue based on this parameter count ?
When i mean queue i mean the hardware queue ...

-Thanks

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 25 Feb 2019 OSR Seminar Space
Developing Minifilters 8 April 2019 OSR Seminar Space