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 F3BD3A2EDB for ; Sat, 7 Sep 2019 20:27:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6666A1F15D; Sat, 7 Sep 2019 20:27:43 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id D7B481F030 for ; Sat, 7 Sep 2019 20:27:41 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Sep 2019 11:27:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,478,1559545200"; d="scan'208";a="184828152" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.5]) by fmsmga007.fm.intel.com with ESMTP; 07 Sep 2019 11:27:39 -0700 Date: Sun, 8 Sep 2019 02:25:34 +0800 From: Ye Xiaolong To: Yahui Cao Cc: Qiming Yang , Wenzhuo Lu , dev@dpdk.org, Qi Zhang , Beilei Xing Message-ID: <20190907182534.GE110251@intel.com> References: <20190906120058.108073-1-yahui.cao@intel.com> <20190906120058.108073-9-yahui.cao@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190906120058.108073-9-yahui.cao@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [dpdk-dev 08/12] net/ice: add FDIR dst mac support 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 09/06, Yahui Cao wrote: >Enable FDIR ethernet destination address field matching support > >Signed-off-by: Yahui Cao >--- > drivers/net/ice/ice_fdir_filter.c | 27 +++++++++++++++++++++++---- > 1 file changed, 23 insertions(+), 4 deletions(-) > >diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c >index ebbe1bd6c..1893aa0ee 100644 >--- a/drivers/net/ice/ice_fdir_filter.c >+++ b/drivers/net/ice/ice_fdir_filter.c >@@ -10,6 +10,7 @@ > #include "ice_generic_flow.h" > > #define ICE_FDIR_INSET_ETH_IPV4 (\ >+ ICE_INSET_DMAC | \ > ICE_INSET_IPV4_SRC | ICE_INSET_IPV4_DST | ICE_INSET_IPV4_TOS | \ > ICE_INSET_IPV4_TTL | ICE_INSET_IPV4_PROTO) > >@@ -387,6 +388,7 @@ ice_parse_input_set(uint64_t inset, enum ice_flow_field *field) > enum ice_flow_field fld; > }; > static const struct ice_inset_map ice_inset_map[] = { >+ {ICE_INSET_DMAC, ICE_FLOW_FIELD_IDX_ETH_DA}, > {ICE_INSET_IPV4_SRC, ICE_FLOW_FIELD_IDX_IPV4_SA}, > {ICE_INSET_IPV4_DST, ICE_FLOW_FIELD_IDX_IPV4_DA}, > {ICE_INSET_IPV6_SRC, ICE_FLOW_FIELD_IDX_IPV6_SA}, >@@ -918,13 +920,30 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, > case RTE_FLOW_ITEM_TYPE_ETH: > eth_spec = item->spec; > eth_mask = item->mask; >- if (eth_spec || eth_mask) { >- rte_flow_error_set(error, EINVAL, >+ if (eth_spec && eth_mask) { >+ if (!rte_is_zero_ether_addr(ð_spec->src) || >+ !rte_is_zero_ether_addr(ð_mask->src)) { >+ rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ITEM, > item, >- "eth mac not support"); >- return -rte_errno; >+ "Src mac not support"); >+ return -rte_errno; >+ } >+ >+ if (!rte_is_broadcast_ether_addr(ð_mask->dst)) { >+ rte_flow_error_set(error, EINVAL, >+ RTE_FLOW_ERROR_TYPE_ITEM, >+ item, >+ "Invalid mac addr mask"); >+ return -rte_errno; >+ } >+ >+ input_set |= ICE_INSET_DMAC; >+ rte_memcpy(&filter->input.ext_data.dst_mac, >+ ð_spec->dst, >+ RTE_ETHER_ADDR_LEN); > } >+ Unnecessary empty line. > break; > case RTE_FLOW_ITEM_TYPE_IPV4: > l3 = RTE_FLOW_ITEM_TYPE_IPV4; >-- >2.17.1 >