patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Guo, Jia" <jia.guo@intel.com>
To: "Xing, Beilei" <beilei.xing@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>,
	"Sun, Chenmin" <chenmin.sun@intel.com>
Subject: Re: [dpdk-stable] [PATCH v2] net/i40e: fix flex payload rule conflict issue
Date: Mon, 28 Dec 2020 07:15:11 +0000
Message-ID: <6b0ab68e80364f8cb56dee33327e528e@intel.com> (raw)
In-Reply-To: <20201229061736.92666-1-beilei.xing@intel.com>

Hi, beilei

> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Tuesday, December 29, 2020 2:18 PM
> To: Guo, Jia <jia.guo@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; stable@dpdk.org; Sun, Chenmin
> <chenmin.sun@intel.com>
> Subject: [PATCH v2] net/i40e: fix flex payload rule conflict issue
> 
> From: Beilei Xing <beilei.xing@intel.com>
> 
> With the following commands, the second flow can't be created successfully.
> 
> 1. flow create 0 ingress pattern eth / ipv4 / udp /
>    raw relative is 1 pattern is 0102030405 / end
>    actions drop / end
> 2. flow destroy 0 rule 0
> 3. flow create 0 ingress pattern eth / ipv4 / udp /
>    raw relative is 1 pattern is 010203040506 / end
>    actions drop / end
> 
> The root cause is that a flag for flex pit isn't reset.
> 
> Fixes: 6ced3dd72f5f ("net/i40e: support flexible payload parsing for FDIR")
> Cc: stable@dpdk.org
> 
> Reported-by: Chenmin Sun<chenmin.sun@intel.com>
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
> 
> v2 changes:
>  - Add fix line.
>  - Refine comments.
> 
>  drivers/net/i40e/i40e_flow.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
> index b09ff6590d..65e0b69356 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -5284,6 +5284,7 @@ i40e_flow_destroy(struct rte_eth_dev *dev,
>  	enum rte_filter_type filter_type = flow->filter_type;
>  	struct i40e_fdir_info *fdir_info = &pf->fdir;
>  	int ret = 0;
> +	int i;
> 
>  	switch (filter_type) {
>  	case RTE_ETH_FILTER_ETHERTYPE:
> @@ -5299,9 +5300,13 @@ i40e_flow_destroy(struct rte_eth_dev *dev,
>  				&((struct i40e_fdir_filter *)flow->rule)->fdir,
>  				0);
> 
> -		/* If the last flow is destroyed, disable fdir. */
> +		/* When the last flow is destroyed. */
>  		if (!ret && TAILQ_EMPTY(&pf->fdir.fdir_list)) {
> +			/* Disable FDIR processing. */
>  			i40e_fdir_rx_proc_enable(dev, 0);
> +			/* Reset the flex_pit_flag. */
> +			for (i = 0; i < I40E_MAX_FLXPLD_LAYER; i++)
> +				pf->fdir.flex_pit_flag[i] = 0;

Why reset all flex_pit_flag when destroy the last flow, if destroy other flow, is it no need to reset corresponding flex_pit_flag which set before when the flow added?
And reset flag should be ahead of the FDIR disabling I think.

>  		}
>  		break;
>  	case RTE_ETH_FILTER_HASH:
> @@ -5515,6 +5520,9 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
>  			pf->fdir.flex_mask_flag[pctype] = 0;
>  		}
> 
> +		for (i = 0; i < I40E_MAX_FLXPLD_LAYER; i++)
> +			pf->fdir.flex_pit_flag[i] = 0;
> +
>  		/* Disable FDIR processing as all FDIR rules are now flushed
> */
>  		i40e_fdir_rx_proc_enable(dev, 0);
>  	}
> --
> 2.26.2


  reply	other threads:[~2020-12-28  7:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201229054639.92132-1-beilei.xing@intel.com>
2020-12-29  6:17 ` beilei.xing
2020-12-28  7:15   ` Guo, Jia [this message]
2021-01-01  4:03 ` [dpdk-stable] [PATCH v3] " beilei.xing
2020-12-31  6:07   ` Guo, Jia
2021-01-05  2:36     ` Xing, Beilei
2021-01-05  3:12 ` [dpdk-stable] [PATCH v5] " beilei.xing
2021-01-05  3:39   ` Guo, Jia
2021-01-05 12:33     ` Zhang, Qi Z
2021-01-06  2:51 ` [dpdk-stable] [PATCH v4] " beilei.xing

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=6b0ab68e80364f8cb56dee33327e528e@intel.com \
    --to=jia.guo@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=chenmin.sun@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git