From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id DD997B5C4 for ; Thu, 19 Feb 2015 16:48:13 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 19 Feb 2015 07:48:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,609,1418112000"; d="scan'208";a="680396089" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by fmsmga002.fm.intel.com with ESMTP; 19 Feb 2015 07:48:11 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 19 Feb 2015 23:48:10 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.161]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.197]) with mapi id 14.03.0195.001; Thu, 19 Feb 2015 23:48:02 +0800 From: "Zhou, Danny" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v1 1/3] eal: enable uio_pci_generic support Thread-Index: AQHQS4ByRGnrucq3okCbOBitjY0c9Zz4EXsw Date: Thu, 19 Feb 2015 15:48:02 +0000 Message-ID: References: <1422523699-17181-1-git-send-email-danny.zhou@intel.com> <1422523699-17181-2-git-send-email-danny.zhou@intel.com> <22608095.lA2lToQDvY@xps13> In-Reply-To: <22608095.lA2lToQDvY@xps13> Accept-Language: zh-CN, 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 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v1 1/3] eal: enable uio_pci_generic 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: Thu, 19 Feb 2015 15:48:14 -0000 Thomas, thanks for review and I added comments inline. > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Wednesday, February 18, 2015 9:40 PM > To: Zhou, Danny > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v1 1/3] eal: enable uio_pci_generic suppor= t >=20 > Hi Danny, >=20 > I wanted to apply this patchset which was reviewed. But when having a qui= ck > overview, I've seen some strange additions. >=20 > 2015-01-29 17:28, Danny Zhou: > > 1) Unify procedure to retrieve BAR resource mapping information. > > 2) Setup bus master bit in NIC's PCIe configuration space for uio_pci_g= eneric. > > > > Signed-off-by: Danny Zhou > > Tested-by: Qun Wan > [...] > > --- a/lib/librte_eal/common/include/rte_pci.h > > +++ b/lib/librte_eal/common/include/rte_pci.h > > @@ -148,6 +148,7 @@ struct rte_pci_device { > > struct rte_pci_id id; /**< PCI ID. */ > > struct rte_pci_resource mem_resource[PCI_MAX_RESOURCE]; /**< PCI Me= mory Resource */ > > struct rte_intr_handle intr_handle; /**< Interrupt handle */ > > + char driver_name[BUFSIZ]; /**< driver name */ >=20 > Why not embedding this field in driver struct? > The name and comment should be more precise. > There is also driver->name and hotplug patchset is adding a kernel driver= name. > Please bring the light in all these driver names :) >=20 This driver_name is the name of kernel driver(e.g. vfio_pci, igb_uio, uio_p= ci_generic) while the driver->name is a user-defined name for user space driver. I am going to change it to kerne= l_driver_name with precise comment in V2 patch, and when the V2 patch is applied, I think the function pci_get_kerne= l_driver_by_path() in hotplug patchset is not=20 necessary then as it could directly retrieve the kernel driver name from th= is variable. > > const struct rte_pci_driver *driver; /**< Associated driver */ > [...] > > --- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > > +#define IORESOURCE_MEM 0x00000200 >=20 > Please comment this value. Will do. >=20 > > --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h > > +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h > > @@ -50,8 +50,14 @@ enum rte_intr_handle_type { > > > > /** Handle for interrupts. */ > > struct rte_intr_handle { > > - int vfio_dev_fd; /**< VFIO device file descriptor */ > > - int fd; /**< file descriptor */ > > + union { > > + int vfio_dev_fd; /**< VFIO device file descriptor */ > > + }; > > + union { > > + int uio_cfg_fd; /**< UIO config file descriptor > > + for uio_pci_generic */ > > + }; >=20 > Apart the indent, it seems there is a mistake here. > Why 2 unions with 1 field each? It is a mistake I made during code merge, will fix it in V2. >=20 > > + int fd; /**< interrupt event file descriptor */ > > enum rte_intr_handle_type type; /**< handle type */ > > };