Hey VMware, SET_NETDEV_DEV wants a word with you

VMware workstation 6.0.2 build-59824 is apparently the latest available for download. VMware has a ‘vmxnet’ driver that is installed when you install the VMware Tools inside your VM.

It does not:

  • support HAL
  • support carrier detection

To get HAL to recognize the network device, you need to have the ‘device’ link in sysfs point to the hardware device of your card, ie /sys/class/net/eth0/device -> /sys/devices/pci0000:00/0000:00:11.0/0000:02:00.0. This is accomplished simply by adding SET_NETDEV_DEV(<struct net_device *>, <struct device *>) to your driver. Almost all of the worthwhile in-kernel drivers do this already. vmxnet does not.

qemu’s ne2000 driver doesn’t support carrier detection either; but you can use a different qemu driver that emulates an rtl8139 card which does support carrier detection, and hence works nicely with NetworkManager. Both call SET_NETDEV_DEV().

I’ve submitted a VMware Support Request (#1104170215) for this issue, including a patch. We’ll see what happens.

[UPDATE]: I’ve been helpfully pointed to open-vm-tools by Philip. It has SET_NETDEV_DEV and carrier detection, but it doesn’t look like it easily supports mii-tool or ethtool with recent kernels (which use ethtool_ops). Carrier detection is pretty much useless if you can’t actually find out whether or not the driver supports it. So NetworkManager pokes the card with SIOCGMIIPHY + MII_BMSR or ETHTOOL_GLINK and if there aren’t any errors, assumes the card supports carrier detection.

I’ve got a patch for minimal ethtool support (at least for drvinfo and link reporting), but I have to (a) make a half-assed effort to make the patch compatible with kernels that don’t have ethtool_ops, and (b) sign and fax a copyright assignment to VMware before they’ll think about taking the patch.

One Response to “Hey VMware, SET_NETDEV_DEV wants a word with you”

  1. [...] I’ve mentioned these before but Dan Williams’ blog post about SET_NETDEV_DEV in the vmxnet driver clearly tells me I need to try and publicise these more. [...]