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 5C877A04F1; Mon, 6 Jan 2020 04:36:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 538BE1D546; Mon, 6 Jan 2020 04:35:56 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 6A2D41D52B for ; Mon, 6 Jan 2020 04:35:52 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jan 2020 19:35:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,401,1571727600"; d="scan'208";a="216726345" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by fmsmga007.fm.intel.com with ESMTP; 05 Jan 2020 19:35:50 -0800 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, xiaolong.ye@intel.com, Qi Zhang , Henry Tieman , Paul M Stillwell Jr Date: Mon, 6 Jan 2020 11:38:44 +0800 Message-Id: <20200106033851.43978-6-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200106033851.43978-1-qi.z.zhang@intel.com> References: <20191205123847.39579-1-qi.z.zhang@intel.com> <20200106033851.43978-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH v2 05/12] net/ice/base: flexbytes should match on header data 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 the extraction sequence generated by flow director flexbytes to use package mac protocol. Without this change data in packet headers cannot be used for flexbyte matching. The old extraction for flex bytes started at the beginning of the payload which is after the header. Signed-off-by: Henry Tieman Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- drivers/net/ice/base/ice_flow.c | 17 ++++------------- drivers/net/ice/base/ice_flow.h | 2 +- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c index 391df1b54..eaa7a3b96 100644 --- a/drivers/net/ice/base/ice_flow.c +++ b/drivers/net/ice/base/ice_flow.c @@ -868,20 +868,11 @@ ice_flow_xtract_raws(struct ice_hw *hw, struct ice_flow_prof_params *params, raw = ¶ms->prof->segs[seg].raws[i]; - /* Only support matching raw fields in the payload */ - if (raw->off < hdrs_sz) - return ICE_ERR_PARAM; - - /* Convert the segment-relative offset into payload-relative - * offset. - */ - off = raw->off - hdrs_sz; - /* Storing extraction information */ - raw->info.xtrct.prot_id = ICE_PROT_PAY; - raw->info.xtrct.off = (off / ICE_FLOW_FV_EXTRACT_SZ) * + raw->info.xtrct.prot_id = ICE_PROT_MAC_OF_OR_S; + raw->info.xtrct.off = (raw->off / ICE_FLOW_FV_EXTRACT_SZ) * ICE_FLOW_FV_EXTRACT_SZ; - raw->info.xtrct.disp = (off % ICE_FLOW_FV_EXTRACT_SZ) * + raw->info.xtrct.disp = (raw->off % ICE_FLOW_FV_EXTRACT_SZ) * BITS_PER_BYTE; raw->info.xtrct.idx = params->es_cnt; @@ -909,7 +900,7 @@ ice_flow_xtract_raws(struct ice_hw *hw, struct ice_flow_prof_params *params, else idx = params->es_cnt; - params->es[idx].prot_id = ICE_PROT_PAY; + params->es[idx].prot_id = raw->info.xtrct.prot_id; params->es[idx].off = off; params->es_cnt++; off += ICE_FLOW_FV_EXTRACT_SZ; diff --git a/drivers/net/ice/base/ice_flow.h b/drivers/net/ice/base/ice_flow.h index 4686274af..d7b10ccc3 100644 --- a/drivers/net/ice/base/ice_flow.h +++ b/drivers/net/ice/base/ice_flow.h @@ -282,8 +282,8 @@ struct ice_flow_fld_info { }; struct ice_flow_seg_fld_raw { - int off; /* Offset from the start of the segment */ struct ice_flow_fld_info info; + u16 off; /* Offset from the start of the segment */ }; struct ice_flow_seg_info { -- 2.13.6