From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 5C5341B160 for ; Thu, 7 Mar 2019 13:57:25 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2019 04:57:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,451,1544515200"; d="scan'208";a="152884428" Received: from dpdk51.sh.intel.com ([10.67.110.160]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2019 04:57:23 -0800 From: Qi Zhang To: wenzhuo.lu@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, paul.m.stillwell.jr@intel.com, ferruh.yigit@intel.com, Qi Zhang , Dan Nowlin Date: Thu, 7 Mar 2019 20:58:27 +0800 Message-Id: <20190307125841.14247-24-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190307125841.14247-1-qi.z.zhang@intel.com> References: <20190228055650.25237-1-qi.z.zhang@intel.com> <20190307125841.14247-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH v2 23/37] net/ice/base: do not write TCAM entries back 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: , X-List-Received-Date: Thu, 07 Mar 2019 12:57:25 -0000 Profile TCAM entry removal is handled by the firmware when freeing the resource, so the driver does not need to write these default entries back with an update Package action. This patch removes writing of the TCAM entry using Update Package command when removing it, since the entry has already been freed by firmware. Signed-off-by: Dan Nowlin Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_flex_pipe.c | 41 +++++++++--------------------------- drivers/net/ice/base/ice_flex_type.h | 2 -- 2 files changed, 10 insertions(+), 33 deletions(-) diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c index ff615f94f..900a19387 100644 --- a/drivers/net/ice/base/ice_flex_pipe.c +++ b/drivers/net/ice/base/ice_flex_pipe.c @@ -3558,8 +3558,7 @@ ice_prof_bld_tcam(struct ice_hw *hw, enum ice_block blk, struct ice_chs_chg *tmp; LIST_FOR_EACH_ENTRY(tmp, chgs, ice_chs_chg, list_entry) { - if ((tmp->type == ICE_TCAM_ADD && tmp->add_tcam_idx) || - tmp->type == ICE_TCAM_REM) { + if (tmp->type == ICE_TCAM_ADD && tmp->add_tcam_idx) { struct ice_prof_id_section *p; u32 id; @@ -3689,7 +3688,6 @@ ice_upd_prof_hw(struct ice_hw *hw, enum ice_block blk, es++; break; case ICE_TCAM_ADD: - case ICE_TCAM_REM: tcam++; break; case ICE_VSIG_ADD: @@ -3962,46 +3960,27 @@ ice_rel_tcam_idx(struct ice_hw *hw, enum ice_block blk, u16 idx) * ice_rem_prof_id - remove one profile from a VSIG * @hw: pointer to the HW struct * @blk: hardware block - * @vsig: VSIG to remove the profile from * @prof: pointer to profile structure to remove - * @chg: pointer to list to record changes */ static enum ice_status -ice_rem_prof_id(struct ice_hw *hw, enum ice_block blk, u16 vsig, - struct ice_vsig_prof *prof, struct LIST_HEAD_TYPE *chg) +ice_rem_prof_id(struct ice_hw *hw, enum ice_block blk, + struct ice_vsig_prof *prof) { enum ice_status status; - struct ice_chs_chg *p; u16 i; for (i = 0; i < prof->tcam_count; i++) { - p = (struct ice_chs_chg *)ice_malloc(hw, sizeof(*p)); - if (!p) - goto err_ice_rem_prof_id; - - p->type = ICE_TCAM_REM; - p->vsig = vsig; - p->prof_id = prof->tcam[i].prof_id; - p->tcam_idx = prof->tcam[i].tcam_idx; - - p->ptg = prof->tcam[i].ptg; prof->tcam[i].in_use = false; - p->orig_ent = hw->blk[blk].prof.t[p->tcam_idx]; - status = ice_rel_tcam_idx(hw, blk, p->tcam_idx); + status = ice_rel_tcam_idx(hw, blk, prof->tcam[i].tcam_idx); if (!status) - status = ice_prof_dec_ref(hw, blk, p->prof_id); - - LIST_ADD(&p->list_entry, chg); + status = ice_prof_dec_ref(hw, blk, + prof->tcam[i].prof_id); if (status) - goto err_ice_rem_prof_id; + return ICE_ERR_HW_TABLE; } return ICE_SUCCESS; - -err_ice_rem_prof_id: - /* caller will clean up the change list */ - return ICE_ERR_NO_MEMORY; } /** @@ -4024,9 +4003,9 @@ ice_rem_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, LIST_FOR_EACH_ENTRY_SAFE(d, t, &hw->blk[blk].xlt2.vsig_tbl[idx].prop_lst, ice_vsig_prof, list) { - status = ice_rem_prof_id(hw, blk, vsig, d, chg); + status = ice_rem_prof_id(hw, blk, d); if (status) - goto err_ice_rem_vsig; + return status; LIST_DEL(&d->list); ice_free(hw, d); @@ -4090,7 +4069,7 @@ ice_rem_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl, /* this is the last profile, remove the VSIG */ return ice_rem_vsig(hw, blk, vsig, chg); - status = ice_rem_prof_id(hw, blk, vsig, p, chg); + status = ice_rem_prof_id(hw, blk, p); if (!status) { LIST_DEL(&p->list); ice_free(hw, p); diff --git a/drivers/net/ice/base/ice_flex_type.h b/drivers/net/ice/base/ice_flex_type.h index aed23a067..1bb865896 100644 --- a/drivers/net/ice/base/ice_flex_type.h +++ b/drivers/net/ice/base/ice_flex_type.h @@ -676,7 +676,6 @@ enum ice_chg_type { ICE_TCAM_NONE = 0, ICE_PTG_ES_ADD, ICE_TCAM_ADD, - ICE_TCAM_REM, ICE_VSIG_ADD, ICE_VSIG_REM, ICE_VSI_MOVE, @@ -697,7 +696,6 @@ struct ice_chs_chg { u16 vsig; u16 orig_vsig; u16 tcam_idx; - struct ice_prof_tcam_entry orig_ent; }; #define ICE_FLOW_PTYPE_MAX ICE_XLT1_CNT -- 2.13.6