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 3B9916CB3 for ; Wed, 26 Oct 2016 11:12:11 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 26 Oct 2016 02:12:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,550,1473145200"; d="scan'208";a="1050357871" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by orsmga001.jf.intel.com with ESMTP; 26 Oct 2016 02:12:09 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.122]) by IRSMSX152.ger.corp.intel.com ([169.254.6.24]) with mapi id 14.03.0248.002; Wed, 26 Oct 2016 10:12:08 +0100 From: "Pattan, Reshma" To: Shreyansh Jain Thread-Topic: [PATCH v10 11/25] eal/pci: helpers for device name parsing/update Thread-Index: AQHSL1FHqe3e8Bj9rUK88UUtUeBmfqC6ct9A Date: Wed, 26 Oct 2016 09:12:06 +0000 Message-ID: <3AEA2BF9852C6F48A459DA490692831F010BE6C7@IRSMSX109.ger.corp.intel.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> <1474000200-16705-12-git-send-email-shreyansh.jain@nxp.com> <3AEA2BF9852C6F48A459DA490692831F010BD36E@IRSMSX109.ger.corp.intel.com> <39622c65-4cbd-4841-541f-8673e1935036@nxp.com> In-Reply-To: <39622c65-4cbd-4841-541f-8673e1935036@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2I1N2RiZTktZDUzZC00YjU0LWI5OTEtMmMwYjU5ZDgxZGNiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Inh4ZUxjRGpMbjdnRUhcL0NIUG1uTlZ6YlIyMERRWGUycm9LSnBoMkx6QkVRPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" , Thomas Monjalon , "viktorin@rehivetech.com" Subject: Re: [dpdk-dev] [PATCH v10 11/25] eal/pci: helpers for device name parsing/update 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, 26 Oct 2016 09:12:11 -0000 Hi, > -----Original Message----- > From: Shreyansh Jain [mailto:shreyansh.jain@nxp.com] > Sent: Wednesday, October 26, 2016 7:23 AM > To: Pattan, Reshma > Cc: dev@dpdk.org; viktorin@rehivetech.com; David Marchand > ; hemant.agrawal@nxp.com; Thomas Monjalon > > Subject: Re: [PATCH v10 11/25] eal/pci: helpers for device name parsing/u= pdate >=20 > Hello Reshma, >=20 > On Tuesday 25 October 2016 09:19 PM, Pattan, Reshma wrote: > > Hi Shreyansh, > > > >> -----Original Message----- > >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shreyansh Jain > >> Sent: Friday, September 16, 2016 5:30 AM > >> To: dev@dpdk.org > >> Cc: viktorin@rehivetech.com; David Marchand > >> ; hemant.agrawal@nxp.com; Thomas > Monjalon > >> ; Shreyansh Jain > >> Subject: [dpdk-dev] [PATCH v10 11/25] eal/pci: helpers for device > >> name parsing/update > >> > >> From: David Marchand > >> > >> - Move rte_eth_dev_create_unique_device_name() from ether/rte_ethdev.c > to > >> common/include/rte_pci.h as rte_eal_pci_device_name(). Being a commo= n > >> method, can be used across crypto/net PCI PMDs. > >> - Remove crypto specific routine and fallback to common name function. > >> - Introduce a eal private Update function for PCI device naming. > >> > >> Signed-off-by: David Marchand > >> [Shreyansh: Merge crypto/pci helper patches] > >> Signed-off-by: Shreyansh Jain > >> --- > >> lib/librte_cryptodev/rte_cryptodev.c | 27 +++--------------- > >> lib/librte_eal/bsdapp/eal/eal_pci.c | 49 > >> +++++++++++++++++++++++++++++++++ > >> lib/librte_eal/common/eal_private.h | 13 +++++++++ > >> lib/librte_eal/common/include/rte_pci.h | 24 ++++++++++++++++ > >> lib/librte_eal/linuxapp/eal/eal_pci.c | 13 +++++++++ > >> lib/librte_ether/rte_ethdev.c | 24 +++------------- > >> 6 files changed, 107 insertions(+), 43 deletions(-) > >> > >> diff --git a/lib/librte_cryptodev/rte_cryptodev.c > >> b/lib/librte_cryptodev/rte_cryptodev.c > >> index 2a3b649..c81e366 100644 > >> --- a/lib/librte_cryptodev/rte_cryptodev.c > >> +++ b/lib/librte_cryptodev/rte_cryptodev.c > >> @@ -365,23 +365,6 @@ rte_cryptodev_pmd_allocate(const char *name, int > >> socket_id) > >> return cryptodev; > >> } > >> > >> * > >> * This function is private to EAL. > >> diff --git a/lib/librte_eal/common/include/rte_pci.h > >> b/lib/librte_eal/common/include/rte_pci.h > >> index cf81898..e1f695f 100644 > >> --- a/lib/librte_eal/common/include/rte_pci.h > >> +++ b/lib/librte_eal/common/include/rte_pci.h > >> @@ -82,6 +82,7 @@ extern "C" { > >> /** Formatting string for PCI device identifier: Ex: 0000:00:01.0 */ > >> #define PCI_PRI_FMT "%.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 > >> +#define PCI_PRI_STR_SIZE sizeof("XXXX:XX:XX.X") > >> > >> /** Short formatting string, without domain, for PCI device: Ex: > >> 00:01.0 */ #define PCI_SHORT_PRI_FMT "%.2" PRIx8 ":%.2" PRIx8 ".%" > >> PRIx8 @@ -308,6 > >> > >> +static inline void > >> +rte_eal_pci_device_name(const struct rte_pci_addr *addr, > >> + char *output, size_t size) > >> +{ > >> + RTE_VERIFY(size >=3D PCI_PRI_STR_SIZE); > >> + RTE_VERIFY(snprintf(output, size, PCI_PRI_FMT, > >> + addr->domain, addr->bus, > >> + addr->devid, addr->function) >=3D 0); } > >> + > >> > >> +int > >> +pci_update_device(const struct rte_pci_addr *addr) { > >> + char filename[PATH_MAX]; > >> + > >> + snprintf(filename, sizeof(filename), "%s/" PCI_PRI_FMT, > >> + pci_get_sysfs_path(), addr->domain, addr->bus, addr->devid, > >> + addr->function); > >> + > >> + return pci_scan_one(filename, addr->domain, addr->bus, addr->devid, > >> + addr->function); > >> +} > >> + > > > > > > Earlier device names were created in the format "bus:deviceid.function"= as per > the below ethdev API. > > Now after above new eal API the name format is "domain:bus:deviceid.fun= c" > was that intentional and why is that so. >=20 > Yes, this is intentional. > It is to bring the naming in sync with the device name being used for sca= nning on > the bus (/sys/bus/pci/devices/AAAA:BB:CC.D/). Fair enough and thanks for clarification. Thanks, Reshma