get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64619,
    "url": "http://patches.dpdk.org/api/patches/64619/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1578988193-9015-2-git-send-email-viacheslavo@mellanox.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": "<1578988193-9015-2-git-send-email-viacheslavo@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1578988193-9015-2-git-send-email-viacheslavo@mellanox.com",
    "date": "2020-01-14T07:49:50",
    "name": "[v2,1/4] mbuf: detach mbuf with pinned external buffer",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4d3b12ccf6df22bf8de297198484daf3912b70b1",
    "submitter": {
        "id": 1102,
        "url": "http://patches.dpdk.org/api/people/1102/?format=api",
        "name": "Slava Ovsiienko",
        "email": "viacheslavo@mellanox.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1578988193-9015-2-git-send-email-viacheslavo@mellanox.com/mbox/",
    "series": [
        {
            "id": 8101,
            "url": "http://patches.dpdk.org/api/series/8101/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8101",
            "date": "2020-01-14T07:49:49",
            "name": "mbuf: introduce pktmbuf pool with pinned external buffers",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/8101/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64619/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/64619/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 9D61DA04FD;\n\tTue, 14 Jan 2020 08:50:19 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9956E1C2A7;\n\tTue, 14 Jan 2020 08:50:07 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 9469C1C29B\n for <dev@dpdk.org>; Tue, 14 Jan 2020 08:50:01 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n viacheslavo@mellanox.com)\n with ESMTPS (AES256-SHA encrypted); 14 Jan 2020 09:49:57 +0200",
            "from pegasus11.mtr.labs.mlnx (pegasus11.mtr.labs.mlnx\n [10.210.16.104])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00E7nvlc008557;\n Tue, 14 Jan 2020 09:49:57 +0200",
            "from pegasus11.mtr.labs.mlnx (localhost [127.0.0.1])\n by pegasus11.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id 00E7nvH7009289;\n Tue, 14 Jan 2020 07:49:57 GMT",
            "(from viacheslavo@localhost)\n by pegasus11.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id 00E7nvD5009288;\n Tue, 14 Jan 2020 07:49:57 GMT"
        ],
        "X-Authentication-Warning": "pegasus11.mtr.labs.mlnx: viacheslavo set sender to\n viacheslavo@mellanox.com using -f",
        "From": "Viacheslav Ovsiienko <viacheslavo@mellanox.com>",
        "To": "dev@dpdk.org",
        "Cc": "matan@mellanox.com, rasland@mellanox.com, orika@mellanox.com,\n shahafs@mellanox.com, olivier.matz@6wind.com, stephen@networkplumber.org",
        "Date": "Tue, 14 Jan 2020 07:49:50 +0000",
        "Message-Id": "<1578988193-9015-2-git-send-email-viacheslavo@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1578988193-9015-1-git-send-email-viacheslavo@mellanox.com>",
        "References": "<20191118094938.192850-1-shahafs@mellanox.com>\n <1578988193-9015-1-git-send-email-viacheslavo@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v2 1/4] mbuf: detach mbuf with pinned external\n\tbuffer",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Update detach routine to check the mbuf pool type.\n\nSigned-off-by: Shahaf Shuler <shahafs@mellanox.com>\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n lib/librte_mbuf/rte_mbuf.h | 65 +++++++++++++++++++++++++++++++++++++++++++---\n 1 file changed, 61 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\nindex 219b110..46ae76c 100644\n--- a/lib/librte_mbuf/rte_mbuf.h\n+++ b/lib/librte_mbuf/rte_mbuf.h\n@@ -32,6 +32,7 @@\n  */\n \n #include <stdint.h>\n+#include <stdbool.h>\n #include <rte_compat.h>\n #include <rte_common.h>\n #include <rte_config.h>\n@@ -306,6 +307,46 @@ struct rte_pktmbuf_pool_private {\n \tuint32_t flags; /**< reserved for future use. */\n };\n \n+/**\n+ * When set pktmbuf mempool will hold only mbufs with pinned external\n+ * buffer. The external buffer will be attached on the mbuf at the\n+ * memory pool creation and will never be detached by the mbuf free calls.\n+ * mbuf should not contain any room for data after the mbuf structure.\n+ */\n+#define RTE_PKTMBUF_POOL_F_PINNED_EXT_BUF (1 << 0)\n+\n+/**\n+ * Returns TRUE if given mbuf has an pinned external buffer, or FALSE\n+ * otherwise. The pinned external buffer is allocated at pool creation\n+ * time and should not be freed.\n+ *\n+ * External buffer is a user-provided anonymous buffer.\n+ */\n+#ifdef ALLOW_EXPERIMENTAL_API\n+#define RTE_MBUF_HAS_PINNED_EXTBUF(mb) rte_mbuf_has_pinned_extbuf(mb)\n+#else\n+#define RTE_MBUF_HAS_PINNED_EXTBUF(mb) false\n+#endif\n+\n+__rte_experimental\n+static inline uint32_t\n+rte_mbuf_has_pinned_extbuf(const struct rte_mbuf *m)\n+{\n+\tif (RTE_MBUF_HAS_EXTBUF(m)) {\n+\t\t/*\n+\t\t * The mbuf has the external attached buffer,\n+\t\t * we should check the type of the memory pool where\n+\t\t * the mbuf was allocated from.\n+\t\t */\n+\t\tstruct rte_pktmbuf_pool_private *priv =\n+\t\t\t(struct rte_pktmbuf_pool_private *)\n+\t\t\t\trte_mempool_get_priv(m->pool);\n+\n+\t\treturn priv->flags & RTE_PKTMBUF_POOL_F_PINNED_EXT_BUF;\n+\t}\n+\treturn 0;\n+}\n+\n #ifdef RTE_LIBRTE_MBUF_DEBUG\n \n /**  check mbuf type in debug mode */\n@@ -571,7 +612,8 @@ static inline struct rte_mbuf *rte_mbuf_raw_alloc(struct rte_mempool *mp)\n static __rte_always_inline void\n rte_mbuf_raw_free(struct rte_mbuf *m)\n {\n-\tRTE_ASSERT(RTE_MBUF_DIRECT(m));\n+\tRTE_ASSERT(!RTE_MBUF_CLONED(m) &&\n+\t\t  (!RTE_MBUF_HAS_EXTBUF(m) || RTE_MBUF_HAS_PINNED_EXTBUF(m)));\n \tRTE_ASSERT(rte_mbuf_refcnt_read(m) == 1);\n \tRTE_ASSERT(m->next == NULL);\n \tRTE_ASSERT(m->nb_segs == 1);\n@@ -1141,11 +1183,26 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m)\n \tuint32_t mbuf_size, buf_len;\n \tuint16_t priv_size;\n \n-\tif (RTE_MBUF_HAS_EXTBUF(m))\n+\tif (RTE_MBUF_HAS_EXTBUF(m)) {\n+\t\t/*\n+\t\t * The mbuf has the external attached buffed,\n+\t\t * we should check the type of the memory pool where\n+\t\t * the mbuf was allocated from to detect the pinned\n+\t\t * external buffer.\n+\t\t */\n+\t\tstruct rte_pktmbuf_pool_private *priv =\n+\t\t\t(struct rte_pktmbuf_pool_private *)\n+\t\t\t\trte_mempool_get_priv(mp);\n+\n+\t\tif (priv->flags & RTE_PKTMBUF_POOL_F_PINNED_EXT_BUF) {\n+\t\t\tRTE_ASSERT(m->shinfo == NULL);\n+\t\t\tm->ol_flags = EXT_ATTACHED_MBUF;\n+\t\t\treturn;\n+\t\t}\n \t\t__rte_pktmbuf_free_extbuf(m);\n-\telse\n+\t} else {\n \t\t__rte_pktmbuf_free_direct(m);\n-\n+\t}\n \tpriv_size = rte_pktmbuf_priv_size(mp);\n \tmbuf_size = (uint32_t)(sizeof(struct rte_mbuf) + priv_size);\n \tbuf_len = rte_pktmbuf_data_room_size(mp);\n",
    "prefixes": [
        "v2",
        "1/4"
    ]
}