DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Jeff Guo <jia.guo@intel.com>,
	qi.z.zhang@intel.com, qiming.yang@intel.com
Cc: dev@dpdk.org, jingjing.wu@intel.com, junfeng.guo@intel.com,
	beilei.xing@intel.com, simei.su@intel.com
Subject: Re: [dpdk-dev] [dpdk-dev v5 1/4] net/ice: refactor for pf hash flow
Date: Tue, 7 Jul 2020 15:24:57 +0100
Message-ID: <d9d4e9f1-a0a5-c15f-dc81-46c9e8e7aef9@intel.com> (raw)
In-Reply-To: <20200707052546.14151-2-jia.guo@intel.com>

On 7/7/2020 6:25 AM, Jeff Guo wrote:
> Refactor hash flow by change the action parser and clean some code.
> 
> Signed-off-by: Jeff Guo <jia.guo@intel.com>

<...>

> @@ -333,46 +507,24 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
>  		switch (action_type) {
>  		case RTE_FLOW_ACTION_TYPE_RSS:
>  			rss = action->conf;
> -			rss_hf = rss->types;
> -
> -			/**
> -			 * Check simultaneous use of SRC_ONLY and DST_ONLY
> -			 * of the same level.
> -			 */
> -			rss_hf = rte_eth_rss_hf_refine(rss_hf);
> +			rss_type = rss->types;
>  
> -			/* Check if pattern is empty. */
> +			/* Check hash function and save it to rss_meta. */
>  			if (pattern_match_item->pattern_list !=
> -				pattern_empty && rss->func ==
> -				RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)
> +			    pattern_empty && rss->func ==
> +			    RTE_ETH_HASH_FUNCTION_SIMPLE_XOR) {
>  				return rte_flow_error_set(error, ENOTSUP,
>  					RTE_FLOW_ERROR_TYPE_ACTION, action,
>  					"Not supported flow");
> -
> -			if ((rss_hf & ETH_RSS_ETH) && (rss_hf & ~ETH_RSS_PPPOE))
> -				m->eth_rss_hint = ETH_RSS_ETH;
> -			else if ((rss_hf & ETH_RSS_PPPOE) && (rss_hf & ~ETH_RSS_ETH))
> -				m->eth_rss_hint = ETH_RSS_PPPOE;
> -			else if ((rss_hf & ETH_RSS_ETH) && (rss_hf & ETH_RSS_PPPOE))
> -				m->eth_rss_hint = ETH_RSS_ETH | ETH_RSS_PPPOE;
> -
> -			/* Check if rss types match pattern. */
> -			if (rss->func != RTE_ETH_HASH_FUNCTION_SIMPLE_XOR) {
> -				if (((rss_hf & ETH_RSS_IPV4) != m->eth_rss_hint) &&
> -				((rss_hf & ETH_RSS_NONFRAG_IPV4_UDP) != m->eth_rss_hint) &&
> -				((rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) != m->eth_rss_hint) &&
> -				((rss_hf & ETH_RSS_NONFRAG_IPV4_SCTP) != m->eth_rss_hint) &&
> -				((rss_hf & ETH_RSS_IPV6) != m->eth_rss_hint) &&
> -				((rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) != m->eth_rss_hint) &&
> -				((rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) != m->eth_rss_hint) &&
> -				((rss_hf & ETH_RSS_NONFRAG_IPV6_SCTP) != m->eth_rss_hint) &&
> -				((rss_hf & ETH_RSS_ETH) != m->eth_rss_hint) &&
> -				((rss_hf & ETH_RSS_PPPOE) != m->eth_rss_hint) &&
> -				(((rss_hf & (ETH_RSS_ETH | ETH_RSS_PPPOE)) !=
> -									m->eth_rss_hint)))
> -					return rte_flow_error_set(error,
> -					ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,
> -					action, "Not supported RSS types");
> +			} else if (rss->func ==
> +				   RTE_ETH_HASH_FUNCTION_SIMPLE_XOR){
> +				((struct rss_meta *)*meta)->hash_function =
> +				RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
> +				return 0;
> +			} else if (rss->func ==
> +				   RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) {
> +				((struct rss_meta *)*meta)->hash_function =
> +				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;
>  			}
>  
>  			if (rss->level)
> @@ -390,42 +542,38 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
>  					RTE_FLOW_ERROR_TYPE_ACTION, action,
>  					"a non-NULL RSS queue is not supported");
>  
> -			/* Check hash function and save it to rss_meta. */
> -			if (rss->func ==
> -				RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)
> -				((struct rss_meta *)*meta)->hash_function =
> -				RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
> +			/**
> +			 * Check simultaneous use of SRC_ONLY and DST_ONLY
> +			 * of the same level.
> +			 */
> +			rss_type = rte_eth_rss_hf_refine(rss_type);
>  
> -			if (rss->func ==
> -				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
> -				((struct rss_meta *)*meta)->hash_function =
> -				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;
> +			uint64_t combine_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;


Declaring and initializing a varible in switch case causing warning with icc
[1], I will fix this while mergin by moving declaration out of switch.

[1]
.../dpdk/drivers/net/ice/ice_hash.c(672):
   warning #589: transfer of control bypasses initialization of:
            variable "combine_type" (declared at line 716)
                switch (action_type) {
                ^

<...>

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

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-12  2:57 [dpdk-dev] net/ice: enable new input set for rss hash Jeff Guo
2020-06-14 15:08 ` [dpdk-dev] [dpdk-dev v2] " Jeff Guo
2020-06-21 14:09   ` [dpdk-dev] [dpdk-dev v3 1/2] app/testpmd: add GTPU to RSS hash commands Jeff Guo
2020-06-21 14:09     ` [dpdk-dev] [dpdk-dev v3 2/2] net/ice: enable new input set for rss hash Jeff Guo
2020-07-01 13:02       ` Zhang, Qi Z
2020-07-03  3:53         ` Jeff Guo
2020-07-03  3:58       ` [dpdk-dev] [dpdk-dev v4 0/4] enable new hash flow for pf Jeff Guo
2020-07-03  3:58         ` [dpdk-dev] [dpdk-dev v4 1/4] net/ice: refactor for pf hash flow Jeff Guo
2020-07-03  3:58         ` [dpdk-dev] [dpdk-dev v4 2/4] net/ice: support hash for new GTPU protocols Jeff Guo
2020-07-03  3:58         ` [dpdk-dev] [dpdk-dev v4 3/4] net/ice: enable new input set for rss hash Jeff Guo
2020-07-03  3:58         ` [dpdk-dev] [dpdk-dev v4 4/4] app/testpmd: add GTPU to RSS hash commands Jeff Guo
2020-07-07  5:25       ` [dpdk-dev] [dpdk-dev v5 0/4] enable new hash flow for pf Jeff Guo
2020-07-07  5:25         ` [dpdk-dev] [dpdk-dev v5 1/4] net/ice: refactor for pf hash flow Jeff Guo
2020-07-07 14:24           ` Ferruh Yigit [this message]
2020-07-07  5:25         ` [dpdk-dev] [dpdk-dev v5 2/4] net/ice: support hash for new GTPU protocols Jeff Guo
2020-07-07  5:25         ` [dpdk-dev] [dpdk-dev v5 3/4] net/ice: enable new input set for rss hash Jeff Guo
2020-07-07  5:25         ` [dpdk-dev] [dpdk-dev v5 4/4] app/testpmd: add GTPU to RSS hash commands Jeff Guo
2020-07-07  9:31         ` [dpdk-dev] [dpdk-dev v5 0/4] enable new hash flow for pf 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=d9d4e9f1-a0a5-c15f-dc81-46c9e8e7aef9@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jia.guo@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=junfeng.guo@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=simei.su@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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/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 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

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


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