get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43837,
    "url": "http://patches.dpdk.org/api/patches/43837/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/2e89e49d1c11166d35b66ada0bf21c0718e232e8.1535041359.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": "<2e89e49d1c11166d35b66ada0bf21c0718e232e8.1535041359.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/2e89e49d1c11166d35b66ada0bf21c0718e232e8.1535041359.git.anatoly.burakov@intel.com",
    "date": "2018-08-23T16:59:54",
    "name": "[7/8] mem: add external API to retrieve page fd from EAL",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "bb09757edb2ce172e85765ea40984962015069fb",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "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/2e89e49d1c11166d35b66ada0bf21c0718e232e8.1535041359.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 1040,
            "url": "http://patches.dpdk.org/api/series/1040/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1040",
            "date": "2018-08-23T16:59:47",
            "name": "Improve running DPDK without hugetlbfs mounpoint",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/1040/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43837/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/43837/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 30D314F93;\n\tThu, 23 Aug 2018 19:00:08 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id E00F94C8D\n\tfor <dev@dpdk.org>; Thu, 23 Aug 2018 18:59:59 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t23 Aug 2018 09:59:58 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga002.jf.intel.com with ESMTP; 23 Aug 2018 09:59:57 -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\tw7NGxu96025445; Thu, 23 Aug 2018 17:59:56 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w7NGxuHf006733;\n\tThu, 23 Aug 2018 17:59:56 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w7NGxutK006729;\n\tThu, 23 Aug 2018 17:59:56 +0100"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.53,278,1531810800\"; d=\"scan'208\";a=\"85839920\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "tiwei.bie@intel.com, ray.kinsella@intel.com, zhihong.wang@intel.com,\n\tmaxime.coquelin@redhat.com, kuralamudhan.ramakrishnan@intel.com",
        "Date": "Thu, 23 Aug 2018 17:59:54 +0100",
        "Message-Id": "<2e89e49d1c11166d35b66ada0bf21c0718e232e8.1535041359.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<cover.1535041359.git.anatoly.burakov@intel.com>",
            "<cover.1535041359.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1535041359.git.anatoly.burakov@intel.com>",
            "<cover.1535041359.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH 7/8] mem: add external API to retrieve page fd\n\tfrom EAL",
        "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": "Now that we can retrieve page fd's internally, we can expose it\nas an external API. This will add two flavors of API - thread-safe\nand non-thread-safe.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_memory.c  | 47 ++++++++++++++++++++++\n lib/librte_eal/common/include/rte_memory.h | 44 ++++++++++++++++++++\n lib/librte_eal/rte_eal_version.map         |  2 +\n 3 files changed, 93 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c\nindex 034c2026a..cd3805b46 100644\n--- a/lib/librte_eal/common/eal_common_memory.c\n+++ b/lib/librte_eal/common/eal_common_memory.c\n@@ -550,6 +550,53 @@ rte_memseg_list_walk(rte_memseg_list_walk_t func, void *arg)\n \treturn ret;\n }\n \n+int __rte_experimental\n+rte_memseg_get_fd_thread_unsafe(const struct rte_memseg *ms)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\tstruct rte_memseg_list *msl;\n+\tstruct rte_fbarray *arr;\n+\tint msl_idx, seg_idx, fd;\n+\n+\tif (ms == NULL) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -1;\n+\t}\n+\n+\tmsl = rte_mem_virt2memseg_list(ms->addr);\n+\tif (msl == NULL) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -1;\n+\t}\n+\tarr = &msl->memseg_arr;\n+\n+\tmsl_idx = msl - mcfg->memsegs;\n+\tseg_idx = rte_fbarray_find_idx(arr, ms);\n+\n+\tif (!rte_fbarray_is_used(arr, seg_idx)) {\n+\t\trte_errno = ENOENT;\n+\t\treturn -1;\n+\t}\n+\n+\tfd = eal_memalloc_get_seg_fd(msl_idx, seg_idx);\n+\tif (fd < 0)\n+\t\trte_errno = ENOENT;\n+\treturn fd;\n+}\n+\n+int __rte_experimental\n+rte_memseg_get_fd(const struct rte_memseg *ms)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\tint ret;\n+\n+\trte_rwlock_read_lock(&mcfg->memory_hotplug_lock);\n+\tret = rte_memseg_get_fd_thread_unsafe(ms);\n+\trte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);\n+\n+\treturn ret;\n+}\n+\n /* init memory subsystem */\n int\n rte_eal_memory_init(void)\ndiff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h\nindex c4b7f4cff..4d075b1cc 100644\n--- a/lib/librte_eal/common/include/rte_memory.h\n+++ b/lib/librte_eal/common/include/rte_memory.h\n@@ -317,6 +317,50 @@ rte_memseg_contig_walk_thread_unsafe(rte_memseg_contig_walk_t func, void *arg);\n int __rte_experimental\n rte_memseg_list_walk_thread_unsafe(rte_memseg_list_walk_t func, void *arg);\n \n+/**\n+ * Return file descriptor associated with a particular memseg (if available).\n+ *\n+ * @note This function read-locks the memory hotplug subsystem, and thus cannot\n+ *       be used within memory-related callback functions.\n+ *\n+ * @note This returns the internal file descriptor - no operations should ever\n+ *       be performed on it, and it should be treated as read-only for all\n+ *       intents and purposes.\n+ *\n+ * @param ms\n+ *   A pointer to memseg for which to get file descriptor.\n+ *\n+ * @return\n+ *   Valid file descriptor in case of success.\n+ *   -1 in case of error, with ``rte_errno`` set to the following values:\n+ *     - EINVAL - ``ms`` pointer was NULL or did not point to a valid memseg\n+ *     - ENOENT - ``ms`` pointed to an unused segment, or fd is not available\n+ */\n+int __rte_experimental\n+rte_memseg_get_fd(const struct rte_memseg *ms);\n+\n+/**\n+ * Return file descriptor associated with a particular memseg (if available).\n+ *\n+ * @note This function does not perform any locking, and is only safe to call\n+ *       from within memory-related callback functions.\n+ *\n+ * @note This returns the internal file descriptor - no operations should ever\n+ *       be performed on it, and it should be treated as read-only for all\n+ *       intents and purposes.\n+ *\n+ * @param ms\n+ *   A pointer to memseg for which to get file descriptor.\n+ *\n+ * @return\n+ *   Valid file descriptor in case of success.\n+ *   -1 in case of error, with ``rte_errno`` set to the following values:\n+ *     - EINVAL - ``ms`` pointer was NULL or did not point to a valid memseg\n+ *     - ENOENT - ``ms`` pointed to an unused segment, or fd is not available\n+ */\n+int __rte_experimental\n+rte_memseg_get_fd_thread_unsafe(const struct rte_memseg *ms);\n+\n /**\n  * Dump the physical memory layout to a file.\n  *\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex 344a43d32..e659e19d6 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -320,6 +320,8 @@ EXPERIMENTAL {\n \trte_mem_virt2memseg_list;\n \trte_memseg_contig_walk;\n \trte_memseg_contig_walk_thread_unsafe;\n+\trte_memseg_get_fd;\n+\trte_memseg_get_fd_thread_unsafe;\n \trte_memseg_list_walk;\n \trte_memseg_list_walk_thread_unsafe;\n \trte_memseg_walk;\n",
    "prefixes": [
        "7/8"
    ]
}