DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Zhao1, Wei" <wei.zhao1@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: add fdir nvgre parameters check
Date: Fri, 22 Dec 2017 06:06:09 +0000	[thread overview]
Message-ID: <039ED4275CED7440929022BC67E7061153123E63@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20171222051105.53722-1-wei.zhao1@intel.com>



> -----Original Message-----
> From: Zhao1, Wei
> Sent: Friday, December 22, 2017 1:11 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [PATCH v2] net/i40e: add fdir nvgre parameters check
> 
> Add mask parameters check in nvgre parser for flow API.
> 
> Fixes: 30965ca341278 ("net/i40e: add NVGRE flow parsing")
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> 
> ---
> 
> V2:
> -change c_k_s_rsvd0_ver mask check to 0xFFFF.
> ---
>  drivers/net/i40e/i40e_flow.c | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
> 
> 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 != 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 !=
> +					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 !=
> +					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 !=
> +					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 =
> --
> 2.9.3

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

  reply	other threads:[~2017-12-22  6:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01  8:47 [dpdk-dev] [PATCH] " Wei Zhao
2017-12-22  2:10 ` Zhang, Qi Z
2017-12-22  2:26   ` Zhao1, Wei
2017-12-22  2:45   ` Zhao1, Wei
2017-12-22  5:11 ` [dpdk-dev] [PATCH v2] " Wei Zhao
2017-12-22  6:06   ` Zhang, Qi Z [this message]
2018-01-08  6:21     ` Zhang, Helin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=039ED4275CED7440929022BC67E7061153123E63@SHSMSX103.ccr.corp.intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=wei.zhao1@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).