2015-04-21 10:32, Stephen Hemminger: > The hyper-v device driver forces the base EAL code to change > to support multiple bus types. This is done changing the pci_device > in ether driver to a generic union. > > As much as possible this is done in a backwards source compatiable > way. It will break ABI for device drivers.
> --- a/lib/librte_eal/common/eal_common_options.c > +++ b/lib/librte_eal/common/eal_common_options.c > @@ -80,6 +80,7 @@ eal_long_options[] = { > {OPT_NO_HPET, 0, NULL, OPT_NO_HPET_NUM }, > {OPT_NO_HUGE, 0, NULL, OPT_NO_HUGE_NUM }, > {OPT_NO_PCI, 0, NULL, OPT_NO_PCI_NUM }, > + {OPT_NO_VMBUS, 0, NULL, OPT_NO_VMBUS_NUM }, Alignment, please. > @@ -66,6 +66,7 @@ struct internal_config { > volatile unsigned no_hugetlbfs; /**< true to disable hugetlbfs */ > volatile unsigned xen_dom0_support; /**< support app running on Xen > Dom0*/ > volatile unsigned no_pci; /**< true to disable PCI */ > + volatile unsigned no_vmbus; /**< true to disable VMBUS */ > volatile unsigned no_hpet; /**< true to disable HPET */ > volatile unsigned vmware_tsc_map; /**< true to use VMware TSC mapping Alignment may be better. > +#ifdef RTE_LIBRTE_HV_PMD > + case RTE_BUS_VMBUS: > + eth_drv->vmbus_drv.devinit = rte_vmbus_dev_init; > + eth_drv->vmbus_drv.devuninit = rte_vmbus_dev_uninit; > + rte_eal_vmbus_register(ð_drv->vmbus_drv); > + break; > +#endif Why ifdef'ing this code? > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -1477,7 +1478,10 @@ struct rte_eth_dev { > struct rte_eth_dev_data *data; /**< Pointer to device data */ > const struct eth_driver *driver;/**< Driver for this device */ > const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */ > - struct rte_pci_device *pci_dev; /**< PCI info. supplied by probing */ > + union { > + struct rte_pci_device *pci_dev; /**< PCI info. supplied by > probig */ > + struct rte_vmbus_device *vmbus_dev; /**< VMBUS info. supplied > by probing */ > + }; [...] > struct eth_driver { > - struct rte_pci_driver pci_drv; /**< The PMD is also a PCI driver. */ > + union { > + struct rte_pci_driver pci_drv; /**< The PMD is also a PCI > driver. */ > + struct rte_vmbus_driver vmbus_drv;/**< The PMD is also a VMBUS > drv. */ > + }; > + enum { > + RTE_BUS_PCI=0, > + RTE_BUS_VMBUS > + } bus_type; /**< Device bus type. */ A device may also be virtual.