get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 972038,
    "url": "http://patchwork.ozlabs.org/api/patches/972038/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180920002319.10971-11-anirudh.venkataramanan@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20180920002319.10971-11-anirudh.venkataramanan@intel.com>",
    "list_archive_url": null,
    "date": "2018-09-20T00:23:13",
    "name": "[10/16] ice: Expand use of VSI handles part 2/2",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "d531b034b6f796636b23855b2bc994e30a6bdac7",
    "submitter": {
        "id": 73601,
        "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api",
        "name": "Anirudh Venkataramanan",
        "email": "anirudh.venkataramanan@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180920002319.10971-11-anirudh.venkataramanan@intel.com/mbox/",
    "series": [
        {
            "id": 66525,
            "url": "http://patchwork.ozlabs.org/api/series/66525/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=66525",
            "date": "2018-09-20T00:23:03",
            "name": "Implementation updates for ice",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/66525/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/972038/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/972038/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 42FyBh6rCTz9sBJ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 20 Sep 2018 10:23:40 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 9AFFE88ADE;\n\tThu, 20 Sep 2018 00:23:39 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id TVrPq9CO8z46; Thu, 20 Sep 2018 00:23:37 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 9A89C88AE0;\n\tThu, 20 Sep 2018 00:23:36 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 38DF91C08AF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:23:33 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 3649B302BD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:23:33 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id a3-JnpHaMJj9 for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:23:27 +0000 (UTC)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby silver.osuosl.org (Postfix) with ESMTPS id B27E4227A3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:23:24 +0000 (UTC)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Sep 2018 17:23:23 -0700",
            "from shasta.jf.intel.com ([10.166.241.11])\n\tby fmsmga006.fm.intel.com with ESMTP; 19 Sep 2018 17:23:20 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.53,396,1531810800\"; d=\"scan'208\";a=\"265057701\"",
        "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 19 Sep 2018 17:23:13 -0700",
        "Message-Id": "<20180920002319.10971-11-anirudh.venkataramanan@intel.com>",
        "X-Mailer": "git-send-email 2.14.3",
        "In-Reply-To": "<20180920002319.10971-1-anirudh.venkataramanan@intel.com>",
        "References": "<20180920002319.10971-1-anirudh.venkataramanan@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH 10/16] ice: Expand use of VSI handles part\n\t2/2",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.24",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "This patch is a continuation of the previous patch where VSI\nhandles are used instead of VSI numbers.\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_common.c |  71 ++++++++-----\n drivers/net/ethernet/intel/ice/ice_common.h |  13 +--\n drivers/net/ethernet/intel/ice/ice_lib.c    |  18 ++--\n drivers/net/ethernet/intel/ice/ice_main.c   |  22 ++--\n drivers/net/ethernet/intel/ice/ice_sched.c  | 151 +++++++++-------------------\n drivers/net/ethernet/intel/ice/ice_sched.h  |   5 +-\n drivers/net/ethernet/intel/ice/ice_switch.c |   6 +-\n drivers/net/ethernet/intel/ice/ice_switch.h |   5 +\n drivers/net/ethernet/intel/ice/ice_type.h   |   4 +-\n 9 files changed, 132 insertions(+), 163 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c\nindex ef9229fa5510..62bc717e4a90 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.c\n+++ b/drivers/net/ethernet/intel/ice/ice_common.c\n@@ -2055,7 +2055,7 @@ __ice_aq_get_set_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut,\n /**\n  * ice_aq_get_rss_lut\n  * @hw: pointer to the hardware structure\n- * @vsi_id: VSI FW index\n+ * @vsi_handle: software VSI handle\n  * @lut_type: LUT table type\n  * @lut: pointer to the LUT buffer provided by the caller\n  * @lut_size: size of the LUT buffer\n@@ -2063,17 +2063,20 @@ __ice_aq_get_set_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut,\n  * get the RSS lookup table, PF or VSI type\n  */\n enum ice_status\n-ice_aq_get_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut,\n-\t\t   u16 lut_size)\n+ice_aq_get_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type,\n+\t\t   u8 *lut, u16 lut_size)\n {\n-\treturn __ice_aq_get_set_rss_lut(hw, vsi_id, lut_type, lut, lut_size, 0,\n-\t\t\t\t\tfalse);\n+\tif (!ice_is_vsi_valid(hw, vsi_handle) || !lut)\n+\t\treturn ICE_ERR_PARAM;\n+\n+\treturn __ice_aq_get_set_rss_lut(hw, ice_get_hw_vsi_num(hw, vsi_handle),\n+\t\t\t\t\tlut_type, lut, lut_size, 0, false);\n }\n \n /**\n  * ice_aq_set_rss_lut\n  * @hw: pointer to the hardware structure\n- * @vsi_id: VSI FW index\n+ * @vsi_handle: software VSI handle\n  * @lut_type: LUT table type\n  * @lut: pointer to the LUT buffer provided by the caller\n  * @lut_size: size of the LUT buffer\n@@ -2081,11 +2084,14 @@ ice_aq_get_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut,\n  * set the RSS lookup table, PF or VSI type\n  */\n enum ice_status\n-ice_aq_set_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut,\n-\t\t   u16 lut_size)\n+ice_aq_set_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type,\n+\t\t   u8 *lut, u16 lut_size)\n {\n-\treturn __ice_aq_get_set_rss_lut(hw, vsi_id, lut_type, lut, lut_size, 0,\n-\t\t\t\t\ttrue);\n+\tif (!ice_is_vsi_valid(hw, vsi_handle) || !lut)\n+\t\treturn ICE_ERR_PARAM;\n+\n+\treturn __ice_aq_get_set_rss_lut(hw, ice_get_hw_vsi_num(hw, vsi_handle),\n+\t\t\t\t\tlut_type, lut, lut_size, 0, true);\n }\n \n /**\n@@ -2126,31 +2132,39 @@ ice_status __ice_aq_get_set_rss_key(struct ice_hw *hw, u16 vsi_id,\n /**\n  * ice_aq_get_rss_key\n  * @hw: pointer to the hw struct\n- * @vsi_id: VSI FW index\n+ * @vsi_handle: software VSI handle\n  * @key: pointer to key info struct\n  *\n  * get the RSS key per VSI\n  */\n enum ice_status\n-ice_aq_get_rss_key(struct ice_hw *hw, u16 vsi_id,\n+ice_aq_get_rss_key(struct ice_hw *hw, u16 vsi_handle,\n \t\t   struct ice_aqc_get_set_rss_keys *key)\n {\n-\treturn __ice_aq_get_set_rss_key(hw, vsi_id, key, false);\n+\tif (!ice_is_vsi_valid(hw, vsi_handle) || !key)\n+\t\treturn ICE_ERR_PARAM;\n+\n+\treturn __ice_aq_get_set_rss_key(hw, ice_get_hw_vsi_num(hw, vsi_handle),\n+\t\t\t\t\tkey, false);\n }\n \n /**\n  * ice_aq_set_rss_key\n  * @hw: pointer to the hw struct\n- * @vsi_id: VSI FW index\n+ * @vsi_handle: software VSI handle\n  * @keys: pointer to key info struct\n  *\n  * set the RSS key per VSI\n  */\n enum ice_status\n-ice_aq_set_rss_key(struct ice_hw *hw, u16 vsi_id,\n+ice_aq_set_rss_key(struct ice_hw *hw, u16 vsi_handle,\n \t\t   struct ice_aqc_get_set_rss_keys *keys)\n {\n-\treturn __ice_aq_get_set_rss_key(hw, vsi_id, keys, true);\n+\tif (!ice_is_vsi_valid(hw, vsi_handle) || !keys)\n+\t\treturn ICE_ERR_PARAM;\n+\n+\treturn __ice_aq_get_set_rss_key(hw, ice_get_hw_vsi_num(hw, vsi_handle),\n+\t\t\t\t\tkeys, true);\n }\n \n /**\n@@ -2489,7 +2503,7 @@ ice_set_ctx(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)\n /**\n  * ice_ena_vsi_txq\n  * @pi: port information structure\n- * @vsi_id: VSI id\n+ * @vsi_handle: software VSI handle\n  * @tc: tc number\n  * @num_qgrps: Number of added queue groups\n  * @buf: list of queue groups to be added\n@@ -2499,7 +2513,7 @@ ice_set_ctx(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)\n  * This function adds one lan q\n  */\n enum ice_status\n-ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_id, u8 tc, u8 num_qgrps,\n+ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_qgrps,\n \t\tstruct ice_aqc_add_tx_qgrp *buf, u16 buf_size,\n \t\tstruct ice_sq_cd *cd)\n {\n@@ -2516,15 +2530,19 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_id, u8 tc, u8 num_qgrps,\n \n \thw = pi->hw;\n \n+\tif (!ice_is_vsi_valid(hw, vsi_handle))\n+\t\treturn ICE_ERR_PARAM;\n+\n \tmutex_lock(&pi->sched_lock);\n \n \t/* find a parent node */\n-\tparent = ice_sched_get_free_qparent(pi, vsi_id, tc,\n+\tparent = ice_sched_get_free_qparent(pi, vsi_handle, tc,\n \t\t\t\t\t    ICE_SCHED_NODE_OWNER_LAN);\n \tif (!parent) {\n \t\tstatus = ICE_ERR_PARAM;\n \t\tgoto ena_txq_exit;\n \t}\n+\n \tbuf->parent_teid = parent->info.node_teid;\n \tnode.parent_teid = parent->info.node_teid;\n \t/* Mark that the values in the \"generic\" section as valid. The default\n@@ -2602,7 +2620,7 @@ ice_dis_vsi_txq(struct ice_port_info *pi, u8 num_queues, u16 *q_ids,\n /**\n  * ice_cfg_vsi_qs - configure the new/exisiting VSI queues\n  * @pi: port information structure\n- * @vsi_id: VSI Id\n+ * @vsi_handle: software VSI handle\n  * @tc_bitmap: TC bitmap\n  * @maxqs: max queues array per TC\n  * @owner: lan or rdma\n@@ -2610,7 +2628,7 @@ ice_dis_vsi_txq(struct ice_port_info *pi, u8 num_queues, u16 *q_ids,\n  * This function adds/updates the VSI queues per TC.\n  */\n static enum ice_status\n-ice_cfg_vsi_qs(struct ice_port_info *pi, u16 vsi_id, u8 tc_bitmap,\n+ice_cfg_vsi_qs(struct ice_port_info *pi, u16 vsi_handle, u8 tc_bitmap,\n \t       u16 *maxqs, u8 owner)\n {\n \tenum ice_status status = 0;\n@@ -2619,6 +2637,9 @@ ice_cfg_vsi_qs(struct ice_port_info *pi, u16 vsi_id, u8 tc_bitmap,\n \tif (!pi || pi->port_state != ICE_SCHED_PORT_STATE_READY)\n \t\treturn ICE_ERR_CFG;\n \n+\tif (!ice_is_vsi_valid(pi->hw, vsi_handle))\n+\t\treturn ICE_ERR_PARAM;\n+\n \tmutex_lock(&pi->sched_lock);\n \n \tfor (i = 0; i < ICE_MAX_TRAFFIC_CLASS; i++) {\n@@ -2626,7 +2647,7 @@ ice_cfg_vsi_qs(struct ice_port_info *pi, u16 vsi_id, u8 tc_bitmap,\n \t\tif (!ice_sched_get_tc_node(pi, i))\n \t\t\tcontinue;\n \n-\t\tstatus = ice_sched_cfg_vsi(pi, vsi_id, i, maxqs[i], owner,\n+\t\tstatus = ice_sched_cfg_vsi(pi, vsi_handle, i, maxqs[i], owner,\n \t\t\t\t\t   ice_is_tc_ena(tc_bitmap, i));\n \t\tif (status)\n \t\t\tbreak;\n@@ -2639,17 +2660,17 @@ ice_cfg_vsi_qs(struct ice_port_info *pi, u16 vsi_id, u8 tc_bitmap,\n /**\n  * ice_cfg_vsi_lan - configure VSI lan queues\n  * @pi: port information structure\n- * @vsi_id: VSI Id\n+ * @vsi_handle: software VSI handle\n  * @tc_bitmap: TC bitmap\n  * @max_lanqs: max lan queues array per TC\n  *\n  * This function adds/updates the VSI lan queues per TC.\n  */\n enum ice_status\n-ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_id, u8 tc_bitmap,\n+ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_handle, u8 tc_bitmap,\n \t\tu16 *max_lanqs)\n {\n-\treturn ice_cfg_vsi_qs(pi, vsi_id, tc_bitmap, max_lanqs,\n+\treturn ice_cfg_vsi_qs(pi, vsi_handle, tc_bitmap, max_lanqs,\n \t\t\t      ICE_SCHED_NODE_OWNER_LAN);\n }\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_common.h b/drivers/net/ethernet/intel/ice/ice_common.h\nindex 80d288a07731..01384fb919df 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.h\n+++ b/drivers/net/ethernet/intel/ice/ice_common.h\n@@ -37,17 +37,18 @@ ice_write_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx,\n \t\t  u32 rxq_index);\n \n enum ice_status\n-ice_aq_get_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut,\n+ice_aq_get_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type, u8 *lut,\n \t\t   u16 lut_size);\n enum ice_status\n-ice_aq_set_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut,\n+ice_aq_set_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type, u8 *lut,\n \t\t   u16 lut_size);\n enum ice_status\n-ice_aq_get_rss_key(struct ice_hw *hw, u16 vsi_id,\n+ice_aq_get_rss_key(struct ice_hw *hw, u16 vsi_handle,\n \t\t   struct ice_aqc_get_set_rss_keys *keys);\n enum ice_status\n-ice_aq_set_rss_key(struct ice_hw *hw, u16 vsi_id,\n+ice_aq_set_rss_key(struct ice_hw *hw, u16 vsi_handle,\n \t\t   struct ice_aqc_get_set_rss_keys *keys);\n+\n bool ice_check_sq_alive(struct ice_hw *hw, struct ice_ctl_q_info *cq);\n enum ice_status ice_aq_q_shutdown(struct ice_hw *hw, bool unloading);\n void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode);\n@@ -89,10 +90,10 @@ enum ice_status\n ice_dis_vsi_txq(struct ice_port_info *pi, u8 num_queues, u16 *q_ids,\n \t\tu32 *q_teids, struct ice_sq_cd *cmd_details);\n enum ice_status\n-ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_id, u8 tc_bitmap,\n+ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_handle, u8 tc_bitmap,\n \t\tu16 *max_lanqs);\n enum ice_status\n-ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_id, u8 tc, u8 num_qgrps,\n+ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_qgrps,\n \t\tstruct ice_aqc_add_tx_qgrp *buf, u16 buf_size,\n \t\tstruct ice_sq_cd *cd);\n void ice_output_fw_log(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex 2b8dd9272ede..673123823d54 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -137,7 +137,7 @@ ice_setup_tx_ctx(struct ice_ring *ring, struct ice_tlan_ctx *tlan_ctx, u16 pf_q)\n \t}\n \n \t/* make sure the context is associated with the right VSI */\n-\ttlan_ctx->src_vsi = vsi->vsi_num;\n+\ttlan_ctx->src_vsi = ice_get_hw_vsi_num(hw, vsi->idx);\n \n \ttlan_ctx->tso_ena = ICE_TX_LEGACY;\n \ttlan_ctx->tso_qnum = pf_q;\n@@ -1230,8 +1230,8 @@ static int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi)\n \telse\n \t\tice_fill_rss_lut(lut, vsi->rss_table_size, vsi->rss_size);\n \n-\tstatus = ice_aq_set_rss_lut(&pf->hw, vsi->vsi_num, vsi->rss_lut_type,\n-\t\t\t\t    lut, vsi->rss_table_size);\n+\tstatus = ice_aq_set_rss_lut(&pf->hw, vsi->idx, vsi->rss_lut_type, lut,\n+\t\t\t\t    vsi->rss_table_size);\n \n \tif (status) {\n \t\tdev_err(&vsi->back->pdev->dev,\n@@ -1255,7 +1255,7 @@ static int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi)\n \tmemcpy(&key->standard_rss_key, seed,\n \t       ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE);\n \n-\tstatus = ice_aq_set_rss_key(&pf->hw, vsi->vsi_num, key);\n+\tstatus = ice_aq_set_rss_key(&pf->hw, vsi->idx, key);\n \n \tif (status) {\n \t\tdev_err(&vsi->back->pdev->dev, \"set_rss_key failed, error %d\\n\",\n@@ -1524,7 +1524,7 @@ int ice_vsi_cfg_txqs(struct ice_vsi *vsi)\n \t\t * comm scheduler queue doorbell.\n \t\t */\n \t\tvsi->tx_rings[i]->tail = pf->hw.hw_addr + QTX_COMM_DBELL(pf_q);\n-\t\tstatus = ice_ena_vsi_txq(vsi->port_info, vsi->vsi_num, tc,\n+\t\tstatus = ice_ena_vsi_txq(vsi->port_info, vsi->idx, tc,\n \t\t\t\t\t num_q_grps, qg_buf, buf_len, NULL);\n \t\tif (status) {\n \t\t\tdev_err(&vsi->back->pdev->dev,\n@@ -1929,8 +1929,8 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,\n \tfor (i = 0; i < vsi->tc_cfg.numtc; i++)\n \t\tmax_txqs[i] = vsi->num_txq;\n \n-\tret = ice_cfg_vsi_lan(vsi->port_info, vsi->vsi_num,\n-\t\t\t      vsi->tc_cfg.ena_tc, max_txqs);\n+\tret = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, vsi->tc_cfg.ena_tc,\n+\t\t\t      max_txqs);\n \tif (ret) {\n \t\tdev_info(&pf->pdev->dev, \"Failed VSI lan queue config\\n\");\n \t\tgoto unroll_vector_base;\n@@ -2340,8 +2340,8 @@ int ice_vsi_rebuild(struct ice_vsi *vsi)\n \tfor (i = 0; i < vsi->tc_cfg.numtc; i++)\n \t\tmax_txqs[i] = vsi->num_txq;\n \n-\tret = ice_cfg_vsi_lan(vsi->port_info, vsi->vsi_num,\n-\t\t\t      vsi->tc_cfg.ena_tc, max_txqs);\n+\tret = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, vsi->tc_cfg.ena_tc,\n+\t\t\t      max_txqs);\n \tif (ret) {\n \t\tdev_info(&vsi->back->pdev->dev,\n \t\t\t \"Failed VSI lan queue config\\n\");\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex b502d0522d21..cb12cb5b62a1 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -253,7 +253,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)\n \t\tclear_bit(ICE_VSI_FLAG_PROMISC_CHANGED, vsi->flags);\n \t\tif (vsi->current_netdev_flags & IFF_PROMISC) {\n \t\t\t/* Apply TX filter rule to get traffic from VMs */\n-\t\t\tstatus = ice_cfg_dflt_vsi(hw, vsi->vsi_num, true,\n+\t\t\tstatus = ice_cfg_dflt_vsi(hw, vsi->idx, true,\n \t\t\t\t\t\t  ICE_FLTR_TX);\n \t\t\tif (status) {\n \t\t\t\tnetdev_err(netdev, \"Error setting default VSI %i tx rule\\n\",\n@@ -263,7 +263,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)\n \t\t\t\tgoto out_promisc;\n \t\t\t}\n \t\t\t/* Apply RX filter rule to get traffic from wire */\n-\t\t\tstatus = ice_cfg_dflt_vsi(hw, vsi->vsi_num, true,\n+\t\t\tstatus = ice_cfg_dflt_vsi(hw, vsi->idx, true,\n \t\t\t\t\t\t  ICE_FLTR_RX);\n \t\t\tif (status) {\n \t\t\t\tnetdev_err(netdev, \"Error setting default VSI %i rx rule\\n\",\n@@ -274,7 +274,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)\n \t\t\t}\n \t\t} else {\n \t\t\t/* Clear TX filter rule to stop traffic from VMs */\n-\t\t\tstatus = ice_cfg_dflt_vsi(hw, vsi->vsi_num, false,\n+\t\t\tstatus = ice_cfg_dflt_vsi(hw, vsi->idx, false,\n \t\t\t\t\t\t  ICE_FLTR_TX);\n \t\t\tif (status) {\n \t\t\t\tnetdev_err(netdev, \"Error clearing default VSI %i tx rule\\n\",\n@@ -283,8 +283,8 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)\n \t\t\t\terr = -EIO;\n \t\t\t\tgoto out_promisc;\n \t\t\t}\n-\t\t\t/* Clear filter RX to remove traffic from wire */\n-\t\t\tstatus = ice_cfg_dflt_vsi(hw, vsi->vsi_num, false,\n+\t\t\t/* Clear RX filter to remove traffic from wire */\n+\t\t\tstatus = ice_cfg_dflt_vsi(hw, vsi->idx, false,\n \t\t\t\t\t\t  ICE_FLTR_RX);\n \t\t\tif (status) {\n \t\t\t\tnetdev_err(netdev, \"Error clearing default VSI %i rx rule\\n\",\n@@ -3334,7 +3334,7 @@ int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)\n \t\tstruct ice_aqc_get_set_rss_keys *buf =\n \t\t\t\t  (struct ice_aqc_get_set_rss_keys *)seed;\n \n-\t\tstatus = ice_aq_set_rss_key(hw, vsi->vsi_num, buf);\n+\t\tstatus = ice_aq_set_rss_key(hw, vsi->idx, buf);\n \n \t\tif (status) {\n \t\t\tdev_err(&pf->pdev->dev,\n@@ -3345,8 +3345,8 @@ int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)\n \t}\n \n \tif (lut) {\n-\t\tstatus = ice_aq_set_rss_lut(hw, vsi->vsi_num,\n-\t\t\t\t\t    vsi->rss_lut_type, lut, lut_size);\n+\t\tstatus = ice_aq_set_rss_lut(hw, vsi->idx, vsi->rss_lut_type,\n+\t\t\t\t\t    lut, lut_size);\n \t\tif (status) {\n \t\t\tdev_err(&pf->pdev->dev,\n \t\t\t\t\"Cannot set RSS lut, err %d aq_err %d\\n\",\n@@ -3377,7 +3377,7 @@ int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)\n \t\tstruct ice_aqc_get_set_rss_keys *buf =\n \t\t\t\t  (struct ice_aqc_get_set_rss_keys *)seed;\n \n-\t\tstatus = ice_aq_get_rss_key(hw, vsi->vsi_num, buf);\n+\t\tstatus = ice_aq_get_rss_key(hw, vsi->idx, buf);\n \t\tif (status) {\n \t\t\tdev_err(&pf->pdev->dev,\n \t\t\t\t\"Cannot get RSS key, err %d aq_err %d\\n\",\n@@ -3387,8 +3387,8 @@ int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)\n \t}\n \n \tif (lut) {\n-\t\tstatus = ice_aq_get_rss_lut(hw, vsi->vsi_num,\n-\t\t\t\t\t    vsi->rss_lut_type, lut, lut_size);\n+\t\tstatus = ice_aq_get_rss_lut(hw, vsi->idx, vsi->rss_lut_type,\n+\t\t\t\t\t    lut, lut_size);\n \t\tif (status) {\n \t\t\tdev_err(&pf->pdev->dev,\n \t\t\t\t\"Cannot get RSS lut, err %d aq_err %d\\n\",\ndiff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c\nindex 9c4f408f222d..7cc8aa18a22b 100644\n--- a/drivers/net/ethernet/intel/ice/ice_sched.c\n+++ b/drivers/net/ethernet/intel/ice/ice_sched.c\n@@ -599,9 +599,7 @@ ice_sched_suspend_resume_elems(struct ice_hw *hw, u8 num_nodes, u32 *node_teids,\n static void ice_sched_clear_tx_topo(struct ice_port_info *pi)\n {\n \tstruct ice_sched_agg_info *agg_info;\n-\tstruct ice_sched_vsi_info *vsi_elem;\n \tstruct ice_sched_agg_info *atmp;\n-\tstruct ice_sched_vsi_info *tmp;\n \tstruct ice_hw *hw;\n \n \tif (!pi)\n@@ -620,13 +618,6 @@ static void ice_sched_clear_tx_topo(struct ice_port_info *pi)\n \t\t}\n \t}\n \n-\t/* remove the vsi list */\n-\tlist_for_each_entry_safe(vsi_elem, tmp, &pi->vsi_info_list,\n-\t\t\t\t list_entry) {\n-\t\tlist_del(&vsi_elem->list_entry);\n-\t\tdevm_kfree(ice_hw_to_dev(hw), vsi_elem);\n-\t}\n-\n \tif (pi->root) {\n \t\tice_free_sched_node(pi, pi->root);\n \t\tpi->root = NULL;\n@@ -676,31 +667,6 @@ void ice_sched_cleanup_all(struct ice_hw *hw)\n \thw->max_cgds = 0;\n }\n \n-/**\n- * ice_sched_create_vsi_info_entry - create an empty new VSI entry\n- * @pi: port information structure\n- * @vsi_id: VSI Id\n- *\n- * This function creates a new VSI entry and adds it to list\n- */\n-static struct ice_sched_vsi_info *\n-ice_sched_create_vsi_info_entry(struct ice_port_info *pi, u16 vsi_id)\n-{\n-\tstruct ice_sched_vsi_info *vsi_elem;\n-\n-\tif (!pi)\n-\t\treturn NULL;\n-\n-\tvsi_elem = devm_kzalloc(ice_hw_to_dev(pi->hw), sizeof(*vsi_elem),\n-\t\t\t\tGFP_KERNEL);\n-\tif (!vsi_elem)\n-\t\treturn NULL;\n-\n-\tlist_add(&vsi_elem->list_entry, &pi->vsi_info_list);\n-\tvsi_elem->vsi_id = vsi_id;\n-\treturn vsi_elem;\n-}\n-\n /**\n  * ice_sched_add_elems - add nodes to hw and SW DB\n  * @pi: port information structure\n@@ -1072,7 +1038,6 @@ enum ice_status ice_sched_init_port(struct ice_port_info *pi)\n \tpi->port_state = ICE_SCHED_PORT_STATE_READY;\n \tmutex_init(&pi->sched_lock);\n \tINIT_LIST_HEAD(&pi->agg_list);\n-\tINIT_LIST_HEAD(&pi->vsi_info_list);\n \n err_init_port:\n \tif (status && pi->root) {\n@@ -1141,27 +1106,6 @@ enum ice_status ice_sched_query_res_alloc(struct ice_hw *hw)\n \treturn status;\n }\n \n-/**\n- * ice_sched_get_vsi_info_entry - Get the vsi entry list for given vsi_id\n- * @pi: port information structure\n- * @vsi_id: vsi id\n- *\n- * This function retrieves the vsi list for the given vsi id\n- */\n-static struct ice_sched_vsi_info *\n-ice_sched_get_vsi_info_entry(struct ice_port_info *pi, u16 vsi_id)\n-{\n-\tstruct ice_sched_vsi_info *list_elem;\n-\n-\tif (!pi)\n-\t\treturn NULL;\n-\n-\tlist_for_each_entry(list_elem, &pi->vsi_info_list, list_entry)\n-\t\tif (list_elem->vsi_id == vsi_id)\n-\t\t\treturn list_elem;\n-\treturn NULL;\n-}\n-\n /**\n  * ice_sched_find_node_in_subtree - Find node in part of base node subtree\n  * @hw: pointer to the hw struct\n@@ -1198,30 +1142,28 @@ ice_sched_find_node_in_subtree(struct ice_hw *hw, struct ice_sched_node *base,\n /**\n  * ice_sched_get_free_qparent - Get a free lan or rdma q group node\n  * @pi: port information structure\n- * @vsi_id: vsi id\n+ * @vsi_handle: software VSI handle\n  * @tc: branch number\n  * @owner: lan or rdma\n  *\n  * This function retrieves a free lan or rdma q group node\n  */\n struct ice_sched_node *\n-ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_id, u8 tc,\n+ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_handle, u8 tc,\n \t\t\t   u8 owner)\n {\n \tstruct ice_sched_node *vsi_node, *qgrp_node = NULL;\n-\tstruct ice_sched_vsi_info *list_elem;\n+\tstruct ice_vsi_ctx *vsi_ctx;\n \tu16 max_children;\n \tu8 qgrp_layer;\n \n \tqgrp_layer = ice_sched_get_qgrp_layer(pi->hw);\n \tmax_children = pi->hw->max_children[qgrp_layer];\n \n-\tlist_elem = ice_sched_get_vsi_info_entry(pi, vsi_id);\n-\tif (!list_elem)\n-\t\tgoto lan_q_exit;\n-\n-\tvsi_node = list_elem->vsi_node[tc];\n-\n+\tvsi_ctx = ice_get_vsi_ctx(pi->hw, vsi_handle);\n+\tif (!vsi_ctx)\n+\t\treturn NULL;\n+\tvsi_node = vsi_ctx->sched.vsi_node[tc];\n \t/* validate invalid VSI id */\n \tif (!vsi_node)\n \t\tgoto lan_q_exit;\n@@ -1245,14 +1187,14 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_id, u8 tc,\n  * ice_sched_get_vsi_node - Get a VSI node based on VSI id\n  * @hw: pointer to the hw struct\n  * @tc_node: pointer to the TC node\n- * @vsi_id: VSI id\n+ * @vsi_handle: software VSI handle\n  *\n  * This function retrieves a VSI node for a given VSI id from a given\n  * TC branch\n  */\n static struct ice_sched_node *\n ice_sched_get_vsi_node(struct ice_hw *hw, struct ice_sched_node *tc_node,\n-\t\t       u16 vsi_id)\n+\t\t       u16 vsi_handle)\n {\n \tstruct ice_sched_node *node;\n \tu8 vsi_layer;\n@@ -1262,7 +1204,7 @@ ice_sched_get_vsi_node(struct ice_hw *hw, struct ice_sched_node *tc_node,\n \n \t/* Check whether it already exists */\n \twhile (node) {\n-\t\tif (node->vsi_id == vsi_id)\n+\t\tif (node->vsi_handle == vsi_handle)\n \t\t\treturn node;\n \t\tnode = node->sibling;\n \t}\n@@ -1301,7 +1243,7 @@ ice_sched_calc_vsi_child_nodes(struct ice_hw *hw, u16 num_qs, u16 *num_nodes)\n /**\n  * ice_sched_add_vsi_child_nodes - add VSI child nodes to tree\n  * @pi: port information structure\n- * @vsi_id: VSI id\n+ * @vsi_handle: software VSI handle\n  * @tc_node: pointer to the TC node\n  * @num_nodes: pointer to the num nodes that needs to be added per layer\n  * @owner: node owner (lan or rdma)\n@@ -1310,7 +1252,7 @@ ice_sched_calc_vsi_child_nodes(struct ice_hw *hw, u16 num_qs, u16 *num_nodes)\n  * lan and rdma separately.\n  */\n static enum ice_status\n-ice_sched_add_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_id,\n+ice_sched_add_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle,\n \t\t\t      struct ice_sched_node *tc_node, u16 *num_nodes,\n \t\t\t      u8 owner)\n {\n@@ -1323,7 +1265,7 @@ ice_sched_add_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_id,\n \n \tqgl = ice_sched_get_qgrp_layer(hw);\n \tvsil = ice_sched_get_vsi_layer(hw);\n-\tparent = ice_sched_get_vsi_node(hw, tc_node, vsi_id);\n+\tparent = ice_sched_get_vsi_node(hw, tc_node, vsi_handle);\n \tfor (i = vsil + 1; i <= qgl; i++) {\n \t\tif (!parent)\n \t\t\treturn ICE_ERR_CFG;\n@@ -1436,7 +1378,7 @@ ice_sched_calc_vsi_support_nodes(struct ice_hw *hw,\n /**\n  * ice_sched_add_vsi_support_nodes - add VSI supported nodes into tx tree\n  * @pi: port information structure\n- * @vsi_id: VSI Id\n+ * @vsi_handle: software VSI handle\n  * @tc_node: pointer to TC node\n  * @num_nodes: pointer to num nodes array\n  *\n@@ -1444,7 +1386,7 @@ ice_sched_calc_vsi_support_nodes(struct ice_hw *hw,\n  * VSI, its parent and intermediate nodes in below layers\n  */\n static enum ice_status\n-ice_sched_add_vsi_support_nodes(struct ice_port_info *pi, u16 vsi_id,\n+ice_sched_add_vsi_support_nodes(struct ice_port_info *pi, u16 vsi_handle,\n \t\t\t\tstruct ice_sched_node *tc_node, u16 *num_nodes)\n {\n \tstruct ice_sched_node *parent = tc_node;\n@@ -1478,7 +1420,7 @@ ice_sched_add_vsi_support_nodes(struct ice_port_info *pi, u16 vsi_id,\n \t\t\treturn ICE_ERR_CFG;\n \n \t\tif (i == vsil)\n-\t\t\tparent->vsi_id = vsi_id;\n+\t\t\tparent->vsi_handle = vsi_handle;\n \t}\n \n \treturn 0;\n@@ -1487,13 +1429,13 @@ ice_sched_add_vsi_support_nodes(struct ice_port_info *pi, u16 vsi_id,\n /**\n  * ice_sched_add_vsi_to_topo - add a new VSI into tree\n  * @pi: port information structure\n- * @vsi_id: VSI Id\n+ * @vsi_handle: software VSI handle\n  * @tc: TC number\n  *\n  * This function adds a new VSI into scheduler tree\n  */\n static enum ice_status\n-ice_sched_add_vsi_to_topo(struct ice_port_info *pi, u16 vsi_id, u8 tc)\n+ice_sched_add_vsi_to_topo(struct ice_port_info *pi, u16 vsi_handle, u8 tc)\n {\n \tu16 num_nodes[ICE_AQC_TOPO_MAX_LEVEL_NUM] = { 0 };\n \tstruct ice_sched_node *tc_node;\n@@ -1507,13 +1449,14 @@ ice_sched_add_vsi_to_topo(struct ice_port_info *pi, u16 vsi_id, u8 tc)\n \tice_sched_calc_vsi_support_nodes(hw, tc_node, num_nodes);\n \n \t/* add vsi supported nodes to tc subtree */\n-\treturn ice_sched_add_vsi_support_nodes(pi, vsi_id, tc_node, num_nodes);\n+\treturn ice_sched_add_vsi_support_nodes(pi, vsi_handle, tc_node,\n+\t\t\t\t\t       num_nodes);\n }\n \n /**\n  * ice_sched_update_vsi_child_nodes - update VSI child nodes\n  * @pi: port information structure\n- * @vsi_id: VSI Id\n+ * @vsi_handle: software VSI handle\n  * @tc: TC number\n  * @new_numqs: new number of max queues\n  * @owner: owner of this subtree\n@@ -1521,14 +1464,14 @@ ice_sched_add_vsi_to_topo(struct ice_port_info *pi, u16 vsi_id, u8 tc)\n  * This function updates the VSI child nodes based on the number of queues\n  */\n static enum ice_status\n-ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_id, u8 tc,\n-\t\t\t\t u16 new_numqs, u8 owner)\n+ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle,\n+\t\t\t\t u8 tc, u16 new_numqs, u8 owner)\n {\n \tu16 prev_num_nodes[ICE_AQC_TOPO_MAX_LEVEL_NUM] = { 0 };\n \tu16 new_num_nodes[ICE_AQC_TOPO_MAX_LEVEL_NUM] = { 0 };\n \tstruct ice_sched_node *vsi_node;\n \tstruct ice_sched_node *tc_node;\n-\tstruct ice_sched_vsi_info *vsi;\n+\tstruct ice_vsi_ctx *vsi_ctx;\n \tenum ice_status status = 0;\n \tstruct ice_hw *hw = pi->hw;\n \tu16 prev_numqs;\n@@ -1538,16 +1481,16 @@ ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_id, u8 tc,\n \tif (!tc_node)\n \t\treturn ICE_ERR_CFG;\n \n-\tvsi_node = ice_sched_get_vsi_node(hw, tc_node, vsi_id);\n+\tvsi_node = ice_sched_get_vsi_node(hw, tc_node, vsi_handle);\n \tif (!vsi_node)\n \t\treturn ICE_ERR_CFG;\n \n-\tvsi = ice_sched_get_vsi_info_entry(pi, vsi_id);\n-\tif (!vsi)\n-\t\treturn ICE_ERR_CFG;\n+\tvsi_ctx = ice_get_vsi_ctx(hw, vsi_handle);\n+\tif (!vsi_ctx)\n+\t\treturn ICE_ERR_PARAM;\n \n \tif (owner == ICE_SCHED_NODE_OWNER_LAN)\n-\t\tprev_numqs = vsi->max_lanq[tc];\n+\t\tprev_numqs = vsi_ctx->sched.max_lanq[tc];\n \telse\n \t\treturn ICE_ERR_PARAM;\n \n@@ -1572,13 +1515,13 @@ ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_id, u8 tc,\n \t\tfor (i = 0; i < ICE_AQC_TOPO_MAX_LEVEL_NUM; i++)\n \t\t\tnew_num_nodes[i] -= prev_num_nodes[i];\n \n-\t\tstatus = ice_sched_add_vsi_child_nodes(pi, vsi_id, tc_node,\n+\t\tstatus = ice_sched_add_vsi_child_nodes(pi, vsi_handle, tc_node,\n \t\t\t\t\t\t       new_num_nodes, owner);\n \t\tif (status)\n \t\t\treturn status;\n \t}\n \n-\tvsi->max_lanq[tc] = new_numqs;\n+\tvsi_ctx->sched.max_lanq[tc] = new_numqs;\n \n \treturn status;\n }\n@@ -1586,7 +1529,7 @@ ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_id, u8 tc,\n /**\n  * ice_sched_cfg_vsi - configure the new/exisiting VSI\n  * @pi: port information structure\n- * @vsi_id: VSI Id\n+ * @vsi_handle: software VSI handle\n  * @tc: TC number\n  * @maxqs: max number of queues\n  * @owner: lan or rdma\n@@ -1597,25 +1540,21 @@ ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_id, u8 tc,\n  * disabled then suspend the VSI if it is not already.\n  */\n enum ice_status\n-ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_id, u8 tc, u16 maxqs,\n+ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 maxqs,\n \t\t  u8 owner, bool enable)\n {\n \tstruct ice_sched_node *vsi_node, *tc_node;\n-\tstruct ice_sched_vsi_info *vsi;\n+\tstruct ice_vsi_ctx *vsi_ctx;\n \tenum ice_status status = 0;\n \tstruct ice_hw *hw = pi->hw;\n \n \ttc_node = ice_sched_get_tc_node(pi, tc);\n \tif (!tc_node)\n \t\treturn ICE_ERR_PARAM;\n-\n-\tvsi = ice_sched_get_vsi_info_entry(pi, vsi_id);\n-\tif (!vsi)\n-\t\tvsi = ice_sched_create_vsi_info_entry(pi, vsi_id);\n-\tif (!vsi)\n-\t\treturn ICE_ERR_NO_MEMORY;\n-\n-\tvsi_node = ice_sched_get_vsi_node(hw, tc_node, vsi_id);\n+\tvsi_ctx = ice_get_vsi_ctx(hw, vsi_handle);\n+\tif (!vsi_ctx)\n+\t\treturn ICE_ERR_PARAM;\n+\tvsi_node = ice_sched_get_vsi_node(hw, tc_node, vsi_handle);\n \n \t/* suspend the VSI if tc is not enabled */\n \tif (!enable) {\n@@ -1632,20 +1571,26 @@ ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_id, u8 tc, u16 maxqs,\n \n \t/* TC is enabled, if it is a new VSI then add it to the tree */\n \tif (!vsi_node) {\n-\t\tstatus = ice_sched_add_vsi_to_topo(pi, vsi_id, tc);\n+\t\tstatus = ice_sched_add_vsi_to_topo(pi, vsi_handle, tc);\n \t\tif (status)\n \t\t\treturn status;\n \n-\t\tvsi_node = ice_sched_get_vsi_node(hw, tc_node, vsi_id);\n+\t\tvsi_node = ice_sched_get_vsi_node(hw, tc_node, vsi_handle);\n \t\tif (!vsi_node)\n \t\t\treturn ICE_ERR_CFG;\n \n-\t\tvsi->vsi_node[tc] = vsi_node;\n+\t\tvsi_ctx->sched.vsi_node[tc] = vsi_node;\n \t\tvsi_node->in_use = true;\n+\t\t/* invalidate the max queues whenever VSI gets added first time\n+\t\t * into the scheduler tree (boot or after reset). We need to\n+\t\t * recreate the child nodes all the time in these cases.\n+\t\t */\n+\t\tvsi_ctx->sched.max_lanq[tc] = 0;\n \t}\n \n \t/* update the VSI child nodes */\n-\tstatus = ice_sched_update_vsi_child_nodes(pi, vsi_id, tc, maxqs, owner);\n+\tstatus = ice_sched_update_vsi_child_nodes(pi, vsi_handle, tc, maxqs,\n+\t\t\t\t\t\t  owner);\n \tif (status)\n \t\treturn status;\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_sched.h b/drivers/net/ethernet/intel/ice/ice_sched.h\nindex badadcc120d3..5dc9cfa04c58 100644\n--- a/drivers/net/ethernet/intel/ice/ice_sched.h\n+++ b/drivers/net/ethernet/intel/ice/ice_sched.h\n@@ -12,7 +12,6 @@\n struct ice_sched_agg_vsi_info {\n \tstruct list_head list_entry;\n \tDECLARE_BITMAP(tc_bitmap, ICE_MAX_TRAFFIC_CLASS);\n-\tu16 vsi_id;\n };\n \n struct ice_sched_agg_info {\n@@ -35,9 +34,9 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer,\n void ice_free_sched_node(struct ice_port_info *pi, struct ice_sched_node *node);\n struct ice_sched_node *ice_sched_get_tc_node(struct ice_port_info *pi, u8 tc);\n struct ice_sched_node *\n-ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_id, u8 tc,\n+ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_handle, u8 tc,\n \t\t\t   u8 owner);\n enum ice_status\n-ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_id, u8 tc, u16 maxqs,\n+ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 maxqs,\n \t\t  u8 owner, bool enable);\n #endif /* _ICE_SCHED_H_ */\ndiff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c\nindex 50927f79b9dc..aab3ade35cb1 100644\n--- a/drivers/net/ethernet/intel/ice/ice_switch.c\n+++ b/drivers/net/ethernet/intel/ice/ice_switch.c\n@@ -283,7 +283,7 @@ ice_aq_update_vsi(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx,\n  *\n  * check whether the VSI is valid or not\n  */\n-static bool ice_is_vsi_valid(struct ice_hw *hw, u16 vsi_handle)\n+bool ice_is_vsi_valid(struct ice_hw *hw, u16 vsi_handle)\n {\n \treturn vsi_handle < ICE_MAX_VSI && hw->vsi_ctx[vsi_handle];\n }\n@@ -296,7 +296,7 @@ static bool ice_is_vsi_valid(struct ice_hw *hw, u16 vsi_handle)\n  * return the hw VSI number\n  * Caution: call this function only if VSI is valid (ice_is_vsi_valid)\n  */\n-static u16 ice_get_hw_vsi_num(struct ice_hw *hw, u16 vsi_handle)\n+u16 ice_get_hw_vsi_num(struct ice_hw *hw, u16 vsi_handle)\n {\n \treturn hw->vsi_ctx[vsi_handle]->vsi_num;\n }\n@@ -308,7 +308,7 @@ static u16 ice_get_hw_vsi_num(struct ice_hw *hw, u16 vsi_handle)\n  *\n  * return the VSI context entry for a given VSI handle\n  */\n-static struct ice_vsi_ctx *ice_get_vsi_ctx(struct ice_hw *hw, u16 vsi_handle)\n+struct ice_vsi_ctx *ice_get_vsi_ctx(struct ice_hw *hw, u16 vsi_handle)\n {\n \treturn (vsi_handle >= ICE_MAX_VSI) ? NULL : hw->vsi_ctx[vsi_handle];\n }\ndiff --git a/drivers/net/ethernet/intel/ice/ice_switch.h b/drivers/net/ethernet/intel/ice/ice_switch.h\nindex c188bbc3de2a..50ab036a17f3 100644\n--- a/drivers/net/ethernet/intel/ice/ice_switch.h\n+++ b/drivers/net/ethernet/intel/ice/ice_switch.h\n@@ -17,6 +17,7 @@ struct ice_vsi_ctx {\n \tu16 vsis_unallocated;\n \tu16 flags;\n \tstruct ice_aqc_vsi_props info;\n+\tstruct ice_sched_vsi_info sched;\n \tu8 alloc_from_pool;\n };\n \n@@ -185,6 +186,8 @@ ice_free_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx,\n enum ice_status\n ice_update_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx,\n \t       struct ice_sq_cd *cd);\n+bool ice_is_vsi_valid(struct ice_hw *hw, u16 vsi_handle);\n+struct ice_vsi_ctx *ice_get_vsi_ctx(struct ice_hw *hw, u16 vsi_handle);\n enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw);\n \n /* Switch/bridge related commands */\n@@ -197,6 +200,8 @@ enum ice_status ice_remove_vlan(struct ice_hw *hw, struct list_head *v_list);\n enum ice_status\n ice_cfg_dflt_vsi(struct ice_hw *hw, u16 vsi_handle, bool set, u8 direction);\n \n+u16 ice_get_hw_vsi_num(struct ice_hw *hw, u16 vsi_handle);\n+\n enum ice_status ice_replay_all_fltr(struct ice_hw *hw);\n \n enum ice_status ice_init_def_sw_recp(struct ice_hw *hw);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h\nindex e681804be4d4..fa459329c1de 100644\n--- a/drivers/net/ethernet/intel/ice/ice_type.h\n+++ b/drivers/net/ethernet/intel/ice/ice_type.h\n@@ -186,7 +186,7 @@ struct ice_sched_node {\n \tstruct ice_sched_node **children;\n \tstruct ice_aqc_txsched_elem_data info;\n \tu32 agg_id;\t\t\t/* aggregator group id */\n-\tu16 vsi_id;\n+\tu16 vsi_handle;\n \tu8 in_use;\t\t\t/* suspended or in use */\n \tu8 tx_sched_layer;\t\t/* Logical Layer (1-9) */\n \tu8 num_children;\n@@ -245,8 +245,6 @@ struct ice_port_info {\n \tstruct ice_mac_info mac;\n \tstruct ice_phy_info phy;\n \tstruct mutex sched_lock;\t/* protect access to TXSched tree */\n-\tstruct ice_sched_tx_policy sched_policy;\n-\tstruct list_head vsi_info_list;\n \tstruct list_head agg_list;\t/* lists all aggregator */\n \tu8 lport;\n #define ICE_LPORT_MASK\t\t0xff\n",
    "prefixes": [
        "10/16"
    ]
}