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 8CB5758EC for ; Wed, 26 Oct 2016 13:22:28 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP; 26 Oct 2016 04:22:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,550,1473145200"; d="scan'208";a="23897841" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by orsmga005.jf.intel.com with ESMTP; 26 Oct 2016 04:22:26 -0700 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.233]) by IRSMSX151.ger.corp.intel.com ([169.254.4.28]) with mapi id 14.03.0248.002; Wed, 26 Oct 2016 12:22:26 +0100 From: "Zhang, Roy Fan" To: "Pattan, Reshma" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] pdump: revert PCI device name conversion Thread-Index: AQHSLt1VlbdtH1bUK0qh0KUG8mqigaC6mFSg Date: Wed, 26 Oct 2016 11:22:24 +0000 Message-ID: <9F7182E3F746AB4EA17801C148F3C60409E15CB7@IRSMSX101.ger.corp.intel.com> References: <1477413098-3121-1-git-send-email-reshma.pattan@intel.com> In-Reply-To: <1477413098-3121-1-git-send-email-reshma.pattan@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODI1ZjNlNjktZjljNy00ZTIxLWEwYzUtYzc2OTk1MDZlYTFkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkRQWm5KblZUdDlzYnUwNHhWdUt3M3dMcVZkdUFGQTFhYkFOdnBzNGt2VTQ9In0= x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] pdump: revert PCI device name conversion 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 11:22:29 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Reshma Pattan > Sent: Tuesday, October 25, 2016 5:32 PM > To: dev@dpdk.org > Cc: Pattan, Reshma > Subject: [dpdk-dev] [PATCH] pdump: revert PCI device name conversion >=20 > Earlier ethdev library created the device names in the "bus:device.func" > format hence pdump library implemented its own conversion method for > changing the user passed device name format "domain:bus:device.func" to > "bus:device.func" > for finding the port id using device name using ethdev library calls. Now= after > ethdev and eal rework http://dpdk.org/dev/patchwork/patch/15855/, > the device names are created in the format "domain:bus:device.func", so > pdump library conversion is not needed any more, hence removed the > corresponding code. >=20 > Signed-off-by: Reshma Pattan > --- > lib/librte_pdump/rte_pdump.c | 37 ++----------------------------------- > 1 file changed, 2 insertions(+), 35 deletions(-) >=20 > diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c > index ea5ccd9..504a1ce 100644 > --- a/lib/librte_pdump/rte_pdump.c > +++ b/lib/librte_pdump/rte_pdump.c > @@ -226,29 +226,6 @@ pdump_tx(uint8_t port __rte_unused, uint16_t qidx > __rte_unused, } >=20 > static int > -pdump_get_dombdf(char *device_id, char *domBDF, size_t len) -{ > - int ret; > - struct rte_pci_addr dev_addr =3D {0}; > - > - /* identify if device_id is pci address or name */ > - ret =3D eal_parse_pci_DomBDF(device_id, &dev_addr); > - if (ret < 0) > - return -1; > - > - if (dev_addr.domain) > - ret =3D snprintf(domBDF, len, "%u:%u:%u.%u", > dev_addr.domain, > - dev_addr.bus, dev_addr.devid, > - dev_addr.function); > - else > - ret =3D snprintf(domBDF, len, "%u:%u.%u", dev_addr.bus, > - dev_addr.devid, > - dev_addr.function); > - > - return ret; > -} > - > -static int > pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue= , > struct rte_ring *ring, struct rte_mempool > *mp, > uint16_t operation) > @@ -885,7 +862,6 @@ rte_pdump_enable_by_deviceid(char *device_id, > uint16_t queue, > void *filter) > { > int ret =3D 0; > - char domBDF[DEVICE_ID_SIZE]; >=20 > ret =3D pdump_validate_ring_mp(ring, mp); > if (ret < 0) > @@ -894,11 +870,7 @@ rte_pdump_enable_by_deviceid(char *device_id, > uint16_t queue, > if (ret < 0) > return ret; >=20 > - if (pdump_get_dombdf(device_id, domBDF, sizeof(domBDF)) > 0) > - ret =3D pdump_prepare_client_request(domBDF, queue, flags, > - ENABLE, ring, mp, filter); > - else > - ret =3D pdump_prepare_client_request(device_id, queue, > flags, > + ret =3D pdump_prepare_client_request(device_id, queue, flags, > ENABLE, ring, mp, filter); >=20 > return ret; > @@ -928,17 +900,12 @@ rte_pdump_disable_by_deviceid(char *device_id, > uint16_t queue, > uint32_t flags) > { > int ret =3D 0; > - char domBDF[DEVICE_ID_SIZE]; >=20 > ret =3D pdump_validate_flags(flags); > if (ret < 0) > return ret; >=20 > - if (pdump_get_dombdf(device_id, domBDF, sizeof(domBDF)) > 0) > - ret =3D pdump_prepare_client_request(domBDF, queue, flags, > - DISABLE, NULL, NULL, NULL); > - else > - ret =3D pdump_prepare_client_request(device_id, queue, > flags, > + ret =3D pdump_prepare_client_request(device_id, queue, flags, > DISABLE, NULL, NULL, NULL); >=20 > return ret; > -- > 2.7.4 Acked-by: Fan Zhang