Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/48126/?format=api
http://patchwork.dpdk.org/api/patches/48126/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/097ace69a66250f46ed24e4f9dbd1102bc912f63.1542291869.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": "<097ace69a66250f46ed24e4f9dbd1102bc912f63.1542291869.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/097ace69a66250f46ed24e4f9dbd1102bc912f63.1542291869.git.anatoly.burakov@intel.com", "date": "2018-11-15T15:47:15", "name": "[RFC,v2,3/9] usertools/cpu_layout: rewrite to use DPDKConfigLib", "commit_ref": null, "pull_url": null, "state": "rejected", "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/097ace69a66250f46ed24e4f9dbd1102bc912f63.1542291869.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 2442, "url": "http://patchwork.dpdk.org/api/series/2442/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=2442", "date": "2018-11-15T15:47:16", "name": "Modularize and enhance DPDK Python scripts", "version": 2, "mbox": "http://patchwork.dpdk.org/series/2442/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/48126/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/48126/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 327F54CC5;\n\tThu, 15 Nov 2018 16:47:30 +0100 (CET)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 2F2B54CA2\n\tfor <dev@dpdk.org>; Thu, 15 Nov 2018 16:47:25 +0100 (CET)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t15 Nov 2018 07:47:24 -0800", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga002.jf.intel.com with ESMTP; 15 Nov 2018 07:47:22 -0800", "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\twAFFlLDx024799; Thu, 15 Nov 2018 15:47:21 GMT", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id wAFFlLhh028114;\n\tThu, 15 Nov 2018 15:47:21 GMT", "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id wAFFlLvB028110;\n\tThu, 15 Nov 2018 15:47:21 GMT" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.56,236,1539673200\"; d=\"scan'208\";a=\"108832359\"", "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, thomas@monjalon.net,\n\tferruh.yigit@intel.com", "Date": "Thu, 15 Nov 2018 15:47:15 +0000", "Message-Id": "<097ace69a66250f46ed24e4f9dbd1102bc912f63.1542291869.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": [ "<cover.1542291869.git.anatoly.burakov@intel.com>", "<cover.1542291869.git.anatoly.burakov@intel.com>" ], "References": [ "<cover.1542291869.git.anatoly.burakov@intel.com>", "<cover.1529940601.git.anatoly.burakov@intel.com>\n\t<cover.1542291869.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [RFC v2 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", "v2", "3/9" ] }{ "id": 48126, "url": "