get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 103426,
    "url": "http://patches.dpdk.org/api/patches/103426/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211102055802.1801583-2-rkudurumalla@marvell.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": "<20211102055802.1801583-2-rkudurumalla@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211102055802.1801583-2-rkudurumalla@marvell.com",
    "date": "2021-11-02T05:58:02",
    "name": "[2/2] net/cnxk: integrate bpfcount get MBOX interface",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e15672f734b218d67ceb9b9a4a9e5b2aa6720f5d",
    "submitter": {
        "id": 2289,
        "url": "http://patches.dpdk.org/api/people/2289/?format=api",
        "name": "Rakesh Kudurumalla",
        "email": "rkudurumalla@marvell.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20211102055802.1801583-2-rkudurumalla@marvell.com/mbox/",
    "series": [
        {
            "id": 20193,
            "url": "http://patches.dpdk.org/api/series/20193/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=20193",
            "date": "2021-11-02T05:58:01",
            "name": "[1/2] common/cnxk: change policer timeuint to configured value",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/20193/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/103426/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/103426/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 83633A0C4E;\n\tTue,  2 Nov 2021 06:59:22 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 727F4410FF;\n\tTue,  2 Nov 2021 06:59:22 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 9C3664068F\n for <dev@dpdk.org>; Tue,  2 Nov 2021 06:59:21 +0100 (CET)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id\n 1A23CBw2011690\n for <dev@dpdk.org>; Mon, 1 Nov 2021 22:59:20 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3c2w7bgngn-2\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Mon, 01 Nov 2021 22:59:20 -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, 1 Nov 2021 22:59:18 -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, 1 Nov 2021 22:59:19 -0700",
            "from localhost.localdomain (unknown [10.28.48.103])\n by maili.marvell.com (Postfix) with ESMTP id 35F4C3F70B7;\n Mon,  1 Nov 2021 22:59:14 -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=1DHm/RgbSex6uvTArF4Rp/IyW203N/x/bstVin7OlWs=;\n b=ZA/Kzor+7cGcsgGjMiV4AHpFZU66UVKjPh9HNwLYLAmrH/D0laUo2f+6rIfJbzlibJ/r\n UIiB6qcCzvJ/Jd4kcBR5FNPT91A5sPh+B3ielm0ObMJgwGrWBxHdnowkgJVQYsu41Mpa\n bmOSFPEv9hSV+RkOOMACZ0/QJYSONCI+92tRqUQc0WiRYTzUHhYPZASB41Qbjy5PixTr\n +mpe9x8OOdrZ77SZ9216eRtQjplo7bJeqw/0rg3XYPXy61y2GO0BY3Tqvu9TYyKBfC0g\n ocsWNQAmQ/aEJVT26qMI/TZn6Gizmg3PJn7qSyIhYOUh0od6aaHKn5NjFS2wkculkvAM qw==",
        "From": "Rakesh Kudurumalla <rkudurumalla@marvell.com>",
        "To": "<jerinj@marvell.com>, Nithin Dabilpuram <ndabilpuram@marvell.com>, \"Kiran\n Kumar K\" <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>,\n Satha Rao <skoteshwar@marvell.com>",
        "CC": "<dev@dpdk.org>, Rakesh Kudurumalla <rkudurumalla@marvell.com>",
        "Date": "Tue, 2 Nov 2021 11:28:02 +0530",
        "Message-ID": "<20211102055802.1801583-2-rkudurumalla@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20211102055802.1801583-1-rkudurumalla@marvell.com>",
        "References": "<20211102055802.1801583-1-rkudurumalla@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "IxG5vLTKq9iNDD8Y0oRWlPRG_DQ17TUd",
        "X-Proofpoint-GUID": "IxG5vLTKq9iNDD8Y0oRWlPRG_DQ17TUd",
        "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-11-02_01,2021-11-01_01,2020-04-07_01",
        "Subject": "[dpdk-dev] [PATCH 2/2] net/cnxk: integrate bpfcount get MBOX\n interface",
        "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": "Bpf count is updated in meter capabilities during device\ninitialization using mbox interface\n\nSigned-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>\n---\n drivers/net/cnxk/cn10k_rte_flow.c  |  2 +-\n drivers/net/cnxk/cnxk_ethdev.c     |  4 ++-\n drivers/net/cnxk/cnxk_ethdev.h     |  1 +\n drivers/net/cnxk/cnxk_ethdev_mtr.c | 39 ++++++++++++++++++++++++------\n 4 files changed, 37 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/drivers/net/cnxk/cn10k_rte_flow.c b/drivers/net/cnxk/cn10k_rte_flow.c\nindex dff4c7746c..b830abe63e 100644\n--- a/drivers/net/cnxk/cn10k_rte_flow.c\n+++ b/drivers/net/cnxk/cn10k_rte_flow.c\n@@ -249,7 +249,7 @@ cn10k_flow_destroy(struct rte_eth_dev *eth_dev, struct rte_flow *rte_flow,\n \n \tmtr_id = flow->mtr_id;\n \trc = cnxk_flow_destroy(eth_dev, flow, error);\n-\tif (!rc) {\n+\tif (!rc && mtr_id != ROC_NIX_MTR_ID_INVALID) {\n \t\trc = cn10k_mtr_destroy(eth_dev, mtr_id);\n \t\tif (rc) {\n \t\t\trte_flow_error_set(error, ENXIO,\ndiff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c\nindex db54468dbc..a7d9978d70 100644\n--- a/drivers/net/cnxk/cnxk_ethdev.c\n+++ b/drivers/net/cnxk/cnxk_ethdev.c\n@@ -730,11 +730,13 @@ nix_free_queue_mem(struct cnxk_eth_dev *dev)\n static int\n nix_ingress_policer_setup(struct cnxk_eth_dev *dev)\n {\n+\tstruct rte_eth_dev *eth_dev = dev->eth_dev;\n+\n \tTAILQ_INIT(&dev->mtr_profiles);\n \tTAILQ_INIT(&dev->mtr_policy);\n \tTAILQ_INIT(&dev->mtr);\n \n-\treturn 0;\n+\treturn nix_mtr_capabilities_init(eth_dev);\n }\n \n static int\ndiff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h\nindex 7e4939f0b9..d7c4b3e319 100644\n--- a/drivers/net/cnxk/cnxk_ethdev.h\n+++ b/drivers/net/cnxk/cnxk_ethdev.h\n@@ -590,6 +590,7 @@ struct cnxk_meter_node *nix_get_mtr(struct rte_eth_dev *eth_dev,\n \t\t\t\t    uint32_t cur_id);\n int nix_mtr_level_update(struct rte_eth_dev *eth_dev, uint32_t id,\n \t\t\t uint32_t level);\n+int nix_mtr_capabilities_init(struct rte_eth_dev *eth_dev);\n int nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id);\n int nix_mtr_connect(struct rte_eth_dev *eth_dev, uint32_t id);\n int nix_mtr_destroy(struct rte_eth_dev *eth_dev, uint32_t id,\ndiff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c\nindex 22c85336d9..39d8563826 100644\n--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c\n+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c\n@@ -28,7 +28,6 @@ static const enum roc_nix_bpf_level_flag lvl_map[] = {ROC_NIX_BPF_LEVEL_F_LEAF,\n \t\t\t\t\t\t      ROC_NIX_BPF_LEVEL_F_TOP};\n \n static struct rte_mtr_capabilities mtr_capa = {\n-\t.n_max = NIX_MTR_COUNT_MAX,\n \t.n_shared_max = NIX_MTR_COUNT_PER_FLOW,\n \t/* .identical = , */\n \t.shared_identical = true,\n@@ -36,11 +35,7 @@ static struct rte_mtr_capabilities mtr_capa = {\n \t.chaining_n_mtrs_per_flow_max = NIX_MTR_COUNT_PER_FLOW,\n \t.chaining_use_prev_mtr_color_supported = true,\n \t.chaining_use_prev_mtr_color_enforced = true,\n-\t.meter_srtcm_rfc2697_n_max = NIX_MTR_COUNT_MAX,\n-\t.meter_trtcm_rfc2698_n_max = NIX_MTR_COUNT_MAX,\n-\t.meter_trtcm_rfc4115_n_max = NIX_MTR_COUNT_MAX,\n \t.meter_rate_max = NIX_BPF_RATE_MAX / 8, /* Bytes per second */\n-\t.meter_policy_n_max = NIX_MTR_COUNT_MAX,\n \t.color_aware_srtcm_rfc2697_supported = true,\n \t.color_aware_trtcm_rfc2698_supported = true,\n \t.color_aware_trtcm_rfc4115_supported = true,\n@@ -185,12 +180,33 @@ cnxk_nix_mtr_capabilities_get(struct rte_eth_dev *dev,\n \t\t\t      struct rte_mtr_capabilities *capa,\n \t\t\t      struct rte_mtr_error *error)\n {\n+\tstruct cnxk_eth_dev *eth_dev = cnxk_eth_pmd_priv(dev);\n+\tuint16_t count[ROC_NIX_BPF_LEVEL_MAX] = {0};\n+\tuint8_t lvl_mask = ROC_NIX_BPF_LEVEL_F_LEAF | ROC_NIX_BPF_LEVEL_F_MID |\n+\t\t\t   ROC_NIX_BPF_LEVEL_F_TOP;\n+\tstruct roc_nix *nix = &eth_dev->nix;\n+\tint rc;\n+\tint i;\n+\n \tRTE_SET_USED(dev);\n \n \tif (!capa)\n \t\treturn -rte_mtr_error_set(error, EINVAL,\n-\t\t\t\t\t  RTE_MTR_ERROR_TYPE_MTR_PARAMS, NULL,\n-\t\t\t\t\t  \"NULL input parameter\");\n+\t\t\t\tRTE_MTR_ERROR_TYPE_MTR_PARAMS, NULL,\n+\t\t\t\t\"NULL input parameter\");\n+\n+\trc = roc_nix_bpf_count_get(nix, lvl_mask, count);\n+\tif (rc)\n+\t\treturn rc;\n+\n+\tfor (i = 0; i < ROC_NIX_BPF_LEVEL_MAX; i++)\n+\t\tmtr_capa.n_max += count[i];\n+\n+\tmtr_capa.meter_srtcm_rfc2697_n_max = mtr_capa.n_max;\n+\tmtr_capa.meter_trtcm_rfc2698_n_max = mtr_capa.n_max;\n+\tmtr_capa.meter_trtcm_rfc4115_n_max = mtr_capa.n_max;\n+\tmtr_capa.meter_policy_n_max = mtr_capa.n_max;\n+\n \t*capa = mtr_capa;\n \treturn 0;\n }\n@@ -1339,3 +1355,12 @@ nix_mtr_color_action_validate(struct rte_eth_dev *eth_dev, uint32_t id,\n \n \treturn 0;\n }\n+\n+int\n+nix_mtr_capabilities_init(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct rte_mtr_capabilities capa;\n+\tstruct rte_mtr_error error;\n+\n+\treturn cnxk_nix_mtr_capabilities_get(eth_dev, &capa, &error);\n+}\n",
    "prefixes": [
        "2/2"
    ]
}