From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Ziye Yang <ziye.yang@intel.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH] pci: Add the class_id support in pci probe
Date: Thu, 19 May 2016 12:33:47 +0200 [thread overview]
Message-ID: <1727235.C3RSOGSy8E@xps13> (raw)
In-Reply-To: <1462946895-49958-1-git-send-email-ziye.yang@intel.com>
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 <ziye.yang@intel.com>
> ---
> 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?
next prev parent reply other threads:[~2016-05-19 10:33 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-11 6:08 [PATCH] pci: Add the class_id support in pci probe Ziye Yang
2016-05-11 15:21 ` Stephen Hemminger
2016-05-11 15:34 ` Richardson, Bruce
2016-05-19 10:33 ` Thomas Monjalon [this message]
2016-05-19 12:18 ` Yang, Ziye
2016-05-19 12:57 ` Thomas Monjalon
2016-05-19 13:14 ` Yang, Ziye
2016-05-19 12:25 ` [PATCH v2] ci: " Ziye Yang
2016-05-19 13:17 ` [PATCH v3] " Ziye Yang
2016-05-24 9:29 ` Thomas Monjalon
2016-05-24 12:50 ` [PATCH v4] Pci: Add the class_id support Ziye Yang
2016-06-14 14:52 ` Thomas Monjalon
2016-07-06 11:08 ` Ferruh Yigit
2016-07-07 7:46 ` Thomas Monjalon
-- strict thread matches above, loose matches on Subject: below --
2015-12-29 2:53 [PATCH] pci: Add the class_id support in pci probe Ziye Yang
2015-12-31 17:12 ` Stephen Hemminger
2016-01-13 11:55 ` Bruce Richardson
2016-01-13 12:22 ` Panu Matilainen
2016-01-28 21:38 ` Thomas Monjalon
2016-01-29 9:21 ` Panu Matilainen
2016-01-29 9:34 ` Thomas Monjalon
2016-01-29 10:10 ` Panu Matilainen
2016-01-29 12:47 ` Panu Matilainen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1727235.C3RSOGSy8E@xps13 \
--to=thomas.monjalon@6wind.com \
--cc=dev@dpdk.org \
--cc=ziye.yang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.