get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 137036,
    "url": "http://patches.dpdk.org/api/patches/137036/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1708608939-14440-1-git-send-email-wangyunjian@huawei.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": "<1708608939-14440-1-git-send-email-wangyunjian@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1708608939-14440-1-git-send-email-wangyunjian@huawei.com",
    "date": "2024-02-22T13:35:39",
    "name": "[v2] net/af_xdp: fix resources leak when xsk configure fails",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fd887cf75587cb9aba56a863b1da95fb27d1f296",
    "submitter": {
        "id": 551,
        "url": "http://patches.dpdk.org/api/people/551/?format=api",
        "name": "Yunjian Wang",
        "email": "wangyunjian@huawei.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/1708608939-14440-1-git-send-email-wangyunjian@huawei.com/mbox/",
    "series": [
        {
            "id": 31183,
            "url": "http://patches.dpdk.org/api/series/31183/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31183",
            "date": "2024-02-22T13:35:39",
            "name": "[v2] net/af_xdp: fix resources leak when xsk configure fails",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/31183/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/137036/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/137036/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 B29F243B5E;\n\tThu, 22 Feb 2024 14:35:46 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4932340281;\n\tThu, 22 Feb 2024 14:35:46 +0100 (CET)",
            "from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191])\n by mails.dpdk.org (Postfix) with ESMTP id 09BAE4027F;\n Thu, 22 Feb 2024 14:35:43 +0100 (CET)",
            "from mail.maildlp.com (unknown [172.19.88.163])\n by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4TgYxl0Whnz1h0QQ;\n Thu, 22 Feb 2024 21:33:31 +0800 (CST)",
            "from dggpemm500008.china.huawei.com (unknown [7.185.36.136])\n by mail.maildlp.com (Postfix) with ESMTPS id B8F4C18002F;\n Thu, 22 Feb 2024 21:35:40 +0800 (CST)",
            "from localhost (10.174.242.157) by dggpemm500008.china.huawei.com\n (7.185.36.136) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 22 Feb\n 2024 21:35:40 +0800"
        ],
        "From": "Yunjian Wang <wangyunjian@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@amd.com>, <ciara.loftus@intel.com>, <xudingke@huawei.com>,\n Yunjian Wang <wangyunjian@huawei.com>, <stable@dpdk.org>",
        "Subject": "[PATCH v2] net/af_xdp: fix resources leak when xsk configure fails",
        "Date": "Thu, 22 Feb 2024 21:35:39 +0800",
        "Message-ID": "<1708608939-14440-1-git-send-email-wangyunjian@huawei.com>",
        "X-Mailer": "git-send-email 1.9.5.msysgit.1",
        "In-Reply-To": "<1708571262-48380-1-git-send-email-wangyunjian@huawei.com>",
        "References": "<1708571262-48380-1-git-send-email-wangyunjian@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.174.242.157]",
        "X-ClientProxiedBy": "dggems705-chm.china.huawei.com (10.3.19.182) To\n dggpemm500008.china.huawei.com (7.185.36.136)",
        "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": "In xdp_umem_configure() allocated some resources for the\nxsk umem, we should delete them when xsk configure fails,\notherwise it will lead to resources leak.\n\nFixes: f1debd77efaf (\"net/af_xdp: introduce AF_XDP PMD\")\nCc: stable@dpdk.org\n\nSigned-off-by: Yunjian Wang <wangyunjian@huawei.com>\n---\nv2: update code style as suggested by Maryam Tahhan\n---\n drivers/net/af_xdp/rte_eth_af_xdp.c | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c\nindex 2d151e45c7..b52513bd7e 100644\n--- a/drivers/net/af_xdp/rte_eth_af_xdp.c\n+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c\n@@ -960,6 +960,11 @@ remove_xdp_program(struct pmd_internals *internals)\n static void\n xdp_umem_destroy(struct xsk_umem_info *umem)\n {\n+\tif (umem->umem) {\n+\t\t(void)xsk_umem__delete(umem->umem);\n+\t\tumem->umem = NULL;\n+\t}\n+\n #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG)\n \tumem->mb_pool = NULL;\n #else\n@@ -992,11 +997,8 @@ eth_dev_close(struct rte_eth_dev *dev)\n \t\t\tbreak;\n \t\txsk_socket__delete(rxq->xsk);\n \n-\t\tif (__atomic_fetch_sub(&rxq->umem->refcnt, 1, __ATOMIC_ACQUIRE) - 1\n-\t\t\t\t== 0) {\n-\t\t\t(void)xsk_umem__delete(rxq->umem->umem);\n+\t\tif (__atomic_fetch_sub(&rxq->umem->refcnt, 1, __ATOMIC_ACQUIRE) - 1 == 0)\n \t\t\txdp_umem_destroy(rxq->umem);\n-\t\t}\n \n \t\t/* free pkt_tx_queue */\n \t\trte_free(rxq->pair);\n",
    "prefixes": [
        "v2"
    ]
}