Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/104826/?format=api
http://patchwork.dpdk.org/api/patches/104826/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20211202125040.3665-1-radu.nicolau@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": "<20211202125040.3665-1-radu.nicolau@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20211202125040.3665-1-radu.nicolau@intel.com", "date": "2021-12-02T12:50:40", "name": "[v2] dma/idxd: add allow/block list support", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "d714eb17ea371a20ae361781d27a5c74d2972eb8", "submitter": { "id": 743, "url": "http://patchwork.dpdk.org/api/people/743/?format=api", "name": "Radu Nicolau", "email": "radu.nicolau@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/20211202125040.3665-1-radu.nicolau@intel.com/mbox/", "series": [ { "id": 20836, "url": "http://patchwork.dpdk.org/api/series/20836/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20836", "date": "2021-12-02T12:50:40", "name": "[v2] dma/idxd: add allow/block list support", "version": 2, "mbox": "http://patchwork.dpdk.org/series/20836/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/104826/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/104826/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 4DCDBA0548;\n\tThu, 2 Dec 2021 13:50:47 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C964340692;\n\tThu, 2 Dec 2021 13:50:46 +0100 (CET)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id 2C6514067B\n for <dev@dpdk.org>; Thu, 2 Dec 2021 13:50:44 +0100 (CET)", "from fmsmga007.fm.intel.com ([10.253.24.52])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 02 Dec 2021 04:50:44 -0800", "from silpixa00400884.ir.intel.com ([10.243.22.82])\n by fmsmga007.fm.intel.com with ESMTP; 02 Dec 2021 04:50:42 -0800" ], "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10185\"; a=\"223932225\"", "E=Sophos;i=\"5.87,282,1631602800\"; d=\"scan'208\";a=\"223932225\"", "E=Sophos;i=\"5.87,282,1631602800\"; d=\"scan'208\";a=\"512641866\"" ], "X-ExtLoop1": "1", "From": "Radu Nicolau <radu.nicolau@intel.com>", "To": "Bruce Richardson <bruce.richardson@intel.com>,\n Kevin Laatz <kevin.laatz@intel.com>", "Cc": "dev@dpdk.org,\n\tRadu Nicolau <radu.nicolau@intel.com>", "Subject": "[PATCH v2] dma/idxd: add allow/block list support", "Date": "Thu, 2 Dec 2021 12:50:40 +0000", "Message-Id": "<20211202125040.3665-1-radu.nicolau@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20211130095439.784229-1-radu.nicolau@intel.com>", "References": "<20211130095439.784229-1-radu.nicolau@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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" }, "content": "Add support for allow or block list for devices bound\nto the kernel driver.\nWhen used the allow or block list applies as an additional\ncondition to the name prefix.\n\nSigned-off-by: Radu Nicolau <radu.nicolau@intel.com>\nReviewed-by: Bruce Richardson <bruce.richardson@intel.com>\nAcked-by: Bruce Richardson <bruce.richardson@intel.com>\n---\nv2: corrected doc\n\n doc/guides/dmadevs/idxd.rst | 8 ++++++++\n drivers/dma/idxd/idxd_bus.c | 30 ++++++++++++++++++++++++++----\n 2 files changed, 34 insertions(+), 4 deletions(-)", "diff": "diff --git a/doc/guides/dmadevs/idxd.rst b/doc/guides/dmadevs/idxd.rst\nindex d4a210b854..a4681b2c5a 100644\n--- a/doc/guides/dmadevs/idxd.rst\n+++ b/doc/guides/dmadevs/idxd.rst\n@@ -117,6 +117,14 @@ the value used as the DPDK ``--file-prefix`` parameter may be used as a workqueu\n name prefix, instead of ``dpdk_``, allowing each DPDK application instance to only\n use a subset of configured queues.\n \n+Additionally, the -a (allowlist) or -b (blocklist) commandline parameters are\n+also available to further restrict the device list that will be used. If the -a option is used,\n+then any device that passes the ``dpdk_`` or ``--file-prefix`` prefix condition must also be present in the allow list.\n+Similarly, when the block list is used, any device that passes the prefix condition must not be in the block list.\n+For example, to only use ``wq0.3``, assuming the name prefix condition is met::\n+\n+\t$ dpdk-test -a wq0.3\n+\n Once probed successfully, irrespective of kernel driver, the device will appear as a ``dmadev``,\n that is a \"DMA device type\" inside DPDK, and can be accessed using APIs from the\n ``rte_dmadev`` library.\ndiff --git a/drivers/dma/idxd/idxd_bus.c b/drivers/dma/idxd/idxd_bus.c\nindex 08639e9dce..13cb967f6d 100644\n--- a/drivers/dma/idxd/idxd_bus.c\n+++ b/drivers/dma/idxd/idxd_bus.c\n@@ -9,6 +9,7 @@\n #include <libgen.h>\n \n #include <rte_bus.h>\n+#include <rte_devargs.h>\n #include <rte_eal.h>\n #include <rte_log.h>\n #include <rte_dmadev_pmd.h>\n@@ -244,8 +245,18 @@ idxd_probe_dsa(struct rte_dsa_device *dev)\n \treturn 0;\n }\n \n+static int search_devargs(const char *name)\n+{\n+\tstruct rte_devargs *devargs;\n+\tRTE_EAL_DEVARGS_FOREACH(dsa_bus.bus.name, devargs) {\n+\t\tif (strcmp(devargs->name, name) == 0)\n+\t\t\treturn 1;\n+\t}\n+\treturn 0;\n+}\n+\n static int\n-is_for_this_process_use(const char *name)\n+is_for_this_process_use(struct rte_dsa_device *dev, const char *name)\n {\n \tchar *runtime_dir = strdup(rte_eal_get_runtime_dir());\n \tchar *prefix = basename(runtime_dir);\n@@ -257,6 +268,13 @@ is_for_this_process_use(const char *name)\n \tif (strncmp(name, prefix, prefixlen) == 0 && name[prefixlen] == '_')\n \t\tretval = 1;\n \n+\tif (retval && dsa_bus.bus.conf.scan_mode != RTE_BUS_SCAN_UNDEFINED) {\n+\t\tif (dsa_bus.bus.conf.scan_mode == RTE_BUS_SCAN_ALLOWLIST)\n+\t\t\tretval = search_devargs(dev->device.name);\n+\t\telse\n+\t\t\tretval = !search_devargs(dev->device.name);\n+\t}\n+\n \tfree(runtime_dir);\n \treturn retval;\n }\n@@ -273,7 +291,8 @@ dsa_probe(void)\n \t\t\t\tread_wq_string(dev, \"name\", name, sizeof(name)) < 0)\n \t\t\tcontinue;\n \n-\t\tif (strncmp(type, \"user\", 4) == 0 && is_for_this_process_use(name)) {\n+\t\tif (strncmp(type, \"user\", 4) == 0 &&\n+\t\t\t\tis_for_this_process_use(dev, name)) {\n \t\t\tdev->device.driver = &dsa_bus.driver;\n \t\t\tidxd_probe_dsa(dev);\n \t\t\tcontinue;\n@@ -370,8 +389,11 @@ dsa_addr_parse(const char *name, void *addr)\n \t\treturn -1;\n \t}\n \n-\twq->device_id = device_id;\n-\twq->wq_id = wq_id;\n+\tif (wq != NULL) {\n+\t\twq->device_id = device_id;\n+\t\twq->wq_id = wq_id;\n+\t}\n+\n \treturn 0;\n }\n \n", "prefixes": [ "v2" ] }{ "id": 104826, "url": "