get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/104778/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 104778,
    "url": "http://patchwork.dpdk.org/api/patches/104778/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20211130095439.784229-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": "<20211130095439.784229-1-radu.nicolau@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211130095439.784229-1-radu.nicolau@intel.com",
    "date": "2021-11-30T09:54:39",
    "name": "dma/idxd: add allow/block list support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f90851c9abb3a3f84d392e45f04fe4a9e6ea1df9",
    "submitter": {
        "id": 743,
        "url": "http://patchwork.dpdk.org/api/people/743/?format=api",
        "name": "Radu Nicolau",
        "email": "radu.nicolau@intel.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20211130095439.784229-1-radu.nicolau@intel.com/mbox/",
    "series": [
        {
            "id": 20815,
            "url": "http://patchwork.dpdk.org/api/series/20815/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20815",
            "date": "2021-11-30T09:54:39",
            "name": "dma/idxd: add allow/block list support",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/20815/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/104778/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/104778/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 09775A0C55;\n\tTue, 30 Nov 2021 11:13:35 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 82FB14113C;\n\tTue, 30 Nov 2021 11:13:34 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id B0F55410F7\n for <dev@dpdk.org>; Tue, 30 Nov 2021 11:13:32 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 30 Nov 2021 02:13:31 -0800",
            "from silpixa00400884.ir.intel.com ([10.243.22.82])\n by orsmga003.jf.intel.com with ESMTP; 30 Nov 2021 02:13:30 -0800"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10183\"; a=\"236414891\"",
            "E=Sophos;i=\"5.87,275,1631602800\"; d=\"scan'208\";a=\"236414891\"",
            "E=Sophos;i=\"5.87,275,1631602800\"; d=\"scan'208\";a=\"458780657\""
        ],
        "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] dma/idxd: add allow/block list support",
        "Date": "Tue, 30 Nov 2021 09:54:39 +0000",
        "Message-Id": "<20211130095439.784229-1-radu.nicolau@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "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>\n---\n doc/guides/dmadevs/idxd.rst | 10 ++++++++++\n drivers/dma/idxd/idxd_bus.c | 30 ++++++++++++++++++++++++++----\n 2 files changed, 36 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/doc/guides/dmadevs/idxd.rst b/doc/guides/dmadevs/idxd.rst\nindex d4a210b854..6201d4db1d 100644\n--- a/doc/guides/dmadevs/idxd.rst\n+++ b/doc/guides/dmadevs/idxd.rst\n@@ -117,6 +117,16 @@ 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.\n+If the -a option is used then any device that passes the ``dpdk_`` or\n+``--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\n+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": []
}