From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 06A2F9614 for ; Thu, 19 May 2016 12:33:55 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id r12so73640071wme.0 for ; Thu, 19 May 2016 03:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=zss8f/zRdyaJPUTOXB84U7cPBLbWjPj409X4r3BTlHE=; b=rTFRVe/bdDJc+sjOc9OIlVj/55N9ZdDdEsTQkK0BOA4cuEx1+SFMIpH37MXOhGPwzM U32YsGqK8DmQ1wFjg8MTSdvTfM0fUf0RdS2yAfqDJg/+uSMyn3WqNCbKislIYv0bQSFz AzMAG/fdtDtENJ2cJii4uCQSpIxKkMckhsNFEdvU1NQ6UJW6stdLUhDW7yp8ljyWWwPd ZWf64nTiiBHdOAsoRdw8eHO0T1Q0KvfdZlJ9qwD41s4pSWiPEQ00v8GFlScup9kMEmdR 4E6tVHM+iu70gIAiT5y/tBYRkCb6B5Umd5Y0jrlHEYua+mPjfslE+MgzjPFLa1Xv7BZC qpFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=zss8f/zRdyaJPUTOXB84U7cPBLbWjPj409X4r3BTlHE=; b=da+byZbch2/mDj5OKSKEI90yRNlDZPx+3jTaJSTcZ2WSXlieapCJCGhRIkVUHUFTD+ kOioCcQVXRvFC/9X0KwKTCIk7gTM/iMRWihWXH8Jtjj92IKPsAQSiXOZ+7+QmznD2qfY ya/AVJx4ya88GIVq/mAYqradkBGwT9U9oe40wDyAgnhRMbmVX6j+RjaUhwDpfkepPVfg V+Qu6uI/CC8HUyEOHdHWpZO6gtzaj0e3+/H+qsdUdWfr3wixcaBe/xhoUe4LEEA6lcSL INPp0XoxyMd9JRDHduTiHcmeCP1f8N1m22w3nIMk793Jnh0nUfMdORXgEwKBT1eq+2WO JDgA== X-Gm-Message-State: AOPr4FXBqtG3d7Ek+2XWRX0dWoiXuvaug4TikolwnC38mUDmWujv9mdmhq2NjZEsoBDAuTnt X-Received: by 10.195.11.106 with SMTP id eh10mr14348407wjd.130.1463654034795; Thu, 19 May 2016 03:33:54 -0700 (PDT) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id k1sm13636557wjx.22.2016.05.19.03.33.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 May 2016 03:33:54 -0700 (PDT) From: Thomas Monjalon To: Ziye Yang Cc: dev@dpdk.org Date: Thu, 19 May 2016 12:33:47 +0200 Message-ID: <1727235.C3RSOGSy8E@xps13> User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1462946895-49958-1-git-send-email-ziye.yang@intel.com> References: <1462946895-49958-1-git-send-email-ziye.yang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 10:33:55 -0000 2016-05-11 14:08, Ziye Yang: > This patch is used to add the class_id (class_code, > subclass_code, programming_interface) support for > pci_device probe. With this patch, it will be > flexible for users to probe a class of devices > by class_id. > > Signed-off-by: Ziye Yang > --- > lib/librte_eal/bsdapp/eal/eal_pci.c | 4 ++++ > lib/librte_eal/common/eal_common_pci.c | 3 +++ > 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 PCI_ANY_ID. */ > + uint32_t class_id; /**< Class ID (class, subclass, pi) or CLASS_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 PCI_ANY_ID (0xffff) > +#define CLASS_ANY_ID (0xffffff) These constants should be prefixed with RTE_. > --- 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 = (uint32_t)tmp && CLASS_ANY_ID; Should be a bitwise &. Why masking is needed?