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 A01443DC for ; Mon, 26 Jun 2017 06:29:07 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jun 2017 21:29:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,393,1493708400"; d="scan'208";a="1186914032" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 25 Jun 2017 21:29:06 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 25 Jun 2017 21:29:06 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 25 Jun 2017 21:29:05 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by shsmsx102.ccr.corp.intel.com ([169.254.2.146]) with mapi id 14.03.0319.002; Mon, 26 Jun 2017 12:29:03 +0800 From: "Chang, Cunyin" To: Stephen Hemminger CC: "dev@dpdk.org" , Stephen Hemminger Thread-Topic: [dpdk-dev] [PATCH 2/3] eal: PCI domain should be 32 bits Thread-Index: AQHS6qyWZKTqhZpoWUeorTUcdVX5Z6Iwlx/Q///sRACAAQv+gIAAprOAgARdyFA= Date: Mon, 26 Jun 2017 04:29:02 +0000 Message-ID: <2BFA8F2383C3784C90698C10BC0963195EEF003D@SHSMSX103.ccr.corp.intel.com> References: <20170621163545.25713-1-stephen@networkplumber.org> <20170621163545.25713-3-stephen@networkplumber.org> <2BFA8F2383C3784C90698C10BC0963195EEEF678@SHSMSX103.ccr.corp.intel.com> <20170622085134.598451d3@xeon-e3> <2BFA8F2383C3784C90698C10BC0963195EEEF974@SHSMSX103.ccr.corp.intel.com> <20170623104723.52069936@xeon-e3> In-Reply-To: <20170623104723.52069936@xeon-e3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDdlNjE1NGUtYzIwNi00Y2E4LWIwZTktOGM4OGZhZjEwZWY0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ikx1K1ozUnVrT2lqSlhBSlluaXpVS0FxM3FVZkhJRWZtVWUzQzNcL2hmTHBNPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action 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 2/3] eal: PCI domain should be 32 bits X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jun 2017 04:29:08 -0000 > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Saturday, June 24, 2017 1:47 AM > To: Chang, Cunyin > Cc: dev@dpdk.org; Stephen Hemminger > Subject: Re: [dpdk-dev] [PATCH 2/3] eal: PCI domain should be 32 bits >=20 > On Fri, 23 Jun 2017 00:41:43 +0000 > "Chang, Cunyin" wrote: >=20 > > > -----Original Message----- > > > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > > > Sent: Thursday, June 22, 2017 11:52 PM > > > To: Chang, Cunyin > > > Cc: dev@dpdk.org; Stephen Hemminger > > > Subject: Re: [dpdk-dev] [PATCH 2/3] eal: PCI domain should be 32 > > > bits > > > > > > On Thu, 22 Jun 2017 09:28:31 +0000 > > > "Chang, Cunyin" wrote: > > > > > > > I think the series patches does not cover all area which need to > > > > adapt to u32 PCI domain, We still need some other work to do: > > > > we need define another macro such as PCI_PRI_FMT. Something like: > > > > #define PCI_XXX_PRI_FMT "%.5" PRIx32 ":%.2" PRIx8 ":%.2" PRIx8 ".%" > > > > PRIx8 > > > > > > > > PCI_PRI_STR_SIZE also need to be modified: > > > > #define PCI_PRI_STR_SIZE sizeof("XXXXX:XX:XX.X") > > > > > > > > The macro PCI_PRI_FMT will not works if The domain exceed 16bits. > > > > It will impact the following functions: > > > > 1 RTE_LOG function, there a lots of RTE_LOG such as: > > > > RTE_LOG(WARNING, EAL, > > > > "Requested device " PCI_PRI_FMT " cannot be > > > used\n", > > > > addr->domain, addr->bus, addr->devid, addr- > function); > > > > 2 pci_dump_one_device(). > > > > 3 rte_eal_pci_device_name() > > > > 4 pci_update_device() > > > > 5 pci_ioport_map() > > > > 6 pci_get_uio_dev() > > > > 7 pci_uio_map_resource_by_index() > > > > 8 pci_uio_ioport_map() > > > > 9 pci_vfio_map_resource() > > > > 10 pci_vfio_unmap_resource() > > > > All the above functions will related with the macro PCI_PRI_FMT, > > > >so I think > > > they need to be modified too. > > > > > > > > There are some other code need modify: > > > > In function rte_eal_compare_pci_addr(), we need do the following > work: > > > > dev_addr =3D ((uint64_t)addr->domain << 24) | ((uint64_t)addr->bus = << > 16) | > > > > ((uint64_t)addr->devid << 8) | > > > (uint64_t)addr->function; > > > > dev_addr2 =3D ((uint64_t)addr2->domain << 24) | > > > > ((uint64_t)addr2->bus << > > > 16) | > > > > ((uint64_t)addr2->devid << 8) | > > > (uint64_t)addr2->function; > > > > > > > > In function eal_parse_pci_BDF(), we need do the following work: > > > > GET_PCIADDR_FIELD(input, dev_addr->domain, UINT32_MAX, ':'); > > > > > > Good catch, the string size must be increased. > > > > > > It turns out that you don't need to change the PCI print format. > > > Printing the domain with %.4x works correctly with 32 bit. It just > > > gets wider. This is how pciutils works, so no change is necessary the= re. > > > > I suppose we should use %4x, not %.4x?, the %.4x will cut the > 10000:05:00.0 as 0000:05:00.0. > > So the macro: > > #define PCI_PRI_FMT "%.4" PRIx32 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 > > Should be: > > #define PCI_PRI_FMT "%4" PRIx32 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 > > > > Make sense? >=20 > No, that format would not be correct. I want to keep the visible output t= he > same for the normal case of 16 bit domains. Output of printf test progra= m > shows that %.4x is the correct format to use. >=20 > Domain %4x %.4x %4.4x > 0 0 0000 0000 > 0x1 1 0001 0001 > 0x1000 1000 1000 1000 > 0x10000 10000 10000 10000 > 0x12345678 12345678 12345678 12345678 > 0xdeadbeef deadbeef deadbeef deadbeef >=20 Looks good. No more questions about this.