NetAdapterCx: Creating multiple NetAdapters for multi-connector NIC

Environment: Windows 10, Kernel Driver KMDF 1.31, NetAdapter 2.0.
I am designing a PCIe HW card that has multiple Ethernet connectors. We followed the instructions on how to create a driver using the Network Adapter WDF Class Extension (NetAdapterCx) and based our design on the example RtEthSample. INF has entry NumberOfNetworkInterfaces = 2
The 1st NetAdapter created functions correctly (ie we can communicate with network devices). The other NetAdapter created is partially functional under Windows 10. I cannot see the 2nd adapter under Windows’ Network Connections so I cannot edit any properties for that 2nd adapter (ie. force an IP address, use DHCP etc.). On the other hand, I do see both “NetAdapters’ under Windows’ Network Status menu and the 2nd adapter is assigned an IP address. If the IP address does not conflict, I can communicate with network devices on that 2nd adapter.

I can’t seem to find what I am doing wrong to have such a behavior. We hope somebody can help.

What shows in device manager?

I see a single device under Network Adapters, which I assume is correct since I have a single WDFDRIVER/WDFDEVICE
PCIe device = Network Adapter WDFDEVICE, which will create 2 NetAdapters.

Usually, multi-port network adapters appear as multiple devices

image

MBond2, can you confirm that this Cisco driver is using NetAdapterCx and not NDIS miniports?

I have no idea. This is just something in a machine I happen to have. A Cisco branded Intel x710 dual port adapter.

I downloaded the Cisco driver and checked the inf and the entry NumberOfNetworkInterfaces is not there. With my driver, if I remove the entry, only 1 network adapter is seen under Windows, while setting the value NumberOfNetworkInterfaces = 2, I get 2 network adapters, but where the 2nd one cannot be configured. This entry is mandatory to get multiple NetAdapters from a single board.

Bonjour Andredr,

I have exactly the same problem on Windows 11, with KMDF 1.33 and NetAdapterCx 2.2. Did you find a solution to this problem ?

Thanks in advance,
Martin

I looked at this a while ago and concluded there was no way to make NumberOfNetworkInterfaces work on Windows 10. Thankfully I technically only needed to make one work to meet the requirements of my customer.

On Windows 11 you only get 1 entry in Device Manager and only 1 dialog for configuration in Device Manager. Multiple NICs will show up in the system though under Network Connections and do work. I've done it in my driver using NetAdapterCx 2.2.

@MartinDuboisKMS not sure your exact problem and I do not remember what happens if you do it wrong. But make sure that for each call to NetAdapterCreate you are also calling NetAdapterInitAllocate and NetAdapterInitFree. You cannot use a single NETADAPTER_INIT struct for multiple calls to NetAdapterCreate.

Thanks @GrimBeaver

I call NetAdapterInitAllocate and NetAdapterInitFree twice, as your command.

My next try is to create a bus driver. This will be loaded for the PCIe device and will create 2 PDO. This way, Windows will load 2 instance of a second driver based on NetAdapterCx.

I will get 2 entries in the device manager and I hope it will work fine.

Regards,
Martin

@MartinDuboisKMS do you have your driver fully working for one NetAdapter interface? I would not try and instantiate more than one instance until you have everything working. If you are missing any of the critical setup calls you can get really weird behavior from Windows. For example at one point the card was showing up for me in ipconfig but not in Network Connections.

Thanks @GrimBeaver

Yes, my driver is working fine with the first interface. I now work to get the second Ethernet port working.

Martin