get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 101083,
    "url": "https://patches.dpdk.org/api/patches/101083/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211011155057.302142-5-skori@marvell.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": "<20211011155057.302142-5-skori@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211011155057.302142-5-skori@marvell.com",
    "date": "2021-10-11T15:50:32",
    "name": "[v4,04/28] common/cnxk: support RoC API to alloc bandwidth profiles",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4c21d9423fb46622af626c648afb1fba147b56be",
    "submitter": {
        "id": 1318,
        "url": "https://patches.dpdk.org/api/people/1318/?format=api",
        "name": "Sunil Kumar Kori",
        "email": "skori@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20211011155057.302142-5-skori@marvell.com/mbox/",
    "series": [
        {
            "id": 19528,
            "url": "https://patches.dpdk.org/api/series/19528/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19528",
            "date": "2021-10-11T15:50:28",
            "name": "Support ingress policer",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/19528/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/101083/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/101083/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 3EFE4A034F;\n\tMon, 11 Oct 2021 17:51:30 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4B8174115D;\n\tMon, 11 Oct 2021 17:51:16 +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 3C56641157\n for <dev@dpdk.org>; Mon, 11 Oct 2021 17:51:15 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id\n 19BEHdfi030603;\n Mon, 11 Oct 2021 08:51:13 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com with ESMTP id 3bmpv4rc13-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 11 Oct 2021 08:51:13 -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.18;\n Mon, 11 Oct 2021 08:51:11 -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.18 via Frontend\n Transport; Mon, 11 Oct 2021 08:51:11 -0700",
            "from localhost.localdomain (unknown [10.28.34.25])\n by maili.marvell.com (Postfix) with ESMTP id 2D69A3F707B;\n Mon, 11 Oct 2021 08:51:08 -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=5BvD7ljDjPyP9OOVqFx0uQd1Sva8gK3u6cMgXLyABdw=;\n b=PemdZY8l0lo4dSknxIjNsRJC3MXOnuT7ulpbuhgXndJPw9w90ngL5EJYJBHgf6/l6lhO\n YBsi2iCZ06tnG32pvp9WydHRwgVXlthfpNBbuiSYvKDlbsJVY9z/5X+XeXuWoXpSKgrA\n q377os7FbV+ICQmSdDTF4QIGfZibqlKaIvNf2Jc50mFFlSGEI7YFhq73On7+BagRDG3a\n +WrCI8COiaoWiAtvzErKdmebmzu1UaimyZr35oUW/6+1tkeeZSMlw7x9uZiHI5XYbQvw\n kGvnfKMKmxiK26Ruy6OsAyhseYHjyA1naB4g6lhoceKi0Dl00Z6VyT/yshBo22PrDo8a FA==",
        "From": "<skori@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>, Ray Kinsella <mdr@ashroe.eu>",
        "CC": "<dev@dpdk.org>",
        "Date": "Mon, 11 Oct 2021 21:20:32 +0530",
        "Message-ID": "<20211011155057.302142-5-skori@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20211011155057.302142-1-skori@marvell.com>",
        "References": "<20210930090844.1059326-1-skori@marvell.com>\n <20211011155057.302142-1-skori@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "aEaw5nX81oqxGxQeULR2Vjuc5IADPVpl",
        "X-Proofpoint-GUID": "aEaw5nX81oqxGxQeULR2Vjuc5IADPVpl",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475\n definitions=2021-10-11_05,2021-10-11_01,2020-04-07_01",
        "Subject": "[dpdk-dev] [PATCH v4 04/28] common/cnxk: support RoC API to alloc\n bandwidth profiles",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Sunil Kumar Kori <skori@marvell.com>\n\nImplement RoC API to allocate HW resources i.e. bandwidth\nprofiles for policer processing on CN10K platform.\n\nSigned-off-by: Sunil Kumar Kori <skori@marvell.com>\n---\nv4:\n - Rebase support on dpdk-next-net-mrvl branch\n - Handled meter action during flow destroy\n - Handled meter cleanup during port shutdown\n \nv3:\n - Rebase support on latest DPDK\n - Handled multilevel chaining for tree hierarchy\n - Fix naming convention\nv2:\n - Rebase support on latest DPDK\n - Handled multilevel chaining for linear hierarchy\n - Review comments incorporated\n\n drivers/common/cnxk/roc_nix.h     |  11 ++++\n drivers/common/cnxk/roc_nix_bpf.c | 104 ++++++++++++++++++++++++++++++\n drivers/common/cnxk/version.map   |   1 +\n 3 files changed, 116 insertions(+)",
    "diff": "diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h\nindex 4fef6d44e7..b192a2b217 100644\n--- a/drivers/common/cnxk/roc_nix.h\n+++ b/drivers/common/cnxk/roc_nix.h\n@@ -6,6 +6,7 @@\n #define _ROC_NIX_H_\n \n /* Constants */\n+#define ROC_NIX_BPF_PER_PFFUNC\t      64\n #define ROC_NIX_BPF_LEVEL_IDX_INVALID 0xFF\n #define ROC_NIX_BPF_LEVEL_MAX\t      3\n \n@@ -38,6 +39,12 @@ enum roc_nix_bpf_level_flag {\n \tROC_NIX_BPF_LEVEL_F_TOP = BIT(2),\n };\n \n+struct roc_nix_bpf_objs {\n+\tuint16_t level;\n+\tuint16_t count;\n+\tuint16_t ids[ROC_NIX_BPF_PER_PFFUNC];\n+};\n+\n struct roc_nix_vlan_config {\n \tuint32_t type;\n \tunion {\n@@ -522,6 +529,10 @@ int __roc_api\n roc_nix_bpf_count_get(struct roc_nix *roc_nix, uint8_t lvl_mask,\n \t\t      uint16_t count[ROC_NIX_BPF_LEVEL_MAX] /* Out */);\n \n+int __roc_api roc_nix_bpf_alloc(struct roc_nix *roc_nix, uint8_t lvl_mask,\n+\t\t\t\tuint16_t per_lvl_cnt[ROC_NIX_BPF_LEVEL_MAX],\n+\t\t\t\tstruct roc_nix_bpf_objs *profs /* Out */);\n+\n uint8_t __roc_api\n roc_nix_bpf_level_to_idx(enum roc_nix_bpf_level_flag lvl_flag);\n \ndiff --git a/drivers/common/cnxk/roc_nix_bpf.c b/drivers/common/cnxk/roc_nix_bpf.c\nindex af9dffa90c..06394bda07 100644\n--- a/drivers/common/cnxk/roc_nix_bpf.c\n+++ b/drivers/common/cnxk/roc_nix_bpf.c\n@@ -13,6 +13,19 @@\n \t(ROC_NIX_BPF_LEVEL_F_LEAF | ROC_NIX_BPF_LEVEL_F_MID |                  \\\n \t ROC_NIX_BPF_LEVEL_F_TOP)\n \n+static uint8_t sw_to_hw_lvl_map[] = {NIX_RX_BAND_PROF_LAYER_LEAF,\n+\t\t\t\t     NIX_RX_BAND_PROF_LAYER_MIDDLE,\n+\t\t\t\t     NIX_RX_BAND_PROF_LAYER_TOP};\n+\n+static inline struct mbox *\n+get_mbox(struct roc_nix *roc_nix)\n+{\n+\tstruct nix *nix = roc_nix_to_nix_priv(roc_nix);\n+\tstruct dev *dev = &nix->dev;\n+\n+\treturn dev->mbox;\n+}\n+\n uint8_t\n roc_nix_bpf_level_to_idx(enum roc_nix_bpf_level_flag level_f)\n {\n@@ -66,3 +79,94 @@ roc_nix_bpf_count_get(struct roc_nix *roc_nix, uint8_t lvl_mask,\n \n \treturn 0;\n }\n+\n+int\n+roc_nix_bpf_alloc(struct roc_nix *roc_nix, uint8_t lvl_mask,\n+\t\t  uint16_t per_lvl_cnt[ROC_NIX_BPF_LEVEL_MAX],\n+\t\t  struct roc_nix_bpf_objs *profs)\n+{\n+\tuint8_t mask = lvl_mask & NIX_BPF_LEVEL_F_MASK;\n+\tstruct mbox *mbox = get_mbox(roc_nix);\n+\tstruct nix_bandprof_alloc_req *req;\n+\tstruct nix_bandprof_alloc_rsp *rsp;\n+\tuint8_t leaf_idx, mid_idx, top_idx;\n+\tint rc = -ENOSPC, i;\n+\n+\tif (roc_model_is_cn9k())\n+\t\treturn NIX_ERR_HW_NOTSUP;\n+\n+\tif (!mask)\n+\t\treturn NIX_ERR_PARAM;\n+\n+\tleaf_idx = roc_nix_bpf_level_to_idx(mask & ROC_NIX_BPF_LEVEL_F_LEAF);\n+\tmid_idx = roc_nix_bpf_level_to_idx(mask & ROC_NIX_BPF_LEVEL_F_MID);\n+\ttop_idx = roc_nix_bpf_level_to_idx(mask & ROC_NIX_BPF_LEVEL_F_TOP);\n+\n+\tif ((leaf_idx != ROC_NIX_BPF_LEVEL_IDX_INVALID) &&\n+\t    (per_lvl_cnt[leaf_idx] > NIX_MAX_BPF_COUNT_LEAF_LAYER))\n+\t\treturn NIX_ERR_INVALID_RANGE;\n+\n+\tif ((mid_idx != ROC_NIX_BPF_LEVEL_IDX_INVALID) &&\n+\t    (per_lvl_cnt[mid_idx] > NIX_MAX_BPF_COUNT_MID_LAYER))\n+\t\treturn NIX_ERR_INVALID_RANGE;\n+\n+\tif ((top_idx != ROC_NIX_BPF_LEVEL_IDX_INVALID) &&\n+\t    (per_lvl_cnt[top_idx] > NIX_MAX_BPF_COUNT_TOP_LAYER))\n+\t\treturn NIX_ERR_INVALID_RANGE;\n+\n+\treq = mbox_alloc_msg_nix_bandprof_alloc(mbox);\n+\tif (req == NULL)\n+\t\tgoto exit;\n+\n+\tif (leaf_idx != ROC_NIX_BPF_LEVEL_IDX_INVALID) {\n+\t\treq->prof_count[sw_to_hw_lvl_map[leaf_idx]] =\n+\t\t\tper_lvl_cnt[leaf_idx];\n+\t}\n+\n+\tif (mid_idx != ROC_NIX_BPF_LEVEL_IDX_INVALID) {\n+\t\treq->prof_count[sw_to_hw_lvl_map[mid_idx]] =\n+\t\t\tper_lvl_cnt[mid_idx];\n+\t}\n+\n+\tif (top_idx != ROC_NIX_BPF_LEVEL_IDX_INVALID) {\n+\t\treq->prof_count[sw_to_hw_lvl_map[top_idx]] =\n+\t\t\tper_lvl_cnt[top_idx];\n+\t}\n+\n+\trc = mbox_process_msg(mbox, (void *)&rsp);\n+\tif (rc)\n+\t\tgoto exit;\n+\n+\tif (leaf_idx != ROC_NIX_BPF_LEVEL_IDX_INVALID) {\n+\t\tprofs[leaf_idx].level = leaf_idx;\n+\t\tprofs[leaf_idx].count =\n+\t\t\trsp->prof_count[sw_to_hw_lvl_map[leaf_idx]];\n+\t\tfor (i = 0; i < profs[leaf_idx].count; i++) {\n+\t\t\tprofs[leaf_idx].ids[i] =\n+\t\t\t\trsp->prof_idx[sw_to_hw_lvl_map[leaf_idx]][i];\n+\t\t}\n+\t}\n+\n+\tif (mid_idx != ROC_NIX_BPF_LEVEL_IDX_INVALID) {\n+\t\tprofs[mid_idx].level = mid_idx;\n+\t\tprofs[mid_idx].count =\n+\t\t\trsp->prof_count[sw_to_hw_lvl_map[mid_idx]];\n+\t\tfor (i = 0; i < profs[mid_idx].count; i++) {\n+\t\t\tprofs[mid_idx].ids[i] =\n+\t\t\t\trsp->prof_idx[sw_to_hw_lvl_map[mid_idx]][i];\n+\t\t}\n+\t}\n+\n+\tif (top_idx != ROC_NIX_BPF_LEVEL_IDX_INVALID) {\n+\t\tprofs[top_idx].level = top_idx;\n+\t\tprofs[top_idx].count =\n+\t\t\trsp->prof_count[sw_to_hw_lvl_map[top_idx]];\n+\t\tfor (i = 0; i < profs[top_idx].count; i++) {\n+\t\t\tprofs[top_idx].ids[i] =\n+\t\t\t\trsp->prof_idx[sw_to_hw_lvl_map[top_idx]][i];\n+\t\t}\n+\t}\n+\n+exit:\n+\treturn rc;\n+}\ndiff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map\nindex 6990c1f084..b8863a1155 100644\n--- a/drivers/common/cnxk/version.map\n+++ b/drivers/common/cnxk/version.map\n@@ -82,6 +82,7 @@ INTERNAL {\n \troc_model;\n \troc_se_auth_key_set;\n \troc_se_ciph_key_set;\n+\troc_nix_bpf_alloc;\n \troc_nix_bpf_count_get;\n \troc_nix_bpf_level_to_idx;\n \troc_nix_cq_dump;\n",
    "prefixes": [
        "v4",
        "04/28"
    ]
}