get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 66581,
    "url": "http://patches.dpdk.org/api/patches/66581/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200312111907.31555-7-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": "<20200312111907.31555-7-ndabilpuram@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200312111907.31555-7-ndabilpuram@marvell.com",
    "date": "2020-03-12T11:19:02",
    "name": "[06/11] net/octeontx2: add tm hierarchy commit callback",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c2405b54c869968eb65fe0ee7dbd33a7b0847e04",
    "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/20200312111907.31555-7-ndabilpuram@marvell.com/mbox/",
    "series": [
        {
            "id": 8894,
            "url": "http://patches.dpdk.org/api/series/8894/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8894",
            "date": "2020-03-12T11:18:56",
            "name": "net/octeontx2: add traffic manager support",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/8894/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/66581/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/66581/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2F39DA056B;\n\tThu, 12 Mar 2020 12:20:58 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9A7331C0B3;\n\tThu, 12 Mar 2020 12:19:32 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 614451C0B1\n for <dev@dpdk.org>; Thu, 12 Mar 2020 12:19:31 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 02CBFWvk017671 for <dev@dpdk.org>; Thu, 12 Mar 2020 04:19:30 -0700",
            "from sc-exch01.marvell.com ([199.233.58.181])\n by mx0b-0016f401.pphosted.com with ESMTP id 2yqfggs6f1-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Thu, 12 Mar 2020 04:19:30 -0700",
            "from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH01.marvell.com\n (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Mar\n 2020 04:19:28 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH02.marvell.com\n (10.93.176.82) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Thu, 12 Mar 2020 04:19:28 -0700",
            "from hyd1588t430.marvell.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id 1C6B63F703F;\n Thu, 12 Mar 2020 04:19:26 -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-type; s=pfpt0818; bh=eqVNf4GIm+Z/xQ2i2DK0WDfe4cacyo7pGQY54+ybW20=;\n b=El7xGXrbhWctEkBvjVTSjIue+k3+PvcyIWoKjQEmdQksL0HHtjp5hW3dcForpw61iJrL\n xHCSD7k9h5BZZnOm0jjkDyeOz4aB37PHojOvJPsQpjbZIQKGlleCOHLIM+TM3s5IyE+P\n RU8oC81F5erhAGgjLYclIPyUgLmRbHzDMLdVkjpJxfPRERt/8dSyHfQVSMluCq6JVcur\n hmo4OF/qRvjQY89S4VIvw0yLfcF43TbDLEa28ZTSTuLS97GpYjNmpSiP46g0InYrxXRt\n spt2eppwdTzBa05PfaWumbVIag51rUxnympLNh/IsgBVo9Sb8cnxoYSWrLR2R55k10Gf Uw==",
        "From": "Nithin Dabilpuram <ndabilpuram@marvell.com>",
        "To": "Jerin Jacob <jerinj@marvell.com>, Nithin Dabilpuram\n <ndabilpuram@marvell.com>, Kiran Kumar K <kirankumark@marvell.com>",
        "CC": "Krzysztof Kanas <kkanas@marvell.com>, <dev@dpdk.org>",
        "Date": "Thu, 12 Mar 2020 16:49:02 +0530",
        "Message-ID": "<20200312111907.31555-7-ndabilpuram@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20200312111907.31555-1-ndabilpuram@marvell.com>",
        "References": "<20200312111907.31555-1-ndabilpuram@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572\n definitions=2020-03-12_03:2020-03-11,\n 2020-03-12 signatures=0",
        "Subject": "[dpdk-dev] [PATCH 06/11] net/octeontx2: add tm hierarchy commit\n\tcallback",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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": "Add TM hierarchy commit callback to support enabling\nnewly created topology.\n\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\nSigned-off-by: Krzysztof Kanas <kkanas@marvell.com>\n---\n drivers/net/octeontx2/otx2_tm.c | 170 ++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 170 insertions(+)",
    "diff": "diff --git a/drivers/net/octeontx2/otx2_tm.c b/drivers/net/octeontx2/otx2_tm.c\nindex 175d1d5..ae779a5 100644\n--- a/drivers/net/octeontx2/otx2_tm.c\n+++ b/drivers/net/octeontx2/otx2_tm.c\n@@ -1668,6 +1668,101 @@ validate_prio(struct otx2_eth_dev *dev, uint32_t lvl,\n }\n \n static int\n+nix_xmit_disable(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);\n+\tuint16_t sq_cnt = eth_dev->data->nb_tx_queues;\n+\tuint16_t sqb_cnt, head_off, tail_off;\n+\tstruct otx2_nix_tm_node *tm_node;\n+\tstruct otx2_eth_txq *txq;\n+\tuint64_t wdata, val;\n+\tint i, rc;\n+\n+\totx2_tm_dbg(\"Disabling xmit on %s\", eth_dev->data->name);\n+\n+\t/* Enable CGX RXTX to drain pkts */\n+\tif (!eth_dev->data->dev_started) {\n+\t\trc = otx2_cgx_rxtx_start(dev);\n+\t\tif (rc)\n+\t\t\treturn rc;\n+\t}\n+\n+\t/* XON all SMQ's */\n+\tTAILQ_FOREACH(tm_node, &dev->node_list, node) {\n+\t\tif (tm_node->hw_lvl != NIX_TXSCH_LVL_SMQ)\n+\t\t\tcontinue;\n+\t\tif (!(tm_node->flags & NIX_TM_NODE_HWRES))\n+\t\t\tcontinue;\n+\n+\t\trc = nix_smq_xoff(dev, tm_node, false);\n+\t\tif (rc) {\n+\t\t\totx2_err(\"Failed to enable smq %u, rc=%d\",\n+\t\t\t\t tm_node->hw_id, rc);\n+\t\t\tgoto cleanup;\n+\t\t}\n+\t}\n+\n+\t/* Flush all tx queues */\n+\tfor (i = 0; i < sq_cnt; i++) {\n+\t\ttxq = eth_dev->data->tx_queues[i];\n+\n+\t\trc = otx2_nix_sq_sqb_aura_fc(txq, false);\n+\t\tif (rc) {\n+\t\t\totx2_err(\"Failed to disable sqb aura fc, rc=%d\", rc);\n+\t\t\tgoto cleanup;\n+\t\t}\n+\n+\t\t/* Wait for sq entries to be flushed */\n+\t\trc = nix_txq_flush_sq_spin(txq);\n+\t\tif (rc) {\n+\t\t\totx2_err(\"Failed to drain sq, rc=%d\\n\", rc);\n+\t\t\tgoto cleanup;\n+\t\t}\n+\t}\n+\n+\t/* XOFF & Flush all SMQ's. HRM mandates\n+\t * all SQ's empty before SMQ flush is issued.\n+\t */\n+\tTAILQ_FOREACH(tm_node, &dev->node_list, node) {\n+\t\tif (tm_node->hw_lvl != NIX_TXSCH_LVL_SMQ)\n+\t\t\tcontinue;\n+\t\tif (!(tm_node->flags & NIX_TM_NODE_HWRES))\n+\t\t\tcontinue;\n+\n+\t\trc = nix_smq_xoff(dev, tm_node, true);\n+\t\tif (rc) {\n+\t\t\totx2_err(\"Failed to enable smq %u, rc=%d\",\n+\t\t\t\t tm_node->hw_id, rc);\n+\t\t\tgoto cleanup;\n+\t\t}\n+\t}\n+\n+\t/* Verify sanity of all tx queues */\n+\tfor (i = 0; i < sq_cnt; i++) {\n+\t\ttxq = eth_dev->data->tx_queues[i];\n+\n+\t\twdata = ((uint64_t)txq->sq << 32);\n+\t\tval = otx2_atomic64_add_nosync(wdata,\n+\t\t\t       (int64_t *)(dev->base + NIX_LF_SQ_OP_STATUS));\n+\n+\t\tsqb_cnt = val & 0xFFFF;\n+\t\thead_off = (val >> 20) & 0x3F;\n+\t\ttail_off = (val >> 28) & 0x3F;\n+\n+\t\tif (sqb_cnt > 1 || head_off != tail_off ||\n+\t\t    (*txq->fc_mem != txq->nb_sqb_bufs))\n+\t\t\totx2_err(\"Failed to gracefully flush sq %u\", txq->sq);\n+\t}\n+\n+cleanup:\n+\t/* restore cgx state */\n+\tif (!eth_dev->data->dev_started)\n+\t\trc |= otx2_cgx_rxtx_stop(dev);\n+\n+\treturn rc;\n+}\n+\n+static int\n nix_tm_node_add(struct rte_eth_dev *eth_dev, uint32_t node_id,\n \t\tuint32_t parent_node_id, uint32_t priority,\n \t\tuint32_t weight, uint32_t lvl,\n@@ -1879,11 +1974,86 @@ nix_tm_node_resume(struct rte_eth_dev *eth_dev, uint32_t node_id,\n \treturn nix_tm_node_suspend_resume(eth_dev, node_id, error, false);\n }\n \n+static int\n+nix_tm_hierarchy_commit(struct rte_eth_dev *eth_dev,\n+\t\t\tint clear_on_fail,\n+\t\t\tstruct rte_tm_error *error)\n+{\n+\tstruct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);\n+\tstruct otx2_nix_tm_node *tm_node;\n+\tuint32_t leaf_cnt = 0;\n+\tint rc;\n+\n+\tif (dev->tm_flags & NIX_TM_COMMITTED) {\n+\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n+\t\terror->message = \"hierarchy exists\";\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Check if we have all the leaf nodes */\n+\tTAILQ_FOREACH(tm_node, &dev->node_list, node) {\n+\t\tif (tm_node->flags & NIX_TM_NODE_USER &&\n+\t\t    tm_node->id < dev->tm_leaf_cnt)\n+\t\t\tleaf_cnt++;\n+\t}\n+\n+\tif (leaf_cnt != dev->tm_leaf_cnt) {\n+\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n+\t\terror->message = \"incomplete hierarchy\";\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/*\n+\t * Disable xmit will be enabled when\n+\t * new topology is available.\n+\t */\n+\trc = nix_xmit_disable(eth_dev);\n+\tif (rc) {\n+\t\totx2_err(\"failed to disable TX, rc=%d\", rc);\n+\t\treturn -EIO;\n+\t}\n+\n+\t/* Delete default/ratelimit tree */\n+\tif (dev->tm_flags & (NIX_TM_DEFAULT_TREE)) {\n+\t\trc = nix_tm_free_resources(dev, NIX_TM_NODE_USER, 0, false);\n+\t\tif (rc) {\n+\t\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n+\t\t\terror->message = \"failed to free default resources\";\n+\t\t\treturn rc;\n+\t\t}\n+\t\tdev->tm_flags &= ~(NIX_TM_DEFAULT_TREE);\n+\t}\n+\n+\t/* Free up user alloc'ed resources */\n+\trc = nix_tm_free_resources(dev, NIX_TM_NODE_USER,\n+\t\t\t\t   NIX_TM_NODE_USER, true);\n+\tif (rc) {\n+\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n+\t\terror->message = \"failed to free user resources\";\n+\t\treturn rc;\n+\t}\n+\n+\trc = nix_tm_alloc_resources(eth_dev, true);\n+\tif (rc) {\n+\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n+\t\terror->message = \"alloc resources failed\";\n+\t\t/* TODO should we restore default config ? */\n+\t\tif (clear_on_fail)\n+\t\t\tnix_tm_free_resources(dev, 0, 0, false);\n+\t\treturn rc;\n+\t}\n+\n+\terror->type = RTE_TM_ERROR_TYPE_NONE;\n+\tdev->tm_flags |= NIX_TM_COMMITTED;\n+\treturn 0;\n+}\n+\n const struct rte_tm_ops otx2_tm_ops = {\n \t.node_add = nix_tm_node_add,\n \t.node_delete = nix_tm_node_delete,\n \t.node_suspend = nix_tm_node_suspend,\n \t.node_resume = nix_tm_node_resume,\n+\t.hierarchy_commit = nix_tm_hierarchy_commit,\n };\n \n static int\n",
    "prefixes": [
        "06/11"
    ]
}