get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43182,
    "url": "http://patchwork.dpdk.org/api/patches/43182/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/be78bcd8da77c58dc43764e562295485f987ea71.1531911034.git.anatoly.burakov@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": "<be78bcd8da77c58dc43764e562295485f987ea71.1531911034.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/be78bcd8da77c58dc43764e562295485f987ea71.1531911034.git.anatoly.burakov@intel.com",
    "date": "2018-07-18T10:53:42",
    "name": "eal: fix circular dependency in EAL proc type detection",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c2f0b1c8505646c6d72414fe9e783c05b2d6ec83",
    "submitter": {
        "id": 4,
        "url": "http://patchwork.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@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/be78bcd8da77c58dc43764e562295485f987ea71.1531911034.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 653,
            "url": "http://patchwork.dpdk.org/api/series/653/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=653",
            "date": "2018-07-18T10:53:42",
            "name": "eal: fix circular dependency in EAL proc type detection",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/653/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/43182/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/43182/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 7287D1DB8;\n\tWed, 18 Jul 2018 12:54:27 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 8419910A3\n\tfor <dev@dpdk.org>; Wed, 18 Jul 2018 12:54:25 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t18 Jul 2018 03:54:24 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga002.jf.intel.com with ESMTP; 18 Jul 2018 03:53:42 -0700",
            "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tw6IArgL2030466; Wed, 18 Jul 2018 11:53:42 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w6IArgYg017309;\n\tWed, 18 Jul 2018 11:53:42 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w6IArgX7017305;\n\tWed, 18 Jul 2018 11:53:42 +0100"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,370,1526367600\"; d=\"scan'208\";a=\"75759485\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Bruce Richardson <bruce.richardson@intel.com>, qian.q.xu@intel.com,\n\tlei.a.yao@intel.com, peipeix.lu@intel.com",
        "Date": "Wed, 18 Jul 2018 11:53:42 +0100",
        "Message-Id": "<be78bcd8da77c58dc43764e562295485f987ea71.1531911034.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Subject": "[dpdk-dev] [PATCH] eal: fix circular dependency in EAL proc type\n\tdetection",
        "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": "Currently, we need runtime dir to put all of our runtime info in,\nincluding the DPDK shared config. However, we use the shared\nconfig to determine our proc type, and this happens earlier than\nwe actually create the config dir and thus can know where to\nplace the config file.\n\nFix this by moving runtime dir creation right after the EAL\narguments parsing, but before proc type autodetection. Also,\npreviously we were creating the config file unconditionally,\neven if we specified no_shconf - fix it by only creating\nthe config file if no_shconf is not set.\n\nFixes: adf1d867361c (\"eal: move runtime config file to new location\")\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/bsdapp/eal/eal.c   | 33 ++++++++++++++++++-------------\n lib/librte_eal/linuxapp/eal/eal.c | 33 ++++++++++++++++++-------------\n 2 files changed, 38 insertions(+), 28 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c\nindex 73cdf07b8..7b399bc9d 100644\n--- a/lib/librte_eal/bsdapp/eal/eal.c\n+++ b/lib/librte_eal/bsdapp/eal/eal.c\n@@ -286,12 +286,17 @@ eal_proc_type_detect(void)\n \tenum rte_proc_type_t ptype = RTE_PROC_PRIMARY;\n \tconst char *pathname = eal_runtime_config_path();\n \n-\t/* if we can open the file but not get a write-lock we are a secondary\n-\t * process. NOTE: if we get a file handle back, we keep that open\n-\t * and don't close it to prevent a race condition between multiple opens */\n-\tif (((mem_cfg_fd = open(pathname, O_RDWR)) >= 0) &&\n-\t\t\t(fcntl(mem_cfg_fd, F_SETLK, &wr_lock) < 0))\n-\t\tptype = RTE_PROC_SECONDARY;\n+\t/* if there no shared config, there can be no secondary processes */\n+\tif (!internal_config.no_shconf) {\n+\t\t/* if we can open the file but not get a write-lock we are a\n+\t\t * secondary process. NOTE: if we get a file handle back, we\n+\t\t * keep that open and don't close it to prevent a race condition\n+\t\t * between multiple opens.\n+\t\t */\n+\t\tif (((mem_cfg_fd = open(pathname, O_RDWR)) >= 0) &&\n+\t\t\t\t(fcntl(mem_cfg_fd, F_SETLK, &wr_lock) < 0))\n+\t\t\tptype = RTE_PROC_SECONDARY;\n+\t}\n \n \tRTE_LOG(INFO, EAL, \"Auto-detected process type: %s\\n\",\n \t\t\tptype == RTE_PROC_PRIMARY ? \"PRIMARY\" : \"SECONDARY\");\n@@ -468,6 +473,14 @@ eal_parse_args(int argc, char **argv)\n \t\t}\n \t}\n \n+\t/* create runtime data directory */\n+\tif (internal_config.no_shconf == 0 &&\n+\t\t\teal_create_runtime_dir() < 0) {\n+\t\tRTE_LOG(ERR, EAL, \"Cannot create runtime directory\\n\");\n+\t\tret = -1;\n+\t\tgoto out;\n+\t}\n+\n \tif (eal_adjust_config(&internal_config) != 0) {\n \t\tret = -1;\n \t\tgoto out;\n@@ -600,14 +613,6 @@ rte_eal_init(int argc, char **argv)\n \t\treturn -1;\n \t}\n \n-\t/* create runtime data directory */\n-\tif (internal_config.no_shconf == 0 &&\n-\t\t\teal_create_runtime_dir() < 0) {\n-\t\trte_eal_init_alert(\"Cannot create runtime directory\\n\");\n-\t\trte_errno = EACCES;\n-\t\treturn -1;\n-\t}\n-\n \t/* FreeBSD always uses legacy memory model */\n \tinternal_config.legacy_mem = true;\n \ndiff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c\nindex d75ae9dae..d2d5aae80 100644\n--- a/lib/librte_eal/linuxapp/eal/eal.c\n+++ b/lib/librte_eal/linuxapp/eal/eal.c\n@@ -344,12 +344,17 @@ eal_proc_type_detect(void)\n \tenum rte_proc_type_t ptype = RTE_PROC_PRIMARY;\n \tconst char *pathname = eal_runtime_config_path();\n \n-\t/* if we can open the file but not get a write-lock we are a secondary\n-\t * process. NOTE: if we get a file handle back, we keep that open\n-\t * and don't close it to prevent a race condition between multiple opens */\n-\tif (((mem_cfg_fd = open(pathname, O_RDWR)) >= 0) &&\n-\t\t\t(fcntl(mem_cfg_fd, F_SETLK, &wr_lock) < 0))\n-\t\tptype = RTE_PROC_SECONDARY;\n+\t/* if there no shared config, there can be no secondary processes */\n+\tif (!internal_config.no_shconf) {\n+\t\t/* if we can open the file but not get a write-lock we are a\n+\t\t * secondary process. NOTE: if we get a file handle back, we\n+\t\t * keep that open and don't close it to prevent a race condition\n+\t\t * between multiple opens.\n+\t\t */\n+\t\tif (((mem_cfg_fd = open(pathname, O_RDWR)) >= 0) &&\n+\t\t\t\t(fcntl(mem_cfg_fd, F_SETLK, &wr_lock) < 0))\n+\t\t\tptype = RTE_PROC_SECONDARY;\n+\t}\n \n \tRTE_LOG(INFO, EAL, \"Auto-detected process type: %s\\n\",\n \t\t\tptype == RTE_PROC_PRIMARY ? \"PRIMARY\" : \"SECONDARY\");\n@@ -692,6 +697,14 @@ eal_parse_args(int argc, char **argv)\n \t\t}\n \t}\n \n+\t/* create runtime data directory */\n+\tif (internal_config.no_shconf == 0 &&\n+\t\t\teal_create_runtime_dir() < 0) {\n+\t\tRTE_LOG(ERR, EAL, \"Cannot create runtime directory\\n\");\n+\t\tret = -1;\n+\t\tgoto out;\n+\t}\n+\n \tif (eal_adjust_config(&internal_config) != 0) {\n \t\tret = -1;\n \t\tgoto out;\n@@ -831,14 +844,6 @@ rte_eal_init(int argc, char **argv)\n \t\treturn -1;\n \t}\n \n-\t/* create runtime data directory */\n-\tif (internal_config.no_shconf == 0 &&\n-\t\t\teal_create_runtime_dir() < 0) {\n-\t\trte_eal_init_alert(\"Cannot create runtime directory\\n\");\n-\t\trte_errno = EACCES;\n-\t\treturn -1;\n-\t}\n-\n \tif (eal_plugins_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot init plugins\\n\");\n \t\trte_errno = EINVAL;\n",
    "prefixes": []
}