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 1B3D0A0471 for ; Wed, 19 Jun 2019 17:59:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 971691C4EB; Wed, 19 Jun 2019 17:22:39 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 3925C1C552 for ; Wed, 19 Jun 2019 17:21:26 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2019 08:21:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,392,1557212400"; d="scan'208";a="165050552" Received: from lrong-srv-03.sh.intel.com ([10.67.119.177]) by orsmga006.jf.intel.com with ESMTP; 19 Jun 2019 08:21:24 -0700 From: Leyi Rong To: qi.z.zhang@intel.com Cc: dev@dpdk.org, Leyi Rong , Shivanshu Shukla , Paul M Stillwell Jr Date: Wed, 19 Jun 2019 23:18:33 +0800 Message-Id: <20190619151846.113820-57-leyi.rong@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190619151846.113820-1-leyi.rong@intel.com> References: <20190611155221.2703-1-leyi.rong@intel.com> <20190619151846.113820-1-leyi.rong@intel.com> Subject: [dpdk-dev] [PATCH v3 56/69] net/ice/base: changes for reducing ice add adv rule time 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" While calling ice_find_recp we were calling ice_get_recp_to_prof_map everytime we called ice_find_recp. ice_get_recp_to_prof_map is a very expensive operation and we should try to reduce the number of times we call this function. So moved it into ice_get_recp_frm_fw since we only need to have fresh recp_to_profile mapping when we we check FW to see if the recipe we are trying to add already exists in FW. Signed-off-by: Shivanshu Shukla Signed-off-by: Paul M Stillwell Jr Signed-off-by: Leyi Rong --- drivers/net/ice/base/ice_switch.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 9f47ae96b..fe4d344a4 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -168,6 +168,8 @@ static ice_declare_bitmap(recipe_to_profile[ICE_MAX_NUM_RECIPES], ICE_MAX_NUM_PROFILES); static ice_declare_bitmap(available_result_ids, ICE_CHAIN_FV_INDEX_START + 1); +static void ice_get_recp_to_prof_map(struct ice_hw *hw); + /** * ice_get_recp_frm_fw - update SW bookkeeping from FW recipe entries * @hw: pointer to hardware structure @@ -189,6 +191,10 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid) struct ice_prot_lkup_ext *lkup_exts; enum ice_status status; + /* Get recipe to profile map so that we can get the fv from + * lkups that we read for a recipe from FW. + */ + ice_get_recp_to_prof_map(hw); /* we need a buffer big enough to accommodate all the recipes */ tmp = (struct ice_aqc_recipe_data_elem *)ice_calloc(hw, ICE_MAX_NUM_RECIPES, sizeof(*tmp)); @@ -4355,7 +4361,6 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts) struct ice_sw_recipe *recp; u16 i; - ice_get_recp_to_prof_map(hw); /* Initialize available_result_ids which tracks available result idx */ for (i = 0; i <= ICE_CHAIN_FV_INDEX_START; i++) ice_set_bit(ICE_CHAIN_FV_INDEX_START - i, -- 2.17.1