From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stephen@networkplumber.org>
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 <dev@dpdk.org>; Thu, 15 Dec 2016 18:26:40 +0100 (CET)
Received: by mail-pg0-f48.google.com with SMTP id f188so21954734pgc.3
 for <dev@dpdk.org>; Thu, 15 Dec 2016 09:26:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20150623.gappssmtp.com; s=20150623;
 h=date:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=w2PLmTWeRAy42X1+/JxAusf+Of+f8a3W3uOdJSjT+7c=;
 b=DmQ8vsEtMumDeFhICGhiA4pYaDcFqtGm8vm7k0jC/QoihRTvPMzel5u384t/pAFMp0
 07JagbK5wB5EfnUmmHaXtbFx8XycKUKHK40gsny1elqmumWViViFekb2ZgOfT8RgDVdq
 5/Pv820ClUwBzDwUyUhlIkODVQ71SZR0LGElBLT8MEbltEXa4zX8A4puKaSGiAtf4CBX
 nuHpRQxFeXqRD6bYmQ9hBrsie4/o/cbaSfYHWwNJcY4e/bSsStcqVAqmwVuh5ThN8Jqu
 hl9pMMAycsVjM7dLiesmq6BFMmVA9eHITma43BlKVutnqmeOLpmAcYo+zIM3w2cYVDA5
 q7ZQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=w2PLmTWeRAy42X1+/JxAusf+Of+f8a3W3uOdJSjT+7c=;
 b=qmMtdJ4Urgr4KX684bc5qqR5jIqHfnoweigqqlmmmCOSJzzhPShynGCL7K0iSkt9DR
 L6AgOppuUUtBC1XEVN0ht/bbVME+qrrChWvfwQKul0gBlt2CClKkSSsaUvx8zlZ5HnvT
 aGdvJVMRiwklXj9qLlYv5MdrJ5NViWm3vxcYVRhHXjwazNEYjbJN47QAj1gJl9VZfhJx
 Ao1p/vnSCNumaoyTS/ki/KUB93i3NP5FfDijIJQRz18SEKSjchTX9fGdKS1tF0MN47yh
 sjE8cAXzC/ly9Q8lDknPfq4m5ae4fgNDjrycApMNBEm2ok+2j6OJD/FsgvmhPz+eP9Do
 5CbQ==
X-Gm-Message-State: AKaTC01rIACSMRdYZzP08KAM//VlBB1meOYnsXhnCRLiGCsSBdym9dToARnbHp2hkEj0Ng==
X-Received: by 10.98.19.137 with SMTP id 9mr3353313pft.150.1481822799985;
 Thu, 15 Dec 2016 09:26:39 -0800 (PST)
Received: from xeon-e3 (204-195-18-65.wavecable.com. [204.195.18.65])
 by smtp.gmail.com with ESMTPSA id 13sm5966467pfz.30.2016.12.15.09.26.39
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 15 Dec 2016 09:26:39 -0800 (PST)
Date: Thu, 15 Dec 2016 09:26:31 -0800
From: Stephen Hemminger <stephen@networkplumber.org>
To: Shreyansh Jain <shreyansh.jain@nxp.com>
Cc: <dev@dpdk.org>, Stephen Hemminger <sthemmin@microsoft.com>
Message-ID: <20161215092631.5cb798b2@xeon-e3>
In-Reply-To: <544b6faf-11f4-93fe-6427-7d3fcfaba388@nxp.com>
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
Subject: Re: [dpdk-dev] [PATCH 2/2] hyperv: VMBUS support infrastucture
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Dec 2016 17:26:41 -0000

On Thu, 15 Dec 2016 12:19:44 +0530
Shreyansh Jain <shreyansh.jain@nxp.com> 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.