get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 35361,
    "url": "http://patches.dpdk.org/api/patches/35361/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/c88d580626439c2814c0ed539ae35dc708aa2cbf.1519322682.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": "<c88d580626439c2814c0ed539ae35dc708aa2cbf.1519322682.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/c88d580626439c2814c0ed539ae35dc708aa2cbf.1519322682.git.anatoly.burakov@intel.com",
    "date": "2018-02-22T18:21:14",
    "name": "[dpdk-dev,2/3] eal: don't process IPC messages before init finished",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c7981d78c00217185211882ba8ea8de4e2e46041",
    "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/c88d580626439c2814c0ed539ae35dc708aa2cbf.1519322682.git.anatoly.burakov@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/35361/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/35361/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 16B501B28F;\n\tThu, 22 Feb 2018 19:21:21 +0100 (CET)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 2358B1B28E\n\tfor <dev@dpdk.org>; Thu, 22 Feb 2018 19:21:18 +0100 (CET)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t22 Feb 2018 10:21:17 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga002.fm.intel.com with ESMTP; 22 Feb 2018 10:21:16 -0800",
            "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\tw1MILGDw013690 for <dev@dpdk.org>; Thu, 22 Feb 2018 18:21:16 GMT",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w1MILG44022604\n\tfor <dev@dpdk.org>; Thu, 22 Feb 2018 18:21:16 GMT",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w1MILFi5022600\n\tfor dev@dpdk.org; Thu, 22 Feb 2018 18:21:15 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.47,378,1515484800\"; d=\"scan'208\";a=\"22281038\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 22 Feb 2018 18:21:14 +0000",
        "Message-Id": "<c88d580626439c2814c0ed539ae35dc708aa2cbf.1519322682.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<31f6d9ef676fb1eb0a664c06d62d66f32876dcb6.1519322682.git.anatoly.burakov@intel.com>",
            "<31f6d9ef676fb1eb0a664c06d62d66f32876dcb6.1519322682.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<31f6d9ef676fb1eb0a664c06d62d66f32876dcb6.1519322682.git.anatoly.burakov@intel.com>",
            "<31f6d9ef676fb1eb0a664c06d62d66f32876dcb6.1519322682.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH 2/3] eal: don't process IPC messages before init\n\tfinished",
        "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "It is not possible for a primary process to receive any messages\nwhile initializing, because RTE_MAGIC value is not set in the\nshared config, and hence no secondary process can ever spin up\nduring that time.\n\nHowever, it is possible for a secondary process to receive messages\nfrom the primary during initialization. We can't just drop the\nmessages as they may be important, and also we might need to process\nreplies to our own requests (e.g. VFIO) during initialization.\n\nTherefore, add a tailq for incoming messages, and queue them up\nuntil initialization is complete, and process them in order they\narrived.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_proc.c | 50 +++++++++++++++++++++++++++++----\n 1 file changed, 45 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c\nindex 3a1088e..b4d00c3 100644\n--- a/lib/librte_eal/common/eal_common_proc.c\n+++ b/lib/librte_eal/common/eal_common_proc.c\n@@ -25,6 +25,7 @@\n #include <rte_errno.h>\n #include <rte_lcore.h>\n #include <rte_log.h>\n+#include <rte_tailq.h>\n \n #include \"eal_private.h\"\n #include \"eal_filesystem.h\"\n@@ -58,6 +59,18 @@ struct mp_msg_internal {\n \tstruct rte_mp_msg msg;\n };\n \n+struct message_queue_entry {\n+\tTAILQ_ENTRY(message_queue_entry) next;\n+\tstruct mp_msg_internal msg;\n+\tstruct sockaddr_un sa;\n+};\n+\n+/** Double linked list of received messages. */\n+TAILQ_HEAD(message_queue, message_queue_entry);\n+\n+static struct message_queue message_queue =\n+\tTAILQ_HEAD_INITIALIZER(message_queue);\n+\n struct sync_request {\n \tTAILQ_ENTRY(sync_request) next;\n \tint reply_received;\n@@ -276,12 +289,39 @@ process_msg(struct mp_msg_internal *m, struct sockaddr_un *s)\n static void *\n mp_handle(void *arg __rte_unused)\n {\n-\tstruct mp_msg_internal msg;\n-\tstruct sockaddr_un sa;\n-\n+\tstruct message_queue_entry *cur_msg, *next_msg, *new_msg = NULL;\n \twhile (1) {\n-\t\tif (read_msg(&msg, &sa) == 0)\n-\t\t\tprocess_msg(&msg, &sa);\n+\t\t/* we want to process all messages in order of their arrival,\n+\t\t * but status of init_complete may change while we're iterating\n+\t\t * the tailq. so, store it here and check once every iteration.\n+\t\t */\n+\t\tint init_complete = internal_config.init_complete;\n+\n+\t\tif (new_msg == NULL)\n+\t\t\tnew_msg = malloc(sizeof(*new_msg));\n+\t\tif (read_msg(&new_msg->msg, &new_msg->sa) == 0) {\n+\t\t\t/* we successfully read the message, so enqueue it */\n+\t\t\tTAILQ_INSERT_TAIL(&message_queue, new_msg, next);\n+\t\t\tnew_msg = NULL;\n+\t\t} /* reuse new_msg for next message if we couldn't read_msg */\n+\n+\t\t/* tailq only accessed here, so no locking needed */\n+\t\tTAILQ_FOREACH_SAFE(cur_msg, &message_queue, next, next_msg) {\n+\t\t\t/* secondary process should not process any incoming\n+\t\t\t * requests until its initialization is complete, but\n+\t\t\t * it is allowed to process replies to its own queries.\n+\t\t\t */\n+\t\t\tif (rte_eal_process_type() == RTE_PROC_SECONDARY &&\n+\t\t\t\t\t!init_complete &&\n+\t\t\t\t\tcur_msg->msg.type != MP_REP)\n+\t\t\t\tcontinue;\n+\n+\t\t\tTAILQ_REMOVE(&message_queue, cur_msg, next);\n+\n+\t\t\tprocess_msg(&cur_msg->msg, &cur_msg->sa);\n+\n+\t\t\tfree(cur_msg);\n+\t\t}\n \t}\n \n \treturn NULL;\n",
    "prefixes": [
        "dpdk-dev",
        "2/3"
    ]
}