From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id DA33DA0096 for ; Wed, 5 Jun 2019 11:07:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AB5A71B9D4; Wed, 5 Jun 2019 11:07:24 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 234091B9CC for ; Wed, 5 Jun 2019 11:07:23 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D60B8535D; Wed, 5 Jun 2019 09:07:22 +0000 (UTC) Received: from [10.36.112.53] (ovpn-112-53.ams2.redhat.com [10.36.112.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 331FD5D9D6; Wed, 5 Jun 2019 09:07:20 +0000 (UTC) To: Leyi Rong , qi.z.zhang@intel.com Cc: dev@dpdk.org, Shivanshu Shukla , Paul M Stillwell Jr References: <20190604054248.68510-1-leyi.rong@intel.com> <20190604054248.68510-9-leyi.rong@intel.com> From: Maxime Coquelin Message-ID: <9cb07190-a848-d6ea-e8e4-2a813b899e41@redhat.com> Date: Wed, 5 Jun 2019 11:07:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190604054248.68510-9-leyi.rong@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 05 Jun 2019 09:07:22 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 08/49] net/ice/base: code for removing advanced rule 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" On 6/4/19 7:42 AM, Leyi Rong wrote: > This patch also contains ice_remove_adv_rule function to remove existing > advanced rules. it also handles the case when we have multiple VSI using > the same rule using the following helper functions: > > ice_adv_rem_update_vsi_list - function to remove VS from VSI list for > advanced rules. > > Signed-off-by: Shivanshu Shukla > Signed-off-by: Paul M Stillwell Jr > Signed-off-by: Leyi Rong > --- > drivers/net/ice/base/ice_switch.c | 309 +++++++++++++++++++++++++++++- > drivers/net/ice/base/ice_switch.h | 9 + > 2 files changed, 310 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c > index ca0497ca7..3719ac4bb 100644 > --- a/drivers/net/ice/base/ice_switch.c > +++ b/drivers/net/ice/base/ice_switch.c ... > +/** > + * ice_rem_adv_for_vsi - removes existing advanced switch rules for a > + * given VSI handle > + * @hw: pointer to the hardware structure > + * @vsi_handle: VSI handle for which we are supposed to remove all the rules. > + * > + * This function is used to remove all the rules for a given VSI and as soon > + * as removing a rule fails, it will return immediately with the error code, > + * else it will return ICE_SUCCESS > + */ > +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_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; > + for (rid = 0; rid < ICE_MAX_NUM_RECIPES; rid++) { > + if (!sw->recp_list[rid].recp_created) > + continue; > + if (!sw->recp_list[rid].adv_rule) > + continue; > + list_head = &sw->recp_list[rid].filt_rules; > + map_info = NULL; Useless assignation > + LIST_FOR_EACH_ENTRY(list_itr, list_head, > + ice_adv_fltr_mgmt_list_entry, list_entry) { > + map_info = ice_find_vsi_list_entry(hw, rid, vsi_handle, > + &vsi_list_id); > + if (!map_info) > + continue; > + rinfo = list_itr->rule_info; > + 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; Useless assignation > + } > + } > + return ICE_SUCCESS; > +} > + > /** > * ice_replay_fltr - Replay all the filters stored by a specific list head > * @hw: pointer to the hardware structure