get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 117546,
    "url": "https://patches.dpdk.org/api/patches/117546/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20221007032743.2129353-17-g.singh@nxp.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20221007032743.2129353-17-g.singh@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221007032743.2129353-17-g.singh@nxp.com",
    "date": "2022-10-07T03:27:43",
    "name": "[v2,16/16] net/dpaa: fix buffer free in slow path",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a6845755762c34124c8f7ee00d56930371f61f20",
    "submitter": {
        "id": 1068,
        "url": "https://patches.dpdk.org/api/people/1068/?format=api",
        "name": "Gagandeep Singh",
        "email": "g.singh@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20221007032743.2129353-17-g.singh@nxp.com/mbox/",
    "series": [
        {
            "id": 25024,
            "url": "https://patches.dpdk.org/api/series/25024/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=25024",
            "date": "2022-10-07T03:27:27",
            "name": "DPAA and DPAA2 driver changes",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/25024/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/117546/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/117546/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 B5D80A00C2;\n\tFri,  7 Oct 2022 05:30:28 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 25C2942BBD;\n\tFri,  7 Oct 2022 05:29:06 +0200 (CEST)",
            "from EUR02-AM0-obe.outbound.protection.outlook.com\n (mail-am0eur02on2043.outbound.protection.outlook.com [40.107.247.43])\n by mails.dpdk.org (Postfix) with ESMTP id D303C40A80;\n Fri,  7 Oct 2022 05:29:04 +0200 (CEST)",
            "from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14)\n by PAXPR04MB9326.eurprd04.prod.outlook.com (2603:10a6:102:2b8::19)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Fri, 7 Oct\n 2022 03:29:04 +0000",
            "from AS8PR04MB8198.eurprd04.prod.outlook.com\n ([fe80::9ee7:dafa:ba51:c71e]) by AS8PR04MB8198.eurprd04.prod.outlook.com\n ([fe80::9ee7:dafa:ba51:c71e%7]) with mapi id 15.20.5676.032; Fri, 7 Oct 2022\n 03:29:04 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=M4qvITKp/Xltx979qoZblIKJvz09Au8TEVmH9wQ7h2lp0WfcfUuTaomBwZg8OJKJgcEM1kgm0e9zL8J/7hLNVZ1arJB/kFPv9ydYWw7IWhlmoqB/T7v378cAvDPV4mL7vXolezNlN5t4fia1s//11dLgLQWIIoVCoPyJTrYCnOWg6loCjD20N7tWAOY+lPo0kQEjLclf1pHCh3PX6lMmS0r3q1PXgMRUORjXQhjnFsM1Gi6y8COU9E7dJaOPu77LZwKLi6aW42PRTLsGKth7t1inn01qgWaJDHTDWZH0a/lQhwVWIpOpV2w1aos5vNmMB9A54EDydlG+QCMIaXiJqw==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=XIAL+JPKfiUfEWJiJ/7QVa3Jh+ghKJNufpb/DPMEA4E=;\n b=VGgG7h21Ociue5J2lDiXv4+lAPv/bQ9Kid0Njf754X12ZuyN1jcqLqPIX2maRuTZ2SFRiOquGduVyZzwPqBcVgs/gBOwuv4FqHHhpmhSV6cc43tfULDaDDw36CfhhMG1/9Thxy1A+nu9czGrPsqJjrepCJjcBEyrElabbNSMdv5dUfnEhifXglJKly+GRH26W9TqELBtr4K4696Y92BXj77/H3xQn97nHu08gnHG9b0W6lryaACiR7WS5WkidVdieMcnKwheJqoeIlKm+gZJQ2tpnnMVB9kE1uv0kbQEGWAsBPsoU5y0ZaYuaxO5nL3BFKu+FPyHZYY9AZKygkbKjw==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass\n header.d=nxp.com; arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=XIAL+JPKfiUfEWJiJ/7QVa3Jh+ghKJNufpb/DPMEA4E=;\n b=VAvbLTqHLeYRwGE4NavNLrsATxDrH9hdjXEFuT3cpG+Sc7cpjH9DJkj3bZ3p7VR+Clo81MM3HUec9X9XvnAlWXMuVMkjNvMWCo5QY1fq/3ftg5mASuORx3xie25ETnIjrXpn2eovPi0I1r9jYmTxyhBRCEFNCzwCCvDHJ2SJ4CY=",
        "Authentication-Results": "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=nxp.com;",
        "From": "Gagandeep Singh <g.singh@nxp.com>",
        "To": "ferruh.yigit@amd.com,\n\tdev@dpdk.org",
        "Cc": "Gagandeep Singh <g.singh@nxp.com>, stable@dpdk.org,\n Hemant Agrawal <hemant.agrawal@nxp.com>",
        "Subject": "[PATCH v2 16/16] net/dpaa: fix buffer free in slow path",
        "Date": "Fri,  7 Oct 2022 08:57:43 +0530",
        "Message-Id": "<20221007032743.2129353-17-g.singh@nxp.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221007032743.2129353-1-g.singh@nxp.com>",
        "References": "<20220928052516.1279442-1-g.singh@nxp.com>\n <20221007032743.2129353-1-g.singh@nxp.com>",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-ClientProxiedBy": "SG2P153CA0033.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::20)\n To AS8PR04MB8198.eurprd04.prod.outlook.com\n (2603:10a6:20b:3b0::14)",
        "MIME-Version": "1.0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "AS8PR04MB8198:EE_|PAXPR04MB9326:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "b7333daa-66de-4937-dd6e-08daa8141555",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n wLCeYAz55ZTy3rON678uI/sfbXPL5udu7SZ13fhhrSnjC9mtmEjw/EN+TxRs89poel3mY87K0u9JWvkhCCPV7JGSFJCldk3M5SzYjSoCOk/xYKY7MfoncgRFFlGIln9fsJO4ECZvQMgybBEFobwjPwYX+zI6GaIAgso/LFaMHj23r8wan+pxuU0m/8Z8TOt9iKJLXdIObhH5jC2CEMxhDwE9Ym05dKWsApIVYBs5Kqkju/8rV5aIHDnoV+pSXrYe9KmStORjRn6/GAplgxWP0YPrLdHYG8HLhml02crewuA3TOKhGaXAptrt4opR6gZXp6SrSFfmXUuEOdr2RL8qoeZV7bORKlaiyYYEaK678Ffq+GFJ3Z1o7O/RDwazfvk+ja9okCt6ih8TtngdUJ8bPI0G4hYQ3WiboFlYgpHFe1YxG0aAPYrc6urJRXpCPpB9/8780ONrIxpf8EOecYmJbS/5nI0VuTV5Bhl/2XMhRHEr7fn/hZynY7Jr7+7KATtTkSh9uIaZqGx+UDrqh/BlKuNKD2yI4lqWLQLeU5mUSnSYl2ZBIXkTUeoJJ6TqwxMolfJYMLzhH/xt/EgrVvbcXS8h5Cjf3dMK9EMAm6fLLKbDT4ekNJQFU09pbAxf3rmrWD8FEQ5MGW/6FpmP0SiXlDdhvCb3klMhJcB5adL1WEyBORxliIW/ULczmJq7QHbkYxWO3AbeTjL2Spa/cs6TLmooXP8fH4C1OFFo1eascxLJCjp1rzjMyNaC+B3LJzX/MNu7jlnkGbSGuTvmnVn7yA==",
        "X-Forefront-Antispam-Report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230022)(4636009)(376002)(136003)(396003)(39860400002)(346002)(366004)(451199015)(2906002)(5660300002)(66946007)(66556008)(66476007)(54906003)(478600001)(8676002)(316002)(86362001)(6486002)(4326008)(41300700001)(6666004)(6506007)(38100700002)(26005)(52116002)(6512007)(38350700002)(83380400001)(8936002)(36756003)(2616005)(1076003)(186003);\n DIR:OUT; SFP:1101;",
        "X-MS-Exchange-AntiSpam-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7iEyJo2tT4vgi1j8vYNc2dILu+kWjTEdOb8odUI4+kXanQ4VcUcQ7FUDC+aWJELV72iuILd1pTAHuDrx0vekdvs/jQ2ZcytZ4tIGLqKPl7X5l5TxqnA1iOw+6ZSUtGgLtOx2HmU38AV3ewRdDmYUhgcyPRV3y5JKBUZwQmnpAA5/Uo5inLKEKEiWavR5jFGAVQGNN+54M0wS++i1fYMoKAMHKSTYCXzfbsfVvUkbwxXiE0ZbzaDyzLUVv7Ry0chK5f+CWkjBuPBYRP/kKlFwd+KcheBq1BJ6eutzIIDY0PMbrC4lDy3j2CvyPAbgqdUdKsuE1z9DyXbNp9ANpWFH4/Tfa/O+RQD9noSehNKuMWPJeoc4bCNs6/VUB3KurObjyInbzmNtMpiGo6whzsfnLQ+GaQLKkPPWpkYV7HcD+8hpe9fJmP0+ILZ9aL0DjoYSiZWAU7ZQ5hO7cyaNOsl/DObJxaBiu28zAX4ju7PQ6O99e73M6n244u1qjcb36MdimnUw/zIAR81tBuVh8qRGYYlf+1edUPxUuHnaKCxqQhv1QDGE9qvQIFx",
        "X-OriginatorOrg": "nxp.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n b7333daa-66de-4937-dd6e-08daa8141555",
        "X-MS-Exchange-CrossTenant-AuthSource": "AS8PR04MB8198.eurprd04.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Internal",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "07 Oct 2022 03:29:03.9137 (UTC)",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted",
        "X-MS-Exchange-CrossTenant-Id": "686ea1d3-bc2b-4c6f-a92c-d99c5c301635",
        "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED",
        "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n b0RyRavk8tqs6W/lxTt7irV4mDqfldggOmiVDXnZ0QVY3PglCzIxbuOguOFnIYkb",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "PAXPR04MB9326",
        "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": "If there is any error in packet or taildrop feature is enabled,\nHW can reject those packets and put them in error queue. Driver\npoll this error queue to free the buffers.\nDPAA driver has an issue while freeing these rejected buffers. In\ncase of scatter gather packets, it is preparing the mbuf SG list\nby scanning the HW descriptors and once the mbuf SG list prepared,\nit free only first segment of the mbuf SG list by calling the\nAPI rte_pktmbuf_free_seg(), This will leak the memory of other\nsegments and mempool can be empty.\n\nAlso there is one more issue, external buffer's memory may not\nbelong to mempool so driver itself free the external buffer\nafter successfully send the packet to HW to transmit instead of\nlet the HW to free it. So transmit function free all the external\nbuffers. But driver has no check for external buffers\nwhile freeing the rejected buffers and this can do double free the\nmemory which can corrupt the user pool and crashes and undefined\nbehaviour of system can be seen.\n\nThis patch fixes the above mentioned issue by checking each\nand every segment and freeing all the segments except external.\n\nFixes: 9124e65dd3eb (\"net/dpaa: enable Tx queue taildrop\")\nCc: stable@dpdk.org\n\nSigned-off-by: Gagandeep Singh <g.singh@nxp.com>\nAcked-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n drivers/net/dpaa/dpaa_rxtx.c | 23 ++++++++---------------\n 1 file changed, 8 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c\nindex 4d285b4f38..ce4f3d6c85 100644\n--- a/drivers/net/dpaa/dpaa_rxtx.c\n+++ b/drivers/net/dpaa/dpaa_rxtx.c\n@@ -455,7 +455,7 @@ dpaa_free_mbuf(const struct qm_fd *fd)\n \tbp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid);\n \tformat = (fd->opaque & DPAA_FD_FORMAT_MASK) >> DPAA_FD_FORMAT_SHIFT;\n \tif (unlikely(format == qm_fd_sg)) {\n-\t\tstruct rte_mbuf *first_seg, *prev_seg, *cur_seg, *temp;\n+\t\tstruct rte_mbuf *first_seg, *cur_seg;\n \t\tstruct qm_sg_entry *sgt, *sg_temp;\n \t\tvoid *vaddr, *sg_vaddr;\n \t\tint i = 0;\n@@ -469,32 +469,25 @@ dpaa_free_mbuf(const struct qm_fd *fd)\n \t\tsgt = vaddr + fd_offset;\n \t\tsg_temp = &sgt[i++];\n \t\thw_sg_to_cpu(sg_temp);\n-\t\ttemp = (struct rte_mbuf *)\n-\t\t\t((char *)vaddr - bp_info->meta_data_size);\n \t\tsg_vaddr = DPAA_MEMPOOL_PTOV(bp_info,\n \t\t\t\t\t\tqm_sg_entry_get64(sg_temp));\n-\n \t\tfirst_seg = (struct rte_mbuf *)((char *)sg_vaddr -\n \t\t\t\t\t\tbp_info->meta_data_size);\n \t\tfirst_seg->nb_segs = 1;\n-\t\tprev_seg = first_seg;\n \t\twhile (i < DPAA_SGT_MAX_ENTRIES) {\n \t\t\tsg_temp = &sgt[i++];\n \t\t\thw_sg_to_cpu(sg_temp);\n-\t\t\tsg_vaddr = DPAA_MEMPOOL_PTOV(bp_info,\n+\t\t\tif (sg_temp->bpid != 0xFF) {\n+\t\t\t\tbp_info = DPAA_BPID_TO_POOL_INFO(sg_temp->bpid);\n+\t\t\t\tsg_vaddr = DPAA_MEMPOOL_PTOV(bp_info,\n \t\t\t\t\t\tqm_sg_entry_get64(sg_temp));\n-\t\t\tcur_seg = (struct rte_mbuf *)((char *)sg_vaddr -\n+\t\t\t\tcur_seg = (struct rte_mbuf *)((char *)sg_vaddr -\n \t\t\t\t\t\t      bp_info->meta_data_size);\n-\t\t\tfirst_seg->nb_segs += 1;\n-\t\t\tprev_seg->next = cur_seg;\n-\t\t\tif (sg_temp->final) {\n-\t\t\t\tcur_seg->next = NULL;\n-\t\t\t\tbreak;\n+\t\t\t\trte_pktmbuf_free_seg(cur_seg);\n \t\t\t}\n-\t\t\tprev_seg = cur_seg;\n+\t\t\tif (sg_temp->final)\n+\t\t\t\tbreak;\n \t\t}\n-\n-\t\trte_pktmbuf_free_seg(temp);\n \t\trte_pktmbuf_free_seg(first_seg);\n \t\treturn 0;\n \t}\n",
    "prefixes": [
        "v2",
        "16/16"
    ]
}