From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 06D261B32B for ; Fri, 22 Dec 2017 07:06:13 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Dec 2017 22:06:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,439,1508828400"; d="scan'208";a="189190695" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga006.fm.intel.com with ESMTP; 21 Dec 2017 22:06:12 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 21 Dec 2017 22:06:12 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 21 Dec 2017 22:06:12 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Fri, 22 Dec 2017 14:06:10 +0800 From: "Zhang, Qi Z" To: "Zhao1, Wei" , "dev@dpdk.org" Thread-Topic: [PATCH v2] net/i40e: add fdir nvgre parameters check Thread-Index: AQHTeuRlU+NJX9deakWBQeswaz9F66NO3zCw Date: Fri, 22 Dec 2017 06:06:09 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153123E63@SHSMSX103.ccr.corp.intel.com> References: <20171201084706.7741-1-wei.zhao1@intel.com> <20171222051105.53722-1-wei.zhao1@intel.com> In-Reply-To: <20171222051105.53722-1-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: add fdir nvgre parameters check 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: Fri, 22 Dec 2017 06:06:14 -0000 > -----Original Message----- > From: Zhao1, Wei > Sent: Friday, December 22, 2017 1:11 PM > To: dev@dpdk.org > Cc: Zhang, Qi Z ; Zhao1, Wei > Subject: [PATCH v2] net/i40e: add fdir nvgre parameters check >=20 > Add mask parameters check in nvgre parser for flow API. >=20 > Fixes: 30965ca341278 ("net/i40e: add NVGRE flow parsing") >=20 > Signed-off-by: Wei Zhao >=20 > --- >=20 > V2: > -change c_k_s_rsvd0_ver mask check to 0xFFFF. > --- > drivers/net/i40e/i40e_flow.c | 35 +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) >=20 > diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c = index > 7e4936e..fa2e168 100644 > --- a/drivers/net/i40e/i40e_flow.c > +++ b/drivers/net/i40e/i40e_flow.c > @@ -3610,6 +3610,41 @@ i40e_flow_parse_nvgre_pattern(__rte_unused > struct rte_eth_dev *dev, > "Invalid TNI mask"); > return -rte_errno; > } > + if (nvgre_mask->protocol && > + nvgre_mask->protocol !=3D 0xFFFF) { > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ITEM, > + item, > + "Invalid NVGRE item"); > + return -rte_errno; > + } > + if (nvgre_mask->c_k_s_rsvd0_ver && > + nvgre_mask->c_k_s_rsvd0_ver !=3D > + rte_cpu_to_be_16(0xFFFF)) { > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ITEM, > + item, > + "Invalid NVGRE item"); > + return -rte_errno; > + } > + if (nvgre_spec->c_k_s_rsvd0_ver !=3D > + rte_cpu_to_be_16(0x2000) && > + nvgre_mask->c_k_s_rsvd0_ver) { > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ITEM, > + item, > + "Invalid NVGRE item"); > + return -rte_errno; > + } > + if (nvgre_mask->protocol && > + nvgre_spec->protocol !=3D > + rte_cpu_to_be_16(0x6558)) { > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ITEM, > + item, > + "Invalid NVGRE item"); > + return -rte_errno; > + } > rte_memcpy(((uint8_t *)&tenant_id_be + 1), > nvgre_spec->tni, 3); > filter->tenant_id =3D > -- > 2.9.3 Acked-by: Qi Zhang