get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52819,
    "url": "http://patches.dpdk.org/api/patches/52819/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1555386203-23776-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp/",
    "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": "<1555386203-23776-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1555386203-23776-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp",
    "date": "2019-04-16T03:43:23",
    "name": "[v2,1/1] fbarray: get fbarrays from containerized secondary",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e0416011b1ea0de239571d86ad4e1544a68c1c9d",
    "submitter": {
        "id": 805,
        "url": "http://patches.dpdk.org/api/people/805/?format=api",
        "name": "Yasufumi Ogawa",
        "email": "ogawa.yasufumi@lab.ntt.co.jp"
    },
    "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/1555386203-23776-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp/mbox/",
    "series": [
        {
            "id": 4322,
            "url": "http://patches.dpdk.org/api/series/4322/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4322",
            "date": "2019-04-16T03:43:23",
            "name": "Get fbarrays from containerized secondary",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/4322/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52819/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/52819/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E29611B455;\n\tTue, 16 Apr 2019 05:45:43 +0200 (CEST)",
            "from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148])\n\tby dpdk.org (Postfix) with ESMTP id BCA911B454;\n\tTue, 16 Apr 2019 05:45:41 +0200 (CEST)",
            "from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153])\n\tby tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x3G3jeMG004276;\n\tTue, 16 Apr 2019 12:45:40 +0900",
            "from vc1.ecl.ntt.co.jp (localhost [127.0.0.1])\n\tby vc1.ecl.ntt.co.jp (Postfix) with ESMTP id E7C6CEA79F3;\n\tTue, 16 Apr 2019 12:45:39 +0900 (JST)",
            "from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp\n\t[129.60.13.95])\n\tby vc1.ecl.ntt.co.jp (Postfix) with ESMTP id DA140EA7894;\n\tTue, 16 Apr 2019 12:45:39 +0900 (JST)"
        ],
        "From": "ogawa.yasufumi@lab.ntt.co.jp",
        "To": "anatoly.burakov@intel.com",
        "Cc": "dev@dpdk.org, stable@dpdk.org,\n\tYasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>",
        "Date": "Tue, 16 Apr 2019 12:43:23 +0900",
        "Message-Id": "<1555386203-23776-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1555386203-23776-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>",
        "References": "<1555379952-23517-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>\n\t<1555386203-23776-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>",
        "X-TM-AS-MML": "disable",
        "Subject": "[dpdk-dev] [PATCH v2 1/1] fbarray: get fbarrays from containerized\n\tsecondary",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>\n\nIn secondary_msl_create_walk(), it creates a file for fbarrays with its\nPID for reserving unique name among secondary processes. However, it\ndoes not work if secondary is run as app container because each of\ncontainerized secondary has PID 1. To reserve unique name, use hostname\ninstead of PID if the value is 1.\n\nCc: stable@dpdk.org\n\nSigned-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>\n---\n lib/librte_eal/linux/eal/eal_memalloc.c | 25 +++++++++++++++++++++++--\n 1 file changed, 23 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linux/eal/eal_memalloc.c b/lib/librte_eal/linux/eal/eal_memalloc.c\nindex 1e9ebb86d..beec03648 100644\n--- a/lib/librte_eal/linux/eal/eal_memalloc.c\n+++ b/lib/librte_eal/linux/eal/eal_memalloc.c\n@@ -1362,6 +1362,7 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,\n \tstruct rte_memseg_list *primary_msl, *local_msl;\n \tchar name[PATH_MAX];\n \tint msl_idx, ret;\n+\tchar proc_id[16];\n \n \tif (msl->external)\n \t\treturn 0;\n@@ -1371,8 +1372,28 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,\n \tlocal_msl = &local_memsegs[msl_idx];\n \n \t/* create distinct fbarrays for each secondary */\n-\tsnprintf(name, RTE_FBARRAY_NAME_LEN, \"%s_%i\",\n-\t\tprimary_msl->memseg_arr.name, getpid());\n+\t/* if run secondary in a container, the name of fbarray file cannot\n+\t * be decided with pid because getpid() always returns 1, so use\n+\t * hostname as a unique identifier among containers instead.\n+\t */\n+\tif (getpid() == 1) {\n+\t\tFILE *hn_fp;\n+\t\thn_fp = fopen(\"/etc/hostname\", \"r\");\n+\t\tif (hn_fp == NULL) {\n+\t\t\tRTE_LOG(ERR, EAL,\n+\t\t\t\t\"Cannot open '/etc/hostname' for secondary\\n\");\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\t/* with docker, /etc/hostname just has one entry of hostname */\n+\t\tif (fscanf(hn_fp, \"%s\", proc_id) == EOF)\n+\t\t\treturn -1;\n+\t\tfclose(hn_fp);\n+\t} else\n+\t\tsprintf(proc_id, \"%d\", (int)getpid());\n+\n+\tsnprintf(name, RTE_FBARRAY_NAME_LEN, \"%s_%s\",\n+\t\t\tprimary_msl->memseg_arr.name, proc_id);\n \n \tret = rte_fbarray_init(&local_msl->memseg_arr, name,\n \t\tprimary_msl->memseg_arr.len,\n",
    "prefixes": [
        "v2",
        "1/1"
    ]
}