get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 129279,
    "url": "https://patches.dpdk.org/api/patches/129279/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230705093515.3285574-1-kaisenx.you@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": "<20230705093515.3285574-1-kaisenx.you@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230705093515.3285574-1-kaisenx.you@intel.com",
    "date": "2023-07-05T09:35:14",
    "name": "child process synchronization NIC startup parameters",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "ef945683f91ee37ae2046afe1bad49799bb4caf9",
    "submitter": {
        "id": 2900,
        "url": "https://patches.dpdk.org/api/people/2900/?format=api",
        "name": "Kaisen You",
        "email": "kaisenx.you@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/20230705093515.3285574-1-kaisenx.you@intel.com/mbox/",
    "series": [
        {
            "id": 28824,
            "url": "https://patches.dpdk.org/api/series/28824/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=28824",
            "date": "2023-07-05T09:35:14",
            "name": "child process synchronization NIC startup parameters",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/28824/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/129279/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/129279/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 D13E942DD6;\n\tWed,  5 Jul 2023 11:36:20 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 187D5410F2;\n\tWed,  5 Jul 2023 11:36:20 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id 6605340150;\n Wed,  5 Jul 2023 11:36:18 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 05 Jul 2023 02:36:16 -0700",
            "from unknown (HELO localhost.localdomain) ([10.239.252.104])\n by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 05 Jul 2023 02:36:14 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1688549778; x=1720085778;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=Tr066M9Zq0pA1qEnMWXv8+eV9Zxy83R8t6qIjw62Kqw=;\n b=TBLbPdfsX53YgkTkQ9P+WiHBcuaQl3YiwHxkGMMLy4CfI2hYpRAAlrkV\n X5mntWYK3RSzfoFPcKA4qqZUF3pZobgeQ9/8GyfqzII+usQF9iTJDUbi8\n 5gRF7nqMntU7V5VX4FimiftDvp1IsHSuxrkTrlHJx54iz07KMZRpR/7ec\n c2qyC553YkIA08kaigph15Buz/1qSo7gB5l0/jqIv+VnNeweMCLUqmzUw\n EjFfPr9BD2YO11DjwbaH1E3ldYHeuOfCSXoKtyi/UHPx+VY61BraY4iXF\n 3tx5g4GwQkzBex453qqFeRv6K6YTLEVVJF+i86dVLAVDmFbcSPYm8MnZy Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10761\"; a=\"362163595\"",
            "E=Sophos;i=\"6.01,182,1684825200\"; d=\"scan'208\";a=\"362163595\"",
            "E=McAfee;i=\"6600,9927,10761\"; a=\"1049640849\"",
            "E=Sophos;i=\"6.01,182,1684825200\"; d=\"scan'208\";a=\"1049640849\""
        ],
        "X-ExtLoop1": "1",
        "From": "Kaisen You <kaisenx.you@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qiming.yang@intel.com, yidingx.zhou@intel.com,\n Kaisen You <kaisenx.you@intel.com>, stable@dpdk.org",
        "Subject": "[PATCH] child process synchronization NIC startup parameters",
        "Date": "Wed,  5 Jul 2023 17:35:14 +0800",
        "Message-Id": "<20230705093515.3285574-1-kaisenx.you@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": "In meson_test, because the child process does not synchronize\nthe NIC startup parameters of the parent process at startup,\nit uses all NICs bound by vfio as startup parameters by default,\nand an exception occurs in the subsequent hugefile check,\ncausing the test to fail. Synchronize the NIC startup parameters\nof the parent process to the child process to solve this problem.\n\nFixes: 786b29255c49 (\"test: fix file prefix discovery\")\nCc: stable@dpdk.org\n\nSigned-off-by: Kaisen You <kaisenx.you@intel.com>\n---\n app/test/process.h | 80 ++++++++++++++++++++++++++++++++++++++++++++--\n 1 file changed, 77 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/app/test/process.h b/app/test/process.h\nindex 1f073b9c5c..c8a15e8989 100644\n--- a/app/test/process.h\n+++ b/app/test/process.h\n@@ -15,9 +15,11 @@\n #include <string.h> /* strerror */\n #include <unistd.h> /* readlink */\n #include <dirent.h>\n+#include <fcntl.h>\n \n #include <rte_string_fns.h> /* strlcpy */\n \n+#define MAX_EXTRA_ARGS 32\n #ifdef RTE_EXEC_ENV_FREEBSD\n #define self \"curproc\"\n #define exe \"file\"\n@@ -34,6 +36,50 @@ extern uint16_t flag_for_send_pkts;\n #endif\n #endif\n \n+/* get cmdline form PID. Read process info form /proc/$PID. */\n+static char *get_cmdline_from_pid(pid_t pid, char *buf, int len)\n+{\n+\tchar filename[PATH_MAX];\n+\tchar *name = NULL;\n+\tint fd;\n+\tint ret;\n+\n+\tif (pid < 1 || buf == NULL || len < 0) {\n+\t\tprintf(\"%s: illegal param\\n\", __func__);\n+\t\treturn NULL;\n+\t}\n+\n+\tsnprintf(filename, PATH_MAX, \"/proc/%d/cmdline\", pid);\n+\tmemset(buf, 0, len);\n+\tfd = open(filename, O_RDONLY);\n+\tif (fd < 0) {\n+\t\tperror(\"open:\");\n+\t\treturn NULL;\n+\t}\n+\tret = read(fd, buf, len);\n+\tclose(fd);\n+\n+\tif (ret < 0)\n+\t\treturn NULL;\n+\n+\tif (buf[ret-1] == '\\n')\n+\t\tbuf[--ret] = 0;\n+\n+\tname = buf;\n+\twhile (ret) {\n+\t\tif (((unsigned char)*name) < ' ')\n+\t\t\t*name = ' ';\n+\t\tname++;\n+\t\tret--;\n+\t}\n+\t*name = 0;\n+\n+\tif (buf[0])\n+\t\treturn buf;\n+\n+\treturn NULL;\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,9 +90,15 @@ 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-\tint i, status;\n+\tchar *argv_cpy[MAX_EXTRA_ARGS];\n+\tint i, status, n, s, j;\n \tchar path[32];\n+\tchar buf[1024];\n+\tchar *token;\n+\tchar str_1[] = \"-a\";\n+\tchar str_2[] = \" \";\n+\tchar *argv_str[MAX_EXTRA_ARGS];\n+\tchar *argv_copy[MAX_EXTRA_ARGS];\n #ifdef RTE_LIB_PDUMP\n #ifdef RTE_NET_RING\n \tpthread_t thread;\n@@ -113,10 +165,32 @@ process_dup(const char *const argv[], int numargs, const char *env_value)\n \t\t\tclosedir(dir);\n \t\t}\n #endif\n+\t\t/* Add the -a parameter to the child process start parameter */\n+\t\tget_cmdline_from_pid(getppid(), buf, 1024);\n+\t\ttoken = strtok(buf, str_2);\n+\t\targv_str[0] = strdup(token);\n+\t\tn = 0;\n+\t\tj = 0;\n+\t\twhile (token != NULL) {\n+\t\t\tn = n + 1;\n+\t\t\targv_str[n] = strdup(token);\n+\t\t\ttoken = strtok(NULL, str_2);\n+\t\t}\n+\t\tfor (s = 0; s < n; s++) {\n+\t\t\tif (strcmp(argv_str[s], str_1) == 0 ||\n+\t\t\t\tstrcmp(argv_str[s + 1], str_1) == 0) {\n+\t\t\t\targv_copy[j] = strdup(argv_str[s + 1]);\n+\t\t\t\tj++;\n+\t\t\t}\n+\t\t}\n+\t\tfor (s = 0; s < j; s++)\n+\t\t\targv_cpy[numargs + s] = strdup(argv_copy[s]);\n+\n \t\tprintf(\"Running binary with argv[]:\");\n-\t\tfor (i = 0; i < num; i++)\n+\t\tfor (i = 0; i < num + j; i++)\n \t\t\tprintf(\"'%s' \", argv_cpy[i]);\n \t\tprintf(\"\\n\");\n+\t\targv_cpy[numargs + j] = NULL;\n \t\tfflush(stdout);\n \n \t\t/* set the environment variable */\n",
    "prefixes": []
}