get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 56195,
    "url": "http://patches.dpdk.org/api/patches/56195/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/5e1ebf1da67b704f47c5d24f73c09a3bc4f77564.1562347546.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": "<5e1ebf1da67b704f47c5d24f73c09a3bc4f77564.1562347546.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/5e1ebf1da67b704f47c5d24f73c09a3bc4f77564.1562347546.git.anatoly.burakov@intel.com",
    "date": "2019-07-05T17:26:27",
    "name": "[v5,9/9] eal: prevent different primary/secondary process versions",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c71b2369e5b2da4a8293a02af92eb646ba681be1",
    "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/5e1ebf1da67b704f47c5d24f73c09a3bc4f77564.1562347546.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 5379,
            "url": "http://patches.dpdk.org/api/series/5379/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5379",
            "date": "2019-07-05T17:26:18",
            "name": "Make shared memory config non-public",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/5379/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/56195/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/56195/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 50C6B1BEB4;\n\tFri,  5 Jul 2019 19:27:02 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 964881BE96\n\tfor <dev@dpdk.org>; Fri,  5 Jul 2019 19:26:50 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Jul 2019 10:26:50 -0700",
            "from silpixa00399498.ir.intel.com (HELO\n\tsilpixa00399498.ger.corp.intel.com) ([10.237.223.125])\n\tby FMSMGA003.fm.intel.com with ESMTP; 05 Jul 2019 10:26:49 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.63,455,1557212400\"; d=\"scan'208\";a=\"172723291\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Bruce Richardson <bruce.richardson@intel.com>, thomas@monjalon.net,\n\tdavid.marchand@redhat.com, stephen@networkplumber.org",
        "Date": "Fri,  5 Jul 2019 18:26:27 +0100",
        "Message-Id": "<5e1ebf1da67b704f47c5d24f73c09a3bc4f77564.1562347546.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": [
            "<cover.1562347546.git.anatoly.burakov@intel.com>",
            "<cover.1562347546.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1562347546.git.anatoly.burakov@intel.com>",
            "<cover.1562332112.git.anatoly.burakov@intel.com>\n\t<cover.1562347546.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v5 9/9] eal: prevent different primary/secondary\n\tprocess versions",
        "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, nothing stops DPDK to attempt to run primary and\nsecondary processes while having different versions. This\ncan lead to all sorts of weird behavior and makes it harder\nto maintain compatibility without breaking ABI every once\nin a while.\n\nFix it by explicitly disallowing running different DPDK\nversions as primary and secondary processes.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\nAcked-by: David Marchand <david.marchand@redhat.com>\n---\n lib/librte_eal/common/eal_common_mcfg.c | 15 +++++++++++++++\n lib/librte_eal/common/eal_memcfg.h      |  6 ++++++\n lib/librte_eal/freebsd/eal/eal.c        |  4 ++++\n lib/librte_eal/linux/eal/eal.c          |  4 ++++\n 4 files changed, 29 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_mcfg.c b/lib/librte_eal/common/eal_common_mcfg.c\nindex fe8d2b726..1825d9083 100644\n--- a/lib/librte_eal/common/eal_common_mcfg.c\n+++ b/lib/librte_eal/common/eal_common_mcfg.c\n@@ -4,6 +4,7 @@\n \n #include <rte_config.h>\n #include <rte_eal_memconfig.h>\n+#include <rte_version.h>\n \n #include \"eal_internal_cfg.h\"\n #include \"eal_memcfg.h\"\n@@ -31,6 +32,18 @@ eal_mcfg_wait_complete(void)\n \t\trte_pause();\n }\n \n+int\n+eal_mcfg_check_version(void)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\n+\t/* check if version from memconfig matches compiled in macro */\n+\tif (mcfg->version != RTE_VERSION)\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n void\n eal_mcfg_update_internal(void)\n {\n@@ -47,6 +60,8 @@ eal_mcfg_update_from_internal(void)\n \n \tmcfg->legacy_mem = internal_config.legacy_mem;\n \tmcfg->single_file_segments = internal_config.single_file_segments;\n+\t/* record current DPDK version */\n+\tmcfg->version = RTE_VERSION;\n }\n \n void\ndiff --git a/lib/librte_eal/common/eal_memcfg.h b/lib/librte_eal/common/eal_memcfg.h\nindex 573233896..030f903ad 100644\n--- a/lib/librte_eal/common/eal_memcfg.h\n+++ b/lib/librte_eal/common/eal_memcfg.h\n@@ -19,6 +19,8 @@\n  */\n struct rte_mem_config {\n \tvolatile uint32_t magic;   /**< Magic number - sanity check. */\n+\tuint32_t version;\n+\t/**< Prevent secondary processes using different DPDK versions. */\n \n \t/* memory topology */\n \tuint32_t nchannel;    /**< Number of channels (0 if unknown). */\n@@ -81,6 +83,10 @@ eal_mcfg_update_from_internal(void);\n void\n eal_mcfg_wait_complete(void);\n \n+/* check if DPDK version of current process matches one stored in the config */\n+int\n+eal_mcfg_check_version(void);\n+\n /* set mem config as complete */\n void\n eal_mcfg_complete(void);\ndiff --git a/lib/librte_eal/freebsd/eal/eal.c b/lib/librte_eal/freebsd/eal/eal.c\nindex ec1650c43..139d021d9 100644\n--- a/lib/librte_eal/freebsd/eal/eal.c\n+++ b/lib/librte_eal/freebsd/eal/eal.c\n@@ -385,6 +385,10 @@ rte_config_init(void)\n \t\tif (rte_eal_config_attach() < 0)\n \t\t\treturn -1;\n \t\teal_mcfg_wait_complete();\n+\t\tif (eal_mcfg_check_version() < 0) {\n+\t\t\tRTE_LOG(ERR, EAL, \"Primary and secondary process DPDK version mismatch\\n\");\n+\t\t\treturn -1;\n+\t\t}\n \t\tif (rte_eal_config_reattach() < 0)\n \t\t\treturn -1;\n \t\teal_mcfg_update_internal();\ndiff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c\nindex 445d72f0c..47ac3b025 100644\n--- a/lib/librte_eal/linux/eal/eal.c\n+++ b/lib/librte_eal/linux/eal/eal.c\n@@ -489,6 +489,10 @@ rte_config_init(void)\n \t\tif (rte_eal_config_attach() < 0)\n \t\t\treturn -1;\n \t\teal_mcfg_wait_complete();\n+\t\tif (eal_mcfg_check_version() < 0) {\n+\t\t\tRTE_LOG(ERR, EAL, \"Primary and secondary process DPDK version mismatch\\n\");\n+\t\t\treturn -1;\n+\t\t}\n \t\tif (rte_eal_config_reattach() < 0)\n \t\t\treturn -1;\n \t\teal_mcfg_update_internal();\n",
    "prefixes": [
        "v5",
        "9/9"
    ]
}