get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 120200,
    "url": "http://patches.dpdk.org/api/patches/120200/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221128095442.3185112-4-ndabilpuram@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": "<20221128095442.3185112-4-ndabilpuram@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221128095442.3185112-4-ndabilpuram@marvell.com",
    "date": "2022-11-28T09:54:35",
    "name": "[04/11] common/cnxk: split NIX TM hierarchy enable API",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f297a2824e47d950953c92da940223efc0985a13",
    "submitter": {
        "id": 1202,
        "url": "http://patches.dpdk.org/api/people/1202/?format=api",
        "name": "Nithin Dabilpuram",
        "email": "ndabilpuram@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20221128095442.3185112-4-ndabilpuram@marvell.com/mbox/",
    "series": [
        {
            "id": 25906,
            "url": "http://patches.dpdk.org/api/series/25906/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25906",
            "date": "2022-11-28T09:54:32",
            "name": "[01/11] common/cnxk: free pending sqe buffers",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/25906/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/120200/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/120200/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 16A09A00C3;\n\tMon, 28 Nov 2022 10:55:14 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5752842D18;\n\tMon, 28 Nov 2022 10:55:03 +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 A373642C76\n for <dev@dpdk.org>; Mon, 28 Nov 2022 10:55:01 +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 2AS5j8Hx025921 for <dev@dpdk.org>; Mon, 28 Nov 2022 01:55:00 -0800",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3m4q3srseh-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Mon, 28 Nov 2022 01:55:00 -0800",
            "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.2;\n Mon, 28 Nov 2022 01:54:59 -0800",
            "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, 28 Nov 2022 01:54:59 -0800",
            "from hyd1588t430.caveonetworks.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id 230B05C68E1;\n Mon, 28 Nov 2022 01:54:56 -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-transfer-encoding : content-type; s=pfpt0220;\n bh=sfHrjDBdw/aTvblupWLKBHiYDI57RnrNExrFEAtp/A0=;\n b=AuHi7p3RsUm2QHALg5KO5OuQKIWz0pnm9fxoBtnZiaDoMXM+uO87CKoSUOUYtSONjIUh\n 2rJ1j5x9205SY39plVC+6cmOMHA+K1bokrKahLqhC5Htbis8oz1U3NKR6Wyp2eBF6FSW\n f6vUWc4M/TRNrRUm9L9dGj8kpUi1HmC9IUYkCb1BH6TNXslP1Od2sL4dydiabSELxu50\n yswv1+NiHXSGduykvZwe9G1QUbmLEvhdkRFgeoy6y4Hc2NTm8doxMKqCn43/KoReQiSh\n 2QjC9x6DMIqeCRYySH12b+yCpm0L7owBxaV5cUdLvIgvsh2GG42wkFnGgbaBsWx5p6q1 yQ==",
        "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>",
        "Subject": "[PATCH 04/11] common/cnxk: split NIX TM hierarchy enable API",
        "Date": "Mon, 28 Nov 2022 15:24:35 +0530",
        "Message-ID": "<20221128095442.3185112-4-ndabilpuram@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221128095442.3185112-1-ndabilpuram@marvell.com>",
        "References": "<20221128095442.3185112-1-ndabilpuram@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "gHc0vccDeI-4XQSUg3D9K1SHxxQdSipP",
        "X-Proofpoint-GUID": "gHc0vccDeI-4XQSUg3D9K1SHxxQdSipP",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1\n definitions=2022-11-28_07,2022-11-25_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": "From: Satha Rao <skoteshwar@marvell.com>\n\nroc_nix_tm_hierarchy_enable() API will do two things internally,\n1) Creation of all TM nodes, allocate HW resources and connect\n   them as requested.\n2) Enable transmit by XON SMQ and start SQs\n\nIn test cases where both steps called independently. In order\nto support this, patch split the functionality into two APIs.\n\nSigned-off-by: Satha Rao <skoteshwar@marvell.com>\n---\n drivers/common/cnxk/roc_nix.h        |   2 +\n drivers/common/cnxk/roc_nix_tm_ops.c | 116 +++++++++++++++------------\n drivers/common/cnxk/version.map      |   1 +\n 3 files changed, 69 insertions(+), 50 deletions(-)",
    "diff": "diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h\nindex dfc87e8758..47ee078c2e 100644\n--- a/drivers/common/cnxk/roc_nix.h\n+++ b/drivers/common/cnxk/roc_nix.h\n@@ -672,6 +672,8 @@ int __roc_api roc_nix_tm_hierarchy_disable(struct roc_nix *roc_nix);\n int __roc_api roc_nix_tm_hierarchy_enable(struct roc_nix *roc_nix,\n \t\t\t\t\t  enum roc_nix_tm_tree tree,\n \t\t\t\t\t  bool xmit_enable);\n+int __roc_api roc_nix_tm_hierarchy_xmit_enable(struct roc_nix *roc_nix, enum roc_nix_tm_tree tree);\n+\n \n /*\n  * TM utilities API.\ndiff --git a/drivers/common/cnxk/roc_nix_tm_ops.c b/drivers/common/cnxk/roc_nix_tm_ops.c\nindex 4bf7b1e104..5e8637ebdd 100644\n--- a/drivers/common/cnxk/roc_nix_tm_ops.c\n+++ b/drivers/common/cnxk/roc_nix_tm_ops.c\n@@ -549,6 +549,67 @@ roc_nix_tm_hierarchy_disable(struct roc_nix *roc_nix)\n \treturn rc;\n }\n \n+int\n+roc_nix_tm_hierarchy_xmit_enable(struct roc_nix *roc_nix, enum roc_nix_tm_tree tree)\n+{\n+\tstruct nix *nix = roc_nix_to_nix_priv(roc_nix);\n+\tstruct nix_tm_node_list *list;\n+\tstruct nix_tm_node *node;\n+\tstruct roc_nix_sq *sq;\n+\tuint16_t sq_id;\n+\tint rc;\n+\n+\tif (tree >= ROC_NIX_TM_TREE_MAX)\n+\t\treturn NIX_ERR_PARAM;\n+\n+\tlist = nix_tm_node_list(nix, tree);\n+\n+\t/* Update SQ Sched Data while SQ is idle */\n+\tTAILQ_FOREACH(node, list, node) {\n+\t\tif (!nix_tm_is_leaf(nix, node->lvl))\n+\t\t\tcontinue;\n+\n+\t\trc = nix_tm_sq_sched_conf(nix, node, false);\n+\t\tif (rc) {\n+\t\t\tplt_err(\"SQ %u sched update failed, rc=%d\", node->id,\n+\t\t\t\trc);\n+\t\t\treturn rc;\n+\t\t}\n+\t}\n+\n+\t/* Finally XON all SMQ's */\n+\tTAILQ_FOREACH(node, list, node) {\n+\t\tif (node->hw_lvl != NIX_TXSCH_LVL_SMQ)\n+\t\t\tcontinue;\n+\n+\t\trc = nix_tm_smq_xoff(nix, node, false);\n+\t\tif (rc) {\n+\t\t\tplt_err(\"Failed to enable smq %u, rc=%d\", node->hw_id,\n+\t\t\t\trc);\n+\t\t\treturn rc;\n+\t\t}\n+\t}\n+\n+\t/* Enable xmit as all the topology is ready */\n+\tTAILQ_FOREACH(node, list, node) {\n+\t\tif (!nix_tm_is_leaf(nix, node->lvl))\n+\t\t\tcontinue;\n+\n+\t\tsq_id = node->id;\n+\t\tsq = nix->sqs[sq_id];\n+\n+\t\trc = roc_nix_tm_sq_aura_fc(sq, true);\n+\t\tif (rc) {\n+\t\t\tplt_err(\"TM sw xon failed on SQ %u, rc=%d\", node->id,\n+\t\t\t\trc);\n+\t\t\treturn rc;\n+\t\t}\n+\t\tnode->flags |= NIX_TM_NODE_ENABLED;\n+\t}\n+\n+\treturn 0;\n+}\n+\n int\n roc_nix_tm_hierarchy_enable(struct roc_nix *roc_nix, enum roc_nix_tm_tree tree,\n \t\t\t    bool xmit_enable)\n@@ -556,9 +617,7 @@ roc_nix_tm_hierarchy_enable(struct roc_nix *roc_nix, enum roc_nix_tm_tree tree,\n \tstruct nix *nix = roc_nix_to_nix_priv(roc_nix);\n \tstruct nix_tm_node_list *list;\n \tstruct nix_tm_node *node;\n-\tstruct roc_nix_sq *sq;\n \tuint32_t tree_mask;\n-\tuint16_t sq_id;\n \tint rc;\n \n \tif (tree >= ROC_NIX_TM_TREE_MAX)\n@@ -613,55 +672,12 @@ roc_nix_tm_hierarchy_enable(struct roc_nix *roc_nix, enum roc_nix_tm_tree tree,\n \t\t\tnode->flags |= NIX_TM_NODE_ENABLED;\n \t}\n \n-\tif (!xmit_enable)\n-\t\tgoto skip_sq_update;\n+\tif (xmit_enable)\n+\t\trc = roc_nix_tm_hierarchy_xmit_enable(roc_nix, tree);\n \n-\t/* Update SQ Sched Data while SQ is idle */\n-\tTAILQ_FOREACH(node, list, node) {\n-\t\tif (!nix_tm_is_leaf(nix, node->lvl))\n-\t\t\tcontinue;\n-\n-\t\trc = nix_tm_sq_sched_conf(nix, node, false);\n-\t\tif (rc) {\n-\t\t\tplt_err(\"SQ %u sched update failed, rc=%d\", node->id,\n-\t\t\t\trc);\n-\t\t\treturn rc;\n-\t\t}\n-\t}\n-\n-\t/* Finally XON all SMQ's */\n-\tTAILQ_FOREACH(node, list, node) {\n-\t\tif (node->hw_lvl != NIX_TXSCH_LVL_SMQ)\n-\t\t\tcontinue;\n-\n-\t\trc = nix_tm_smq_xoff(nix, node, false);\n-\t\tif (rc) {\n-\t\t\tplt_err(\"Failed to enable smq %u, rc=%d\", node->hw_id,\n-\t\t\t\trc);\n-\t\t\treturn rc;\n-\t\t}\n-\t}\n-\n-\t/* Enable xmit as all the topology is ready */\n-\tTAILQ_FOREACH(node, list, node) {\n-\t\tif (!nix_tm_is_leaf(nix, node->lvl))\n-\t\t\tcontinue;\n-\n-\t\tsq_id = node->id;\n-\t\tsq = nix->sqs[sq_id];\n-\n-\t\trc = roc_nix_tm_sq_aura_fc(sq, true);\n-\t\tif (rc) {\n-\t\t\tplt_err(\"TM sw xon failed on SQ %u, rc=%d\", node->id,\n-\t\t\t\trc);\n-\t\t\treturn rc;\n-\t\t}\n-\t\tnode->flags |= NIX_TM_NODE_ENABLED;\n-\t}\n-\n-skip_sq_update:\n-\tnix->tm_flags |= NIX_TM_HIERARCHY_ENA;\n-\treturn 0;\n+\tif (!rc)\n+\t\tnix->tm_flags |= NIX_TM_HIERARCHY_ENA;\n+\treturn rc;\n }\n \n int\ndiff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map\nindex 70503c0470..63fe9deb72 100644\n--- a/drivers/common/cnxk/version.map\n+++ b/drivers/common/cnxk/version.map\n@@ -270,6 +270,7 @@ INTERNAL {\n \troc_nix_tm_tree_type_get;\n \troc_nix_tm_hierarchy_disable;\n \troc_nix_tm_hierarchy_enable;\n+\troc_nix_tm_hierarchy_xmit_enable;\n \troc_nix_tm_init;\n \troc_nix_tm_is_user_hierarchy_enabled;\n \troc_nix_tm_leaf_cnt;\n",
    "prefixes": [
        "04/11"
    ]
}