From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7A879A04B5; Mon, 7 Sep 2020 13:28:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 89B261C206; Mon, 7 Sep 2020 13:25:09 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id B04AE1C1E6 for ; Mon, 7 Sep 2020 13:25:06 +0200 (CEST) IronPort-SDR: VFvHORw6NwncdMzJyck3lUQjJorW7DQI0+a8OE2rN5Cz1WphW/v3BeYImOrkxbLFODFaDBaDt3 40fz6AM0dbwg== X-IronPort-AV: E=McAfee;i="6000,8403,9736"; a="157252679" X-IronPort-AV: E=Sophos;i="5.76,401,1592895600"; d="scan'208";a="157252679" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2020 04:25:06 -0700 IronPort-SDR: Oy9Yjs6rULgLB7Q5Gd/jieQmN2+GuGm3e0Pno6Y3feCHpflwUubZghjO3E5MLfkptPpuVe/D6C ipkpGhv4K2tA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,401,1592895600"; d="scan'208";a="328058871" Received: from dpdk51.sh.intel.com ([10.67.111.82]) by fmsmga004.fm.intel.com with ESMTP; 07 Sep 2020 04:25:05 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, Qi Zhang , NorbertX Ciosek Date: Mon, 7 Sep 2020 19:28:10 +0800 Message-Id: <20200907112826.48493-25-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200907112826.48493-1-qi.z.zhang@intel.com> References: <20200907112826.48493-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH 24/40] net/ice/base: clear advanced rules in reset preparation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Clear advanced rules from SW and HW before reset. Signed-off-by: NorbertX Ciosek Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_switch.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 4d193b30f..d1bc10539 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -8114,13 +8114,12 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw, */ enum ice_status ice_rem_adv_rule_for_vsi(struct ice_hw *hw, u16 vsi_handle) { - struct ice_adv_fltr_mgmt_list_entry *list_itr; + struct ice_adv_fltr_mgmt_list_entry *list_itr, *tmp_entry; struct ice_vsi_list_map_info *map_info; struct LIST_HEAD_TYPE *list_head; struct ice_adv_rule_info rinfo; struct ice_switch_info *sw; enum ice_status status; - u16 vsi_list_id = 0; u8 rid; sw = hw->switch_info; @@ -8129,22 +8128,31 @@ enum ice_status ice_rem_adv_rule_for_vsi(struct ice_hw *hw, u16 vsi_handle) continue; if (!sw->recp_list[rid].adv_rule) continue; + list_head = &sw->recp_list[rid].filt_rules; - map_info = NULL; - LIST_FOR_EACH_ENTRY(list_itr, list_head, - ice_adv_fltr_mgmt_list_entry, list_entry) { - map_info = ice_find_vsi_list_entry(&sw->recp_list[rid], - vsi_handle, - &vsi_list_id); - if (!map_info) - continue; + LIST_FOR_EACH_ENTRY_SAFE(list_itr, tmp_entry, list_head, + ice_adv_fltr_mgmt_list_entry, + list_entry) { rinfo = list_itr->rule_info; + + if (rinfo.sw_act.fltr_act == ICE_FWD_TO_VSI_LIST) { + map_info = list_itr->vsi_list_info; + if (!map_info) + continue; + + if (!ice_is_bit_set(map_info->vsi_map, + vsi_handle)) + continue; + } else if (rinfo.sw_act.vsi_handle != vsi_handle) { + continue; + } + rinfo.sw_act.vsi_handle = vsi_handle; status = ice_rem_adv_rule(hw, list_itr->lkups, list_itr->lkups_cnt, &rinfo); + if (status) return status; - map_info = NULL; } } return ICE_SUCCESS; -- 2.13.6