From patchwork Tue Oct 8 01:50:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 60665 X-Patchwork-Delegate: xiaolong.ye@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6310E1C0CB; Tue, 8 Oct 2019 03:47:47 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id C1F721C038 for ; Tue, 8 Oct 2019 03:47:41 +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 fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Oct 2019 18:47:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,269,1566889200"; d="scan'208";a="197556249" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by orsmga006.jf.intel.com with ESMTP; 07 Oct 2019 18:47:39 -0700 From: Qi Zhang To: wenzhuo.lu@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, xiaolong.ye@intel.com, Qi Zhang , Dan Nowlin , Paul M Stillwell Jr Date: Tue, 8 Oct 2019 09:50:15 +0800 Message-Id: <20191008015018.17086-10-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20191008015018.17086-1-qi.z.zhang@intel.com> References: <20190902035551.16852-1-qi.z.zhang@intel.com> <20191008015018.17086-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH v3 09/12] net/ice/base: fix flow raw field vector extraction 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" Correct the ordering of raw field extraction in the field vector by taking into account the ordering setting for requesting block. Fixes: aa1cd410fa64 ("net/ice/base: add flow module") Signed-off-by: Dan Nowlin Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang Signed-off-by: Dan Nowlin Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- drivers/net/ice/base/ice_flow.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c index 370ad9ba3..38c7c42f7 100644 --- a/drivers/net/ice/base/ice_flow.c +++ b/drivers/net/ice/base/ice_flow.c @@ -806,6 +806,7 @@ static enum ice_status ice_flow_xtract_raws(struct ice_hw *hw, struct ice_flow_prof_params *params, u8 seg) { + u16 fv_words; u16 hdrs_sz; u8 i; @@ -821,6 +822,8 @@ ice_flow_xtract_raws(struct ice_hw *hw, struct ice_flow_prof_params *params, if (!hdrs_sz) return ICE_ERR_PARAM; + fv_words = hw->blk[params->blk].es.fvw; + for (i = 0; i < params->prof->segs[seg].raws_cnt; i++) { struct ice_flow_seg_fld_raw *raw; u16 off, cnt, j; @@ -853,6 +856,8 @@ ice_flow_xtract_raws(struct ice_hw *hw, struct ice_flow_prof_params *params, BITS_PER_BYTE)); off = raw->info.xtrct.off; for (j = 0; j < cnt; j++) { + u16 idx; + /* Make sure the number of extraction sequence required * does not exceed the block's capability */ @@ -860,8 +865,14 @@ ice_flow_xtract_raws(struct ice_hw *hw, struct ice_flow_prof_params *params, params->es_cnt >= ICE_MAX_FV_WORDS) return ICE_ERR_MAX_LIMIT; - params->es[params->es_cnt].prot_id = ICE_PROT_PAY; - params->es[params->es_cnt].off = off; + /* some blocks require a reversed field vector layout */ + if (hw->blk[params->blk].es.reverse) + idx = fv_words - params->es_cnt - 1; + else + idx = params->es_cnt; + + params->es[idx].prot_id = ICE_PROT_PAY; + params->es[idx].off = off; params->es_cnt++; off += ICE_FLOW_FV_EXTRACT_SZ; }