DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Su, Simei" <simei.su@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Guo, Junfeng" <junfeng.guo@intel.com>,
	"Guo, Jia" <jia.guo@intel.com>, "Xu, Ting" <ting.xu@intel.com>
Subject: Re: [dpdk-dev] [PATCH v4] net/ice: fix invalid RSS type
Date: Wed, 15 Jul 2020 14:13:10 +0000	[thread overview]
Message-ID: <039ED4275CED7440929022BC67E706115485D6EC@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1594808751-138882-1-git-send-email-simei.su@intel.com>



> -----Original Message-----
> From: Su, Simei <simei.su@intel.com>
> Sent: Wednesday, July 15, 2020 6:26 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Guo, Junfeng <junfeng.guo@intel.com>; Guo, Jia
> <jia.guo@intel.com>; Xu, Ting <ting.xu@intel.com>; Su, Simei
> <simei.su@intel.com>
> Subject: [PATCH v4] net/ice: fix invalid RSS type
> 
> When a RSS rule with only SRC/DST_ONLY or IPV6 prefix RSS type, it should
> return failure. Besides, when a RSS rule with symmetric hash function, the RSS
> type shouldn't carry with SRC/DST_ONLY.
> This patch adds invalid RSS type check for the two cases.
> 
> Fixes: dfdc589f6ee0 ("net/ice: refactor PF hash flow")
> 
> Signed-off-by: Simei Su <simei.su@intel.com>

> ---
> 
> v4:
> * Modify check logic for symmetric case.
> 
> v3:
> * Add invalid RSS type check for symmetric case.
> * Consider IPV6 prefix.
> * Refine commit log.
> 
> v2:
> * Add specific macro value in check rather than hard code.
> ---
>  drivers/net/ice/ice_hash.c | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index
> e57feff..009ea1f 100644
> --- a/drivers/net/ice/ice_hash.c
> +++ b/drivers/net/ice/ice_hash.c
> @@ -1049,13 +1049,41 @@ struct ice_hash_match_type ice_hash_type_list[] =
> {
>  			combine_type = ETH_RSS_L2_SRC_ONLY |
>  					ETH_RSS_L2_DST_ONLY |
>  					RTE_ETH_RSS_L3_PRE32    |
> +					RTE_ETH_RSS_L3_PRE40	|
>  					RTE_ETH_RSS_L3_PRE48    |
> +					RTE_ETH_RSS_L3_PRE56	|
>  					RTE_ETH_RSS_L3_PRE64    |
> +					RTE_ETH_RSS_L3_PRE96	|
>  					ETH_RSS_L3_SRC_ONLY |
>  					ETH_RSS_L3_DST_ONLY |
>  					ETH_RSS_L4_SRC_ONLY |
>  					ETH_RSS_L4_DST_ONLY;

Do we support 48, 56 and 96?  Will they already be rejected during previous check?

Better to refactor the code to avoid duplicate, for example:

 rss_attr_src_dst = ETH_RSS_L2_DST_ONLY | ETH_RSS_L2_SRC_ONLY....

 rss_attr_l3_pre = ETH_RSS_L3_PRE32 | PRE_40 | ...

 rss_attr_all = rss_attr_v6_prefix | rss_attr_src_dst


> 
> +			/* Check if only SRC/DST_ONLY or ipv6 prefix exists. */
> +			if ((rss_type & ~combine_type) == 0)
> +				return rte_flow_error_set(error, ENOTSUP,
> +					RTE_FLOW_ERROR_TYPE_ACTION, action,
> +					"invalid rss types");
> +
> +			/**
> +			 * Check if SRC/DST_ONLY is set for SYMMETRIC_TOEPLITZ
> +			 * hash function.
> +			 */
> +			if (rss->func ==
> +				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) {
> +				if (rss_type & (ETH_RSS_L2_SRC_ONLY |
> +						ETH_RSS_L2_DST_ONLY |
> +						ETH_RSS_L3_SRC_ONLY |
> +						ETH_RSS_L3_DST_ONLY |
> +						ETH_RSS_L4_SRC_ONLY |
> +						ETH_RSS_L4_DST_ONLY))
> +					return rte_flow_error_set(error,
> +						ENOTSUP,
> +						RTE_FLOW_ERROR_TYPE_ACTION,
> +						action,
> +						"invalid rss types");
> +			}
> +
>  			/* Check if rss types match pattern. */
>  			if (rss_type & ~combine_type & ~m->eth_rss_hint) {
>  				return rte_flow_error_set(error,
> --
> 1.8.3.1


  reply	other threads:[~2020-07-15 14:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09  6:26 [dpdk-dev] [PATCH] " Simei Su
2020-07-09  6:46 ` Zhang, Qi Z
2020-07-09  7:32   ` Su, Simei
2020-07-09  7:50 ` [dpdk-dev] [PATCH v2] " Simei Su
2020-07-11 14:01   ` [dpdk-dev] [PATCH v3] " Simei Su
2020-07-15 10:25     ` [dpdk-dev] [PATCH v4] " Simei Su
2020-07-15 14:13       ` Zhang, Qi Z [this message]
2020-07-16  3:01         ` Su, Simei
2020-07-16  3:24       ` [dpdk-dev] [PATCH v5] " Simei Su
2020-07-16  3:33         ` 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=039ED4275CED7440929022BC67E706115485D6EC@SHSMSX103.ccr.corp.intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=jia.guo@intel.com \
    --cc=junfeng.guo@intel.com \
    --cc=simei.su@intel.com \
    --cc=ting.xu@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).