From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by dpdk.org (Postfix) with ESMTP id 089BB5A3E for ; Thu, 9 Jul 2015 01:52:40 +0200 (CEST) Received: by wibdq8 with SMTP id dq8so226896141wib.1 for ; Wed, 08 Jul 2015 16:52:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=Caw2Hx3/CFThaYWD26slYw5VFbi3xZOA6R24WCM18LQ=; b=mckAhPfo+BsryKwV7RSptYts7kG1vSdroTpm5gHqZQ+5ZBT0mxy4SuKGXKFfuztw85 aWOXkab0DCnpAzkV3IuU8bffIrXvq3T6daVp0WHOji0GHbZAWEH/OpjHre66WNhwf/kq R4+neybo7gPD0KicsDs9su1jxCtn6Pd6IAiUSYWBVezZc9H/GpagDjazIEW6l+kkmE32 vwh93qToEX+IBk/V9Zl4uuNv09PHRqxVLBKNlN8QvUXhUCEoJZbRHSGSd18elIHlNdfp 3GjRlq7BhbycC4qBj9KZFWtxzVwiYkYMuIpolGBMMEA8I4g3pxNSbNpVaiOx9wnCDER8 Cc3g== X-Gm-Message-State: ALoCoQm70vdXPMhoGWe80/geydEs3mqUPBuJ/pEehipdGMpRLw9AG/u75y+szQCiqQhL8n1Knytc X-Received: by 10.194.121.34 with SMTP id lh2mr24738515wjb.101.1436399559873; Wed, 08 Jul 2015 16:52:39 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id c7sm5835418wjb.19.2015.07.08.16.52.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jul 2015 16:52:39 -0700 (PDT) From: Thomas Monjalon To: Stephen Hemminger Date: Thu, 09 Jul 2015 01:51:34 +0200 Message-ID: <2920494.EFcdHfRdpu@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <1429637564-5656-4-git-send-email-stephen@networkplumber.org> References: <1429637564-5656-1-git-send-email-stephen@networkplumber.org> <1429637564-5656-4-git-send-email-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org, alexmay@microsoft.com Subject: Re: [dpdk-dev] [PATCH v4 3/7] hv: add basic vmbus support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2015 23:52:40 -0000 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.