get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 134778,
    "url": "http://patches.dpdk.org/api/patches/134778/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231204023910.1714667-1-feifei.wang2@arm.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": "<20231204023910.1714667-1-feifei.wang2@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231204023910.1714667-1-feifei.wang2@arm.com",
    "date": "2023-12-04T02:39:10",
    "name": "[v1] mbuf: remove the redundant code for mbuf prefree",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "26c43dacf014baade39523fa959058595e68b7ea",
    "submitter": {
        "id": 1771,
        "url": "http://patches.dpdk.org/api/people/1771/?format=api",
        "name": "Feifei Wang",
        "email": "feifei.wang2@arm.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20231204023910.1714667-1-feifei.wang2@arm.com/mbox/",
    "series": [
        {
            "id": 30435,
            "url": "http://patches.dpdk.org/api/series/30435/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30435",
            "date": "2023-12-04T02:39:10",
            "name": "[v1] mbuf: remove the redundant code for mbuf prefree",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/30435/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/134778/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/134778/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 4A76843666;\n\tMon,  4 Dec 2023 03:39:25 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 21026402AE;\n\tMon,  4 Dec 2023 03:39:25 +0100 (CET)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id 100114026C\n for <dev@dpdk.org>; Mon,  4 Dec 2023 03:39:23 +0100 (CET)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 89F54165C;\n Sun,  3 Dec 2023 18:40:09 -0800 (PST)",
            "from net-x86-dell-8268.shanghai.arm.com\n (net-x86-dell-8268.shanghai.arm.com [10.169.210.116])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D92823F6C4;\n Sun,  3 Dec 2023 18:39:20 -0800 (PST)"
        ],
        "From": "Feifei Wang <feifei.wang2@arm.com>",
        "To": "",
        "Cc": "dev@dpdk.org, nd@arm.com, Feifei Wang <feifei.wang2@arm.com>,\n Ruifeng Wang <ruifeng.wang@arm.com>",
        "Subject": "[PATCH v1] mbuf: remove the redundant code for mbuf prefree",
        "Date": "Mon,  4 Dec 2023 10:39:10 +0800",
        "Message-Id": "<20231204023910.1714667-1-feifei.wang2@arm.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "For 'rte_pktmbuf_prefree_seg' function, 'rte_mbuf_refcnt_read(m) == 1'\nand '__rte_mbuf_refcnt_update(m, -1) == 0' are the same cases where\nmbuf's refcnt value should be 1. Thus we can simplify the code and\nremove the redundant part.\n\nFurthermore, according to [1], when the mbuf is stored inside the\nmempool, the m->refcnt value should be 1. And then it is detached\nfrom its parent for an indirect mbuf. Thus change the description of\n'rte_pktmbuf_prefree_seg' function.\n\n[1] https://patches.dpdk.org/project/dpdk/patch/20170404162807.20157-4-olivier.matz@6wind.com/\n\nSuggested-by: Ruifeng Wang <ruifeng.wang@arm.com>\nSigned-off-by: Feifei Wang <feifei.wang2@arm.com>\n---\n lib/mbuf/rte_mbuf.h | 22 +++-------------------\n 1 file changed, 3 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/lib/mbuf/rte_mbuf.h b/lib/mbuf/rte_mbuf.h\nindex 286b32b788..42e9b50d51 100644\n--- a/lib/mbuf/rte_mbuf.h\n+++ b/lib/mbuf/rte_mbuf.h\n@@ -1328,7 +1328,7 @@ static inline int __rte_pktmbuf_pinned_extbuf_decref(struct rte_mbuf *m)\n  *\n  * This function does the same than a free, except that it does not\n  * return the segment to its pool.\n- * It decreases the reference counter, and if it reaches 0, it is\n+ * It decreases the reference counter, and if it reaches 1, it is\n  * detached from its parent for an indirect mbuf.\n  *\n  * @param m\n@@ -1358,25 +1358,9 @@ rte_pktmbuf_prefree_seg(struct rte_mbuf *m)\n \t\t\tm->nb_segs = 1;\n \n \t\treturn m;\n-\n-\t} else if (__rte_mbuf_refcnt_update(m, -1) == 0) {\n-\n-\t\tif (!RTE_MBUF_DIRECT(m)) {\n-\t\t\trte_pktmbuf_detach(m);\n-\t\t\tif (RTE_MBUF_HAS_EXTBUF(m) &&\n-\t\t\t    RTE_MBUF_HAS_PINNED_EXTBUF(m) &&\n-\t\t\t    __rte_pktmbuf_pinned_extbuf_decref(m))\n-\t\t\t\treturn NULL;\n-\t\t}\n-\n-\t\tif (m->next != NULL)\n-\t\t\tm->next = NULL;\n-\t\tif (m->nb_segs != 1)\n-\t\t\tm->nb_segs = 1;\n-\t\trte_mbuf_refcnt_set(m, 1);\n-\n-\t\treturn m;\n \t}\n+\n+\t__rte_mbuf_refcnt_update(m, -1);\n \treturn NULL;\n }\n \n",
    "prefixes": [
        "v1"
    ]
}