get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 130143,
    "url": "http://patchwork.dpdk.org/api/patches/130143/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230811085805.441256-29-ndabilpuram@marvell.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20230811085805.441256-29-ndabilpuram@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230811085805.441256-29-ndabilpuram@marvell.com",
    "date": "2023-08-11T08:58:03",
    "name": "[29/31] net/cnxk: check returned value for null",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fbcb7d35a16d88656c5b48508dfa1a5def28dfa9",
    "submitter": {
        "id": 1202,
        "url": "http://patchwork.dpdk.org/api/people/1202/?format=api",
        "name": "Nithin Dabilpuram",
        "email": "ndabilpuram@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patchwork.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230811085805.441256-29-ndabilpuram@marvell.com/mbox/",
    "series": [
        {
            "id": 29177,
            "url": "http://patchwork.dpdk.org/api/series/29177/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29177",
            "date": "2023-08-11T08:57:35",
            "name": "[01/31] common/cnxk: add aura ref count mechanism",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/29177/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/130143/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/130143/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 CB33243032;\n\tFri, 11 Aug 2023 11:01:04 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CD186432AE;\n\tFri, 11 Aug 2023 10:59:43 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 7DC764329C\n for <dev@dpdk.org>; Fri, 11 Aug 2023 10:59:39 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 37AN2WVC011282 for <dev@dpdk.org>; Fri, 11 Aug 2023 01:59:39 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3sd8ya1gcd-4\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Fri, 11 Aug 2023 01:59:38 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Fri, 11 Aug 2023 01:59:37 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Fri, 11 Aug 2023 01:59:37 -0700",
            "from hyd1588t430.caveonetworks.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id 09C493F706F;\n Fri, 11 Aug 2023 01:59:34 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=8yw6KObC2L5NQ4Ikk3RRkmTVZUn3F0w4SawKPKfe9qQ=;\n b=Njg4Zc1z8vlXYgWSbFrWvPC/ZNdw9XQDXVLIXK8nC2PVNQ9LP+e8WRAQVMa1ajajurUL\n 5tRsgSaIfx5ZPjwrPHQsubY6ufubWvNRuCZ3SFGYIi1VL1vdwgFTE0nW93BC+oULc83S\n 5Rk63IC2ciAuO+S30RjV8ZNfrJrHEObxppJWkgYvcxqaNOkvNU++G6XR8kmnbg25Ajef\n 1Ml/0Cs68spoRj36L74s+p0UMhVOdpqZvRioNiVZrU9J1w1Y1XxxDPtfds3QIIhHZvc+\n oZz/GhJsoqa9Tz/ExiEMbfU+ygNPW/MFGJvYKhGDiHMu3SNCXNpgtGixk9/L+sr+skpX ew==",
        "From": "Nithin Dabilpuram <ndabilpuram@marvell.com>",
        "To": "Nithin Dabilpuram <ndabilpuram@marvell.com>, Kiran Kumar K\n <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>, Satha Rao\n <skoteshwar@marvell.com>",
        "CC": "<jerinj@marvell.com>, <dev@dpdk.org>, Akhil Goyal <gakhil@marvell.com>",
        "Subject": "[PATCH 29/31] net/cnxk: check returned value for null",
        "Date": "Fri, 11 Aug 2023 14:28:03 +0530",
        "Message-ID": "<20230811085805.441256-29-ndabilpuram@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230811085805.441256-1-ndabilpuram@marvell.com>",
        "References": "<20230811085805.441256-1-ndabilpuram@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "MNNgrMRzwvDioj4bkKjaLltCyZaDz_kj",
        "X-Proofpoint-GUID": "MNNgrMRzwvDioj4bkKjaLltCyZaDz_kj",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26\n definitions=2023-08-10_20,2023-08-10_01,2023-05-22_02",
        "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": "From: Akhil Goyal <gakhil@marvell.com>\n\nnix_mtr_find may return NULL in case mtr is not found.\nHence checking the return value before using it.\n\nSigned-off-by: Akhil Goyal <gakhil@marvell.com>\n---\n drivers/net/cnxk/cnxk_ethdev_mtr.c | 20 ++++++++++++++++++++\n 1 file changed, 20 insertions(+)",
    "diff": "diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c\nindex 27a6e4ef3d..edeca6dcc3 100644\n--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c\n+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c\n@@ -613,6 +613,11 @@ cnxk_nix_mtr_destroy(struct rte_eth_dev *eth_dev, uint32_t mtr_id,\n \t\twhile ((mtr->prev_cnt) + 1) {\n \t\t\tmid_mtr =\n \t\t\t\tnix_mtr_find(dev, mtr->prev_id[mtr->prev_cnt]);\n+\t\t\tif (mid_mtr == NULL) {\n+\t\t\t\treturn -rte_mtr_error_set(error, ENOENT,\n+\t\t\t\t\t  RTE_MTR_ERROR_TYPE_MTR_ID, &mtr->prev_id[mtr->prev_cnt],\n+\t\t\t\t\t  \"Mid meter id is invalid.\");\n+\t\t\t}\n \t\t\trc = roc_nix_bpf_connect(nix, ROC_NIX_BPF_LEVEL_F_LEAF,\n \t\t\t\t\t\t mid_mtr->bpf_id,\n \t\t\t\t\t\t ROC_NIX_BPF_ID_INVALID);\n@@ -628,6 +633,11 @@ cnxk_nix_mtr_destroy(struct rte_eth_dev *eth_dev, uint32_t mtr_id,\n \t\twhile (mtr->prev_cnt) {\n \t\t\ttop_mtr =\n \t\t\t\tnix_mtr_find(dev, mtr->prev_id[mtr->prev_cnt]);\n+\t\t\tif (top_mtr == NULL) {\n+\t\t\t\treturn -rte_mtr_error_set(error, ENOENT,\n+\t\t\t\t\t  RTE_MTR_ERROR_TYPE_MTR_ID, &mtr->prev_id[mtr->prev_cnt],\n+\t\t\t\t\t  \"Top meter id is invalid.\");\n+\t\t\t}\n \t\t\trc = roc_nix_bpf_connect(nix, ROC_NIX_BPF_LEVEL_F_MID,\n \t\t\t\t\t\t top_mtr->bpf_id,\n \t\t\t\t\t\t ROC_NIX_BPF_ID_INVALID);\n@@ -1590,6 +1600,8 @@ nix_mtr_color_action_validate(struct rte_eth_dev *eth_dev, uint32_t id,\n \t\tswitch (*tree_level) {\n \t\tcase 0:\n \t\t\tmtr = nix_get_mtr(eth_dev, cur_mtr_id);\n+\t\t\tif (mtr == NULL)\n+\t\t\t\treturn -EINVAL;\n \t\t\tif (mtr->level == ROC_NIX_BPF_LEVEL_IDX_INVALID) {\n \t\t\t\tnix_mtr_level_update(eth_dev, cur_mtr_id, 0);\n \t\t\t\tnix_mtr_chain_update(eth_dev, cur_mtr_id, -1,\n@@ -1605,6 +1617,8 @@ nix_mtr_color_action_validate(struct rte_eth_dev *eth_dev, uint32_t id,\n \t\t\tbreak;\n \t\tcase 1:\n \t\t\tmtr = nix_get_mtr(eth_dev, cur_mtr_id);\n+\t\t\tif (mtr == NULL)\n+\t\t\t\treturn -EINVAL;\n \t\t\tif (mtr->level == ROC_NIX_BPF_LEVEL_IDX_INVALID) {\n \t\t\t\tnix_mtr_level_update(eth_dev, cur_mtr_id, 1);\n \t\t\t\tprev_mtr_id = id;\n@@ -1635,6 +1649,8 @@ nix_mtr_color_action_validate(struct rte_eth_dev *eth_dev, uint32_t id,\n \t\tswitch (*tree_level) {\n \t\tcase 0:\n \t\t\tmtr = nix_get_mtr(eth_dev, cur_mtr_id);\n+\t\t\tif (mtr == NULL)\n+\t\t\t\treturn -EINVAL;\n \t\t\tif (mtr->level == ROC_NIX_BPF_LEVEL_IDX_INVALID) {\n \t\t\t\tnix_mtr_level_update(eth_dev, cur_mtr_id, 0);\n \t\t\t} else {\n@@ -1646,6 +1662,8 @@ nix_mtr_color_action_validate(struct rte_eth_dev *eth_dev, uint32_t id,\n \t\t\tbreak;\n \t\tcase 1:\n \t\t\tmtr = nix_get_mtr(eth_dev, cur_mtr_id);\n+\t\t\tif (mtr == NULL)\n+\t\t\t\treturn -EINVAL;\n \t\t\tif (mtr->level == ROC_NIX_BPF_LEVEL_IDX_INVALID) {\n \t\t\t\tnix_mtr_level_update(eth_dev, cur_mtr_id, 1);\n \t\t\t\tprev_mtr_id = id;\n@@ -1666,6 +1684,8 @@ nix_mtr_color_action_validate(struct rte_eth_dev *eth_dev, uint32_t id,\n \t\t\tbreak;\n \t\tcase 2:\n \t\t\tmtr = nix_get_mtr(eth_dev, cur_mtr_id);\n+\t\t\tif (mtr == NULL)\n+\t\t\t\treturn -EINVAL;\n \t\t\tif (mtr->level == ROC_NIX_BPF_LEVEL_IDX_INVALID) {\n \t\t\t\tnix_mtr_level_update(eth_dev, cur_mtr_id, 2);\n \t\t\t\tprev_mtr_id = *prev_id;\n",
    "prefixes": [
        "29/31"
    ]
}