patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Li, Xiaoyun" <xiaoyun.li@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>, "Guo,  Jia" <jia.guo@intel.com>,
	"Finn, Emma" <emma.finn@intel.com>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH] net/i40e: fix IPv4 fragment offload issue
Date: Tue, 2 Mar 2021 06:53:32 +0000	[thread overview]
Message-ID: <MN2PR11MB38079F320689C37816E98BF8F7999@MN2PR11MB3807.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210226081438.1693788-1-xiaoyun.li@intel.com>



> -----Original Message-----
> From: Li, Xiaoyun <xiaoyun.li@intel.com>
> Sent: Friday, February 26, 2021 4:15 PM
> To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Guo, Jia
> <jia.guo@intel.com>; Finn, Emma <emma.finn@intel.com>
> Cc: Li, Xiaoyun <xiaoyun.li@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/i40e: fix IPv4 fragment offload issue
> 
> IPv4 fragment_offset mask was required to be 0 no matter what the spec value
> was. But zero mask means not caring about fragment_offset field then both
> non-frag and frag packets should hit the rule.
> 
> But the actual fragment rules should be like the following:
> Only non-fragment packets can hit Rule 1:
> Rule 1: mask=0x3fff, spec=0
> Only fragment packets can hit rule 2:
> Rule 2: mask=0x3fff, spec=0x8, last=0x2000
> 
> This patch allows the above rules.
> 
> Fixes: 42044b69c67d ("net/i40e: support input set selection for FDIR")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
> ---
>  drivers/net/i40e/i40e_flow.c | 89 ++++++++++++++++++++++++++++++++----
>  1 file changed, 80 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index
> 4d44282312..86d96d9a11 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c


> +						   "Invalid IPv4 "
> +						   "fragment_offset mask");

Needn't split the comments line.

> +						return -rte_errno;
> +					}
> +					/*
> +					 * non-frag rule:
> +					 * mask=0x3fff,sepc=0

Typo: sepc->spec

> +					 * frag rule:
> +					 * mask=0x3fff,spec=0x8,last=0x2000
> +					 */
> +					if (frag_spec ==
> +					    (1 << RTE_IPV4_HDR_FO_SHIFT) &&
> +					    frag_last ==
> RTE_IPV4_HDR_MF_FLAG) {
> +						pctype =
> +
> I40E_FILTER_PCTYPE_FRAG_IPV4;
> +					} else if (frag_spec || frag_last) {
> +						rte_flow_error_set(error,
> +						   EINVAL,
> +
> RTE_FLOW_ERROR_TYPE_ITEM,
> +						   item,
> +						   "Invalid IPv4 "
> +						   "fragment_offset rule");

Same as above.

> +						return -rte_errno;
> +					}
> +				} else if (frag_spec || frag_last) {
> +					rte_flow_error_set(error,
> +						EINVAL,
> +
> 	RTE_FLOW_ERROR_TYPE_ITEM,
> +						item,
> +						"Invalid fragment_offset");
> +					return -rte_errno;
> +				}
> 
>  				if (input_set & (I40E_INSET_DMAC |
> I40E_INSET_SMAC)) {
>  					if (input_set & (I40E_INSET_IPV4_SRC
> |
> --
> 2.25.1


  reply	other threads:[~2021-03-02  6:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26  8:14 Xiaoyun Li
2021-03-02  6:53 ` Xing, Beilei [this message]
2021-03-02  7:06   ` Li, Xiaoyun
2021-03-02  7:03 ` [dpdk-stable] [PATCH v2] " Xiaoyun Li
2021-03-02  7:16   ` Xing, Beilei
2021-03-05  8:56     ` 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=MN2PR11MB38079F320689C37816E98BF8F7999@MN2PR11MB3807.namprd11.prod.outlook.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=emma.finn@intel.com \
    --cc=jia.guo@intel.com \
    --cc=stable@dpdk.org \
    --cc=xiaoyun.li@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).