get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 55371,
    "url": "http://patches.dpdk.org/api/patches/55371/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/0743551eba840752223a6447ab4dcaf0731add39.1561478924.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": "<0743551eba840752223a6447ab4dcaf0731add39.1561478924.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/0743551eba840752223a6447ab4dcaf0731add39.1561478924.git.anatoly.burakov@intel.com",
    "date": "2019-06-25T16:11:41",
    "name": "[1/2] eal: add internal locks for timer lib into EAL",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "43c2721e548b9cf381144d27fcab02c399a1c099",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Burakov, Anatoly",
        "email": "anatoly.burakov@intel.com"
    },
    "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/0743551eba840752223a6447ab4dcaf0731add39.1561478924.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 5163,
            "url": "http://patches.dpdk.org/api/series/5163/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5163",
            "date": "2019-06-25T16:11:40",
            "name": "Fix timer resource leak",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/5163/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/55371/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/55371/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 B53001BA9E;\n\tTue, 25 Jun 2019 18:11:49 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id C748A1B9FD\n\tfor <dev@dpdk.org>; Tue, 25 Jun 2019 18:11:45 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Jun 2019 09:11:45 -0700",
            "from silpixa00399498.ir.intel.com (HELO\n\tsilpixa00399498.ger.corp.intel.com) ([10.237.223.125])\n\tby orsmga001.jf.intel.com with ESMTP; 25 Jun 2019 09:11:44 -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,416,1557212400\"; d=\"scan'208\";a=\"245120808\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "erik.g.carrillo@intel.com",
        "Date": "Tue, 25 Jun 2019 17:11:41 +0100",
        "Message-Id": "<0743551eba840752223a6447ab4dcaf0731add39.1561478924.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": [
            "<cover.1561478924.git.anatoly.burakov@intel.com>",
            "<cover.1561478924.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1561478924.git.anatoly.burakov@intel.com>",
            "<1557354906-2500-1-git-send-email-erik.g.carrillo@intel.com>\n\t<cover.1561478924.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH 1/2] eal: add internal locks for timer lib into\n\tEAL",
        "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, timer library has a memory leak because there is no\nway to concurrently initialize/deinitialize shared memory because\nof race conditions [1].\n\nAdd a spinlock to the shared mem config to have a way to\nexclusively initialize/deinitialize the timer library without\nany races.\n\n[1] See the following email thread:\nhttps://mails.dpdk.org/archives/dev/2019-May/131498.html\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_mcfg.c        | 14 ++++++++++++++\n lib/librte_eal/common/eal_memcfg.h             |  2 ++\n .../common/include/rte_eal_memconfig.h         | 18 ++++++++++++++++++\n lib/librte_eal/rte_eal_version.map             |  2 ++\n 4 files changed, 36 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_mcfg.c b/lib/librte_eal/common/eal_common_mcfg.c\nindex 1825d9083..066549432 100644\n--- a/lib/librte_eal/common/eal_common_mcfg.c\n+++ b/lib/librte_eal/common/eal_common_mcfg.c\n@@ -147,3 +147,17 @@ rte_mcfg_mempool_write_unlock(void)\n \tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n \trte_rwlock_write_unlock(&mcfg->mplock);\n }\n+\n+void\n+rte_mcfg_timer_lock(void)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\trte_spinlock_lock(&mcfg->tlock);\n+}\n+\n+void\n+rte_mcfg_timer_unlock(void)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\trte_spinlock_unlock(&mcfg->tlock);\n+}\ndiff --git a/lib/librte_eal/common/eal_memcfg.h b/lib/librte_eal/common/eal_memcfg.h\nindex e1aae32df..00370cece 100644\n--- a/lib/librte_eal/common/eal_memcfg.h\n+++ b/lib/librte_eal/common/eal_memcfg.h\n@@ -11,6 +11,7 @@\n #include <rte_memory.h>\n #include <rte_memzone.h>\n #include <rte_pause.h>\n+#include <rte_spinlock.h>\n #include <rte_rwlock.h>\n #include <rte_tailq.h>\n \n@@ -38,6 +39,7 @@ struct rte_mem_config {\n \trte_rwlock_t mlock;   /**< only used by memzone LIB for thread-safe. */\n \trte_rwlock_t qlock;   /**< used for tailq operation for thread safe. */\n \trte_rwlock_t mplock;  /**< only used by mempool LIB for thread-safe. */\n+\trte_spinlock_t tlock; /**< needed for timer lib thread safety. */\n \n \trte_rwlock_t memory_hotplug_lock;\n \t/**< indicates whether memory hotplug request is in progress. */\ndiff --git a/lib/librte_eal/common/include/rte_eal_memconfig.h b/lib/librte_eal/common/include/rte_eal_memconfig.h\nindex 1b615c892..05a32e12a 100644\n--- a/lib/librte_eal/common/include/rte_eal_memconfig.h\n+++ b/lib/librte_eal/common/include/rte_eal_memconfig.h\n@@ -109,6 +109,24 @@ rte_mcfg_mempool_write_lock(void);\n void\n rte_mcfg_mempool_write_unlock(void);\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Lock the internal EAL Timer Library lock for exclusive access.\n+ */\n+void __rte_experimental\n+rte_mcfg_timer_lock(void);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Unlock the internal EAL Timer Library lock for exclusive access.\n+ */\n+void __rte_experimental\n+rte_mcfg_timer_unlock(void);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex c28951f65..bc08fc4df 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -367,6 +367,8 @@ EXPERIMENTAL {\n \trte_malloc_heap_memory_detach;\n \trte_malloc_heap_memory_remove;\n \trte_malloc_heap_socket_is_external;\n+\trte_mcfg_timer_lock;\n+\trte_mcfg_timer_unlock;\n \trte_mem_alloc_validator_register;\n \trte_mem_alloc_validator_unregister;\n \trte_mem_check_dma_mask;\n",
    "prefixes": [
        "1/2"
    ]
}