From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 1ADF99A98 for ; Thu, 19 May 2016 14:18:23 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 19 May 2016 05:18:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,334,1459839600"; d="scan'208";a="106823539" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 19 May 2016 05:18:22 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 19 May 2016 05:18:22 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 19 May 2016 05:18:22 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.104]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.58]) with mapi id 14.03.0248.002; Thu, 19 May 2016 20:18:21 +0800 From: "Yang, Ziye" To: Thomas Monjalon CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] pci: Add the class_id support in pci probe Thread-Index: AQHRsbn5usy/YtXBNEyKW1iPokucdJ/ALTtA Date: Thu, 19 May 2016 12:18:19 +0000 Message-ID: References: <1462946895-49958-1-git-send-email-ziye.yang@intel.com> <1727235.C3RSOGSy8E@xps13> In-Reply-To: <1727235.C3RSOGSy8E@xps13> Accept-Language: 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 Subject: Re: [dpdk-dev] [PATCH] pci: Add the class_id support in pci probe 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 May 2016 12:18:24 -0000 -----Original Message----- From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]=20 Sent: Thursday, May 19, 2016 6:34 PM To: Yang, Ziye Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] pci: Add the class_id support in pci probe 2016-05-11 14:08, Ziye Yang: > This patch is used to add the class_id (class_code, subclass_code,=20 > programming_interface) support for pci_device probe. With this patch,=20 > it will be flexible for users to probe a class of devices by class_id. >=20 > Signed-off-by: Ziye Yang > --- > lib/librte_eal/bsdapp/eal/eal_pci.c | 4 ++++ > lib/librte_eal/common/eal_common_pci.c | 3 +++ =20 > lib/librte_eal/common/include/rte_pci.h | 8 ++++++-- > lib/librte_eal/linuxapp/eal/eal_pci.c | 9 +++++++++ > 4 files changed, 22 insertions(+), 2 deletions(-) Please remove the deprecation notice. > --- a/lib/librte_eal/common/include/rte_pci.h > +++ b/lib/librte_eal/common/include/rte_pci.h > @@ -129,6 +129,7 @@ struct rte_pci_id { > uint16_t device_id; /**< Device ID or PCI_ANY_ID. */ > uint16_t subsystem_vendor_id; /**< Subsystem vendor ID or PCI_ANY_ID. *= / > uint16_t subsystem_device_id; /**< Subsystem device ID or=20 > PCI_ANY_ID. */ > + uint32_t class_id; /**< Class ID (class, subclass, pi) or CLA= SS_ANY_ID. */ > }; A space is missing. It would be more logical to put the class_id at the beginning of the struct= . > /** Any PCI device identifier (vendor, device, ...) */ #define=20 > PCI_ANY_ID (0xffff) > +#define CLASS_ANY_ID (0xffffff) These constants should be prefixed with RTE_. [Ziye] suggest for doing another patch to change PCI_ANY_ID to RTE_PCI_ANY_= ID since it will affect=20 Other files. > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c > + /* get class_id */ > + snprintf(filename, sizeof(filename), "%s/class", > + dirname); > + if (eal_parse_sysfs_value(filename, &tmp) < 0) { > + free(dev); > + return -1; > + } > + dev->id.class_id =3D (uint32_t)tmp && CLASS_ANY_ID; Should be a bitwise &. Why masking is needed? [Ziye] Only 24bit info is needed.