From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 8A7443777 for ; Tue, 4 Apr 2017 14:39:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491309590; x=1522845590; h=subject:to:references:cc:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=GN68xPpuLQCpIfLwLkXzvja9cB4FyAR97c62Sx7uZYw=; b=eqX2pq1blpOSYVEbQcO7ixFftcvcC8UkqTEZyEy6AzJGH3XroS7nshs9 gZE4rvcitsjIE3DkfW9pexn9b9GnUQ==; Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2017 05:39:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,275,1486454400"; d="scan'208";a="84471983" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.122]) ([10.237.220.122]) by fmsmga006.fm.intel.com with ESMTP; 04 Apr 2017 05:39:47 -0700 To: Bernard Iremonger , dev@dpdk.org, beilei.xing@intel.com References: <1491236049-6747-1-git-send-email-bernard.iremonger@intel.com> Cc: wenzhuo.lu@intel.com From: Ferruh Yigit Message-ID: Date: Tue, 4 Apr 2017 13:39:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1491236049-6747-1-git-send-email-bernard.iremonger@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix eth pattern parsing 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: , X-List-Received-Date: Tue, 04 Apr 2017 12:39:51 -0000 On 4/3/2017 5:14 PM, Bernard Iremonger wrote: > Handle the following eth patterns: > eth dst spec aa:bb:cc:dd:ee:ff > eth dst mask ff:ff:ff:ff:ff:ff > eth src spec aa:bb:cc:dd:ee:ff > eth src mask ff:ff:ff:ff:ff:ff > > Fixes: d46e85af6b5c ("net/i40e: parse QinQ pattern") > > Signed-off-by: Bernard Iremonger > --- > drivers/net/i40e/i40e_flow.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c > index 9f541eaff..3fcd31036 100644 > --- a/drivers/net/i40e/i40e_flow.c > +++ b/drivers/net/i40e/i40e_flow.c > @@ -1772,7 +1772,8 @@ i40e_flow_parse_qinq_pattern(__rte_unused struct rte_eth_dev *dev, > case RTE_FLOW_ITEM_TYPE_ETH: > eth_spec = (const struct rte_flow_item_eth *)item->spec; > eth_mask = (const struct rte_flow_item_eth *)item->mask; > - if (eth_spec && eth_mask) { > + if ((eth_spec && eth_mask) || > + (eth_spec || eth_mask)) { Is this check requires both spec and mask to be all zeros? If this is the real intention, can you please add a comment above check to clarify it. Also other i40e_flow_parse_xxx_pattern() functions has function comment to describe expected/valid pattern for the flow rule. i40e_flow_parse_qinq_pattern() is missing that function comment. Would you mind adding it, which helps to validate implementation against intention. Thanks, ferruh > rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ITEM, > item, >