On Mon, Nov 14, 2016 at 3:02 PM, Phil Sutter <p...@nwl.cc> wrote: > Due to the assumption that all PFs are PCI devices, this implementation > is not completely straightforward: In order to allow for > rtnl_fill_ifinfo() to see the dummy VFs, a fake PCI parent device is > attached to the dummy netdev. This has to happen at the right spot so > register_netdevice() does not get confused. This patch abuses > ndo_fix_features callback for that. In ndo_uninit callback, the fake > parent is removed again for the same purpose.
So you did some mimic-ing of PCI interface, how do you let the user to config the number of VFs? though a module param? why? if the module param only serves to say how many VF the device supports, maybe support the maximum possible by PCI spec and skip the module param? > +module_param(num_vfs, int, 0); > +MODULE_PARM_DESC(num_vfs, "Number of dummy VFs per dummy device"); > + > @@ -190,6 +382,7 @@ static int __init dummy_init_one(void) > err = register_netdevice(dev_dummy); > if (err < 0) > goto err; > + > return 0; nit, remove this added blank line..