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 959AEA057B; Mon, 30 Mar 2020 13:44:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 37CDE1C118; Mon, 30 Mar 2020 13:42:40 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id DDC431C0D0 for ; Mon, 30 Mar 2020 13:42:35 +0200 (CEST) IronPort-SDR: udn+HSZeiM0ZGKwblgWunhbh+xznWW1crc2rhSPDwvs/QUD8TUnZsGE5PlK3ERPrQhvQTaOlKk t0kMDbGYVKrA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2020 04:42:35 -0700 IronPort-SDR: wyZ5MTW6dOil/KcXkuoXyleyoS1xq7oC4KfrV3mI5XOsv12HUvquz4ZFj7+qrovX9/w3B/A3OX h/hLg0r4TEQg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,324,1580803200"; d="scan'208";a="449769918" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by fmsmga006.fm.intel.com with ESMTP; 30 Mar 2020 04:42:33 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: xiaolong.ye@intel.com, dev@dpdk.org, Qi Zhang , Tony Nguyen , Paul M Stillwell Jr Date: Mon, 30 Mar 2020 19:45:36 +0800 Message-Id: <20200330114538.43275-15-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200330114538.43275-1-qi.z.zhang@intel.com> References: <20200330114538.43275-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH 14/16] net/ice/base: change function to static 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" Change ice_set_fd_desc_val to static, since it only be used internally. Signed-off-by: Tony Nguyen Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_fdir.c | 97 +++++++++++++++++++---------------------- drivers/net/ice/base/ice_fdir.h | 3 -- 2 files changed, 45 insertions(+), 55 deletions(-) diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c index df754dc74..c703a7c6b 100644 --- a/drivers/net/ice/base/ice_fdir.c +++ b/drivers/net/ice/base/ice_fdir.c @@ -381,62 +381,11 @@ ice_set_dflt_val_fd_desc(struct ice_fd_fltr_desc_ctx *fd_fltr_ctx) } /** - * ice_fdir_get_prgm_desc - set a fdir descriptor from a fdir filter struct - * @hw: pointer to the hardware structure - * @input: filter - * @fdesc: filter descriptor - * @add: if add is true, this is an add operation, false implies delete - */ -void -ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input, - struct ice_fltr_desc *fdesc, bool add) -{ - struct ice_fd_fltr_desc_ctx fdir_fltr_ctx = { 0 }; - - /* set default context info */ - ice_set_dflt_val_fd_desc(&fdir_fltr_ctx); - - /* change sideband filtering values */ - fdir_fltr_ctx.fdid = input->fltr_id; - if (input->dest_ctl == ICE_FLTR_PRGM_DESC_DEST_DROP_PKT) { - fdir_fltr_ctx.drop = ICE_FXD_FLTR_QW0_DROP_YES; - fdir_fltr_ctx.qindex = 0; - } else if (input->dest_ctl == - ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER) { - fdir_fltr_ctx.drop = ICE_FXD_FLTR_QW0_DROP_NO; - fdir_fltr_ctx.qindex = 0; - } else { - if (input->dest_ctl == - ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_QGROUP) - fdir_fltr_ctx.toq = input->q_region; - fdir_fltr_ctx.drop = ICE_FXD_FLTR_QW0_DROP_NO; - fdir_fltr_ctx.qindex = input->q_index; - } - fdir_fltr_ctx.cnt_ena = input->cnt_ena; - fdir_fltr_ctx.cnt_index = input->cnt_index; - fdir_fltr_ctx.fd_vsi = ice_get_hw_vsi_num(hw, input->dest_vsi); - fdir_fltr_ctx.evict_ena = ICE_FXD_FLTR_QW0_EVICT_ENA_FALSE; - if (input->dest_ctl == ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER) - fdir_fltr_ctx.toq_prio = 0; - else - fdir_fltr_ctx.toq_prio = 3; - fdir_fltr_ctx.pcmd = (add) ? ICE_FXD_FLTR_QW1_PCMD_ADD : - ICE_FXD_FLTR_QW1_PCMD_REMOVE; - fdir_fltr_ctx.swap = ICE_FXD_FLTR_QW1_SWAP_NOT_SET; - fdir_fltr_ctx.comp_q = ICE_FXD_FLTR_QW0_COMP_Q_ZERO; - fdir_fltr_ctx.comp_report = ICE_FXD_FLTR_QW0_COMP_REPORT_SW; - fdir_fltr_ctx.fdid_prio = input->fdid_prio; - fdir_fltr_ctx.desc_prof = 1; - fdir_fltr_ctx.desc_prof_prio = 3; - ice_set_fd_desc_val(&fdir_fltr_ctx, fdesc); -} - -/** * ice_set_fd_desc_val * @ctx: pointer to fd filter descriptor context * @fdir_desc: populated with fd filter descriptor values */ -void +static void ice_set_fd_desc_val(struct ice_fd_fltr_desc_ctx *ctx, struct ice_fltr_desc *fdir_desc) { @@ -496,6 +445,50 @@ ice_set_fd_desc_val(struct ice_fd_fltr_desc_ctx *ctx, } /** + * ice_fdir_get_prgm_desc - set a fdir descriptor from a fdir filter struct + * @hw: pointer to the hardware structure + * @input: filter + * @fdesc: filter descriptor + * @add: if add is true, this is an add operation, false implies delete + */ +void +ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input, + struct ice_fltr_desc *fdesc, bool add) +{ + struct ice_fd_fltr_desc_ctx fdir_fltr_ctx = { 0 }; + + /* set default context info */ + ice_set_dflt_val_fd_desc(&fdir_fltr_ctx); + + /* change sideband filtering values */ + fdir_fltr_ctx.fdid = input->fltr_id; + if (input->dest_ctl == ICE_FLTR_PRGM_DESC_DEST_DROP_PKT) { + fdir_fltr_ctx.drop = ICE_FXD_FLTR_QW0_DROP_YES; + fdir_fltr_ctx.qindex = 0; + } else { + if (input->dest_ctl == + ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_QGROUP) + fdir_fltr_ctx.toq = input->q_region; + fdir_fltr_ctx.drop = ICE_FXD_FLTR_QW0_DROP_NO; + fdir_fltr_ctx.qindex = input->q_index; + } + fdir_fltr_ctx.cnt_ena = input->cnt_ena; + fdir_fltr_ctx.cnt_index = input->cnt_index; + fdir_fltr_ctx.fd_vsi = ice_get_hw_vsi_num(hw, input->dest_vsi); + fdir_fltr_ctx.evict_ena = ICE_FXD_FLTR_QW0_EVICT_ENA_FALSE; + fdir_fltr_ctx.toq_prio = 3; + fdir_fltr_ctx.pcmd = (add) ? ICE_FXD_FLTR_QW1_PCMD_ADD : + ICE_FXD_FLTR_QW1_PCMD_REMOVE; + fdir_fltr_ctx.swap = ICE_FXD_FLTR_QW1_SWAP_NOT_SET; + fdir_fltr_ctx.comp_q = ICE_FXD_FLTR_QW0_COMP_Q_ZERO; + fdir_fltr_ctx.comp_report = ICE_FXD_FLTR_QW0_COMP_REPORT_SW_FAIL; + fdir_fltr_ctx.fdid_prio = input->fdid_prio; + fdir_fltr_ctx.desc_prof = 1; + fdir_fltr_ctx.desc_prof_prio = 3; + ice_set_fd_desc_val(&fdir_fltr_ctx, fdesc); +} + +/** * ice_alloc_fd_res_cntr - obtain counter resource for FD type * @hw: pointer to the hardware structure * @cntr_id: returns counter index diff --git a/drivers/net/ice/base/ice_fdir.h b/drivers/net/ice/base/ice_fdir.h index 6f11195f6..21a83fd6c 100644 --- a/drivers/net/ice/base/ice_fdir.h +++ b/drivers/net/ice/base/ice_fdir.h @@ -36,9 +36,6 @@ struct ice_fd_fltr_desc_ctx { enum ice_status ice_alloc_fd_res_cntr(struct ice_hw *hw, u16 *cntr_id); enum ice_status ice_free_fd_res_cntr(struct ice_hw *hw, u16 cntr_id); -void -ice_set_fd_desc_val(struct ice_fd_fltr_desc_ctx *fd_fltr_ctx, - struct ice_fltr_desc *fdir_desc); void ice_set_dflt_val_fd_desc(struct ice_fd_fltr_desc_ctx *fd_fltr_ctx); enum ice_status ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr); -- 2.13.6