get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64627,
    "url": "http://patches.dpdk.org/api/patches/64627/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1578993305-15165-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": "<1578993305-15165-2-git-send-email-viacheslavo@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1578993305-15165-2-git-send-email-viacheslavo@mellanox.com",
    "date": "2020-01-14T09:15:02",
    "name": "[v3,1/4] mbuf: detach mbuf with pinned external buffer",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fcf7539d5d1f79d83011b1f73af10e38f7f9444f",
    "submitter": {
        "id": 1102,
        "url": "http://patches.dpdk.org/api/people/1102/?format=api",
        "name": "Slava Ovsiienko",
        "email": "viacheslavo@mellanox.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/1578993305-15165-2-git-send-email-viacheslavo@mellanox.com/mbox/",
    "series": [
        {
            "id": 8105,
            "url": "http://patches.dpdk.org/api/series/8105/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8105",
            "date": "2020-01-14T09:15:01",
            "name": "mbuf: detach mbuf with pinned external buffer",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/8105/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64627/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/64627/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 3B183A04FD;\n\tTue, 14 Jan 2020 10:15:24 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 775941C29A;\n\tTue, 14 Jan 2020 10:15:18 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 3107E1C25A\n for <dev@dpdk.org>; Tue, 14 Jan 2020 10:15:15 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n viacheslavo@mellanox.com)\n with ESMTPS (AES256-SHA encrypted); 14 Jan 2020 11:15:12 +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 00E9FC0P026501;\n Tue, 14 Jan 2020 11:15:12 +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 00E9FCqG015223;\n Tue, 14 Jan 2020 09:15:12 GMT",
            "(from viacheslavo@localhost)\n by pegasus11.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id 00E9FCM4015222;\n Tue, 14 Jan 2020 09:15:12 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 09:15:02 +0000",
        "Message-Id": "<1578993305-15165-2-git-send-email-viacheslavo@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1578993305-15165-1-git-send-email-viacheslavo@mellanox.com>",
        "References": "<20191118094938.192850-1-shahafs@mellanox.com>\n <1578993305-15165-1-git-send-email-viacheslavo@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v3 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 | 64 +++++++++++++++++++++++++++++++++++++++++++---\n 1 file changed, 60 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\nindex 219b110..8f486af 100644\n--- a/lib/librte_mbuf/rte_mbuf.h\n+++ b/lib/librte_mbuf/rte_mbuf.h\n@@ -306,6 +306,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 +611,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 +1182,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": [
        "v3",
        "1/4"
    ]
}