get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 972056,
    "url": "http://patchwork.ozlabs.org/api/patches/972056/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180920002319.10971-12-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-12-anirudh.venkataramanan@intel.com>",
    "list_archive_url": null,
    "date": "2018-09-20T00:23:14",
    "name": "[11/16] ice: Implement VSI replay framework",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "cc289946c5f1f65e48ef4fd83ab7efb88e90df3e",
    "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-12-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/972056/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/972056/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.138; helo=whitealder.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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 42FyC60qGxz9s9J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 20 Sep 2018 10:24:02 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B787087C7C;\n\tThu, 20 Sep 2018 00:24:00 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id Wv7zyQFGCBMR; Thu, 20 Sep 2018 00:23:52 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 6D271882FD;\n\tThu, 20 Sep 2018 00:23:41 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 3D0841C08AF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:23:34 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 3A3F4227A3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:23:34 +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 5GfwBs2X6ZI1 for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:23:29 +0000 (UTC)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 44BBF30971\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:23:25 +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:24 -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=\"265057702\"",
        "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 19 Sep 2018 17:23:14 -0700",
        "Message-Id": "<20180920002319.10971-12-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 11/16] ice: Implement VSI replay framework",
        "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": "Currently, switch filters get replayed after reset. In addition to\nfilters, other VSI attributes (like RSS configuration, Tx scheduler\nconfiguration, etc.) also need to be replayed after reset.\n\nThus, instead of replaying based on functional blocks (i.e. replay\nall filters for all VSIs, followed by RSS configuration replay for\nall VSIs, and so on), it makes more sense to have the replay centered\naround a VSI. In other words, replay all configurations for a VSI before\nmoving on to rebuilding the next VSI.\n\nTo that effect, this patch introduces a VSI replay framework in a new\nfunction ice_vsi_replay_all. Currently it only replays switch filters,\nbut it will be expanded in the future to replay additional VSI attributes.\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_common.c |  65 ++++++++++++++++-\n drivers/net/ethernet/intel/ice/ice_common.h |   2 +\n drivers/net/ethernet/intel/ice/ice_main.c   |  44 +++++++++++-\n drivers/net/ethernet/intel/ice/ice_switch.c | 107 ++++++++++++++++------------\n drivers/net/ethernet/intel/ice/ice_switch.h |   8 ++-\n drivers/net/ethernet/intel/ice/ice_type.h   |   3 +\n 6 files changed, 178 insertions(+), 51 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c\nindex 62bc717e4a90..1b38610f8d19 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.c\n+++ b/drivers/net/ethernet/intel/ice/ice_common.c\n@@ -422,7 +422,7 @@ static void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw)\n \t\t\tdevm_kfree(ice_hw_to_dev(hw), lst_itr);\n \t\t}\n \t}\n-\n+\tice_rm_all_sw_replay_rule_info(hw);\n \tdevm_kfree(ice_hw_to_dev(hw), sw->recp_list);\n \tdevm_kfree(ice_hw_to_dev(hw), sw);\n }\n@@ -2674,6 +2674,69 @@ ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_handle, u8 tc_bitmap,\n \t\t\t      ICE_SCHED_NODE_OWNER_LAN);\n }\n \n+/**\n+ * ice_replay_pre_init - replay pre initialization\n+ * @hw: pointer to the hw struct\n+ *\n+ * Initializes required config data for VSI, FD, ACL, and RSS before replay.\n+ */\n+static enum ice_status ice_replay_pre_init(struct ice_hw *hw)\n+{\n+\tstruct ice_switch_info *sw = hw->switch_info;\n+\tu8 i;\n+\n+\t/* Delete old entries from replay filter list head if there is any */\n+\tice_rm_all_sw_replay_rule_info(hw);\n+\t/* In start of replay, move entries into replay_rules list, it\n+\t * will allow adding rules entries back to filt_rules list,\n+\t * which is operational list.\n+\t */\n+\tfor (i = 0; i < ICE_SW_LKUP_LAST; i++)\n+\t\tlist_replace_init(&sw->recp_list[i].filt_rules,\n+\t\t\t\t  &sw->recp_list[i].filt_replay_rules);\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * ice_replay_vsi - replay vsi configuration\n+ * @hw: pointer to the hw struct\n+ * @vsi_handle: driver vsi handle\n+ *\n+ * Restore all VSI configuration after reset. It is required to call this\n+ * function with main VSI first.\n+ */\n+enum ice_status ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle)\n+{\n+\tenum ice_status status;\n+\n+\tif (!ice_is_vsi_valid(hw, vsi_handle))\n+\t\treturn ICE_ERR_PARAM;\n+\n+\t/* Replay pre-initialization if there is any */\n+\tif (vsi_handle == ICE_MAIN_VSI_HANDLE) {\n+\t\tstatus = ice_replay_pre_init(hw);\n+\t\tif (status)\n+\t\t\treturn status;\n+\t}\n+\n+\t/* Replay per VSI all filters */\n+\tstatus = ice_replay_vsi_all_fltr(hw, vsi_handle);\n+\treturn status;\n+}\n+\n+/**\n+ * ice_replay_post - post replay configuration cleanup\n+ * @hw: pointer to the hw struct\n+ *\n+ * Post replay cleanup.\n+ */\n+void ice_replay_post(struct ice_hw *hw)\n+{\n+\t/* Delete old entries from replay filter list head */\n+\tice_rm_all_sw_replay_rule_info(hw);\n+}\n+\n /**\n  * ice_stat_update40 - read 40 bit stat from the chip and update stat values\n  * @hw: ptr to the hardware info\ndiff --git a/drivers/net/ethernet/intel/ice/ice_common.h b/drivers/net/ethernet/intel/ice/ice_common.h\nindex 01384fb919df..5493266d4204 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.h\n+++ b/drivers/net/ethernet/intel/ice/ice_common.h\n@@ -96,6 +96,8 @@ enum ice_status\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+enum ice_status ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle);\n+void ice_replay_post(struct ice_hw *hw);\n void ice_output_fw_log(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf);\n void ice_stat_update40(struct ice_hw *hw, u32 hireg, u32 loreg,\n \t\t       bool prev_stat_loaded, u64 *prev_stat, u64 *cur_stat);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex cb12cb5b62a1..e59fe46b0469 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -3159,6 +3159,44 @@ static int ice_vsi_rebuild_all(struct ice_pf *pf)\n \treturn 0;\n }\n \n+/**\n+ * ice_vsi_replay_all - replay all VSIs configuration in the PF\n+ * @pf: the PF\n+ */\n+static int ice_vsi_replay_all(struct ice_pf *pf)\n+{\n+\tstruct ice_hw *hw = &pf->hw;\n+\tenum ice_status ret;\n+\tint i;\n+\n+\t/* loop through pf->vsi array and replay the VSI if found */\n+\tfor (i = 0; i < pf->num_alloc_vsi; i++) {\n+\t\tif (!pf->vsi[i])\n+\t\t\tcontinue;\n+\n+\t\tret = ice_replay_vsi(hw, pf->vsi[i]->idx);\n+\t\tif (ret) {\n+\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\t\"VSI at index %d replay failed %d\\n\",\n+\t\t\t\tpf->vsi[i]->idx, ret);\n+\t\t\treturn -EIO;\n+\t\t}\n+\n+\t\t/* Re-map HW VSI number, using VSI handle that has been\n+\t\t * previously validated in ice_replay_vsi() call above\n+\t\t */\n+\t\tpf->vsi[i]->vsi_num = ice_get_hw_vsi_num(hw, pf->vsi[i]->idx);\n+\n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"VSI at index %d filter replayed successfully - vsi_num %i\\n\",\n+\t\t\t pf->vsi[i]->idx, pf->vsi[i]->vsi_num);\n+\t}\n+\n+\t/* Clean up replay filter after successful re-configuration */\n+\tice_replay_post(hw);\n+\treturn 0;\n+}\n+\n /**\n  * ice_rebuild - rebuild after reset\n  * @pf: pf to rebuild\n@@ -3205,10 +3243,10 @@ static void ice_rebuild(struct ice_pf *pf)\n \t\tgoto err_vsi_rebuild;\n \t}\n \n-\tret = ice_replay_all_fltr(&pf->hw);\n-\tif (ret) {\n+\t/* Replay all VSIs Configuration, including filters after reset */\n+\tif (ice_vsi_replay_all(pf)) {\n \t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"error replaying switch filter rules\\n\");\n+\t\t\t\"error replaying VSI configurations with switch filter rules\\n\");\n \t\tgoto err_vsi_rebuild;\n \t}\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c\nindex aab3ade35cb1..324232e5d99b 100644\n--- a/drivers/net/ethernet/intel/ice/ice_switch.c\n+++ b/drivers/net/ethernet/intel/ice/ice_switch.c\n@@ -106,6 +106,7 @@ ice_init_def_sw_recp(struct ice_hw *hw)\n \tfor (i = 0; i < ICE_SW_LKUP_LAST; i++) {\n \t\trecps[i].root_rid = i;\n \t\tINIT_LIST_HEAD(&recps[i].filt_rules);\n+\t\tINIT_LIST_HEAD(&recps[i].filt_replay_rules);\n \t\tmutex_init(&recps[i].filt_rule_lock);\n \t}\n \n@@ -2196,87 +2197,105 @@ void ice_remove_vsi_fltr(struct ice_hw *hw, u16 vsi_handle)\n }\n \n /**\n- * ice_replay_fltr - Replay all the filters stored by a specific list head\n+ * ice_replay_vsi_fltr - Replay filters for requested VSI\n  * @hw: pointer to the hardware structure\n- * @list_head: list for which filters needs to be replayed\n+ * @vsi_handle: driver vsi handle\n  * @recp_id: Recipe id for which rules need to be replayed\n+ * @list_head: list for which filters need to be replayed\n+ *\n+ * Replays the filter of recipe recp_id for a VSI represented via vsi_handle.\n+ * It is required to pass valid VSI handle.\n  */\n static enum ice_status\n-ice_replay_fltr(struct ice_hw *hw, u8 recp_id, struct list_head *list_head)\n+ice_replay_vsi_fltr(struct ice_hw *hw, u16 vsi_handle, u8 recp_id,\n+\t\t    struct list_head *list_head)\n {\n \tstruct ice_fltr_mgmt_list_entry *itr;\n-\tstruct list_head l_head;\n \tenum ice_status status = 0;\n+\tu16 hw_vsi_id;\n \n \tif (list_empty(list_head))\n \t\treturn status;\n+\thw_vsi_id = ice_get_hw_vsi_num(hw, vsi_handle);\n \n-\t/* Move entries from the given list_head to a temporary l_head so that\n-\t * they can be replayed. Otherwise when trying to re-add the same\n-\t * filter, the function will return already exists\n-\t */\n-\tlist_replace_init(list_head, &l_head);\n-\n-\t/* Mark the given list_head empty by reinitializing it so filters\n-\t * could be added again by *handler\n-\t */\n-\tlist_for_each_entry(itr, &l_head, list_entry) {\n+\tlist_for_each_entry(itr, list_head, list_entry) {\n \t\tstruct ice_fltr_list_entry f_entry;\n \n \t\tf_entry.fltr_info = itr->fltr_info;\n-\t\tif (itr->vsi_count < 2 && recp_id != ICE_SW_LKUP_VLAN) {\n+\t\tif (itr->vsi_count < 2 && recp_id != ICE_SW_LKUP_VLAN &&\n+\t\t    itr->fltr_info.vsi_handle == vsi_handle) {\n+\t\t\t/* update the src in case it is vsi num */\n+\t\t\tif (f_entry.fltr_info.src_id == ICE_SRC_ID_VSI)\n+\t\t\t\tf_entry.fltr_info.src = hw_vsi_id;\n \t\t\tstatus = ice_add_rule_internal(hw, recp_id, &f_entry);\n \t\t\tif (status)\n \t\t\t\tgoto end;\n \t\t\tcontinue;\n \t\t}\n-\n-\t\t/* Add a filter per vsi separately */\n-\t\twhile (1) {\n-\t\t\tu16 vsi;\n-\n-\t\t\tvsi = find_first_bit(itr->vsi_list_info->vsi_map,\n-\t\t\t\t\t     ICE_MAX_VSI);\n-\t\t\tif (vsi == ICE_MAX_VSI)\n-\t\t\t\tbreak;\n-\n-\t\t\tclear_bit(vsi, itr->vsi_list_info->vsi_map);\n-\t\t\tf_entry.fltr_info.fwd_id.hw_vsi_id = vsi;\n-\t\t\tf_entry.fltr_info.fltr_act = ICE_FWD_TO_VSI;\n-\t\t\tif (recp_id == ICE_SW_LKUP_VLAN)\n-\t\t\t\tstatus = ice_add_vlan_internal(hw, &f_entry);\n-\t\t\telse\n-\t\t\t\tstatus = ice_add_rule_internal(hw, recp_id,\n-\t\t\t\t\t\t\t       &f_entry);\n-\t\t\tif (status)\n-\t\t\t\tgoto end;\n-\t\t}\n+\t\tif (!test_bit(vsi_handle, itr->vsi_list_info->vsi_map))\n+\t\t\tcontinue;\n+\t\t/* Clearing it so that the logic can add it back */\n+\t\tclear_bit(vsi_handle, itr->vsi_list_info->vsi_map);\n+\t\tf_entry.fltr_info.vsi_handle = vsi_handle;\n+\t\tf_entry.fltr_info.fltr_act = ICE_FWD_TO_VSI;\n+\t\t/* update the src in case it is vsi num */\n+\t\tif (f_entry.fltr_info.src_id == ICE_SRC_ID_VSI)\n+\t\t\tf_entry.fltr_info.src = hw_vsi_id;\n+\t\tif (recp_id == ICE_SW_LKUP_VLAN)\n+\t\t\tstatus = ice_add_vlan_internal(hw, &f_entry);\n+\t\telse\n+\t\t\tstatus = ice_add_rule_internal(hw, recp_id, &f_entry);\n+\t\tif (status)\n+\t\t\tgoto end;\n \t}\n end:\n-\t/* Clear the filter management list */\n-\tice_rem_sw_rule_info(hw, &l_head);\n \treturn status;\n }\n \n /**\n- * ice_replay_all_fltr - replay all filters stored in bookkeeping lists\n+ * ice_replay_vsi_all_fltr - replay all filters stored in bookkeeping lists\n  * @hw: pointer to the hardware structure\n+ * @vsi_handle: driver vsi handle\n  *\n- * NOTE: This function does not clean up partially added filters on error.\n- * It is up to caller of the function to issue a reset or fail early.\n+ * Replays filters for requested VSI via vsi_handle.\n  */\n-enum ice_status ice_replay_all_fltr(struct ice_hw *hw)\n+enum ice_status ice_replay_vsi_all_fltr(struct ice_hw *hw, u16 vsi_handle)\n {\n \tstruct ice_switch_info *sw = hw->switch_info;\n \tenum ice_status status = 0;\n \tu8 i;\n \n \tfor (i = 0; i < ICE_SW_LKUP_LAST; i++) {\n-\t\tstruct list_head *head = &sw->recp_list[i].filt_rules;\n+\t\tstruct list_head *head;\n \n-\t\tstatus = ice_replay_fltr(hw, i, head);\n+\t\thead = &sw->recp_list[i].filt_replay_rules;\n+\t\tstatus = ice_replay_vsi_fltr(hw, vsi_handle, i, head);\n \t\tif (status)\n \t\t\treturn status;\n \t}\n \treturn status;\n }\n+\n+/**\n+ * ice_rm_all_sw_replay_rule_info - deletes filter replay rules\n+ * @hw: pointer to the hw struct\n+ *\n+ * Deletes the filter replay rules.\n+ */\n+void ice_rm_all_sw_replay_rule_info(struct ice_hw *hw)\n+{\n+\tstruct ice_switch_info *sw = hw->switch_info;\n+\tu8 i;\n+\n+\tif (!sw)\n+\t\treturn;\n+\n+\tfor (i = 0; i < ICE_SW_LKUP_LAST; i++) {\n+\t\tif (!list_empty(&sw->recp_list[i].filt_replay_rules)) {\n+\t\t\tstruct list_head *l_head;\n+\n+\t\t\tl_head = &sw->recp_list[i].filt_replay_rules;\n+\t\t\tice_rem_sw_rule_info(hw, l_head);\n+\t\t}\n+\t}\n+}\ndiff --git a/drivers/net/ethernet/intel/ice/ice_switch.h b/drivers/net/ethernet/intel/ice/ice_switch.h\nindex 50ab036a17f3..7706e9b6003c 100644\n--- a/drivers/net/ethernet/intel/ice/ice_switch.h\n+++ b/drivers/net/ethernet/intel/ice/ice_switch.h\n@@ -126,6 +126,7 @@ struct ice_sw_recipe {\n \n \t/* List of type ice_fltr_mgmt_list_entry */\n \tstruct list_head filt_rules;\n+\tstruct list_head filt_replay_rules;\n \n \t/* linked list of type recipe_list_entry */\n \tstruct list_head rg_list;\n@@ -200,10 +201,11 @@ 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+enum ice_status ice_init_def_sw_recp(struct ice_hw *hw);\n u16 ice_get_hw_vsi_num(struct ice_hw *hw, u16 vsi_handle);\n+bool ice_is_vsi_valid(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);\n+enum ice_status ice_replay_vsi_all_fltr(struct ice_hw *hw, u16 vsi_handle);\n+void ice_rm_all_sw_replay_rule_info(struct ice_hw *hw);\n \n #endif /* _ICE_SWITCH_H_ */\ndiff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h\nindex fa459329c1de..4a64421b77a7 100644\n--- a/drivers/net/ethernet/intel/ice/ice_type.h\n+++ b/drivers/net/ethernet/intel/ice/ice_type.h\n@@ -18,6 +18,9 @@ static inline bool ice_is_tc_ena(u8 bitmap, u8 tc)\n \treturn test_bit(tc, (unsigned long *)&bitmap);\n }\n \n+/* Driver always calls main vsi_handle first */\n+#define ICE_MAIN_VSI_HANDLE\t\t0\n+\n /* debug masks - set these bits in hw->debug_mask to control output */\n #define ICE_DBG_INIT\t\tBIT_ULL(1)\n #define ICE_DBG_LINK\t\tBIT_ULL(4)\n",
    "prefixes": [
        "11/16"
    ]
}