get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 83552,
    "url": "https://patches.dpdk.org/api/patches/83552/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201103100818.311881-32-jiawenwu@trustnetic.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": "<20201103100818.311881-32-jiawenwu@trustnetic.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201103100818.311881-32-jiawenwu@trustnetic.com",
    "date": "2020-11-03T10:08:12",
    "name": "[31/37] net/txgbe: add TM hierarchy commit",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1e70254a71ab940ee4b969ecb4d03cf3785d3302",
    "submitter": {
        "id": 1932,
        "url": "https://patches.dpdk.org/api/people/1932/?format=api",
        "name": "Jiawen Wu",
        "email": "jiawenwu@trustnetic.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20201103100818.311881-32-jiawenwu@trustnetic.com/mbox/",
    "series": [
        {
            "id": 13612,
            "url": "https://patches.dpdk.org/api/series/13612/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=13612",
            "date": "2020-11-03T10:07:42",
            "name": "net: add txgbe PMD part 2",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/13612/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/83552/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/83552/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 02F4FA0521;\n\tTue,  3 Nov 2020 11:18:20 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 49B90CAB7;\n\tTue,  3 Nov 2020 11:07:53 +0100 (CET)",
            "from smtpbgsg2.qq.com (smtpbgsg2.qq.com [54.254.200.128])\n by dpdk.org (Postfix) with ESMTP id 91A40C85E\n for <dev@dpdk.org>; Tue,  3 Nov 2020 11:07:35 +0100 (CET)",
            "from localhost.localdomain.com (unknown [183.129.236.74])\n by esmtp10.qq.com (ESMTP) with\n id ; Tue, 03 Nov 2020 18:07:29 +0800 (CST)"
        ],
        "X-QQ-mid": "bizesmtp26t1604398050tq7917su",
        "X-QQ-SSF": "01400000002000C0C000B00A0000000",
        "X-QQ-FEAT": "mJG+EqVdzGC7KHvFdBAnfQee8jkBMXomgzIIMJIDtD2WKrLB36x2lIyVSRUz2\n E+aVh4Jc3/jMMtc1NudNjx+X9y/C1hxraDD2DVU2T3irkcMHJoA16mMRplYvsssxAZsN8f3\n iXa37TTwb9xaPtHTYqJmwpYO9fKJ92YtwIH9T8fBQEPSTsDnJ9ESh4k6ZSZ6tWgI/KF/Bi2\n vJ5HrQSSeg3qHHDogvP0ZxI18T2B5+0Q3Bfekqr/XkMYdfqrDsvCOCKm7qnEbCECGhd7LS5\n +ts/aeNQkqXiLhHs198S7NOCU8MSXlBcd58awv3A1/+CNuKJ0D09bjjwTfCNKEaqfu4KOa/\n zTRlS2ipfNnG/Op5TAFrnCl1yte7Q==",
        "X-QQ-GoodBg": "2",
        "From": "Jiawen Wu <jiawenwu@trustnetic.com>",
        "To": "dev@dpdk.org",
        "Cc": "Jiawen Wu <jiawenwu@trustnetic.com>",
        "Date": "Tue,  3 Nov 2020 18:08:12 +0800",
        "Message-Id": "<20201103100818.311881-32-jiawenwu@trustnetic.com>",
        "X-Mailer": "git-send-email 2.18.4",
        "In-Reply-To": "<20201103100818.311881-1-jiawenwu@trustnetic.com>",
        "References": "<20201103100818.311881-1-jiawenwu@trustnetic.com>",
        "X-QQ-SENDSIZE": "520",
        "Feedback-ID": "bizesmtp:trustnetic.com:qybgforeign:qybgforeign5",
        "X-QQ-Bgrelay": "1",
        "Subject": "[dpdk-dev] [PATCH 31/37] net/txgbe: add TM hierarchy commit",
        "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 traffic manager hierarchy commit.\n\nSigned-off-by: Jiawen Wu <jiawenwu@trustnetic.com>\n---\n drivers/net/txgbe/txgbe_tm.c | 70 ++++++++++++++++++++++++++++++++++++\n 1 file changed, 70 insertions(+)",
    "diff": "diff --git a/drivers/net/txgbe/txgbe_tm.c b/drivers/net/txgbe/txgbe_tm.c\nindex 6dd593e54..b8edd78bf 100644\n--- a/drivers/net/txgbe/txgbe_tm.c\n+++ b/drivers/net/txgbe/txgbe_tm.c\n@@ -33,6 +33,9 @@ static int txgbe_node_capabilities_get(struct rte_eth_dev *dev,\n \t\t\t\t       uint32_t node_id,\n \t\t\t\t       struct rte_tm_node_capabilities *cap,\n \t\t\t\t       struct rte_tm_error *error);\n+static int txgbe_hierarchy_commit(struct rte_eth_dev *dev,\n+\t\t\t\t  int clear_on_fail,\n+\t\t\t\t  struct rte_tm_error *error);\n \n const struct rte_tm_ops txgbe_tm_ops = {\n \t.capabilities_get = txgbe_tm_capabilities_get,\n@@ -43,6 +46,7 @@ const struct rte_tm_ops txgbe_tm_ops = {\n \t.node_type_get = txgbe_node_type_get,\n \t.level_capabilities_get = txgbe_level_capabilities_get,\n \t.node_capabilities_get = txgbe_node_capabilities_get,\n+\t.hierarchy_commit = txgbe_hierarchy_commit,\n };\n \n int\n@@ -950,3 +954,69 @@ txgbe_node_capabilities_get(struct rte_eth_dev *dev,\n \treturn 0;\n }\n \n+static int\n+txgbe_hierarchy_commit(struct rte_eth_dev *dev,\n+\t\t       int clear_on_fail,\n+\t\t       struct rte_tm_error *error)\n+{\n+\tstruct txgbe_tm_conf *tm_conf = TXGBE_DEV_TM_CONF(dev);\n+\tstruct txgbe_tm_node *tm_node;\n+\tuint64_t bw;\n+\tint ret;\n+\n+\tif (!error)\n+\t\treturn -EINVAL;\n+\n+\t/* check the setting */\n+\tif (!tm_conf->root)\n+\t\tgoto done;\n+\n+\t/* not support port max bandwidth yet */\n+\tif (tm_conf->root->shaper_profile &&\n+\t    tm_conf->root->shaper_profile->profile.peak.rate) {\n+\t\terror->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE;\n+\t\terror->message = \"no port max bandwidth\";\n+\t\tgoto fail_clear;\n+\t}\n+\n+\t/* HW not support TC max bandwidth */\n+\tTAILQ_FOREACH(tm_node, &tm_conf->tc_list, node) {\n+\t\tif (tm_node->shaper_profile &&\n+\t\t    tm_node->shaper_profile->profile.peak.rate) {\n+\t\t\terror->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE;\n+\t\t\terror->message = \"no TC max bandwidth\";\n+\t\t\tgoto fail_clear;\n+\t\t}\n+\t}\n+\n+\t/* queue max bandwidth */\n+\tTAILQ_FOREACH(tm_node, &tm_conf->queue_list, node) {\n+\t\tif (tm_node->shaper_profile)\n+\t\t\tbw = tm_node->shaper_profile->profile.peak.rate;\n+\t\telse\n+\t\t\tbw = 0;\n+\t\tif (bw) {\n+\t\t\t/* interpret Bps to Mbps */\n+\t\t\tbw = bw * 8 / 1000 / 1000;\n+\t\t\tret = txgbe_set_queue_rate_limit(dev, tm_node->no, bw);\n+\t\t\tif (ret) {\n+\t\t\t\terror->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE;\n+\t\t\t\terror->message =\n+\t\t\t\t\t\"failed to set queue max bandwidth\";\n+\t\t\t\tgoto fail_clear;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+done:\n+\ttm_conf->committed = true;\n+\treturn 0;\n+\n+fail_clear:\n+\t/* clear all the traffic manager configuration */\n+\tif (clear_on_fail) {\n+\t\ttxgbe_tm_conf_uninit(dev);\n+\t\ttxgbe_tm_conf_init(dev);\n+\t}\n+\treturn -EINVAL;\n+}\n",
    "prefixes": [
        "31/37"
    ]
}