patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Ye, Xiaolong" <xiaolong.ye@intel.com>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH 1/2] net/i40e: fix ether pattern rule for fdir
Date: Tue, 23 Jul 2019 05:28:06 +0000	[thread overview]
Message-ID: <94479800C636CB44BD422CB454846E013CE09286@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <20190722120639.62468-1-xiaolong.ye@intel.com>



> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Monday, July 22, 2019 8:07 PM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Ye, Xiaolong <xiaolong.ye@intel.com>; stable@dpdk.org
> Subject: [PATCH 1/2] net/i40e: fix ether pattern rule for fdir
> 
> i40e FDIR doesn't allow to create flow with empty spec and mask for
> ethertype pattern. Without this patch, below flow would be created
> successfully which is unexpected.
> 
> > flow create 0 ingress pattern eth / end actions drop / end
> 
> Fixes: 7d83c152a207 ("net/i40e: parse flow director filter")
> Cc: stable@dpdk.org
> Cc: beilei.xing@intel.com
> 
> Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
> ---
>  drivers/net/i40e/i40e_flow.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index
> 48a6782a8..3c0af70c0 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -2442,6 +2442,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev
> *dev,
>  	uint64_t input_set = I40E_INSET_NONE;
>  	uint16_t frag_off;
>  	enum rte_flow_item_type item_type;
> +	enum rte_flow_item_type next_type;
>  	enum rte_flow_item_type l3 = RTE_FLOW_ITEM_TYPE_END;
>  	enum rte_flow_item_type cus_proto = RTE_FLOW_ITEM_TYPE_END;
>  	uint32_t i, j;
> @@ -2482,6 +2483,16 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev
> *dev,
>  		case RTE_FLOW_ITEM_TYPE_ETH:
>  			eth_spec = item->spec;
>  			eth_mask = item->mask;
> +			next_type = (item + 1)->type;
> +
> +			if (next_type == RTE_FLOW_ITEM_TYPE_END &&
> +						(!eth_spec || !eth_mask)) {
> +				rte_flow_error_set(error, EINVAL,
> +
> RTE_FLOW_ERROR_TYPE_ITEM,
> +						   item,
> +						   "NULL eth spec/mask.");
> +				return -rte_errno;
> +			}
> 
>  			if (eth_spec && eth_mask) {
>  				if (!rte_is_zero_ether_addr(&eth_mask->src)
> || @@ -2494,8 +2505,6 @@ i40e_flow_parse_fdir_pattern(struct
> rte_eth_dev *dev,
>  				}
>  			}
>  			if (eth_spec && eth_mask && eth_mask->type) {
> -				enum rte_flow_item_type next = (item + 1)-
> >type;
> -
>  				if (eth_mask->type != RTE_BE16(0xffff)) {
>  					rte_flow_error_set(error, EINVAL,
> 
> RTE_FLOW_ERROR_TYPE_ITEM,
> @@ -2506,7 +2515,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev
> *dev,
> 
>  				ether_type = rte_be_to_cpu_16(eth_spec-
> >type);
> 
> -				if (next == RTE_FLOW_ITEM_TYPE_VLAN ||
> +				if (next_type ==
> RTE_FLOW_ITEM_TYPE_VLAN ||
>  				    ether_type == RTE_ETHER_TYPE_IPV4 ||
>  				    ether_type == RTE_ETHER_TYPE_IPV6 ||
>  				    ether_type == RTE_ETHER_TYPE_ARP ||
> --
> 2.17.0

Acked-by: Beilei Xing <beilei.xing@intel.com>


  parent reply	other threads:[~2019-07-23  5:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 12:06 Xiaolong Ye
2019-07-22 12:06 ` [dpdk-stable] [PATCH 2/2] net/i40e: fix fdir rule destroy failure Xiaolong Ye
2019-07-23  7:11   ` Xing, Beilei
2019-07-23  7:16     ` Zhang, Qi Z
2019-07-23  5:28 ` Xing, Beilei [this message]
2019-07-23  7:08   ` [dpdk-stable] [PATCH 1/2] net/i40e: fix ether pattern rule for fdir Zhang, Qi Z

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=94479800C636CB44BD422CB454846E013CE09286@SHSMSX101.ccr.corp.intel.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=xiaolong.ye@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).