net/iavf: fix invalid RSS type
diff mbox series

Message ID 20201030031638.370766-1-simei.su@intel.com
State Changes Requested, archived
Delegated to: Qi Zhang
Headers show
Series
  • net/iavf: fix invalid RSS type
Related show

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-testing fail Testing issues
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/checkpatch success coding style OK

Commit Message

Simei Su Oct. 30, 2020, 3:16 a.m. UTC
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 case.

Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")

Signed-off-by: Simei Su <simei.su@intel.com>
---
 drivers/net/iavf/iavf_hash.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Zhang, Qi Z Oct. 30, 2020, 9:41 a.m. UTC | #1
> -----Original Message-----
> From: Su, Simei <simei.su@intel.com>
> Sent: Friday, October 30, 2020 11:17 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Guo, Jia <jia.guo@intel.com>; Guo, Junfeng
> <junfeng.guo@intel.com>; Su, Simei <simei.su@intel.com>
> Subject: [PATCH] net/iavf: fix invalid RSS type
> 
> 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 case.
> 
> Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")
> 
> Signed-off-by: Simei Su <simei.su@intel.com>
> ---
>  drivers/net/iavf/iavf_hash.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> be821b6..6d0360a 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -917,6 +917,22 @@ iavf_hash_parse_action(struct
> iavf_pattern_match_item *match_item,
>  			 */
>  			rss_type = rte_eth_rss_hf_refine(rss_type);
> 
> +			/**
> +			 * Check if SRC/DST_ONLY is set for SYMMETRIC_TOEPLITZ
> +			 * hash function.
> +			 */
> +			if (rss->func ==
> +			    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) {
> +				if (rss_type & ((VALID_RSS_ATTR &
> +				    ~RTE_ETH_RSS_L3_PRE64) |
> +				    ~(VALID_RSS_IPV4 | VALID_RSS_IPV6)))
> +					return rte_flow_error_set(error,
> +						ENOTSUP,
> +						RTE_FLOW_ERROR_TYPE_ACTION,
> +						action,
> +						"invalid rss types");
> +			}

Better to move above check into the below "iavf_any_invalid_rss_type"

> +
>  			if (iavf_any_invalid_rss_type(rss_type,
>  					match_item->input_set_mask))
>  				return rte_flow_error_set(error, ENOTSUP,
> --
> 2.9.5
Simei Su Nov. 2, 2020, 2:11 a.m. UTC | #2
> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Friday, October 30, 2020 5:41 PM
> To: Su, Simei <simei.su@intel.com>
> Cc: dev@dpdk.org; Guo, Jia <jia.guo@intel.com>; Guo, Junfeng
> <junfeng.guo@intel.com>
> Subject: RE: [PATCH] net/iavf: fix invalid RSS type
> 
> 
> 
> > -----Original Message-----
> > From: Su, Simei <simei.su@intel.com>
> > Sent: Friday, October 30, 2020 11:17 AM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>
> > Cc: dev@dpdk.org; Guo, Jia <jia.guo@intel.com>; Guo, Junfeng
> > <junfeng.guo@intel.com>; Su, Simei <simei.su@intel.com>
> > Subject: [PATCH] net/iavf: fix invalid RSS type
> >
> > 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
> case.
> >
> > Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")
> >
> > Signed-off-by: Simei Su <simei.su@intel.com>
> > ---
> >  drivers/net/iavf/iavf_hash.c | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> >
> > diff --git a/drivers/net/iavf/iavf_hash.c
> > b/drivers/net/iavf/iavf_hash.c index be821b6..6d0360a 100644
> > --- a/drivers/net/iavf/iavf_hash.c
> > +++ b/drivers/net/iavf/iavf_hash.c
> > @@ -917,6 +917,22 @@ iavf_hash_parse_action(struct
> > iavf_pattern_match_item *match_item,
> >   */
> >  rss_type = rte_eth_rss_hf_refine(rss_type);
> >
> > +/**
> > + * Check if SRC/DST_ONLY is set for SYMMETRIC_TOEPLITZ
> > + * hash function.
> > + */
> > +if (rss->func ==
> > +    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) { if (rss_type &
> > +((VALID_RSS_ATTR &
> > +    ~RTE_ETH_RSS_L3_PRE64) |
> > +    ~(VALID_RSS_IPV4 | VALID_RSS_IPV6))) return
> > +rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,
> > +action, "invalid rss types"); }
> 
> Better to move above check into the below "iavf_any_invalid_rss_type"

  Ok, will move it into " iavf_any_invalid_rss_type" in v2.

> 
> > +
> >  if (iavf_any_invalid_rss_type(rss_type,
> >  match_item->input_set_mask))
> >  return rte_flow_error_set(error, ENOTSUP,
> > --
> > 2.9.5
>

Patch
diff mbox series

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index be821b6..6d0360a 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -917,6 +917,22 @@  iavf_hash_parse_action(struct iavf_pattern_match_item *match_item,
 			 */
 			rss_type = rte_eth_rss_hf_refine(rss_type);
 
+			/**
+			 * Check if SRC/DST_ONLY is set for SYMMETRIC_TOEPLITZ
+			 * hash function.
+			 */
+			if (rss->func ==
+			    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) {
+				if (rss_type & ((VALID_RSS_ATTR &
+				    ~RTE_ETH_RSS_L3_PRE64) |
+				    ~(VALID_RSS_IPV4 | VALID_RSS_IPV6)))
+					return rte_flow_error_set(error,
+						ENOTSUP,
+						RTE_FLOW_ERROR_TYPE_ACTION,
+						action,
+						"invalid rss types");
+			}
+
 			if (iavf_any_invalid_rss_type(rss_type,
 					match_item->input_set_mask))
 				return rte_flow_error_set(error, ENOTSUP,