get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 35303,
    "url": "http://patches.dpdk.org/api/patches/35303/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1519133453-109024-1-git-send-email-nikhil.rao@intel.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": "<1519133453-109024-1-git-send-email-nikhil.rao@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1519133453-109024-1-git-send-email-nikhil.rao@intel.com",
    "date": "2018-02-20T13:30:53",
    "name": "[dpdk-dev] ethdev: add support for WRED thresholds in bytes",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f3f3a076a2043db716920fb9d001f5f362afdcc3",
    "submitter": {
        "id": 528,
        "url": "http://patches.dpdk.org/api/people/528/?format=api",
        "name": "Rao, Nikhil",
        "email": "nikhil.rao@intel.com"
    },
    "delegate": {
        "id": 10018,
        "url": "http://patches.dpdk.org/api/users/10018/?format=api",
        "username": "cristian_dumitrescu",
        "first_name": "Cristian",
        "last_name": "Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1519133453-109024-1-git-send-email-nikhil.rao@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/35303/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/35303/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C84071D9E;\n\tTue, 20 Feb 2018 14:31:38 +0100 (CET)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id F0D361BE0\n\tfor <dev@dpdk.org>; Tue, 20 Feb 2018 14:31:36 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t20 Feb 2018 05:31:36 -0800",
            "from unknown (HELO localhost.localdomain.localdomain)\n\t([10.224.122.193])\n\tby orsmga002.jf.intel.com with ESMTP; 20 Feb 2018 05:31:33 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.46,539,1511856000\"; d=\"scan'208\";a=\"36063923\"",
        "From": "Nikhil Rao <nikhil.rao@intel.com>",
        "To": "cristian.dumitrescu@intel.com",
        "Cc": "dev@dpdk.org, benjamin.h.shelton@intel.com, narender.vangati@intel.com, \n\tabhinandan.gujjar@intel.com, nikhil.rao@intel.com",
        "Date": "Tue, 20 Feb 2018 08:30:53 -0500",
        "Message-Id": "<1519133453-109024-1-git-send-email-nikhil.rao@intel.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "Subject": "[dpdk-dev] [PATCH] ethdev: add support for WRED thresholds in bytes",
        "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "WRED thresholds can be specified in bytes if the TM leaf\nnode supports it. Also extend WRED thresholds to 32 bits from 16.\n\nTM capability (port/level/queue) fields cman_wred_packet_mode_supported and\ncman_wred_byte_mode_supported, when non-zero, indicate support for WRED\nthresholds in packets and bytes respectively.\n\nThe packet_mode member of struct rte_tm_wred_params, when non-zero,\nindicates that the min and max thresholds are specified in\npackets and when zero, indicates that the min and max thresholds\nare specified in bytes.\n\nSigned-off-by: Nikhil Rao <nikhil.rao@intel.com>\n---\n\nThanks to Cristian for his help with developing this patch.\n\n lib/librte_ether/rte_tm.h                | 53 ++++++++++++++++++++++++++++++--\n drivers/net/softnic/rte_eth_softnic_tm.c | 22 +++++++++++++\n 2 files changed, 73 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/librte_ether/rte_tm.h b/lib/librte_ether/rte_tm.h\nindex 2b25a87..23098ab 100644\n--- a/lib/librte_ether/rte_tm.h\n+++ b/lib/librte_ether/rte_tm.h\n@@ -377,6 +377,22 @@ struct rte_tm_capabilities {\n \t */\n \tuint32_t sched_wfq_weight_max;\n \n+\t/** WRED packet mode support. When non-zero, this parameter indicates\n+\t * that there is atleast one leaf node that supports the WRED packet\n+\t * mode, which might not be true for all the leaf nodes. In packet\n+\t * mode, the WRED thresholds specify the queue length in packets, as\n+\t * opposed to bytes.\n+\t */\n+\tint cman_wred_packet_mode_supported;\n+\n+\t/** WRED byte mode support. When non-zero, this parameter indicates that\n+\t * there is atleast one leaf node that supports the WRED byte mode,\n+\t * which might not be true for all the leaf nodes. In byte mode, the\n+\t * WRED thresholds specify the queue length in bytes, as opposed to\n+\t * packets.\n+\t */\n+\tint cman_wred_byte_mode_supported;\n+\n \t/** Head drop algorithm support. When non-zero, this parameter\n \t * indicates that there is at least one leaf node that supports the head\n \t * drop algorithm, which might not be true for all the leaf nodes.\n@@ -628,6 +644,24 @@ struct rte_tm_level_capabilities {\n \t\t\t */\n \t\t\tuint32_t shaper_shared_n_max;\n \n+\t\t\t/** WRED packet mode support. When non-zero, this\n+\t\t\t * parameter indicates that there is atleast one leaf\n+\t\t\t * node on this level that supports the WRED packet\n+\t\t\t * mode, which might not be true for all the leaf\n+\t\t\t * nodes. In packet mode, the WRED thresholds specify\n+\t\t\t * the queue length in packets, as opposed to bytes.\n+\t\t\t */\n+\t\t\tint cman_wred_packet_mode_supported;\n+\n+\t\t\t/** WRED byte mode support. When non-zero, this\n+\t\t\t * parameter indicates that there is atleast one leaf\n+\t\t\t * node on this level that supports the WRED byte mode,\n+\t\t\t * which might not be true for all the leaf nodes. In\n+\t\t\t * byte mode, the WRED thresholds specify the queue\n+\t\t\t * length in bytes, as opposed to packets.\n+\t\t\t */\n+\t\t\tint cman_wred_byte_mode_supported;\n+\n \t\t\t/** Head drop algorithm support. When non-zero, this\n \t\t\t * parameter indicates that there is at least one leaf\n \t\t\t * node on this level that supports the head drop\n@@ -743,6 +777,12 @@ struct rte_tm_node_capabilities {\n \n \t\t/** Items valid only for leaf nodes. */\n \t\tstruct {\n+\t\t\t/** WRED packet mode support for current node. */\n+\t\t\tint cman_wred_packet_mode_supported;\n+\n+\t\t\t/** WRED byte mode support for current node. */\n+\t\t\tint cman_wred_byte_mode_supported;\n+\n \t\t\t/** Head drop algorithm support for current node. */\n \t\t\tint cman_head_drop_supported;\n \n@@ -791,10 +831,10 @@ enum rte_tm_cman_mode {\n  */\n struct rte_tm_red_params {\n \t/** Minimum queue threshold */\n-\tuint16_t min_th;\n+\tuint32_t min_th;\n \n \t/** Maximum queue threshold */\n-\tuint16_t max_th;\n+\tuint32_t max_th;\n \n \t/** Inverse of packet marking probability maximum value (maxp), i.e.\n \t * maxp_inv = 1 / maxp\n@@ -815,10 +855,19 @@ struct rte_tm_red_params {\n  * WRED context is used to perform congestion management for a single leaf\n  * node, while a shared WRED context is used to perform congestion management\n  * for a group of leaf nodes.\n+ *\n+ * @see struct rte_tm_capabilities::cman_wred_packet_mode_supported\n+ * @see struct rte_tm_capabilities::cman_wred_byte_mode_supported\n  */\n struct rte_tm_wred_params {\n \t/** One set of RED parameters per packet color */\n \tstruct rte_tm_red_params red_params[RTE_TM_COLORS];\n+\n+\t/** When non-zero, the *min_th* and *max_th* thresholds are specified\n+\t * in packets (WRED packet mode). When zero, the *min_th* and *max_th*\n+\t * thresholds are specified in bytes (WRED byte mode)\n+\t */\n+\tint packet_mode;\n };\n \n /**\ndiff --git a/drivers/net/softnic/rte_eth_softnic_tm.c b/drivers/net/softnic/rte_eth_softnic_tm.c\nindex 79f1c6a..e915c36 100644\n--- a/drivers/net/softnic/rte_eth_softnic_tm.c\n+++ b/drivers/net/softnic/rte_eth_softnic_tm.c\n@@ -479,6 +479,8 @@\n \t.sched_wfq_n_groups_max = 1,\n \t.sched_wfq_weight_max = UINT32_MAX,\n \n+\t.cman_wred_packet_mode_supported = WRED_SUPPORTED,\n+\t.cman_wred_byte_mode_supported = 0,\n \t.cman_head_drop_supported = 0,\n \t.cman_wred_context_n_max = 0,\n \t.cman_wred_context_private_n_max = 0,\n@@ -667,6 +669,8 @@\n \t\t\t.shaper_shared_n_max = 0,\n \n \t\t\t.cman_head_drop_supported = 0,\n+\t\t\t.cman_wred_packet_mode_supported = WRED_SUPPORTED,\n+\t\t\t.cman_wred_byte_mode_supported = 0,\n \t\t\t.cman_wred_context_private_supported = WRED_SUPPORTED,\n \t\t\t.cman_wred_context_shared_n_max = 0,\n \n@@ -828,6 +832,8 @@\n \n \t\t{.leaf = {\n \t\t\t.cman_head_drop_supported = 0,\n+\t\t\t.cman_wred_packet_mode_supported = WRED_SUPPORTED,\n+\t\t\t.cman_wred_byte_mode_supported = 0,\n \t\t\t.cman_wred_context_private_supported = WRED_SUPPORTED,\n \t\t\t.cman_wred_context_shared_n_max = 0,\n \t\t} },\n@@ -1226,6 +1232,14 @@\n \t\t\tNULL,\n \t\t\trte_strerror(EINVAL));\n \n+\t/* WRED profile should be in packet mode */\n+\tif (profile->packet_mode == 0)\n+\t\treturn -rte_tm_error_set(error,\n+\t\t\tENOTSUP,\n+\t\t\tRTE_TM_ERROR_TYPE_WRED_PROFILE,\n+\t\t\tNULL,\n+\t\t\trte_strerror(ENOTSUP));\n+\n \t/* WRED profile must not exist. */\n \twp = tm_wred_profile_search(dev, wred_profile_id);\n \tif (wp)\n@@ -1248,6 +1262,14 @@\n \t\tuint16_t min_th = profile->red_params[color].min_th;\n \t\tuint16_t max_th = profile->red_params[color].max_th;\n \n+\t\tif (profile->red_params[color].min_th >= (1 << 16) ||\n+\t\t\t\tprofile->red_params[color].max_th >= (1 << 16))\n+\t\t\treturn -rte_tm_error_set(error,\n+\t\t\t\t\t\tEINVAL,\n+\t\t\t\t\t\tRTE_TM_ERROR_TYPE_WRED_PROFILE,\n+\t\t\t\t\t\tNULL,\n+\t\t\t\t\t\trte_strerror(EINVAL));\n+\n \t\tif (min_th > max_th || max_th == 0)\n \t\t\treturn -rte_tm_error_set(error,\n \t\t\t\tEINVAL,\n",
    "prefixes": [
        "dpdk-dev"
    ]
}