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 2868FA04FA; Sun, 2 Feb 2020 09:23:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5E4281BFFA; Sun, 2 Feb 2020 09:23:27 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id B2D9A1BFEF; Sun, 2 Feb 2020 09:23:25 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2020 00:23:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,393,1574150400"; d="scan'208";a="263051535" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by fmsmga002.fm.intel.com with ESMTP; 02 Feb 2020 00:23:23 -0800 Date: Sun, 2 Feb 2020 16:22:30 +0800 From: Ye Xiaolong To: Yahui Cao Cc: Qiming Yang , Wenzhuo Lu , dev@dpdk.org, stable@dpdk.org, Qi Zhang Message-ID: <20200202082230.GJ54838@intel.com> References: <20200121134113.27109-1-yahui.cao@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200121134113.27109-1-yahui.cao@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH] net/ice: fix FDIR gtp_psc without qfi pattern issue 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" On 01/21, Yahui Cao wrote: >If only gtpu teid is specified, FDIR will always match the gtpu teid no >matter there is gtp extension header appended or not. >So forbid pattern in which gtp_psc without qfi value follows gtpu with >teid value like: >pattern eth / ipv4 / udp / gtpu teid is XXX / gtp_psc / end > >Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel") >Cc: stable@dpdk.org > >Signed-off-by: Yahui Cao >--- > drivers/net/ice/ice_fdir_filter.c | 12 ++++++++++++ > drivers/net/ice/ice_generic_flow.h | 6 ++++++ > 2 files changed, 18 insertions(+) > >diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c >index f356581d1..7517299fc 100644 >--- a/drivers/net/ice/ice_fdir_filter.c >+++ b/drivers/net/ice/ice_fdir_filter.c >@@ -1894,6 +1894,18 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, > > filter->input.gtpu_data.qfi = > gtp_psc_spec->qfi; >+ } else { >+ /* forbid pattern like: >+ * "gtpu teid is XXX / gtp_psc / end" >+ */ >+ if (ice_flow_inset_get_field(input_set, >+ ICE_INSET_GTPU_TEID)) { >+ rte_flow_error_set(error, EINVAL, >+ RTE_FLOW_ERROR_TYPE_ITEM, >+ item, >+ "Invalid GTP mask"); Is this a correct message for the error? Btw, this patch can't be applied cleanly on top of latest dpdk-next-net-intel, please help rebase and send a new version. Thanks, Xiaolong >+ return -rte_errno; >+ } > } > break; > default: >diff --git a/drivers/net/ice/ice_generic_flow.h b/drivers/net/ice/ice_generic_flow.h >index adc30ee2a..8387b5fee 100644 >--- a/drivers/net/ice/ice_generic_flow.h >+++ b/drivers/net/ice/ice_generic_flow.h >@@ -485,4 +485,10 @@ ice_search_pattern_match_item(const struct rte_flow_item pattern[], > struct ice_pattern_match_item *array, > uint32_t array_len, > struct rte_flow_error *error); >+ >+static inline int >+ice_flow_inset_get_field(uint64_t input_set, uint64_t field) >+{ >+ return (input_set & field) == field; >+} > #endif >-- >2.17.1 >