Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/41485/?format=api
http://patchwork.dpdk.org/api/patches/41485/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1e29c42406a4cfa9fcde9ba50ca5e1f25b480429.1529940601.git.anatoly.burakov@intel.com/", "project": { "id": 1, "url": "http://patchwork.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": "<1e29c42406a4cfa9fcde9ba50ca5e1f25b480429.1529940601.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1e29c42406a4cfa9fcde9ba50ca5e1f25b480429.1529940601.git.anatoly.burakov@intel.com", "date": "2018-06-25T15:59:40", "name": "[RFC,3/9] usertools/cpu_layout: rewrite to use DPDKConfigLib", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "28fd6a19b406052f923eda462cb9f0fe43827753", "submitter": { "id": 4, "url": "http://patchwork.dpdk.org/api/people/4/?format=api", "name": "Anatoly Burakov", "email": "anatoly.burakov@intel.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1e29c42406a4cfa9fcde9ba50ca5e1f25b480429.1529940601.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 225, "url": "http://patchwork.dpdk.org/api/series/225/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=225", "date": "2018-06-25T15:59:39", "name": "Modularize and enhance DPDK Python scripts", "version": 1, "mbox": "http://patchwork.dpdk.org/series/225/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/41485/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/41485/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id ED8D458C3;\n\tMon, 25 Jun 2018 18:00:05 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 97A4C2BEB\n\tfor <dev@dpdk.org>; Mon, 25 Jun 2018 17:59:52 +0200 (CEST)", "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Jun 2018 08:59:52 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga008.jf.intel.com with ESMTP; 25 Jun 2018 08:59:47 -0700", "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tw5PFxl7j032506; Mon, 25 Jun 2018 16:59:47 +0100", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w5PFxkoN026592;\n\tMon, 25 Jun 2018 16:59:46 +0100", "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w5PFxk3j026588;\n\tMon, 25 Jun 2018 16:59:46 +0100" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,270,1526367600\"; d=\"scan'208\";a=\"52114536\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "john.mcnamara@intel.com, bruce.richardson@intel.com,\n\tpablo.de.lara.guarch@intel.com, david.hunt@intel.com,\n\tmohammad.abdul.awal@intel.com", "Date": "Mon, 25 Jun 2018 16:59:40 +0100", "Message-Id": "<1e29c42406a4cfa9fcde9ba50ca5e1f25b480429.1529940601.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": [ "<cover.1529940601.git.anatoly.burakov@intel.com>", "<cover.1529940601.git.anatoly.burakov@intel.com>" ], "References": [ "<cover.1529940601.git.anatoly.burakov@intel.com>", "<cover.1529940601.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [RFC 3/9] usertools/cpu_layout: rewrite to use\n\tDPDKConfigLib", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Rewrite cpu layout script to use data provided by DPDKConfigLib\nscript. This demonstrates an example of how external tools can get\nthe same information from DPDKConfigLib.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n usertools/cpu_layout.py | 53 ++++++++++-------------------------------\n 1 file changed, 13 insertions(+), 40 deletions(-)", "diff": "diff --git a/usertools/cpu_layout.py b/usertools/cpu_layout.py\nindex 6f129b1db..af950361c 100755\n--- a/usertools/cpu_layout.py\n+++ b/usertools/cpu_layout.py\n@@ -1,73 +1,46 @@\n #!/usr/bin/env python\n # SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2010-2014 Intel Corporation\n+# Copyright(c) 2010-2018 Intel Corporation\n # Copyright(c) 2017 Cavium, Inc. All rights reserved.\n \n from __future__ import print_function\n-import sys\n-try:\n- xrange # Python 2\n-except NameError:\n- xrange = range # Python 3\n+from DPDKConfigLib import PlatformInfo\n \n-sockets = []\n-cores = []\n-core_map = {}\n+info = PlatformInfo.PlatformInfo()\n base_path = \"/sys/devices/system/cpu\"\n-fd = open(\"{}/kernel_max\".format(base_path))\n-max_cpus = int(fd.read())\n-fd.close()\n-for cpu in xrange(max_cpus + 1):\n- try:\n- fd = open(\"{}/cpu{}/topology/core_id\".format(base_path, cpu))\n- except IOError:\n- continue\n- except:\n- break\n- core = int(fd.read())\n- fd.close()\n- fd = open(\"{}/cpu{}/topology/physical_package_id\".format(base_path, cpu))\n- socket = int(fd.read())\n- fd.close()\n- if core not in cores:\n- cores.append(core)\n- if socket not in sockets:\n- sockets.append(socket)\n- key = (socket, core)\n- if key not in core_map:\n- core_map[key] = []\n- core_map[key].append(cpu)\n+\n+cores = sorted(set([core for _, core in info.core_map]))\n \n print(format(\"=\" * (47 + len(base_path))))\n print(\"Core and Socket Information (as reported by '{}')\".format(base_path))\n print(\"{}\\n\".format(\"=\" * (47 + len(base_path))))\n print(\"cores = \", cores)\n-print(\"sockets = \", sockets)\n+print(\"sockets = \", info.numa_nodes)\n print(\"\")\n \n-max_processor_len = len(str(len(cores) * len(sockets) * 2 - 1))\n-max_thread_count = len(list(core_map.values())[0])\n+max_processor_len = len(str(len(cores) * len(info.numa_nodes) * 2 - 1))\n+max_thread_count = len(info.core_map.values()[0])\n max_core_map_len = (max_processor_len * max_thread_count) \\\n + len(\", \") * (max_thread_count - 1) \\\n + len('[]') + len('Socket ')\n max_core_id_len = len(str(max(cores)))\n \n output = \" \".ljust(max_core_id_len + len('Core '))\n-for s in sockets:\n+for s in info.numa_nodes:\n output += \" Socket %s\" % str(s).ljust(max_core_map_len - len('Socket '))\n print(output)\n \n output = \" \".ljust(max_core_id_len + len('Core '))\n-for s in sockets:\n+for s in info.numa_nodes:\n output += \" --------\".ljust(max_core_map_len)\n output += \" \"\n print(output)\n \n for c in cores:\n output = \"Core %s\" % str(c).ljust(max_core_id_len)\n- for s in sockets:\n- if (s,c) in core_map:\n- output += \" \" + str(core_map[(s, c)]).ljust(max_core_map_len)\n+ for s in info.numa_nodes:\n+ if (s, c) in info.core_map:\n+ output += \" \" + str(info.core_map[(s, c)]).ljust(max_core_map_len)\n else:\n output += \" \" * (max_core_map_len + 1)\n print(output)\n", "prefixes": [ "RFC", "3/9" ] }{ "id": 41485, "url": "