get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 121131,
    "url": "http://patches.dpdk.org/api/patches/121131/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221220192645.14042-33-syalavarthi@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": "<20221220192645.14042-33-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221220192645.14042-33-syalavarthi@marvell.com",
    "date": "2022-12-20T19:26:39",
    "name": "[v3,32/38] ml/cnxk: enable support to get xstats in cycles",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e6ef1a0da75d1cb70bf64d195a76536b9ac3a3a6",
    "submitter": {
        "id": 2480,
        "url": "http://patches.dpdk.org/api/people/2480/?format=api",
        "name": "Srikanth Yalavarthi",
        "email": "syalavarthi@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20221220192645.14042-33-syalavarthi@marvell.com/mbox/",
    "series": [
        {
            "id": 26199,
            "url": "http://patches.dpdk.org/api/series/26199/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26199",
            "date": "2022-12-20T19:26:07",
            "name": "Implementation of ML CNXK driver",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/26199/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/121131/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/121131/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 E3A80A0545;\n\tTue, 20 Dec 2022 20:30:16 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id ED89A42DB0;\n\tTue, 20 Dec 2022 20:27:24 +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 338F442D3A\n for <dev@dpdk.org>; Tue, 20 Dec 2022 20:27:03 +0100 (CET)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 2BKHPQ12015491 for <dev@dpdk.org>; Tue, 20 Dec 2022 11:27:02 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3mkapj2tq2-7\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Tue, 20 Dec 2022 11:27:02 -0800",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42;\n Tue, 20 Dec 2022 11:27:00 -0800",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend\n Transport; Tue, 20 Dec 2022 11:27:00 -0800",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id 59A3D3F7070;\n Tue, 20 Dec 2022 11:27:00 -0800 (PST)"
        ],
        "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-type; s=pfpt0220; bh=ps+1OOKOnCRW0mLIxxv/TmPQY2XsWUkj8CPQLgq2Upo=;\n b=ICRo7M8uMXe05GRyD8pLf2XsZoM15zdF7QDe309gMLZBh1P+dssig38Gyqbo+8L+64kw\n gVCBxAyMU4nIYwspOUxOYGEZvpP26YatleGOnlK31fjo75FLEMEgxcPdS7BF6u75Do7Q\n 8Z3pKbF1uo96w1QRFqeEIpVXuqElRYb7qWwWlfTD/JHaeooNMYVedsOlCaPectfCVy0A\n weoOfk4hMBk5s90qHUwMinJz7GZ9045Q8j6PD20RvhCwkttDJ+dwu2tPCjdN8FuwQcPV\n IMXNz4f5jov2NJ/u21OIoLXvVCgWFyCJF4aJvTDk7ESEQh2wfnaQJ2IBv6DZZxU/abTd 7g==",
        "From": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "To": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "CC": "<dev@dpdk.org>, <sshankarnara@marvell.com>, <jerinj@marvell.com>,\n <aprabhu@marvell.com>",
        "Subject": "[PATCH v3 32/38] ml/cnxk: enable support to get xstats in cycles",
        "Date": "Tue, 20 Dec 2022 11:26:39 -0800",
        "Message-ID": "<20221220192645.14042-33-syalavarthi@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20221220192645.14042-1-syalavarthi@marvell.com>",
        "References": "<20221208201806.21893-1-syalavarthi@marvell.com>\n <20221220192645.14042-1-syalavarthi@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "H0GZy7lUqnRsya4eIqdfpe4jLw_amVyM",
        "X-Proofpoint-GUID": "H0GZy7lUqnRsya4eIqdfpe4jLw_amVyM",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1\n definitions=2022-12-20_06,2022-12-20_01,2022-06-22_01",
        "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": "Enabled support to retrieve xstats in either cycles or ns.\nAccess to sclk is enabled only if an RVU device is probed\nduring initialization. Driver would return the xstats in\nnanoseconds only when an RVU device is probed, else would\nfallback to cycles.\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n drivers/ml/cnxk/cn10k_ml_ops.c | 19 +++++++++++++++++--\n 1 file changed, 17 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c\nindex 47edde0404..cdd9ae9c69 100644\n--- a/drivers/ml/cnxk/cn10k_ml_ops.c\n+++ b/drivers/ml/cnxk/cn10k_ml_ops.c\n@@ -394,6 +394,8 @@ cn10k_ml_model_xstat_get(struct rte_ml_dev *dev, uint16_t model_id,\n \t\t\t enum cn10k_ml_model_xstats_type type)\n {\n \tstruct cn10k_ml_model *model;\n+\tuint16_t rclk_freq; /* MHz */\n+\tuint16_t sclk_freq; /* MHz */\n \tuint64_t count = 0;\n \tuint64_t value;\n \tuint32_t qp_id;\n@@ -425,6 +427,10 @@ cn10k_ml_model_xstat_get(struct rte_ml_dev *dev, uint16_t model_id,\n \t\tvalue = 0;\n \t}\n \n+\troc_clk_freq_get(&rclk_freq, &sclk_freq);\n+\tif (sclk_freq != 0) /* return in ns */\n+\t\tvalue = (value * 1000ULL) / sclk_freq;\n+\n \treturn value;\n }\n \n@@ -863,6 +869,8 @@ cn10k_ml_dev_xstats_names_get(struct rte_ml_dev *dev, struct rte_ml_dev_xstats_m\n \tstruct rte_ml_dev_info dev_info;\n \tstruct cn10k_ml_model *model;\n \tstruct cn10k_ml_dev *mldev;\n+\tuint16_t rclk_freq;\n+\tuint16_t sclk_freq;\n \tuint32_t model_id;\n \tuint32_t count;\n \tuint32_t type;\n@@ -878,6 +886,7 @@ cn10k_ml_dev_xstats_names_get(struct rte_ml_dev *dev, struct rte_ml_dev_xstats_m\n \t/* Model xstats names */\n \tcount = 0;\n \tcn10k_ml_dev_info_get(dev, &dev_info);\n+\troc_clk_freq_get(&rclk_freq, &sclk_freq);\n \n \tfor (id = 0; id < PLT_DIM(cn10k_ml_model_xstats_table) * dev_info.max_models; id++) {\n \t\tmodel_id = id / PLT_DIM(cn10k_ml_model_xstats_table);\n@@ -889,8 +898,14 @@ cn10k_ml_dev_xstats_names_get(struct rte_ml_dev *dev, struct rte_ml_dev_xstats_m\n \t\txstats_map[count].id = id;\n \t\ttype = id % PLT_DIM(cn10k_ml_model_xstats_table);\n \n-\t\tsnprintf(xstats_map[count].name, RTE_ML_STR_MAX, \"%s-%s-cycles\",\n-\t\t\t model->metadata.model.name, cn10k_ml_model_xstats_table[type].name);\n+\t\tif (sclk_freq == 0)\n+\t\t\tsnprintf(xstats_map[count].name, RTE_ML_STR_MAX, \"%s-%s-cycles\",\n+\t\t\t\t model->metadata.model.name,\n+\t\t\t\t cn10k_ml_model_xstats_table[type].name);\n+\t\telse\n+\t\t\tsnprintf(xstats_map[count].name, RTE_ML_STR_MAX, \"%s-%s-ns\",\n+\t\t\t\t model->metadata.model.name,\n+\t\t\t\t cn10k_ml_model_xstats_table[type].name);\n \n \t\tcount++;\n \t\tif (count == size)\n",
    "prefixes": [
        "v3",
        "32/38"
    ]
}