From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id B31EB37A4 for ; Thu, 26 Mar 2015 11:04:02 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 26 Mar 2015 03:03:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,470,1422950400"; d="scan'208";a="670872920" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by orsmga001.jf.intel.com with ESMTP; 26 Mar 2015 03:03:46 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.49]) by IRSMSX153.ger.corp.intel.com ([169.254.9.161]) with mapi id 14.03.0224.002; Thu, 26 Mar 2015 10:03:45 +0000 From: "Iremonger, Bernard" To: Tetsuya Mukawa , Stephen Hemminger Thread-Topic: [dpdk-dev] [PATCH v2 2/6] eal: Close file descriptor of uio configuration Thread-Index: AQHQZmETgyAz6Aa+J0qq2TZvDZ8h5Z0sh7QAgAAe1ACAAYStAIAAW1ig Date: Thu, 26 Mar 2015 10:03:45 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C204A02764@IRSMSX108.ger.corp.intel.com> References: <1426584645-28828-7-git-send-email-mukawa@igel.co.jp> <1427170717-13879-1-git-send-email-mukawa@igel.co.jp> <1427170717-13879-3-git-send-email-mukawa@igel.co.jp> <20150324113321.789c96a1@urahara> <551228CC.3000507@igel.co.jp> <20150324220752.45b4ca0e@urahara> <551388B4.5000905@igel.co.jp> In-Reply-To: <551388B4.5000905@igel.co.jp> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] 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 v2 2/6] eal: Close file descriptor of uio configuration 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, 26 Mar 2015 10:04:03 -0000 > -----Original Message----- > From: Tetsuya Mukawa [mailto:mukawa@igel.co.jp] > Sent: Thursday, March 26, 2015 4:19 AM > To: Stephen Hemminger > Cc: Iremonger, Bernard; david.marchand@6wind.com; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2 2/6] eal: Close file descriptor of uio = configuration >=20 > On 2015/03/25 14:07, Stephen Hemminger wrote: > > On Wed, 25 Mar 2015 12:17:32 +0900 > > Tetsuya Mukawa wrote: > > > >> On 2015/03/25 3:33, Stephen Hemminger wrote: > >>> On Tue, 24 Mar 2015 13:18:33 +0900 > >>> Tetsuya Mukawa wrote: > >>> > >>>> When pci_uio_unmap_resource() is called, a file descriptor that is > >>>> used for uio configuration should be closed. > >>>> > >>>> Signed-off-by: Tetsuya Mukawa > >>>> --- > >>>> lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 6 +++++- > >>>> 1 file changed, 5 insertions(+), 1 deletion(-) > >>>> > >>>> diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > >>>> b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > >>>> index 9cdf24f..f0277be 100644 > >>>> --- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > >>>> +++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > >>>> @@ -459,8 +459,12 @@ pci_uio_unmap_resource(struct rte_pci_device > >>>> *dev) > >>>> > >>>> /* close fd if in primary process */ > >>>> close(dev->intr_handle.fd); > >>>> - > >>>> dev->intr_handle.fd =3D -1; > >>>> + > >>>> + /* close cfg_fd if in primary process */ > >>>> + close(dev->intr_handle.uio_cfg_fd); > >>>> + dev->intr_handle.uio_cfg_fd =3D -1; > >>>> + > >>>> dev->intr_handle.type =3D RTE_INTR_HANDLE_UNKNOWN; } #endif /* > >>>> RTE_LIBRTE_EAL_HOTPLUG */ > >>> For the Qlogic/Broadcom driver it needed the config fd handle, and I > >>> added generic config space access functions. > >> Hi Stephen, > >> > >> Is this the patch you mentioned? > >> http://dpdk.org/dev/patchwork/patch/3024/ > >> > >> > >> Hi David, Bernard, Stephen > >> > >> I guess here are works we will need to do. > >> 1. Add close(dev->config_fd) in Stephen's patch. > >> 2. Write a patch for uio to merge "dev->intr_handle->uio_cfg_fd" and > >> "dev->config_fd". > >> 3. Write a patch for vfio to merge "dev->intr_handle->vfio_cfg_fd" > >> and "dev->config_fd". > >> > >> If we already have these patches, I guess it may be nice to merge > >> above patches first. > >> Do you have a suggestion how to merge patches related with pci config = fd? > >> > >> Thanks, > >> Tetsuya > >> > > Yeah, that is the patch. It reopens config fd, it seems to overlap > > this. >=20 > Hi Stephen, David, Bernard, >=20 > If you are OK, I will cherry pick below Stephen's patch, then put it on t= op of my patches. > - http://dpdk.org/dev/patchwork/patch/3024/ >=20 > Also I will write patches to merge following fds. > - dev->config_fd > - dev->intr_handle->uio_cfg_fd > - dev->intr_handle->vfio_cfg_fd >=20 > Is this direction OK? >=20 >=20 > Stephen, >=20 > For uio, I guess it will be OK that I just replace pread/pwrite by your A= PIs. > But for vfio, I need to write a function to wrap vfio ioctl. > May be rte_eal_pci_ioctl_config()? > And replace all vfio ioctls by the function. > Is this correct way to adopt your APIs for vfio? >=20 > Regards, > Tetsuya Hi Tetsuya, It would be better not to broaden the scope of the BSD cleanup patch set at= this point. It would be better to have a separate patch set to apply Stephen's changes= to the BSD code base. Also, discussion is still ongoing on Stephen's changes so it might be bette= r to wait until the discussion is completed. Regards, Bernard.