get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64225,
    "url": "http://patches.dpdk.org/api/patches/64225/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200106033851.43978-11-qi.z.zhang@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": "<20200106033851.43978-11-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200106033851.43978-11-qi.z.zhang@intel.com",
    "date": "2020-01-06T03:38:49",
    "name": "[v2,10/12] net/ice/base: support add MAC rules on specific port",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "67978e8727523b4d0978c26fd476b6642acb3f32",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "http://patches.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200106033851.43978-11-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 7984,
            "url": "http://patches.dpdk.org/api/series/7984/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7984",
            "date": "2020-01-06T03:38:39",
            "name": "base code update",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/7984/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64225/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/64225/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 7D262A04F1;\n\tMon,  6 Jan 2020 04:37:20 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BE53A1D578;\n\tMon,  6 Jan 2020 04:36:05 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by dpdk.org (Postfix) with ESMTP id B845F1D557\n for <dev@dpdk.org>; Mon,  6 Jan 2020 04:35:59 +0100 (CET)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 05 Jan 2020 19:35:59 -0800",
            "from dpdk51.sh.intel.com ([10.67.110.245])\n by fmsmga007.fm.intel.com with ESMTP; 05 Jan 2020 19:35:57 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.69,401,1571727600\"; d=\"scan'208\";a=\"216726367\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "qiming.yang@intel.com",
        "Cc": "dev@dpdk.org, xiaolong.ye@intel.com, Qi Zhang <qi.z.zhang@intel.com>,\n Michal Swiatkowski <michal.swiatkowski@intel.com>,\n Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>",
        "Date": "Mon,  6 Jan 2020 11:38:49 +0800",
        "Message-Id": "<20200106033851.43978-11-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20200106033851.43978-1-qi.z.zhang@intel.com>",
        "References": "<20191205123847.39579-1-qi.z.zhang@intel.com>\n <20200106033851.43978-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 10/12] net/ice/base: support add MAC rules on\n\tspecific port",
        "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": "ice_add_mac_rule allow user to add rule to port based on\nhw->port_info->lport number. Function in some case should\nallow user to add filter rule on different port, write\nanother function which implemented that behaviour.\nThe same situation is which removing mac function.\n\nAdd new api function which allow user to choose port on which\nrule going to be added. Leave add mac rule function that always\nadd rule on hw->port_info->lport to avoid changes in components\nwhich don't need to choose different port. Also add function to\nremove rule from specific port.\n\nAlloc more switch_info structs to track separately rules for each\nport. Choose switch_info struct basing on logic port number\nbecause in fw added rules are connected with port.\n\nSigned-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>\nSigned-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\nAcked-by: Qiming Yang <qiming.yang@intel.com>\n---\n drivers/net/ice/base/ice_common.c |   2 +-\n drivers/net/ice/base/ice_switch.c | 269 +++++++++++++++++++++++++-------------\n drivers/net/ice/base/ice_switch.h |   3 +-\n 3 files changed, 180 insertions(+), 94 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex 2e756f542..22b2e316d 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -462,7 +462,7 @@ static enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw)\n \n \tINIT_LIST_HEAD(&sw->vsi_list_map_head);\n \n-\treturn ice_init_def_sw_recp(hw);\n+\treturn ice_init_def_sw_recp(hw, &hw->switch_info->recp_list);\n }\n \n /**\ndiff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c\nindex b2945a9e2..085f34406 100644\n--- a/drivers/net/ice/base/ice_switch.c\n+++ b/drivers/net/ice/base/ice_switch.c\n@@ -791,11 +791,13 @@ ice_get_recp_to_prof_map(struct ice_hw *hw)\n /**\n  * ice_init_def_sw_recp - initialize the recipe book keeping tables\n  * @hw: pointer to the HW struct\n+ * @recp_list: pointer to sw recipe list\n  *\n  * Allocate memory for the entire recipe table and initialize the structures/\n  * entries corresponding to basic recipes.\n  */\n-enum ice_status ice_init_def_sw_recp(struct ice_hw *hw)\n+enum ice_status\n+ice_init_def_sw_recp(struct ice_hw *hw, struct ice_sw_recipe **recp_list)\n {\n \tstruct ice_sw_recipe *recps;\n \tu8 i;\n@@ -813,7 +815,7 @@ enum ice_status ice_init_def_sw_recp(struct ice_hw *hw)\n \t\tice_init_lock(&recps[i].filt_rule_lock);\n \t}\n \n-\thw->switch_info->recp_list = recps;\n+\t*recp_list = recps;\n \n \treturn ICE_SUCCESS;\n }\n@@ -2427,6 +2429,7 @@ ice_create_vsi_list_rule(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi,\n /**\n  * ice_create_pkt_fwd_rule\n  * @hw: pointer to the hardware structure\n+ * @recp_list: corresponding filter management list\n  * @f_entry: entry containing packet forwarding information\n  *\n  * Create switch rule with given filter information and add an entry\n@@ -2434,13 +2437,11 @@ ice_create_vsi_list_rule(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi,\n  * and VSI mapping\n  */\n static enum ice_status\n-ice_create_pkt_fwd_rule(struct ice_hw *hw,\n+ice_create_pkt_fwd_rule(struct ice_hw *hw, struct ice_sw_recipe *recp_list,\n \t\t\tstruct ice_fltr_list_entry *f_entry)\n {\n \tstruct ice_fltr_mgmt_list_entry *fm_entry;\n \tstruct ice_aqc_sw_rules_elem *s_rule;\n-\tenum ice_sw_lkup_type l_type;\n-\tstruct ice_sw_recipe *recp;\n \tenum ice_status status;\n \n \ts_rule = (struct ice_aqc_sw_rules_elem *)\n@@ -2480,9 +2481,7 @@ ice_create_pkt_fwd_rule(struct ice_hw *hw,\n \t/* The book keeping entries will get removed when base driver\n \t * calls remove filter AQ command\n \t */\n-\tl_type = fm_entry->fltr_info.lkup_type;\n-\trecp = &hw->switch_info->recp_list[l_type];\n-\tLIST_ADD(&fm_entry->list_entry, &recp->filt_rules);\n+\tLIST_ADD(&fm_entry->list_entry, &recp_list->filt_rules);\n \n ice_create_pkt_fwd_rule_exit:\n \tice_free(hw, s_rule);\n@@ -2679,21 +2678,18 @@ ice_add_update_vsi_list(struct ice_hw *hw,\n \n /**\n  * ice_find_rule_entry - Search a rule entry\n- * @hw: pointer to the hardware structure\n- * @recp_id: lookup type for which the specified rule needs to be searched\n+ * @list_head: head of rule list\n  * @f_info: rule information\n  *\n  * Helper function to search for a given rule entry\n  * Returns pointer to entry storing the rule if found\n  */\n static struct ice_fltr_mgmt_list_entry *\n-ice_find_rule_entry(struct ice_hw *hw, u8 recp_id, struct ice_fltr_info *f_info)\n+ice_find_rule_entry(struct LIST_HEAD_TYPE *list_head,\n+\t\t    struct ice_fltr_info *f_info)\n {\n \tstruct ice_fltr_mgmt_list_entry *list_itr, *ret = NULL;\n-\tstruct ice_switch_info *sw = hw->switch_info;\n-\tstruct LIST_HEAD_TYPE *list_head;\n \n-\tlist_head = &sw->recp_list[recp_id].filt_rules;\n \tLIST_FOR_EACH_ENTRY(list_itr, list_head, ice_fltr_mgmt_list_entry,\n \t\t\t    list_entry) {\n \t\tif (!memcmp(&f_info->l_data, &list_itr->fltr_info.l_data,\n@@ -2764,16 +2760,16 @@ ice_find_vsi_list_entry(struct ice_hw *hw, u8 recp_id, u16 vsi_handle,\n /**\n  * ice_add_rule_internal - add rule for a given lookup type\n  * @hw: pointer to the hardware structure\n- * @recp_id: lookup type (recipe ID) for which rule has to be added\n+ * @recp_list: recipe list for which rule has to be added\n+ * @lport: logic port number on which function add rule\n  * @f_entry: structure containing MAC forwarding information\n  *\n  * Adds or updates the rule lists for a given recipe\n  */\n static enum ice_status\n-ice_add_rule_internal(struct ice_hw *hw, u8 recp_id,\n-\t\t      struct ice_fltr_list_entry *f_entry)\n+ice_add_rule_internal(struct ice_hw *hw, struct ice_sw_recipe *recp_list,\n+\t\t      u8 lport, struct ice_fltr_list_entry *f_entry)\n {\n-\tstruct ice_switch_info *sw = hw->switch_info;\n \tstruct ice_fltr_info *new_fltr, *cur_fltr;\n \tstruct ice_fltr_mgmt_list_entry *m_entry;\n \tstruct ice_lock *rule_lock; /* Lock to protect filter rule list */\n@@ -2787,19 +2783,19 @@ ice_add_rule_internal(struct ice_hw *hw, u8 recp_id,\n \t\tf_entry->fltr_info.fwd_id.hw_vsi_id =\n \t\t\tice_get_hw_vsi_num(hw, f_entry->fltr_info.vsi_handle);\n \n-\trule_lock = &sw->recp_list[recp_id].filt_rule_lock;\n+\trule_lock = &recp_list->filt_rule_lock;\n \n \tice_acquire_lock(rule_lock);\n \tnew_fltr = &f_entry->fltr_info;\n \tif (new_fltr->flag & ICE_FLTR_RX)\n-\t\tnew_fltr->src = hw->port_info->lport;\n+\t\tnew_fltr->src = lport;\n \telse if (new_fltr->flag & ICE_FLTR_TX)\n \t\tnew_fltr->src =\n \t\t\tice_get_hw_vsi_num(hw, f_entry->fltr_info.vsi_handle);\n \n-\tm_entry = ice_find_rule_entry(hw, recp_id, new_fltr);\n+\tm_entry = ice_find_rule_entry(&recp_list->filt_rules, new_fltr);\n \tif (!m_entry) {\n-\t\tstatus = ice_create_pkt_fwd_rule(hw, f_entry);\n+\t\tstatus = ice_create_pkt_fwd_rule(hw, recp_list, f_entry);\n \t\tgoto exit_add_rule_internal;\n \t}\n \n@@ -2940,14 +2936,13 @@ ice_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,\n  * ice_remove_rule_internal - Remove a filter rule of a given type\n  *\n  * @hw: pointer to the hardware structure\n- * @recp_id: recipe ID for which the rule needs to removed\n+ * @recp_list: recipe list for which the rule needs to removed\n  * @f_entry: rule entry containing filter information\n  */\n static enum ice_status\n-ice_remove_rule_internal(struct ice_hw *hw, u8 recp_id,\n+ice_remove_rule_internal(struct ice_hw *hw, struct ice_sw_recipe *recp_list,\n \t\t\t struct ice_fltr_list_entry *f_entry)\n {\n-\tstruct ice_switch_info *sw = hw->switch_info;\n \tstruct ice_fltr_mgmt_list_entry *list_elem;\n \tstruct ice_lock *rule_lock; /* Lock to protect filter rule list */\n \tenum ice_status status = ICE_SUCCESS;\n@@ -2959,9 +2954,10 @@ ice_remove_rule_internal(struct ice_hw *hw, u8 recp_id,\n \tf_entry->fltr_info.fwd_id.hw_vsi_id =\n \t\tice_get_hw_vsi_num(hw, f_entry->fltr_info.vsi_handle);\n \n-\trule_lock = &sw->recp_list[recp_id].filt_rule_lock;\n+\trule_lock = &recp_list->filt_rule_lock;\n \tice_acquire_lock(rule_lock);\n-\tlist_elem = ice_find_rule_entry(hw, recp_id, &f_entry->fltr_info);\n+\tlist_elem = ice_find_rule_entry(&recp_list->filt_rules,\n+\t\t\t\t\t&f_entry->fltr_info);\n \tif (!list_elem) {\n \t\tstatus = ICE_ERR_DOES_NOT_EXIST;\n \t\tgoto exit;\n@@ -3110,9 +3106,11 @@ ice_aq_get_res_descs(struct ice_hw *hw, u16 num_entries,\n }\n \n /**\n- * ice_add_mac - Add a MAC address based filter rule\n+ * ice_add_mac_rule - Add a MAC address based filter rule\n  * @hw: pointer to the hardware structure\n  * @m_list: list of MAC addresses and forwarding information\n+ * @sw: pointer to switch info struct for which function add rule\n+ * @lport: logic port number on which function add rule\n  *\n  * IMPORTANT: When the ucast_shared flag is set to false and m_list has\n  * multiple unicast addresses, the function assumes that all the\n@@ -3120,24 +3118,24 @@ ice_aq_get_res_descs(struct ice_hw *hw, u16 num_entries,\n  * check for duplicates in this case, removing duplicates from a given\n  * list should be taken care of in the caller of this function.\n  */\n-enum ice_status\n-ice_add_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)\n+static enum ice_status\n+ice_add_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list,\n+\t\t struct ice_switch_info *sw, u8 lport)\n {\n+\tstruct ice_sw_recipe *recp_list = &sw->recp_list[ICE_SW_LKUP_MAC];\n \tstruct ice_aqc_sw_rules_elem *s_rule, *r_iter;\n \tstruct ice_fltr_list_entry *m_list_itr;\n \tstruct LIST_HEAD_TYPE *rule_head;\n \tu16 elem_sent, total_elem_left;\n-\tstruct ice_switch_info *sw;\n \tstruct ice_lock *rule_lock; /* Lock to protect filter rule list */\n \tenum ice_status status = ICE_SUCCESS;\n \tu16 num_unicast = 0;\n \tu16 s_rule_size;\n \n-\tif (!m_list || !hw)\n-\t\treturn ICE_ERR_PARAM;\n \ts_rule = NULL;\n-\tsw = hw->switch_info;\n-\trule_lock = &sw->recp_list[ICE_SW_LKUP_MAC].filt_rule_lock;\n+\trule_lock = &recp_list->filt_rule_lock;\n+\trule_head = &recp_list->filt_rules;\n+\n \tLIST_FOR_EACH_ENTRY(m_list_itr, m_list, ice_fltr_list_entry,\n \t\t\t    list_entry) {\n \t\tu8 *add = &m_list_itr->fltr_info.l_data.mac.mac_addr[0];\n@@ -3160,7 +3158,7 @@ ice_add_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)\n \t\tif (IS_UNICAST_ETHER_ADDR(add) && !hw->ucast_shared) {\n \t\t\t/* Don't overwrite the unicast address */\n \t\t\tice_acquire_lock(rule_lock);\n-\t\t\tif (ice_find_rule_entry(hw, ICE_SW_LKUP_MAC,\n+\t\t\tif (ice_find_rule_entry(rule_head,\n \t\t\t\t\t\t&m_list_itr->fltr_info)) {\n \t\t\t\tice_release_lock(rule_lock);\n \t\t\t\treturn ICE_ERR_ALREADY_EXISTS;\n@@ -3170,7 +3168,7 @@ ice_add_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)\n \t\t} else if (IS_MULTICAST_ETHER_ADDR(add) ||\n \t\t\t   (IS_UNICAST_ETHER_ADDR(add) && hw->ucast_shared)) {\n \t\t\tm_list_itr->status =\n-\t\t\t\tice_add_rule_internal(hw, ICE_SW_LKUP_MAC,\n+\t\t\t\tice_add_rule_internal(hw, recp_list, lport,\n \t\t\t\t\t\t      m_list_itr);\n \t\t\tif (m_list_itr->status)\n \t\t\t\treturn m_list_itr->status;\n@@ -3184,7 +3182,6 @@ ice_add_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)\n \t\tgoto ice_add_mac_exit;\n \t}\n \n-\trule_head = &sw->recp_list[ICE_SW_LKUP_MAC].filt_rules;\n \n \t/* Allocate switch rule buffer for the bulk update for unicast */\n \ts_rule_size = ICE_SW_RULE_RX_TX_ETH_HDR_SIZE;\n@@ -3266,6 +3263,23 @@ ice_add_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)\n }\n \n /**\n+ * ice_add_mac - Add a MAC address based filter rule\n+ * @hw: pointer to the hardware structure\n+ * @m_list: list of MAC addresses and forwarding information\n+ *\n+ * Function add mac rule for logical port from hw struct\n+ */\n+enum ice_status\n+ice_add_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)\n+{\n+\tif (!m_list || !hw)\n+\t\treturn ICE_ERR_PARAM;\n+\n+\treturn ice_add_mac_rule(hw, m_list, hw->switch_info,\n+\t\t\t\thw->port_info->lport);\n+}\n+\n+/**\n  * ice_add_vlan_internal - Add one VLAN based filter rule\n  * @hw: pointer to the hardware structure\n  * @f_entry: filter entry containing one VLAN information\n@@ -3276,6 +3290,7 @@ ice_add_vlan_internal(struct ice_hw *hw, struct ice_fltr_list_entry *f_entry)\n \tstruct ice_switch_info *sw = hw->switch_info;\n \tstruct ice_fltr_mgmt_list_entry *v_list_itr;\n \tstruct ice_fltr_info *new_fltr, *cur_fltr;\n+\tstruct ice_sw_recipe *recp_list;\n \tenum ice_sw_lkup_type lkup_type;\n \tu16 vsi_list_id = 0, vsi_handle;\n \tstruct ice_lock *rule_lock; /* Lock to protect filter rule list */\n@@ -3298,9 +3313,10 @@ ice_add_vlan_internal(struct ice_hw *hw, struct ice_fltr_list_entry *f_entry)\n \tnew_fltr->src = new_fltr->fwd_id.hw_vsi_id;\n \tlkup_type = new_fltr->lkup_type;\n \tvsi_handle = new_fltr->vsi_handle;\n-\trule_lock = &sw->recp_list[ICE_SW_LKUP_VLAN].filt_rule_lock;\n+\trecp_list = &sw->recp_list[ICE_SW_LKUP_VLAN];\n+\trule_lock = &recp_list->filt_rule_lock;\n \tice_acquire_lock(rule_lock);\n-\tv_list_itr = ice_find_rule_entry(hw, ICE_SW_LKUP_VLAN, new_fltr);\n+\tv_list_itr = ice_find_rule_entry(&recp_list->filt_rules, new_fltr);\n \tif (!v_list_itr) {\n \t\tstruct ice_vsi_list_map_info *map_info = NULL;\n \n@@ -3327,9 +3343,9 @@ ice_add_vlan_internal(struct ice_hw *hw, struct ice_fltr_list_entry *f_entry)\n \t\t\tnew_fltr->fwd_id.vsi_list_id = vsi_list_id;\n \t\t}\n \n-\t\tstatus = ice_create_pkt_fwd_rule(hw, f_entry);\n+\t\tstatus = ice_create_pkt_fwd_rule(hw, recp_list, f_entry);\n \t\tif (!status) {\n-\t\t\tv_list_itr = ice_find_rule_entry(hw, ICE_SW_LKUP_VLAN,\n+\t\t\tv_list_itr = ice_find_rule_entry(&recp_list->filt_rules,\n \t\t\t\t\t\t\t new_fltr);\n \t\t\tif (!v_list_itr) {\n \t\t\t\tstatus = ICE_ERR_DOES_NOT_EXIST;\n@@ -3458,10 +3474,12 @@ enum ice_status\n ice_add_mac_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *mv_list)\n {\n \tstruct ice_fltr_list_entry *mv_list_itr;\n+\tstruct ice_sw_recipe *recp_list;\n \n \tif (!mv_list || !hw)\n \t\treturn ICE_ERR_PARAM;\n \n+\trecp_list = &hw->switch_info->recp_list[ICE_SW_LKUP_MAC_VLAN];\n \tLIST_FOR_EACH_ENTRY(mv_list_itr, mv_list, ice_fltr_list_entry,\n \t\t\t    list_entry) {\n \t\tenum ice_sw_lkup_type l_type =\n@@ -3471,7 +3489,8 @@ ice_add_mac_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *mv_list)\n \t\t\treturn ICE_ERR_PARAM;\n \t\tmv_list_itr->fltr_info.flag = ICE_FLTR_TX;\n \t\tmv_list_itr->status =\n-\t\t\tice_add_rule_internal(hw, ICE_SW_LKUP_MAC_VLAN,\n+\t\t\tice_add_rule_internal(hw, recp_list,\n+\t\t\t\t\t      hw->port_info->lport,\n \t\t\t\t\t      mv_list_itr);\n \t\tif (mv_list_itr->status)\n \t\t\treturn mv_list_itr->status;\n@@ -3492,20 +3511,26 @@ enum ice_status\n ice_add_eth_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *em_list)\n {\n \tstruct ice_fltr_list_entry *em_list_itr;\n+\tu8 lport;\n \n \tif (!em_list || !hw)\n \t\treturn ICE_ERR_PARAM;\n \n+\tlport = hw->port_info->lport;\n \tLIST_FOR_EACH_ENTRY(em_list_itr, em_list, ice_fltr_list_entry,\n \t\t\t    list_entry) {\n-\t\tenum ice_sw_lkup_type l_type =\n-\t\t\tem_list_itr->fltr_info.lkup_type;\n+\t\tstruct ice_sw_recipe *recp_list;\n+\t\tenum ice_sw_lkup_type l_type;\n+\n+\t\tl_type = em_list_itr->fltr_info.lkup_type;\n+\t\trecp_list = &hw->switch_info->recp_list[l_type];\n \n \t\tif (l_type != ICE_SW_LKUP_ETHERTYPE_MAC &&\n \t\t    l_type != ICE_SW_LKUP_ETHERTYPE)\n \t\t\treturn ICE_ERR_PARAM;\n \n-\t\tem_list_itr->status = ice_add_rule_internal(hw, l_type,\n+\t\tem_list_itr->status = ice_add_rule_internal(hw, recp_list,\n+\t\t\t\t\t\t\t    lport,\n \t\t\t\t\t\t\t    em_list_itr);\n \t\tif (em_list_itr->status)\n \t\t\treturn em_list_itr->status;\n@@ -3522,6 +3547,7 @@ enum ice_status\n ice_remove_eth_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *em_list)\n {\n \tstruct ice_fltr_list_entry *em_list_itr, *tmp;\n+\tstruct ice_sw_recipe *recp_list;\n \n \tif (!em_list || !hw)\n \t\treturn ICE_ERR_PARAM;\n@@ -3535,7 +3561,8 @@ ice_remove_eth_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *em_list)\n \t\t    l_type != ICE_SW_LKUP_ETHERTYPE)\n \t\t\treturn ICE_ERR_PARAM;\n \n-\t\tem_list_itr->status = ice_remove_rule_internal(hw, l_type,\n+\t\trecp_list = &hw->switch_info->recp_list[l_type];\n+\t\tem_list_itr->status = ice_remove_rule_internal(hw, recp_list,\n \t\t\t\t\t\t\t       em_list_itr);\n \t\tif (em_list_itr->status)\n \t\t\treturn em_list_itr->status;\n@@ -3695,8 +3722,7 @@ ice_cfg_dflt_vsi(struct ice_port_info *pi, u16 vsi_handle, bool set,\n \n /**\n  * ice_find_ucast_rule_entry - Search for a unicast MAC filter rule entry\n- * @hw: pointer to the hardware structure\n- * @recp_id: lookup type for which the specified rule needs to be searched\n+ * @list_head: head of rule list\n  * @f_info: rule information\n  *\n  * Helper function to search for a unicast rule entry - this is to be used\n@@ -3706,14 +3732,11 @@ ice_cfg_dflt_vsi(struct ice_port_info *pi, u16 vsi_handle, bool set,\n  * Returns pointer to entry storing the rule if found\n  */\n static struct ice_fltr_mgmt_list_entry *\n-ice_find_ucast_rule_entry(struct ice_hw *hw, u8 recp_id,\n+ice_find_ucast_rule_entry(struct LIST_HEAD_TYPE *list_head,\n \t\t\t  struct ice_fltr_info *f_info)\n {\n-\tstruct ice_switch_info *sw = hw->switch_info;\n \tstruct ice_fltr_mgmt_list_entry *list_itr;\n-\tstruct LIST_HEAD_TYPE *list_head;\n \n-\tlist_head = &sw->recp_list[recp_id].filt_rules;\n \tLIST_FOR_EACH_ENTRY(list_itr, list_head, ice_fltr_mgmt_list_entry,\n \t\t\t    list_entry) {\n \t\tif (!memcmp(&f_info->l_data, &list_itr->fltr_info.l_data,\n@@ -3727,9 +3750,10 @@ ice_find_ucast_rule_entry(struct ice_hw *hw, u8 recp_id,\n }\n \n /**\n- * ice_remove_mac - remove a MAC address based filter rule\n+ * ice_remove_mac_rule - remove a MAC based filter rule\n  * @hw: pointer to the hardware structure\n  * @m_list: list of MAC addresses and forwarding information\n+ * @recp_list: list from which function remove MAC address\n  *\n  * This function removes either a MAC filter rule or a specific VSI from a\n  * VSI list for a multicast MAC address.\n@@ -3739,8 +3763,9 @@ ice_find_ucast_rule_entry(struct ice_hw *hw, u8 recp_id,\n  * the entries passed into m_list were added previously. It will not attempt to\n  * do a partial remove of entries that were found.\n  */\n-enum ice_status\n-ice_remove_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)\n+static enum ice_status\n+ice_remove_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list,\n+\t\t    struct ice_sw_recipe *recp_list)\n {\n \tstruct ice_fltr_list_entry *list_itr, *tmp;\n \tstruct ice_lock *rule_lock; /* Lock to protect filter rule list */\n@@ -3748,7 +3773,7 @@ ice_remove_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)\n \tif (!m_list)\n \t\treturn ICE_ERR_PARAM;\n \n-\trule_lock = &hw->switch_info->recp_list[ICE_SW_LKUP_MAC].filt_rule_lock;\n+\trule_lock = &recp_list->filt_rule_lock;\n \tLIST_FOR_EACH_ENTRY_SAFE(list_itr, tmp, m_list, ice_fltr_list_entry,\n \t\t\t\t list_entry) {\n \t\tenum ice_sw_lkup_type l_type = list_itr->fltr_info.lkup_type;\n@@ -3770,15 +3795,14 @@ ice_remove_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)\n \t\t\t * shared...\n \t\t\t */\n \t\t\tice_acquire_lock(rule_lock);\n-\t\t\tif (!ice_find_ucast_rule_entry(hw, ICE_SW_LKUP_MAC,\n+\t\t\tif (!ice_find_ucast_rule_entry(&recp_list->filt_rules,\n \t\t\t\t\t\t       &list_itr->fltr_info)) {\n \t\t\t\tice_release_lock(rule_lock);\n \t\t\t\treturn ICE_ERR_DOES_NOT_EXIST;\n \t\t\t}\n \t\t\tice_release_lock(rule_lock);\n \t\t}\n-\t\tlist_itr->status = ice_remove_rule_internal(hw,\n-\t\t\t\t\t\t\t    ICE_SW_LKUP_MAC,\n+\t\tlist_itr->status = ice_remove_rule_internal(hw, recp_list,\n \t\t\t\t\t\t\t    list_itr);\n \t\tif (list_itr->status)\n \t\t\treturn list_itr->status;\n@@ -3787,6 +3811,21 @@ ice_remove_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)\n }\n \n /**\n+ * ice_remove_mac - remove a MAC address based filter rule\n+ * @hw: pointer to the hardware structure\n+ * @m_list: list of MAC addresses and forwarding information\n+ *\n+ */\n+enum ice_status\n+ice_remove_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)\n+{\n+\tstruct ice_sw_recipe *recp_list;\n+\n+\trecp_list = &hw->switch_info->recp_list[ICE_SW_LKUP_MAC];\n+\treturn ice_remove_mac_rule(hw, m_list, recp_list);\n+}\n+\n+/**\n  * ice_remove_vlan - Remove VLAN based filter rule\n  * @hw: pointer to the hardware structure\n  * @v_list: list of VLAN entries and forwarding information\n@@ -3795,18 +3834,19 @@ enum ice_status\n ice_remove_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list)\n {\n \tstruct ice_fltr_list_entry *v_list_itr, *tmp;\n+\tstruct ice_sw_recipe *recp_list;\n \n \tif (!v_list || !hw)\n \t\treturn ICE_ERR_PARAM;\n \n+\trecp_list = &hw->switch_info->recp_list[ICE_SW_LKUP_VLAN];\n \tLIST_FOR_EACH_ENTRY_SAFE(v_list_itr, tmp, v_list, ice_fltr_list_entry,\n \t\t\t\t list_entry) {\n \t\tenum ice_sw_lkup_type l_type = v_list_itr->fltr_info.lkup_type;\n \n \t\tif (l_type != ICE_SW_LKUP_VLAN)\n \t\t\treturn ICE_ERR_PARAM;\n-\t\tv_list_itr->status = ice_remove_rule_internal(hw,\n-\t\t\t\t\t\t\t      ICE_SW_LKUP_VLAN,\n+\t\tv_list_itr->status = ice_remove_rule_internal(hw, recp_list,\n \t\t\t\t\t\t\t      v_list_itr);\n \t\tif (v_list_itr->status)\n \t\t\treturn v_list_itr->status;\n@@ -3823,10 +3863,12 @@ enum ice_status\n ice_remove_mac_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list)\n {\n \tstruct ice_fltr_list_entry *v_list_itr, *tmp;\n+\tstruct ice_sw_recipe *recp_list;\n \n \tif (!v_list || !hw)\n \t\treturn ICE_ERR_PARAM;\n \n+\trecp_list = &hw->switch_info->recp_list[ICE_SW_LKUP_MAC_VLAN];\n \tLIST_FOR_EACH_ENTRY_SAFE(v_list_itr, tmp, v_list, ice_fltr_list_entry,\n \t\t\t\t list_entry) {\n \t\tenum ice_sw_lkup_type l_type = v_list_itr->fltr_info.lkup_type;\n@@ -3834,7 +3876,7 @@ ice_remove_mac_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list)\n \t\tif (l_type != ICE_SW_LKUP_MAC_VLAN)\n \t\t\treturn ICE_ERR_PARAM;\n \t\tv_list_itr->status =\n-\t\t\tice_remove_rule_internal(hw, ICE_SW_LKUP_MAC_VLAN,\n+\t\t\tice_remove_rule_internal(hw, recp_list,\n \t\t\t\t\t\t v_list_itr);\n \t\tif (v_list_itr->status)\n \t\t\treturn v_list_itr->status;\n@@ -4065,11 +4107,13 @@ ice_remove_promisc(struct ice_hw *hw, u8 recp_id,\n \t\t   struct LIST_HEAD_TYPE *v_list)\n {\n \tstruct ice_fltr_list_entry *v_list_itr, *tmp;\n+\tstruct ice_sw_recipe *recp_list;\n \n+\trecp_list = &hw->switch_info->recp_list[recp_id];\n \tLIST_FOR_EACH_ENTRY_SAFE(v_list_itr, tmp, v_list, ice_fltr_list_entry,\n \t\t\t\t list_entry) {\n \t\tv_list_itr->status =\n-\t\t\tice_remove_rule_internal(hw, recp_id, v_list_itr);\n+\t\t\tice_remove_rule_internal(hw, recp_list, v_list_itr);\n \t\tif (v_list_itr->status)\n \t\t\treturn v_list_itr->status;\n \t}\n@@ -4193,6 +4237,7 @@ ice_set_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask, u16 vid)\n \t * is found.\n \t */\n \twhile (promisc_mask) {\n+\t\tstruct ice_sw_recipe *recp_list;\n \t\tu8 *mac_addr;\n \n \t\tpkt_type = 0;\n@@ -4256,8 +4301,11 @@ ice_set_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask, u16 vid)\n \t\tnew_fltr.vsi_handle = vsi_handle;\n \t\tnew_fltr.fwd_id.hw_vsi_id = hw_vsi_id;\n \t\tf_list_entry.fltr_info = new_fltr;\n+\t\trecp_list = &hw->switch_info->recp_list[recipe_id];\n \n-\t\tstatus = ice_add_rule_internal(hw, recipe_id, &f_list_entry);\n+\t\tstatus = ice_add_rule_internal(hw, recp_list,\n+\t\t\t\t\t       hw->port_info->lport,\n+\t\t\t\t\t       &f_list_entry);\n \t\tif (status != ICE_SUCCESS)\n \t\t\tgoto set_promisc_exit;\n \t}\n@@ -4323,13 +4371,14 @@ ice_set_vlan_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask,\n  * ice_remove_vsi_lkup_fltr - Remove lookup type filters for a VSI\n  * @hw: pointer to the hardware structure\n  * @vsi_handle: VSI handle to remove filters from\n+ * @recp_list: recipe list from which function remove fltr\n  * @lkup: switch rule filter lookup type\n  */\n static void\n ice_remove_vsi_lkup_fltr(struct ice_hw *hw, u16 vsi_handle,\n+\t\t\t struct ice_sw_recipe *recp_list,\n \t\t\t enum ice_sw_lkup_type lkup)\n {\n-\tstruct ice_switch_info *sw = hw->switch_info;\n \tstruct ice_fltr_list_entry *fm_entry;\n \tstruct LIST_HEAD_TYPE remove_list_head;\n \tstruct LIST_HEAD_TYPE *rule_head;\n@@ -4338,8 +4387,8 @@ ice_remove_vsi_lkup_fltr(struct ice_hw *hw, u16 vsi_handle,\n \tenum ice_status status;\n \n \tINIT_LIST_HEAD(&remove_list_head);\n-\trule_lock = &sw->recp_list[lkup].filt_rule_lock;\n-\trule_head = &sw->recp_list[lkup].filt_rules;\n+\trule_lock = &recp_list[lkup].filt_rule_lock;\n+\trule_head = &recp_list[lkup].filt_rules;\n \tice_acquire_lock(rule_lock);\n \tstatus = ice_add_to_vsi_fltr_list(hw, vsi_handle, rule_head,\n \t\t\t\t\t  &remove_list_head);\n@@ -4349,7 +4398,7 @@ ice_remove_vsi_lkup_fltr(struct ice_hw *hw, u16 vsi_handle,\n \n \tswitch (lkup) {\n \tcase ICE_SW_LKUP_MAC:\n-\t\tice_remove_mac(hw, &remove_list_head);\n+\t\tice_remove_mac_rule(hw, &remove_list_head, recp_list);\n \t\tbreak;\n \tcase ICE_SW_LKUP_VLAN:\n \t\tice_remove_vlan(hw, &remove_list_head);\n@@ -4382,22 +4431,43 @@ ice_remove_vsi_lkup_fltr(struct ice_hw *hw, u16 vsi_handle,\n }\n \n /**\n- * ice_remove_vsi_fltr - Remove all filters for a VSI\n+ * ice_remove_vsi_fltr_rule - Remove all filters for a VSI\n  * @hw: pointer to the hardware structure\n  * @vsi_handle: VSI handle to remove filters from\n+ * @sw: pointer to switch info struct\n  */\n-void ice_remove_vsi_fltr(struct ice_hw *hw, u16 vsi_handle)\n+static void\n+ice_remove_vsi_fltr_rule(struct ice_hw *hw, u16 vsi_handle,\n+\t\t\t struct ice_switch_info *sw)\n {\n \tice_debug(hw, ICE_DBG_TRACE, \"%s\\n\", __func__);\n \n-\tice_remove_vsi_lkup_fltr(hw, vsi_handle, ICE_SW_LKUP_MAC);\n-\tice_remove_vsi_lkup_fltr(hw, vsi_handle, ICE_SW_LKUP_MAC_VLAN);\n-\tice_remove_vsi_lkup_fltr(hw, vsi_handle, ICE_SW_LKUP_PROMISC);\n-\tice_remove_vsi_lkup_fltr(hw, vsi_handle, ICE_SW_LKUP_VLAN);\n-\tice_remove_vsi_lkup_fltr(hw, vsi_handle, ICE_SW_LKUP_DFLT);\n-\tice_remove_vsi_lkup_fltr(hw, vsi_handle, ICE_SW_LKUP_ETHERTYPE);\n-\tice_remove_vsi_lkup_fltr(hw, vsi_handle, ICE_SW_LKUP_ETHERTYPE_MAC);\n-\tice_remove_vsi_lkup_fltr(hw, vsi_handle, ICE_SW_LKUP_PROMISC_VLAN);\n+\tice_remove_vsi_lkup_fltr(hw, vsi_handle,\n+\t\t\t\t sw->recp_list, ICE_SW_LKUP_MAC);\n+\tice_remove_vsi_lkup_fltr(hw, vsi_handle,\n+\t\t\t\t sw->recp_list, ICE_SW_LKUP_MAC_VLAN);\n+\tice_remove_vsi_lkup_fltr(hw, vsi_handle,\n+\t\t\t\t sw->recp_list, ICE_SW_LKUP_PROMISC);\n+\tice_remove_vsi_lkup_fltr(hw, vsi_handle,\n+\t\t\t\t sw->recp_list, ICE_SW_LKUP_VLAN);\n+\tice_remove_vsi_lkup_fltr(hw, vsi_handle,\n+\t\t\t\t sw->recp_list, ICE_SW_LKUP_DFLT);\n+\tice_remove_vsi_lkup_fltr(hw, vsi_handle,\n+\t\t\t\t sw->recp_list, ICE_SW_LKUP_ETHERTYPE);\n+\tice_remove_vsi_lkup_fltr(hw, vsi_handle,\n+\t\t\t\t sw->recp_list, ICE_SW_LKUP_ETHERTYPE_MAC);\n+\tice_remove_vsi_lkup_fltr(hw, vsi_handle,\n+\t\t\t\t sw->recp_list, ICE_SW_LKUP_PROMISC_VLAN);\n+}\n+\n+/**\n+ * ice_remove_vsi_fltr - Remove all filters for a VSI\n+ * @hw: pointer to the hardware structure\n+ * @vsi_handle: VSI handle to remove filters from\n+ */\n+void ice_remove_vsi_fltr(struct ice_hw *hw, u16 vsi_handle)\n+{\n+\tice_remove_vsi_fltr_rule(hw, vsi_handle, hw->switch_info);\n }\n \n /**\n@@ -4559,9 +4629,9 @@ enum ice_status\n ice_add_mac_with_sw_marker(struct ice_hw *hw, struct ice_fltr_info *f_info,\n \t\t\t   u16 sw_marker)\n {\n-\tstruct ice_switch_info *sw = hw->switch_info;\n \tstruct ice_fltr_mgmt_list_entry *m_entry;\n \tstruct ice_fltr_list_entry fl_info;\n+\tstruct ice_sw_recipe *recp_list;\n \tstruct LIST_HEAD_TYPE l_head;\n \tstruct ice_lock *rule_lock;\t/* Lock to protect filter rule list */\n \tenum ice_status ret;\n@@ -4590,16 +4660,18 @@ ice_add_mac_with_sw_marker(struct ice_hw *hw, struct ice_fltr_info *f_info,\n \tLIST_ADD(&fl_info.list_entry, &l_head);\n \n \tentry_exists = false;\n-\tret = ice_add_mac(hw, &l_head);\n+\tret = ice_add_mac_rule(hw, &l_head, hw->switch_info,\n+\t\t\t       hw->port_info->lport);\n \tif (ret == ICE_ERR_ALREADY_EXISTS)\n \t\tentry_exists = true;\n \telse if (ret)\n \t\treturn ret;\n \n-\trule_lock = &sw->recp_list[ICE_SW_LKUP_MAC].filt_rule_lock;\n+\trecp_list = &hw->switch_info->recp_list[ICE_SW_LKUP_MAC];\n+\trule_lock = &recp_list->filt_rule_lock;\n \tice_acquire_lock(rule_lock);\n \t/* Get the book keeping entry for the filter */\n-\tm_entry = ice_find_rule_entry(hw, ICE_SW_LKUP_MAC, f_info);\n+\tm_entry = ice_find_rule_entry(&recp_list->filt_rules, f_info);\n \tif (!m_entry)\n \t\tgoto exit_error;\n \n@@ -4652,9 +4724,9 @@ ice_add_mac_with_sw_marker(struct ice_hw *hw, struct ice_fltr_info *f_info,\n enum ice_status\n ice_add_mac_with_counter(struct ice_hw *hw, struct ice_fltr_info *f_info)\n {\n-\tstruct ice_switch_info *sw = hw->switch_info;\n \tstruct ice_fltr_mgmt_list_entry *m_entry;\n \tstruct ice_fltr_list_entry fl_info;\n+\tstruct ice_sw_recipe *recp_list;\n \tstruct LIST_HEAD_TYPE l_head;\n \tstruct ice_lock *rule_lock;\t/* Lock to protect filter rule list */\n \tenum ice_status ret;\n@@ -4671,10 +4743,11 @@ ice_add_mac_with_counter(struct ice_hw *hw, struct ice_fltr_info *f_info)\n \tif (!ice_is_vsi_valid(hw, f_info->vsi_handle))\n \t\treturn ICE_ERR_PARAM;\n \tf_info->fwd_id.hw_vsi_id = ice_get_hw_vsi_num(hw, f_info->vsi_handle);\n+\trecp_list = &hw->switch_info->recp_list[ICE_SW_LKUP_MAC];\n \n \tentry_exist = false;\n \n-\trule_lock = &sw->recp_list[ICE_SW_LKUP_MAC].filt_rule_lock;\n+\trule_lock = &recp_list->filt_rule_lock;\n \n \t/* Add filter if it doesn't exist so then the adding of large\n \t * action always results in update\n@@ -4684,14 +4757,15 @@ ice_add_mac_with_counter(struct ice_hw *hw, struct ice_fltr_info *f_info)\n \tfl_info.fltr_info = *f_info;\n \tLIST_ADD(&fl_info.list_entry, &l_head);\n \n-\tret = ice_add_mac(hw, &l_head);\n+\tret = ice_add_mac_rule(hw, &l_head, hw->switch_info,\n+\t\t\t       hw->port_info->lport);\n \tif (ret == ICE_ERR_ALREADY_EXISTS)\n \t\tentry_exist = true;\n \telse if (ret)\n \t\treturn ret;\n \n \tice_acquire_lock(rule_lock);\n-\tm_entry = ice_find_rule_entry(hw, ICE_SW_LKUP_MAC, f_info);\n+\tm_entry = ice_find_rule_entry(&recp_list->filt_rules, f_info);\n \tif (!m_entry) {\n \t\tret = ICE_ERR_BAD_PTR;\n \t\tgoto exit_error;\n@@ -6716,12 +6790,15 @@ static enum ice_status\n ice_replay_fltr(struct ice_hw *hw, u8 recp_id, struct LIST_HEAD_TYPE *list_head)\n {\n \tstruct ice_fltr_mgmt_list_entry *itr;\n-\tstruct LIST_HEAD_TYPE l_head;\n \tenum ice_status status = ICE_SUCCESS;\n+\tstruct ice_sw_recipe *recp_list;\n+\tu8 lport = hw->port_info->lport;\n+\tstruct LIST_HEAD_TYPE l_head;\n \n \tif (LIST_EMPTY(list_head))\n \t\treturn status;\n \n+\trecp_list = &hw->switch_info->recp_list[recp_id];\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@@ -6737,7 +6814,8 @@ ice_replay_fltr(struct ice_hw *hw, u8 recp_id, struct LIST_HEAD_TYPE *list_head)\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\t\tstatus = ice_add_rule_internal(hw, recp_id, &f_entry);\n+\t\t\tstatus = ice_add_rule_internal(hw, recp_list, lport,\n+\t\t\t\t\t\t       &f_entry);\n \t\t\tif (status != ICE_SUCCESS)\n \t\t\t\tgoto end;\n \t\t\tcontinue;\n@@ -6761,7 +6839,8 @@ ice_replay_fltr(struct ice_hw *hw, u8 recp_id, struct LIST_HEAD_TYPE *list_head)\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\tstatus = ice_add_rule_internal(hw, recp_list,\n+\t\t\t\t\t\t\t       lport,\n \t\t\t\t\t\t\t       &f_entry);\n \t\t\tif (status != ICE_SUCCESS)\n \t\t\t\tgoto end;\n@@ -6812,10 +6891,12 @@ ice_replay_vsi_fltr(struct ice_hw *hw, u16 vsi_handle, u8 recp_id,\n {\n \tstruct ice_fltr_mgmt_list_entry *itr;\n \tenum ice_status status = ICE_SUCCESS;\n+\tstruct ice_sw_recipe *recp_list;\n \tu16 hw_vsi_id;\n \n \tif (LIST_EMPTY(list_head))\n \t\treturn status;\n+\trecp_list = &hw->switch_info->recp_list[recp_id];\n \thw_vsi_id = ice_get_hw_vsi_num(hw, vsi_handle);\n \n \tLIST_FOR_EACH_ENTRY(itr, list_head, ice_fltr_mgmt_list_entry,\n@@ -6828,7 +6909,9 @@ ice_replay_vsi_fltr(struct ice_hw *hw, u16 vsi_handle, u8 recp_id,\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\tstatus = ice_add_rule_internal(hw, recp_list,\n+\t\t\t\t\t\t       hw->port_info->lport,\n+\t\t\t\t\t\t       &f_entry);\n \t\t\tif (status != ICE_SUCCESS)\n \t\t\t\tgoto end;\n \t\t\tcontinue;\n@@ -6846,7 +6929,9 @@ ice_replay_vsi_fltr(struct ice_hw *hw, u16 vsi_handle, u8 recp_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\t\tstatus = ice_add_rule_internal(hw, recp_list,\n+\t\t\t\t\t\t       hw->port_info->lport,\n+\t\t\t\t\t\t       &f_entry);\n \t\tif (status != ICE_SUCCESS)\n \t\t\tgoto end;\n \t}\ndiff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h\nindex 61083738a..598e9c939 100644\n--- a/drivers/net/ice/base/ice_switch.h\n+++ b/drivers/net/ice/base/ice_switch.h\n@@ -444,7 +444,8 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,\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\n+ice_init_def_sw_recp(struct ice_hw *hw, struct ice_sw_recipe **recp_list);\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",
    "prefixes": [
        "v2",
        "10/12"
    ]
}