View unanswered posts | View active topics It is currently Mon Dec 11, 2017 5:26 am



Reply to topic  [ 2 posts ] 
 Create multiple net_device's for a SINGLE function device 
Author Message

Joined: Wed Oct 09, 2013 11:13 am
Posts: 6
Reply with quote
Post Create multiple net_device's for a SINGLE function device
Greetings,

I have a SINGLE function device that contains a BAR that has 4 MACs. In my driver, I create 4 net device object, and register them using register_netdev(dev). This works fine in Linux as each device is named "eth%d", and the kernel replaces the %d with a new number. However, in ESXi 5+, it only recognizes and starts one of the net devices (which somehow happens to always be port 4). How do I get it to recognize all 4 devices that I've registered?

Thanks in advance.


Wed Oct 09, 2013 3:05 pm
Profile

Joined: Wed Oct 09, 2013 11:13 am
Posts: 6
Reply with quote
Post Re: Create multiple net_device's for a SINGLE function devic
I fixed the issue...in order to support multiple ports on a single-function device, this is what I did in my PCI probe function for every net_device that I created. Hope this helps

/* We give the device a name with the "%d" so the kernel
* can replace it with a respectable name, such as eth0.
*/
strcpy(netdev->name, "test_nic%d");

/* Set the PCI device as the parent of the net device. */
SET_NETDEV_DEV(netdev, &pdev->dev);

/* Make this netdevice a Pseudo-NIC.
* We do this in VMware since multi-port devices are
* expected to be multi-function devices under VMware. By
* setting the device as a Pseudo-NIC, VMware creates
* the net_device as a "virtual" device when register_netdev
* is called, and ## of devices show up
* under ESXi and are all opened. If we don't do this, ESXi
* only opens the last device created, thus limiting us to
* having only one port. I have not yet seen any adverse
* effects to having the devices be "virtual" devices. These
* steps are recommended by VMware in the DDK documentation.
*/
netdev->pdev->netdev = NULL;
netdev->pdev_pseudo = netdev->pdev;
netdev->pdev = NULL;
netdev->features |= NETIF_F_PSEUDO_REG;


Tue Nov 12, 2013 1:03 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.