get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57007,
    "url": "http://patches.dpdk.org/api/patches/57007/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/6b3b660d00b77d267594781fa1ab52607c209799.1563962656.git.anatoly.burakov@intel.com/",
    "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": "<6b3b660d00b77d267594781fa1ab52607c209799.1563962656.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/6b3b660d00b77d267594781fa1ab52607c209799.1563962656.git.anatoly.burakov@intel.com",
    "date": "2019-07-24T10:04:25",
    "name": "[v2] eal: fix proc type auto detection",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "73c80407ea40d23ead8791a3fa4dddcb4007d06a",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/6b3b660d00b77d267594781fa1ab52607c209799.1563962656.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 5696,
            "url": "http://patches.dpdk.org/api/series/5696/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5696",
            "date": "2019-07-24T10:04:25",
            "name": "[v2] eal: fix proc type auto detection",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/5696/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/57007/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/57007/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 5C3731C07C;\n\tWed, 24 Jul 2019 12:04:30 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id D34DC3257;\n\tWed, 24 Jul 2019 12:04:27 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t24 Jul 2019 03:04:27 -0700",
            "from silpixa00399498.ir.intel.com (HELO\n\tsilpixa00399498.ger.corp.intel.com) ([10.237.223.125])\n\tby fmsmga004.fm.intel.com with ESMTP; 24 Jul 2019 03:04:26 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.64,302,1559545200\"; d=\"scan'208\";a=\"193405443\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "stephen@networkplumber.org,\n\tstable@dpdk.org",
        "Date": "Wed, 24 Jul 2019 11:04:25 +0100",
        "Message-Id": "<6b3b660d00b77d267594781fa1ab52607c209799.1563962656.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<6613e2fb817959e0a1230810b2b0c5b93738f1b8.1563887988.git.anatoly.burakov@intel.com>",
        "References": "<6613e2fb817959e0a1230810b2b0c5b93738f1b8.1563887988.git.anatoly.burakov@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2] eal: fix proc type auto detection",
        "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, primary process holds an exclusive lock on the config\nfile, thereby preventing other primaries from spinning up. However,\nwhen the primary dies, the lock is no longer being held, even though\nthere might be other secondary processes still running.\n\nThe fix is two-fold. First of all, downgrade the primary process's\nexclusive lock to a shared lock once we have it. Second of all,\nalso take out shared locks on the config from the secondaries. We\nare using fcntl() locks, which get dropped when the file handle is\nclosed, so also remove the closure of config file handle.\n\nFixes: af75078fece3 (\"first public release\")\nCc: stable@dpdk.org\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n\nNotes:\n    v2:\n    - Adjusted indentation\n\n lib/librte_eal/linux/eal/eal.c | 37 +++++++++++++++++++++++++++++-----\n 1 file changed, 32 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c\nindex 34db78753..0f0726703 100644\n--- a/lib/librte_eal/linux/eal/eal.c\n+++ b/lib/librte_eal/linux/eal/eal.c\n@@ -83,6 +83,13 @@ static struct flock wr_lock = {\n \t\t.l_len = sizeof(early_mem_config.memsegs),\n };\n \n+static struct flock rd_lock = {\n+\t.l_type = F_RDLCK,\n+\t.l_whence = SEEK_SET,\n+\t.l_start = offsetof(struct rte_mem_config, memsegs),\n+\t.l_len = sizeof(early_mem_config.memsegs),\n+};\n+\n /* Address of global and public configuration */\n static struct rte_config rte_config = {\n \t\t.mem_config = &early_mem_config,\n@@ -343,8 +350,21 @@ rte_eal_config_create(void)\n \tif (retval < 0){\n \t\tclose(mem_cfg_fd);\n \t\tmem_cfg_fd = -1;\n-\t\tRTE_LOG(ERR, EAL, \"Cannot create lock on '%s'. Is another primary \"\n-\t\t\t\"process running?\\n\", pathname);\n+\t\tRTE_LOG(ERR, EAL, \"Cannot create exclusive lock on '%s'. \"\n+\t\t\t\"Is another process running?\\n\", pathname);\n+\t\treturn -1;\n+\t}\n+\n+\t/* we hold an exclusive lock - now downgrade it to a read lock to allow\n+\t * other processes to also hold onto this file while preventing other\n+\t * primaries from spinning up.\n+\t */\n+\tretval = fcntl(mem_cfg_fd, F_SETLK, &rd_lock);\n+\tif (retval < 0) {\n+\t\tclose(mem_cfg_fd);\n+\t\tmem_cfg_fd = -1;\n+\t\tRTE_LOG(ERR, EAL, \"Cannot downgrade to shared lock on '%s': %s\\n\",\n+\t\t\tpathname, strerror(errno));\n \t\treturn -1;\n \t}\n \n@@ -389,6 +409,16 @@ rte_eal_config_attach(void)\n \t\t\treturn -1;\n \t\t}\n \t}\n+\t/* lock the file to prevent primary from initializing while this\n+\t * process is still running.\n+\t */\n+\tif (fcntl(mem_cfg_fd, F_SETLK, &rd_lock) < 0) {\n+\t\tclose(mem_cfg_fd);\n+\t\tmem_cfg_fd = -1;\n+\t\tRTE_LOG(ERR, EAL, \"Cannot create shared lock on '%s': %s\\n\",\n+\t\t\t\tpathname, strerror(errno));\n+\t\treturn -1;\n+\t}\n \n \t/* map it as read-only first */\n \tmem_config = (struct rte_mem_config *) mmap(NULL, sizeof(*mem_config),\n@@ -427,9 +457,6 @@ rte_eal_config_reattach(void)\n \t\t\tsizeof(*mem_config), PROT_READ | PROT_WRITE, MAP_SHARED,\n \t\t\tmem_cfg_fd, 0);\n \n-\tclose(mem_cfg_fd);\n-\tmem_cfg_fd = -1;\n-\n \tif (mem_config == MAP_FAILED || mem_config != rte_mem_cfg_addr) {\n \t\tif (mem_config != MAP_FAILED) {\n \t\t\t/* errno is stale, don't use */\n",
    "prefixes": [
        "v2"
    ]
}