From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DB0E6A054F; Tue, 2 Mar 2021 04:01:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09E6D1CC4DC; Tue, 2 Mar 2021 04:01:40 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 0E7541CC4DB for ; Tue, 2 Mar 2021 04:01:38 +0100 (CET) IronPort-SDR: Pp32+0WhosquE7oACn/KUt5F2pXk+VYDdyVIwxXETJgoMDI1NhZlYEDmnPzGWmxbQMz6yugwo4 T0wtoI65aXmw== X-IronPort-AV: E=McAfee;i="6000,8403,9910"; a="183270172" X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="183270172" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 19:01:38 -0800 IronPort-SDR: 0HADwPkLlCUQzMpp7IWoXid0n9Gx+pdChoaY0mxzON+zNRA3uoLPdSFOEtJg7eeV40fFP7RGdz fCZL6yZDpqzg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="366967427" Received: from dpdk-zhirun-dev.sh.intel.com ([10.67.118.176]) by orsmga003.jf.intel.com with ESMTP; 01 Mar 2021 19:01:35 -0800 From: Zhirun Yan To: dev@dpdk.org, qi.z.zhang@intel.com, yahui.cao@intel.com, xiao.w.wang@intel.com, junfeng.guo@intel.com Cc: simei.su@intel.com, ting.xu@intel.com, yuying.zhang@intel.com, xuan.ding@intel.com, Zhirun Yan Date: Tue, 2 Mar 2021 10:54:05 +0800 Message-Id: <20210302025407.1197434-5-zhirun.yan@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302025407.1197434-1-zhirun.yan@intel.com> References: <20210127052933.2149243-1-zhirun.yan@intel.com> <20210302025407.1197434-1-zhirun.yan@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 4/6] net/ice: refactor input set conf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" For tunnel or non-tunnel packet, the input set is in outer_input_set and use seg_tun[0]. seg_tun[1] is only used for tunnel inner fields. This patch make align with input_set inner/outer with seg_tun[] and simplify it. Signed-off-by: Zhirun Yan --- drivers/net/ice/ice_fdir_filter.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c index 6bee2b1167..9cc0e6e0e7 100644 --- a/drivers/net/ice/ice_fdir_filter.c +++ b/drivers/net/ice/ice_fdir_filter.c @@ -1013,7 +1013,7 @@ ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow, return -ENOMEM; } - /* use seg_tun[1] to record tunnel inner part or non-tunnel */ + /* use seg_tun[1] to record tunnel inner part */ for (k = 0; k <= ICE_FD_HW_SEG_TUN; k++) { seg = &seg_tun[k]; input_set = (k == ICE_FD_HW_SEG_TUN) ? inner_input_set : outer_input_set; @@ -1036,13 +1036,9 @@ ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow, } is_tunnel = ice_fdir_is_tunnel_profile(ttype); - if (!is_tunnel) { - ret = ice_fdir_hw_tbl_conf(pf, pf->main_vsi, pf->fdir.fdir_vsi, - seg_tun + 1, flow, false); - } else { - ret = ice_fdir_hw_tbl_conf(pf, pf->main_vsi, pf->fdir.fdir_vsi, - seg_tun, flow, true); - } + + ret = ice_fdir_hw_tbl_conf(pf, pf->main_vsi, pf->fdir.fdir_vsi, + seg_tun, flow, is_tunnel); if (!ret) { return ret; -- 2.25.1