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

robertgraham1906

Joined: Wed Oct 09, 2013 11:13 amPosts: 6

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;

Who is online

Users browsing this forum: No registered users and 1 guest

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