get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54286,
    "url": "http://patches.dpdk.org/api/patches/54286/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190604054248.68510-11-leyi.rong@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": "<20190604054248.68510-11-leyi.rong@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190604054248.68510-11-leyi.rong@intel.com",
    "date": "2019-06-04T05:42:09",
    "name": "[10/49] net/ice/base: save and post reset replay q bandwidth",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a805ac93ee9e751e19ec02c7a5ceef525e0a1412",
    "submitter": {
        "id": 1204,
        "url": "http://patches.dpdk.org/api/people/1204/?format=api",
        "name": "Leyi Rong",
        "email": "leyi.rong@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190604054248.68510-11-leyi.rong@intel.com/mbox/",
    "series": [
        {
            "id": 4879,
            "url": "http://patches.dpdk.org/api/series/4879/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4879",
            "date": "2019-06-04T05:41:59",
            "name": "shared code update",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4879/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54286/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54286/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 8B9FA1BA46;\n\tTue,  4 Jun 2019 07:44:14 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 4043B1B9DD\n\tfor <dev@dpdk.org>; Tue,  4 Jun 2019 07:44:05 +0200 (CEST)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t03 Jun 2019 22:44:04 -0700",
            "from lrong-srv-03.sh.intel.com ([10.67.119.177])\n\tby fmsmga008.fm.intel.com with ESMTP; 03 Jun 2019 22:44:02 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Leyi Rong <leyi.rong@intel.com>",
        "To": "qi.z.zhang@intel.com",
        "Cc": "dev@dpdk.org, Leyi Rong <leyi.rong@intel.com>,\n\tTarun Singh <tarun.k.singh@intel.com>,\n\tPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>",
        "Date": "Tue,  4 Jun 2019 13:42:09 +0800",
        "Message-Id": "<20190604054248.68510-11-leyi.rong@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190604054248.68510-1-leyi.rong@intel.com>",
        "References": "<20190604054248.68510-1-leyi.rong@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 10/49] net/ice/base: save and post reset replay q\n\tbandwidth",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Added code to save the queue bandwidth information when it is applied\nand it is replayed when queue is re-enabled again. Earlier saved value\nis used for replay purpose.\nAdded vsi_handle, tc, and q_handle argument to the ice_cfg_q_bw_lmt,\nice_cfg_q_bw_dflt_lmt.\n\nSigned-off-by: Tarun Singh <tarun.k.singh@intel.com>\nSigned-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>\nSigned-off-by: Leyi Rong <leyi.rong@intel.com>\n---\n drivers/net/ice/base/ice_common.c |  7 ++-\n drivers/net/ice/base/ice_common.h |  4 ++\n drivers/net/ice/base/ice_sched.c  | 91 ++++++++++++++++++++++++++-----\n drivers/net/ice/base/ice_sched.h  |  8 +--\n drivers/net/ice/base/ice_switch.h |  5 --\n drivers/net/ice/base/ice_type.h   |  8 +++\n 6 files changed, 98 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex c74e4e1d4..09296ead2 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -3606,7 +3606,7 @@ ice_get_ctx(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info)\n  * @tc: TC number\n  * @q_handle: software queue handle\n  */\n-static struct ice_q_ctx *\n+struct ice_q_ctx *\n ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle)\n {\n \tstruct ice_vsi_ctx *vsi;\n@@ -3703,9 +3703,12 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle,\n \tnode.node_teid = buf->txqs[0].q_teid;\n \tnode.data.elem_type = ICE_AQC_ELEM_TYPE_LEAF;\n \tq_ctx->q_handle = q_handle;\n+\tq_ctx->q_teid = LE32_TO_CPU(node.node_teid);\n \n-\t/* add a leaf node into schduler tree queue layer */\n+\t/* add a leaf node into scheduler tree queue layer */\n \tstatus = ice_sched_add_node(pi, hw->num_tx_sched_layers - 1, &node);\n+\tif (!status)\n+\t\tstatus = ice_sched_replay_q_bw(pi, q_ctx);\n \n ena_txq_exit:\n \tice_release_lock(&pi->sched_lock);\ndiff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h\nindex 58c66fdc0..aee754b85 100644\n--- a/drivers/net/ice/base/ice_common.h\n+++ b/drivers/net/ice/base/ice_common.h\n@@ -186,6 +186,10 @@ void ice_sched_replay_agg(struct ice_hw *hw);\n enum ice_status ice_sched_replay_tc_node_bw(struct ice_hw *hw);\n enum ice_status ice_replay_vsi_agg(struct ice_hw *hw, u16 vsi_handle);\n enum ice_status\n+ice_sched_replay_q_bw(struct ice_port_info *pi, struct ice_q_ctx *q_ctx);\n+struct ice_q_ctx *\n+ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle);\n+enum ice_status\n ice_cfg_tc_node_bw_alloc(struct ice_port_info *pi, u8 tc,\n \t\t\t enum ice_rl_type rl_type, u8 bw_alloc);\n enum ice_status ice_cfg_rl_burst_size(struct ice_hw *hw, u32 bytes);\ndiff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c\nindex 8773e62a9..855e3848c 100644\n--- a/drivers/net/ice/base/ice_sched.c\n+++ b/drivers/net/ice/base/ice_sched.c\n@@ -4326,27 +4326,61 @@ ice_sched_validate_srl_node(struct ice_sched_node *node, u8 sel_layer)\n \treturn ICE_ERR_CFG;\n }\n \n+/**\n+ * ice_sched_save_q_bw - save queue node's BW information\n+ * @q_ctx: queue context structure\n+ * @rl_type: rate limit type min, max, or shared\n+ * @bw: bandwidth in Kbps - Kilo bits per sec\n+ *\n+ * Save BW information of queue type node for post replay use.\n+ */\n+static enum ice_status\n+ice_sched_save_q_bw(struct ice_q_ctx *q_ctx, enum ice_rl_type rl_type, u32 bw)\n+{\n+\tswitch (rl_type) {\n+\tcase ICE_MIN_BW:\n+\t\tice_set_clear_cir_bw(&q_ctx->bw_t_info, bw);\n+\t\tbreak;\n+\tcase ICE_MAX_BW:\n+\t\tice_set_clear_eir_bw(&q_ctx->bw_t_info, bw);\n+\t\tbreak;\n+\tcase ICE_SHARED_BW:\n+\t\tice_set_clear_shared_bw(&q_ctx->bw_t_info, bw);\n+\t\tbreak;\n+\tdefault:\n+\t\treturn ICE_ERR_PARAM;\n+\t}\n+\treturn ICE_SUCCESS;\n+}\n+\n /**\n  * ice_sched_set_q_bw_lmt - sets queue BW limit\n  * @pi: port information structure\n- * @q_id: queue ID (leaf node TEID)\n+ * @vsi_handle: sw VSI handle\n+ * @tc: traffic class\n+ * @q_handle: software queue handle\n  * @rl_type: min, max, or shared\n  * @bw: bandwidth in Kbps\n  *\n  * This function sets BW limit of queue scheduling node.\n  */\n static enum ice_status\n-ice_sched_set_q_bw_lmt(struct ice_port_info *pi, u32 q_id,\n-\t\t       enum ice_rl_type rl_type, u32 bw)\n+ice_sched_set_q_bw_lmt(struct ice_port_info *pi, u16 vsi_handle, u8 tc,\n+\t\t       u16 q_handle, enum ice_rl_type rl_type, u32 bw)\n {\n \tenum ice_status status = ICE_ERR_PARAM;\n \tstruct ice_sched_node *node;\n+\tstruct ice_q_ctx *q_ctx;\n \n+\tif (!ice_is_vsi_valid(pi->hw, vsi_handle))\n+\t\treturn ICE_ERR_PARAM;\n \tice_acquire_lock(&pi->sched_lock);\n-\n-\tnode = ice_sched_find_node_by_teid(pi->root, q_id);\n+\tq_ctx = ice_get_lan_q_ctx(pi->hw, vsi_handle, tc, q_handle);\n+\tif (!q_ctx)\n+\t\tgoto exit_q_bw_lmt;\n+\tnode = ice_sched_find_node_by_teid(pi->root, q_ctx->q_teid);\n \tif (!node) {\n-\t\tice_debug(pi->hw, ICE_DBG_SCHED, \"Wrong q_id\\n\");\n+\t\tice_debug(pi->hw, ICE_DBG_SCHED, \"Wrong q_teid\\n\");\n \t\tgoto exit_q_bw_lmt;\n \t}\n \n@@ -4374,6 +4408,9 @@ ice_sched_set_q_bw_lmt(struct ice_port_info *pi, u32 q_id,\n \telse\n \t\tstatus = ice_sched_set_node_bw_lmt(pi, node, rl_type, bw);\n \n+\tif (!status)\n+\t\tstatus = ice_sched_save_q_bw(q_ctx, rl_type, bw);\n+\n exit_q_bw_lmt:\n \tice_release_lock(&pi->sched_lock);\n \treturn status;\n@@ -4382,32 +4419,38 @@ ice_sched_set_q_bw_lmt(struct ice_port_info *pi, u32 q_id,\n /**\n  * ice_cfg_q_bw_lmt - configure queue BW limit\n  * @pi: port information structure\n- * @q_id: queue ID (leaf node TEID)\n+ * @vsi_handle: sw VSI handle\n+ * @tc: traffic class\n+ * @q_handle: software queue handle\n  * @rl_type: min, max, or shared\n  * @bw: bandwidth in Kbps\n  *\n  * This function configures BW limit of queue scheduling node.\n  */\n enum ice_status\n-ice_cfg_q_bw_lmt(struct ice_port_info *pi, u32 q_id, enum ice_rl_type rl_type,\n-\t\t u32 bw)\n+ice_cfg_q_bw_lmt(struct ice_port_info *pi, u16 vsi_handle, u8 tc,\n+\t\t u16 q_handle, enum ice_rl_type rl_type, u32 bw)\n {\n-\treturn ice_sched_set_q_bw_lmt(pi, q_id, rl_type, bw);\n+\treturn ice_sched_set_q_bw_lmt(pi, vsi_handle, tc, q_handle, rl_type,\n+\t\t\t\t      bw);\n }\n \n /**\n  * ice_cfg_q_bw_dflt_lmt - configure queue BW default limit\n  * @pi: port information structure\n- * @q_id: queue ID (leaf node TEID)\n+ * @vsi_handle: sw VSI handle\n+ * @tc: traffic class\n+ * @q_handle: software queue handle\n  * @rl_type: min, max, or shared\n  *\n  * This function configures BW default limit of queue scheduling node.\n  */\n enum ice_status\n-ice_cfg_q_bw_dflt_lmt(struct ice_port_info *pi, u32 q_id,\n-\t\t      enum ice_rl_type rl_type)\n+ice_cfg_q_bw_dflt_lmt(struct ice_port_info *pi, u16 vsi_handle, u8 tc,\n+\t\t      u16 q_handle, enum ice_rl_type rl_type)\n {\n-\treturn ice_sched_set_q_bw_lmt(pi, q_id, rl_type, ICE_SCHED_DFLT_BW);\n+\treturn ice_sched_set_q_bw_lmt(pi, vsi_handle, tc, q_handle, rl_type,\n+\t\t\t\t      ICE_SCHED_DFLT_BW);\n }\n \n /**\n@@ -5421,3 +5464,23 @@ ice_replay_vsi_agg(struct ice_hw *hw, u16 vsi_handle)\n \tice_release_lock(&pi->sched_lock);\n \treturn status;\n }\n+\n+/**\n+ * ice_sched_replay_q_bw - replay queue type node BW\n+ * @pi: port information structure\n+ * @q_ctx: queue context structure\n+ *\n+ * This function replays queue type node bandwidth. This function needs to be\n+ * called with scheduler lock held.\n+ */\n+enum ice_status\n+ice_sched_replay_q_bw(struct ice_port_info *pi, struct ice_q_ctx *q_ctx)\n+{\n+\tstruct ice_sched_node *q_node;\n+\n+\t/* Following also checks the presence of node in tree */\n+\tq_node = ice_sched_find_node_by_teid(pi->root, q_ctx->q_teid);\n+\tif (!q_node)\n+\t\treturn ICE_ERR_PARAM;\n+\treturn ice_sched_replay_node_bw(pi->hw, q_node, &q_ctx->bw_t_info);\n+}\ndiff --git a/drivers/net/ice/base/ice_sched.h b/drivers/net/ice/base/ice_sched.h\nindex 92377a82e..56f9977ab 100644\n--- a/drivers/net/ice/base/ice_sched.h\n+++ b/drivers/net/ice/base/ice_sched.h\n@@ -122,11 +122,11 @@ ice_move_vsi_to_agg(struct ice_port_info *pi, u32 agg_id, u16 vsi_handle,\n \t\t    u8 tc_bitmap);\n enum ice_status ice_rm_agg_cfg(struct ice_port_info *pi, u32 agg_id);\n enum ice_status\n-ice_cfg_q_bw_lmt(struct ice_port_info *pi, u32 q_id, enum ice_rl_type rl_type,\n-\t\t u32 bw);\n+ice_cfg_q_bw_lmt(struct ice_port_info *pi, u16 vsi_handle, u8 tc,\n+\t\t u16 q_handle, enum ice_rl_type rl_type, u32 bw);\n enum ice_status\n-ice_cfg_q_bw_dflt_lmt(struct ice_port_info *pi, u32 q_id,\n-\t\t      enum ice_rl_type rl_type);\n+ice_cfg_q_bw_dflt_lmt(struct ice_port_info *pi, u16 vsi_handle, u8 tc,\n+\t\t      u16 q_handle, enum ice_rl_type rl_type);\n enum ice_status\n ice_cfg_tc_node_bw_lmt(struct ice_port_info *pi, u8 tc,\n \t\t       enum ice_rl_type rl_type, u32 bw);\ndiff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h\nindex a6e17e861..e3fb0434d 100644\n--- a/drivers/net/ice/base/ice_switch.h\n+++ b/drivers/net/ice/base/ice_switch.h\n@@ -21,11 +21,6 @@\n #define ICE_VSI_INVAL_ID 0xFFFF\n #define ICE_INVAL_Q_HANDLE 0xFFFF\n \n-/* VSI queue context structure */\n-struct ice_q_ctx {\n-\tu16  q_handle;\n-};\n-\n /* VSI context structure for add/get/update/free operations */\n struct ice_vsi_ctx {\n \tu16 vsi_num;\ndiff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h\nindex d994ea3d2..b229be158 100644\n--- a/drivers/net/ice/base/ice_type.h\n+++ b/drivers/net/ice/base/ice_type.h\n@@ -569,6 +569,14 @@ struct ice_bw_type_info {\n \tu32 shared_bw;\n };\n \n+/* VSI queue context structure for given TC */\n+struct ice_q_ctx {\n+\tu16  q_handle;\n+\tu32  q_teid;\n+\t/* bw_t_info saves queue BW information */\n+\tstruct ice_bw_type_info bw_t_info;\n+};\n+\n /* VSI type list entry to locate corresponding VSI/aggregator nodes */\n struct ice_sched_vsi_info {\n \tstruct ice_sched_node *vsi_node[ICE_MAX_TRAFFIC_CLASS];\n",
    "prefixes": [
        "10/49"
    ]
}