Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/75832/?format=api
http://patches.dpdk.org/api/patches/75832/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200821162944.29840-8-bruce.richardson@intel.com/", "project": { "id": 1, "url": "http://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": "<20200821162944.29840-8-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200821162944.29840-8-bruce.richardson@intel.com", "date": "2020-08-21T16:29:33", "name": "[v2,07/18] raw/ioat: include example configuration script", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "68a3b2f5f7dd771b0e061834a69adb1ece93ccb2", "submitter": { "id": 20, "url": "http://patches.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200821162944.29840-8-bruce.richardson@intel.com/mbox/", "series": [ { "id": 11744, "url": "http://patches.dpdk.org/api/series/11744/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11744", "date": "2020-08-21T16:29:26", "name": "raw/ioat: enhancements and new hardware support", "version": 2, "mbox": "http://patches.dpdk.org/series/11744/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/75832/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/75832/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id BD248A04AF;\n\tFri, 21 Aug 2020 18:31:12 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DB46A1C11A;\n\tFri, 21 Aug 2020 18:30:12 +0200 (CEST)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id 0EF171C119\n for <dev@dpdk.org>; Fri, 21 Aug 2020 18:30:10 +0200 (CEST)", "from orsmga006.jf.intel.com ([10.7.209.51])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Aug 2020 09:30:10 -0700", "from silpixa00399126.ir.intel.com ([10.237.222.56])\n by orsmga006.jf.intel.com with ESMTP; 21 Aug 2020 09:30:08 -0700" ], "IronPort-SDR": [ "\n gZAqa8gtcJUk4D4bIdV2DKPKes9V5Uho85m5NOs4QJ8IIJoqxvdHpvHrDGZONsgJoFx0gCB1tx\n 7ZjyhSFcksQg==", "\n QZpMaoQpnmMfdos2w0yA9HAUZKotWAzkSn9Ney2lQdWb0JBKrh7z0U+2ygvMXp+rhwuLJwWJrN\n R8JHCx1k6YBA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9719\"; a=\"143209509\"", "E=Sophos;i=\"5.76,337,1592895600\"; d=\"scan'208\";a=\"143209509\"", "E=Sophos;i=\"5.76,337,1592895600\"; d=\"scan'208\";a=\"297992741\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Cc": "cheng1.jiang@intel.com, patrick.fu@intel.com, ping.yu@intel.com,\n kevin.laatz@intel.com, Bruce Richardson <bruce.richardson@intel.com>", "Date": "Fri, 21 Aug 2020 17:29:33 +0100", "Message-Id": "<20200821162944.29840-8-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20200821162944.29840-1-bruce.richardson@intel.com>", "References": "<20200721095140.719297-1-bruce.richardson@intel.com>\n <20200821162944.29840-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v2 07/18] raw/ioat: include example configuration\n\tscript", "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Devices managed by the idxd kernel driver must be configured for DPDK use\nbefore it can be used by the ioat driver. This example script serves both\nas a quick way to get the driver set up with a simple configuration, and as\nthe basis for users to modify it and create their own configuration\nscripts.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n doc/guides/rawdevs/ioat.rst | 2 +\n drivers/raw/ioat/dpdk_idxd_cfg.py | 79 +++++++++++++++++++++++++++++++\n 2 files changed, 81 insertions(+)\n create mode 100755 drivers/raw/ioat/dpdk_idxd_cfg.py", "diff": "diff --git a/doc/guides/rawdevs/ioat.rst b/doc/guides/rawdevs/ioat.rst\nindex 43a69ec4c6..8d241d7e77 100644\n--- a/doc/guides/rawdevs/ioat.rst\n+++ b/doc/guides/rawdevs/ioat.rst\n@@ -50,6 +50,8 @@ The `accel-config <https://github.com/intel/idxd-config>`_ utility library can b\n \n .. note::\n The device configuration can also be done by directly interacting with the sysfs nodes.\n+ An example of how this may be done can be seen in the script ``dpdk_idxd_cfg.py``\n+ included in the driver source directory.\n \n There are some mandatory configuration steps before being able to use a device with an application.\n The internal engines, which do the copies or other operations,\ndiff --git a/drivers/raw/ioat/dpdk_idxd_cfg.py b/drivers/raw/ioat/dpdk_idxd_cfg.py\nnew file mode 100755\nindex 0000000000..bce4bb5bd4\n--- /dev/null\n+++ b/drivers/raw/ioat/dpdk_idxd_cfg.py\n@@ -0,0 +1,79 @@\n+#!/usr/bin/env python3\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2020 Intel Corporation\n+\n+\"\"\"\n+Configure an entire Intel DSA instance, using idxd kernel driver, for DPDK use\n+\"\"\"\n+\n+import sys\n+import argparse\n+import os\n+import os.path\n+\n+\n+class SysfsDir:\n+ \"Used to read/write paths in a sysfs directory\"\n+ def __init__(self, path):\n+ self.path = path\n+\n+ def read_int(self, filename):\n+ \"Return a value from sysfs file\"\n+ with open(os.path.join(self.path, filename)) as f:\n+ return int(f.readline())\n+\n+ def write_values(self, values):\n+ \"write dictionary, where key is filename and value is value to write\"\n+ for filename, contents in values.items():\n+ with open(os.path.join(self.path, filename), \"w\") as f:\n+ f.write(str(contents))\n+\n+\n+def configure_dsa(dsa_id, queues):\n+ \"Configure the DSA instance with appropriate number of queues\"\n+ dsa_dir = SysfsDir(f\"/sys/bus/dsa/devices/dsa{dsa_id}\")\n+ drv_dir = SysfsDir(\"/sys/bus/dsa/drivers/dsa\")\n+\n+ max_groups = dsa_dir.read_int(\"max_groups\")\n+ max_engines = dsa_dir.read_int(\"max_engines\")\n+ max_queues = dsa_dir.read_int(\"max_work_queues\")\n+ max_tokens = dsa_dir.read_int(\"max_tokens\")\n+\n+ # we want one engine per group\n+ nb_groups = min(max_engines, max_groups)\n+ for grp in range(nb_groups):\n+ dsa_dir.write_values({f\"engine{dsa_id}.{grp}/group_id\": grp})\n+\n+ nb_queues = min(queues, max_queues)\n+ if queues > nb_queues:\n+ print(f\"Setting number of queues to max supported value: {max_queues}\")\n+\n+ # configure each queue\n+ for q in range(nb_queues):\n+ wq_dir = SysfsDir(os.path.join(dsa_dir.path, f\"wq{dsa_id}.{q}\"))\n+ wq_dir.write_values({\"group_id\": q % nb_groups,\n+ \"type\": \"user\",\n+ \"mode\": \"dedicated\",\n+ \"name\": f\"dpdk_wq{dsa_id}.{q}\",\n+ \"priority\": 1,\n+ \"size\": int(max_tokens / nb_queues)})\n+\n+ # enable device and then queues\n+ drv_dir.write_values({\"bind\": f\"dsa{dsa_id}\"})\n+ for q in range(nb_queues):\n+ drv_dir.write_values({\"bind\": f\"wq{dsa_id}.{q}\"})\n+\n+\n+def main(args):\n+ \"Main function, does arg parsing and calls config function\"\n+ arg_p = argparse.ArgumentParser(\n+ description=\"Configure whole DSA device instance for DPDK use\")\n+ arg_p.add_argument('dsa_id', type=int, help=\"DSA instance number\")\n+ arg_p.add_argument('-q', metavar='queues', type=int, default=255,\n+ help=\"Number of queues to set up\")\n+ parsed_args = arg_p.parse_args(args[1:])\n+ configure_dsa(parsed_args.dsa_id, parsed_args.q)\n+\n+\n+if __name__ == \"__main__\":\n+ main(sys.argv)\n", "prefixes": [ "v2", "07/18" ] }{ "id": 75832, "url": "