From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 2D0402BD3 for ; Mon, 25 Mar 2019 06:43:37 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Mar 2019 22:43:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,256,1549958400"; d="scan'208";a="128368766" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by orsmga008.jf.intel.com with ESMTP; 24 Mar 2019 22:43:35 -0700 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: Mon, 25 Mar 2019 13:44:37 +0800 Message-Id: <20190325054452.2616-24-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190325054452.2616-1-qi.z.zhang@intel.com> References: <20190228055650.25237-1-qi.z.zhang@intel.com> <20190325054452.2616-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH v4 23/38] 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: Mon, 25 Mar 2019 05:43:37 -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 Reviewed-by: Qiming Yang Reviewed-by: Wenzhuo Lu --- 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 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 ABED3A05D3 for ; Mon, 25 Mar 2019 06:46:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 71143569B; Mon, 25 Mar 2019 06:44:08 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 2D0402BD3 for ; Mon, 25 Mar 2019 06:43:37 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Mar 2019 22:43:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,256,1549958400"; d="scan'208";a="128368766" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by orsmga008.jf.intel.com with ESMTP; 24 Mar 2019 22:43:35 -0700 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: Mon, 25 Mar 2019 13:44:37 +0800 Message-Id: <20190325054452.2616-24-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190325054452.2616-1-qi.z.zhang@intel.com> References: <20190228055650.25237-1-qi.z.zhang@intel.com> <20190325054452.2616-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH v4 23/38] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190325054437.GRUNyufTitATGznAC9arns9W10yDJuel1ZNMGvSd7WI@z> 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 Reviewed-by: Qiming Yang Reviewed-by: Wenzhuo Lu --- 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