get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 134104,
    "url": "https://patches.dpdk.org/api/patches/134104/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20231110103013.469430-1-mingjinx.ye@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20231110103013.469430-1-mingjinx.ye@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231110103013.469430-1-mingjinx.ye@intel.com",
    "date": "2023-11-10T10:30:12",
    "name": "[v5] app/test: secondary process passes allow parameters",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "59848347c4a14fffd62a964b82a10aa9170c298b",
    "submitter": {
        "id": 2862,
        "url": "https://patches.dpdk.org/api/people/2862/?format=api",
        "name": "Mingjin Ye",
        "email": "mingjinx.ye@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20231110103013.469430-1-mingjinx.ye@intel.com/mbox/",
    "series": [
        {
            "id": 30245,
            "url": "https://patches.dpdk.org/api/series/30245/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=30245",
            "date": "2023-11-10T10:30:12",
            "name": "[v5] app/test: secondary process passes allow parameters",
            "version": 5,
            "mbox": "https://patches.dpdk.org/series/30245/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/134104/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/134104/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 35AF9432F3;\n\tFri, 10 Nov 2023 11:40:00 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 037F540E5E;\n\tFri, 10 Nov 2023 11:40:00 +0100 (CET)",
            "from mgamail.intel.com (mgamail.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 6339140291;\n Fri, 10 Nov 2023 11:39:58 +0100 (CET)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Nov 2023 02:39:57 -0800",
            "from unknown (HELO localhost.localdomain) ([10.239.252.253])\n by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Nov 2023 02:39:55 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1699612798; x=1731148798;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=cAdVRH6t7WkJbduyGE0UgA8o1FwlfuqRG+COcX1J31U=;\n b=K5P2v/uYAn1EAkoN+Nyeygkm3vzNBreCrKhrJzgXwk3dU2YIEd5tSxWj\n NNQXOS4XqKdGH8DNfICH6q8oMhb1AAAebASUsWjoqYePDQvLUKzSSz4dS\n F3vGXbRtgrv3Y6HhchMJ6Yt4J9qapcy1pLTr4P5VWv44TguVpQqSTXJE9\n KfpzeiQ88KOfnFRxUJaJ8/oRzOTSbMweGQdyJBrk8WhBfsVFlwbB3sF7R\n CPst4Y9MJ0C5rqAzv2Z49nE3+02y15QIDwIgp/O7+nqawZrOD34n5t1/V\n cawtXAcCsRN9hg23s6V5r70hph0NRnejjR5CDg8Jkx7cfL1bIdR1QwCQy Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10889\"; a=\"393042760\"",
            "E=Sophos;i=\"6.03,291,1694761200\"; d=\"scan'208\";a=\"393042760\"",
            "E=McAfee;i=\"6600,9927,10889\"; a=\"757171840\"",
            "E=Sophos;i=\"6.03,291,1694761200\"; d=\"scan'208\";a=\"757171840\""
        ],
        "X-ExtLoop1": "1",
        "From": "Mingjin Ye <mingjinx.ye@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qiming.yang@intel.com, Mingjin Ye <mingjinx.ye@intel.com>, stable@dpdk.org",
        "Subject": "[PATCH v5] app/test: secondary process passes allow parameters",
        "Date": "Fri, 10 Nov 2023 10:30:12 +0000",
        "Message-Id": "<20231110103013.469430-1-mingjinx.ye@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230927034204.2279012-1-mingjinx.ye@intel.com>",
        "References": "<20230927034204.2279012-1-mingjinx.ye@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": "In EAL related test cases, the allow parameters are not passed to\nthe secondary process, resulting in unexpected NICs being loaded.\n\nThis patch fixes this issue by appending the allow parameters to\nthe secondary process.\n\nFixes: af75078fece3 (\"first public release\")\nCc: stable@dpdk.org\n\nSigned-off-by: Mingjin Ye <mingjinx.ye@intel.com>\n---\nv5: Optimized.\n---\n app/test/process.h | 74 +++++++++++++++++++++++++++++++++++++++++++---\n 1 file changed, 70 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/app/test/process.h b/app/test/process.h\nindex af7bc3e0de..f8beb3c36f 100644\n--- a/app/test/process.h\n+++ b/app/test/process.h\n@@ -18,6 +18,8 @@\n \n #include <rte_string_fns.h> /* strlcpy */\n \n+#include <rte_devargs.h>\n+\n #ifdef RTE_EXEC_ENV_FREEBSD\n #define self \"curproc\"\n #define exe \"file\"\n@@ -34,6 +36,57 @@ extern uint16_t flag_for_send_pkts;\n #endif\n #endif\n \n+#define PREFIX_ALLOW \"--allow=\"\n+\n+static int\n+add_parameter_allow(char **argv, int max_capacity)\n+{\n+\tstruct rte_devargs *devargs;\n+\tint count = 0;\n+\tchar *dev;\n+\tint malloc_size;\n+\tint allow_size = strlen(PREFIX_ALLOW);\n+\tint offset;\n+\n+\tRTE_EAL_DEVARGS_FOREACH(NULL, devargs) {\n+\t\tint name_length = 0;\n+\t\tint data_length = 0;\n+\n+\t\tif (count >= max_capacity)\n+\t\t\treturn count;\n+\n+\t\tname_length = strlen(devargs->name);\n+\t\tif (name_length == 0)\n+\t\t\tcontinue;\n+\n+\t\tif (devargs->data != NULL)\n+\t\t\tdata_length = strlen(devargs->data);\n+\t\telse\n+\t\t\tdata_length = 0;\n+\n+\t\tmalloc_size = allow_size + name_length + data_length + 1;\n+\t\tdev = malloc(malloc_size);\n+\t\tif (!dev)\n+\t\t\treturn count;\n+\n+\t\toffset = 0;\n+\t\tmemcpy(dev + offset, PREFIX_ALLOW, allow_size);\n+\t\toffset += allow_size;\n+\t\tmemcpy(dev + offset, devargs->name, name_length);\n+\t\toffset += name_length;\n+\t\tif (data_length > 0) {\n+\t\t\tmemcpy(dev + offset, devargs->data, data_length);\n+\t\t\toffset += data_length;\n+\t\t}\n+\t\tmemset(dev + offset, 0x00, 1);\n+\n+\t\t*(argv + count) = dev;\n+\t\tcount++;\n+\t}\n+\n+\treturn count;\n+}\n+\n /*\n  * launches a second copy of the test process using the given argv parameters,\n  * which should include argv[0] as the process name. To identify in the\n@@ -44,7 +97,9 @@ static inline int\n process_dup(const char *const argv[], int numargs, const char *env_value)\n {\n \tint num;\n-\tchar *argv_cpy[numargs + 1];\n+\tchar **argv_cpy;\n+\tint allow_num;\n+\tint argv_num;\n \tint i, status;\n \tchar path[32];\n #ifdef RTE_LIB_PDUMP\n@@ -58,12 +113,17 @@ process_dup(const char *const argv[], int numargs, const char *env_value)\n \tif (pid < 0)\n \t\treturn -1;\n \telse if (pid == 0) {\n+\t\tallow_num = rte_devargs_type_count(RTE_DEVTYPE_ALLOWED);\n+\t\targv_num = numargs + allow_num + 1;\n+\t\targv_cpy = malloc(argv_num * sizeof(char *));\n \t\t/* make a copy of the arguments to be passed to exec */\n \t\tfor (i = 0; i < numargs; i++)\n \t\t\targv_cpy[i] = strdup(argv[i]);\n-\t\targv_cpy[i] = NULL;\n-\t\tnum = numargs;\n-\n+\t\tnum = add_parameter_allow(&argv_cpy[i], allow_num);\n+\t\tif (num != allow_num)\n+\t\t\trte_panic(\"Fill allow parameter incomplete\\n\");\n+\t\tnum += numargs;\n+\t\targv_cpy[argv_num - 1] = NULL;\n #ifdef RTE_EXEC_ENV_LINUX\n \t\t{\n \t\t\tconst char *procdir = \"/proc/\" self \"/fd/\";\n@@ -131,6 +191,12 @@ process_dup(const char *const argv[], int numargs, const char *env_value)\n \t\t\t}\n \t\t\trte_panic(\"Cannot exec: %s\\n\", strerror(errno));\n \t\t}\n+\n+\t\tfor (i = 0; i < num; i++) {\n+\t\t\tif (argv_cpy[i] != NULL)\n+\t\t\t\tfree(argv_cpy[i]);\n+\t\t}\n+\t\tfree(argv_cpy);\n \t}\n \t/* parent process does a wait */\n #ifdef RTE_LIB_PDUMP\n",
    "prefixes": [
        "v5"
    ]
}