From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 2/2] hyperv: VMBUS support infrastucture Date: Thu, 15 Dec 2016 09:26:31 -0800 Message-ID: <20161215092631.5cb798b2@xeon-e3> References: <20161214235920.12877-1-sthemmin@microsoft.com> <20161214235920.12877-3-sthemmin@microsoft.com> <544b6faf-11f4-93fe-6427-7d3fcfaba388@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: , Stephen Hemminger To: Shreyansh Jain Return-path: Received: from mail-pg0-f48.google.com (mail-pg0-f48.google.com [74.125.83.48]) by dpdk.org (Postfix) with ESMTP id BDAFA4A59 for ; Thu, 15 Dec 2016 18:26:40 +0100 (CET) Received: by mail-pg0-f48.google.com with SMTP id f188so21954734pgc.3 for ; Thu, 15 Dec 2016 09:26:40 -0800 (PST) In-Reply-To: <544b6faf-11f4-93fe-6427-7d3fcfaba388@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 15 Dec 2016 12:19:44 +0530 Shreyansh Jain wrote: > > @@ -1866,7 +1871,11 @@ typedef int (*eth_dev_uninit_t)(struct rte_eth_dev *eth_dev); > > * - The size of the private data to allocate for each matching device. > > */ > > 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 PCI driver. */ > > + struct rte_vmbus_driver vmbus_drv;/**< The PMD VMBUS drv. */ > > + }; > > + > > eth_dev_init_t eth_dev_init; /**< Device init function. */ > > eth_dev_uninit_t eth_dev_uninit; /**< Device uninit function. */ > > unsigned int dev_private_size; /**< Size of device private data. */ > > It is not a scale-able model where we have to change eth_driver/eth_dev > for every new device type, other than PCI. Maybe VMBus is _very_ close > to PCI so no changes are required in PCI layer (common, linuxapp, > bsdapp) - but, for others it won't stop there. > > At the least, rte_pci_driver/rte_pci_device should be removed from > eth_driver & rte_eth_dev, respectively - relying on rte_driver and > rte_device. > > This is the primary reason work on the SoC patchset and now the new Bus > model is being done. Agreed. the better long term model is to use C style inheritance where rte_pci_driver has eth_driver inside. The other alternative is to make the second element an opaque pointer. But that was too big a change, and not necessary to get VMBUS to work. Longer term refactoring will take more effort. Go ahead and address it with a better bus model, but that probably isn't going to be ready for a couple of releases.