Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/12894/?format=api
https://patches.dpdk.org/api/patches/12894/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1463663877-52722-1-git-send-email-ziye.yang@intel.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1463663877-52722-1-git-send-email-ziye.yang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1463663877-52722-1-git-send-email-ziye.yang@intel.com", "date": "2016-05-19T13:17:57", "name": "[dpdk-dev,v3] ci: Add the class_id support in pci probe", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "641cce277b00cfc1fd47c78dfc4ab98d2efff35d", "submitter": { "id": 407, "url": "https://patches.dpdk.org/api/people/407/?format=api", "name": "Ziye Yang", "email": "ziye.yang@intel.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1463663877-52722-1-git-send-email-ziye.yang@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/12894/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/12894/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 004B19AE8;\n\tThu, 19 May 2016 15:18:09 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 54E119AD6\n\tfor <dev@dpdk.org>; Thu, 19 May 2016 15:18:08 +0200 (CEST)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga104.fm.intel.com with ESMTP; 19 May 2016 06:18:07 -0700", "from fxue-mobl1.ccr.corp.intel.com (HELO localhost.localdomain)\n\t([10.255.29.82])\n\tby orsmga002.jf.intel.com with ESMTP; 19 May 2016 06:18:04 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.26,334,1459839600\"; d=\"scan'208\";a=\"980436413\"", "From": "Ziye Yang <ziye.yang@intel.com>", "To": "dev@dpdk.org", "Date": "Thu, 19 May 2016 21:17:57 +0800", "Message-Id": "<1463663877-52722-1-git-send-email-ziye.yang@intel.com>", "X-Mailer": "git-send-email 1.9.3", "In-Reply-To": "<1463660700-42992-1-git-send-email-ziye.yang@intel.com>", "References": "<1463660700-42992-1-git-send-email-ziye.yang@intel.com>", "Subject": "[dpdk-dev] [PATCH v3] ci: 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 <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This patch is used to add the class_id (class_code,\nsubclass_code, programming_interface) support for\npci_device probe. With this patch, it will be\nflexible for users to probe a class of devices\nby class_id.\n\nSigned-off-by: Ziye Yang <ziye.yang@intel.com>\n---\n doc/guides/rel_notes/deprecation.rst | 6 ------\n lib/librte_eal/bsdapp/eal/eal_pci.c | 5 +++++\n lib/librte_eal/common/eal_common_pci.c | 3 +++\n lib/librte_eal/common/include/rte_pci.h | 8 ++++++--\n lib/librte_eal/linuxapp/eal/eal_pci.c | 10 ++++++++++\n 5 files changed, 24 insertions(+), 8 deletions(-)", "diff": "diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst\nindex 7d94ba5..28f9c61 100644\n--- a/doc/guides/rel_notes/deprecation.rst\n+++ b/doc/guides/rel_notes/deprecation.rst\n@@ -20,12 +20,6 @@ Deprecation Notices\n do not need to care about the kind of devices that are being used, making it\n easier to add new buses later.\n \n-* ABI changes are planned for struct rte_pci_id, i.e., add new field ``class``.\n- This new added ``class`` field can be used to probe pci device by class\n- related info. This change should impact size of struct rte_pci_id and struct\n- rte_pci_device. The release 16.04 does not contain these ABI changes, but\n- release 16.07 will.\n-\n * The xstats API and rte_eth_xstats struct will be changed to allow retrieval\n of values without any string copies or parsing.\n No backwards compatibility is planned, as it would require code duplication\ndiff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c\nindex 2d16d78..7fdd6f1 100644\n--- a/lib/librte_eal/bsdapp/eal/eal_pci.c\n+++ b/lib/librte_eal/bsdapp/eal/eal_pci.c\n@@ -278,6 +278,11 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)\n \t/* get subsystem_device id */\n \tdev->id.subsystem_device_id = conf->pc_subdevice;\n \n+\t/* get class id */\n+\tdev->id.class_id = (conf->pc_class << 16) |\n+\t\t\t (conf->pc_subclass << 8) |\n+\t\t\t (conf->pc_progif);\n+\n \t/* TODO: get max_vfs */\n \tdev->max_vfs = 0;\n \ndiff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c\nindex 3cae4cb..6c3117d 100644\n--- a/lib/librte_eal/common/eal_common_pci.c\n+++ b/lib/librte_eal/common/eal_common_pci.c\n@@ -162,6 +162,9 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d\n \t\tif (id_table->subsystem_device_id != dev->id.subsystem_device_id &&\n \t\t\t\tid_table->subsystem_device_id != PCI_ANY_ID)\n \t\t\tcontinue;\n+\t\tif (id_table->class_id != dev->id.class_id &&\n+\t\t\t\tid_table->class_id != RTE_CLASS_ANY_ID)\n+\t\t\tcontinue;\n \n \t\tstruct rte_pci_addr *loc = &dev->addr;\n \ndiff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h\nindex 8fa2712..c30adaf 100644\n--- a/lib/librte_eal/common/include/rte_pci.h\n+++ b/lib/librte_eal/common/include/rte_pci.h\n@@ -125,6 +125,7 @@ struct rte_pci_resource {\n * table of these IDs for each device that it supports.\n */\n struct rte_pci_id {\n+\tuint32_t class_id; /**< Class ID (class, subclass, pi) or RTE_CLASS_ANY_ID. */\n \tuint16_t vendor_id; /**< Vendor ID or PCI_ANY_ID. */\n \tuint16_t device_id; /**< Device ID or PCI_ANY_ID. */\n \tuint16_t subsystem_vendor_id; /**< Subsystem vendor ID or PCI_ANY_ID. */\n@@ -170,6 +171,7 @@ struct rte_pci_device {\n \n /** Any PCI device identifier (vendor, device, ...) */\n #define PCI_ANY_ID (0xffff)\n+#define RTE_CLASS_ANY_ID (0xffffff)\n \n #ifdef __cplusplus\n /** C++ macro used to help building up tables of device IDs */\n@@ -177,14 +179,16 @@ struct rte_pci_device {\n \t(vend), \\\n \t(dev), \\\n \tPCI_ANY_ID, \\\n-\tPCI_ANY_ID\n+\tPCI_ANY_ID, \\\n+\tRTE_CLASS_ANY_ID\n #else\n /** Macro used to help building up tables of device IDs */\n #define RTE_PCI_DEVICE(vend, dev) \\\n \t.vendor_id = (vend), \\\n \t.device_id = (dev), \\\n \t.subsystem_vendor_id = PCI_ANY_ID, \\\n-\t.subsystem_device_id = PCI_ANY_ID\n+\t.subsystem_device_id = PCI_ANY_ID, \\\n+\t.class_id = RTE_CLASS_ANY_ID\n #endif\n \n struct rte_pci_driver;\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c\nindex bdc08a0..e6f0f13 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c\n@@ -306,6 +306,16 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus,\n \t}\n \tdev->id.subsystem_device_id = (uint16_t)tmp;\n \n+\t/* get class_id */\n+\tsnprintf(filename, sizeof(filename), \"%s/class\",\n+\t\t dirname);\n+\tif (eal_parse_sysfs_value(filename, &tmp) < 0) {\n+\t\tfree(dev);\n+\t\treturn -1;\n+\t}\n+\t/* the least 24 bits are valid: class, subclass, program interface */\n+\tdev->id.class_id = (uint32_t)tmp & RTE_CLASS_ANY_ID;\n+\n \t/* get max_vfs */\n \tdev->max_vfs = 0;\n \tsnprintf(filename, sizeof(filename), \"%s/max_vfs\", dirname);\n", "prefixes": [ "dpdk-dev", "v3" ] }{ "id": 12894, "url": "