From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6F54611A2 for ; Tue, 20 Oct 2015 11:18:46 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 20 Oct 2015 02:18:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,706,1437462000"; d="scan'208";a="667888489" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 20 Oct 2015 02:18:45 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 20 Oct 2015 02:18:44 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 20 Oct 2015 02:18:44 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.204]) with mapi id 14.03.0248.002; Tue, 20 Oct 2015 17:18:42 +0800 From: "Qiu, Michael" To: "Iremonger, Bernard" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 02/20] librte_ether: add fields from rte_pci_driver to rte_eth_dev_data Thread-Index: AQHRBQq/JnZfMGu1sk2SrOtL3+5lwA== Date: Tue, 20 Oct 2015 09:18:41 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028621B4E24E@SHSMSX101.ccr.corp.intel.com> References: <1444667120-12891-1-git-send-email-bernard.iremonger@intel.com> <1444667120-12891-3-git-send-email-bernard.iremonger@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 02/20] librte_ether: add fields from rte_pci_driver to rte_eth_dev_data 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: Tue, 20 Oct 2015 09:18:47 -0000 On 2015/10/13 0:26, Bernard Iremonger wrote:=0A= > add dev_flags to rte_eth_dev_data, add macros for dev_flags.=0A= > add kdrv to rte_eth_dev_data.=0A= > add numa_node to rte_eth_dev_data.=0A= > add drv_name to rte_eth_dev_data.=0A= > use dev_type to distinguish between vdev's and pdev's.=0A= > remove pci_dev branches.=0A= >=0A= > Signed-off-by: Bernard Iremonger =0A= =0A= I have a question, if we only apply the patch set till here, does DPDK=0A= work fine?=0A= =0A= Thanks,=0A= Michael=0A= > ---=0A= > lib/librte_ether/rte_ethdev.c | 40 +++++++++++++++++--------------------= ---=0A= > lib/librte_ether/rte_ethdev.h | 15 +++++++++++++++=0A= > 2 files changed, 32 insertions(+), 23 deletions(-)=0A= >=0A= > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.= c=0A= > index f593f6e..4187595 100644=0A= > --- a/lib/librte_ether/rte_ethdev.c=0A= > +++ b/lib/librte_ether/rte_ethdev.c=0A= > @@ -424,7 +424,7 @@ rte_eth_dev_socket_id(uint8_t port_id)=0A= > {=0A= > if (!rte_eth_dev_is_valid_port(port_id))=0A= > return -1;=0A= > - return rte_eth_devices[port_id].pci_dev->numa_node;=0A= > + return rte_eth_devices[port_id].data->numa_node;=0A= > }=0A= > =0A= > uint8_t=0A= > @@ -503,27 +503,25 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char = *name)=0A= > static int=0A= > rte_eth_dev_is_detachable(uint8_t port_id)=0A= > {=0A= > - uint32_t drv_flags;=0A= > + uint32_t dev_flags;=0A= > =0A= > if (!rte_eth_dev_is_valid_port(port_id)) {=0A= > PMD_DEBUG_TRACE("Invalid port_id=3D%d\n", port_id);=0A= > return -EINVAL;=0A= > }=0A= > =0A= > - if (rte_eth_devices[port_id].dev_type =3D=3D RTE_ETH_DEV_PCI) {=0A= > - switch (rte_eth_devices[port_id].pci_dev->kdrv) {=0A= > - case RTE_KDRV_IGB_UIO:=0A= > - case RTE_KDRV_UIO_GENERIC:=0A= > - case RTE_KDRV_NIC_UIO:=0A= > - break;=0A= > - case RTE_KDRV_VFIO:=0A= > - default:=0A= > - return -ENOTSUP;=0A= > - }=0A= > + switch (rte_eth_devices[port_id].data->kdrv) {=0A= > + case RTE_KDRV_IGB_UIO:=0A= > + case RTE_KDRV_UIO_GENERIC:=0A= > + case RTE_KDRV_NIC_UIO:=0A= > + case RTE_KDRV_NONE:=0A= > + break;=0A= > + case RTE_KDRV_VFIO:=0A= > + default:=0A= > + return -ENOTSUP;=0A= > }=0A= > -=0A= > - drv_flags =3D rte_eth_devices[port_id].driver->pci_drv.drv_flags;=0A= > - return !(drv_flags & RTE_PCI_DRV_DETACHABLE);=0A= > + dev_flags =3D rte_eth_devices[port_id].data->dev_flags;=0A= > + return !(dev_flags & RTE_ETH_DEV_DETACHABLE);=0A= > }=0A= > =0A= > /* attach the new physical device, then store port_id of the device */= =0A= > @@ -1143,14 +1141,11 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t n= b_rx_q, uint16_t nb_tx_q,=0A= > * If link state interrupt is enabled, check that the=0A= > * device supports it.=0A= > */=0A= > - if (dev_conf->intr_conf.lsc =3D=3D 1) {=0A= > - const struct rte_pci_driver *pci_drv =3D &dev->driver->pci_drv;=0A= > -=0A= > - if (!(pci_drv->drv_flags & RTE_PCI_DRV_INTR_LSC)) {=0A= > + if ((dev_conf->intr_conf.lsc =3D=3D 1) &&=0A= > + (!(dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC))) {=0A= > PMD_DEBUG_TRACE("driver %s does not support lsc\n",=0A= > - pci_drv->name);=0A= > + dev->data->drv_name);=0A= > return -EINVAL;=0A= > - }=0A= > }=0A= > =0A= > /*=0A= > @@ -1795,8 +1790,7 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_et= h_dev_info *dev_info)=0A= > FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);=0A= > (*dev->dev_ops->dev_infos_get)(dev, dev_info);=0A= > dev_info->pci_dev =3D dev->pci_dev;=0A= > - if (dev->driver)=0A= > - dev_info->driver_name =3D dev->driver->pci_drv.name;=0A= > + dev_info->driver_name =3D dev->data->drv_name;=0A= > }=0A= > =0A= > void=0A= > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.= h=0A= > index 8a8c82b..d440bd6 100644=0A= > --- a/lib/librte_ether/rte_ethdev.h=0A= > +++ b/lib/librte_ether/rte_ethdev.h=0A= > @@ -1471,8 +1471,23 @@ struct rte_eth_dev_data {=0A= > all_multicast : 1, /**< RX all multicast mode ON(1) / OFF(0). */=0A= > dev_started : 1, /**< Device state: STARTED(1) / STOPPED(0). */=0A= > lro : 1; /**< RX LRO is ON(1) / OFF(0) */=0A= > + uint32_t dev_flags; /**< Flags controlling handling of device. */=0A= > + enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */=0A= > + int numa_node;=0A= > + const char *drv_name;=0A= > };=0A= > =0A= > +/** Device needs PCI BAR mapping (done with either IGB_UIO or VFIO) */= =0A= > +#define RTE_ETH_DEV_DRV_NEED_MAPPING RTE_PCI_DRV_NEED_MAPPING=0A= > +/** Device needs to be unbound even if no module is provided */=0A= > +#define RTE_ETH_DEV_DRV_FORCE_UNBIND RTE_PCI_DRV_FORCE_UNBIND=0A= > +/** Device supports link state interrupt */=0A= > +#define RTE_ETH_DEV_INTR_LSC RTE_PCI_DRV_INTR_LSC=0A= > +/** Device supports detaching capability */=0A= > +#define RTE_ETH_DEV_DETACHABLE RTE_PCI_DRV_DETACHABLE=0A= > +/** Device is a bonded device */=0A= > +#define RTE_ETH_DEV_BONDED 0x0020=0A= > +=0A= > /**=0A= > * @internal=0A= > * The pool of *rte_eth_dev* structures. The size of the pool=0A= =0A=