* [dpdk-dev] [PATCH] net/iavf: fix invalid RSS type
@ 2020-10-30 3:16 Simei Su
2020-10-30 9:41 ` Zhang, Qi Z
2020-11-02 2:04 ` [dpdk-dev] [PATCH v2] " Simei Su
0 siblings, 2 replies; 7+ messages in thread
From: Simei Su @ 2020-10-30 3:16 UTC (permalink / raw)
To: qi.z.zhang; +Cc: dev, jia.guo, junfeng.guo, Simei Su
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");
+ }
+
if (iavf_any_invalid_rss_type(rss_type,
match_item->input_set_mask))
return rte_flow_error_set(error, ENOTSUP,
--
2.9.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] net/iavf: fix invalid RSS type
2020-10-30 3:16 [dpdk-dev] [PATCH] net/iavf: fix invalid RSS type Simei Su
@ 2020-10-30 9:41 ` Zhang, Qi Z
2020-11-02 2:11 ` Su, Simei
2020-11-02 2:04 ` [dpdk-dev] [PATCH v2] " Simei Su
1 sibling, 1 reply; 7+ messages in thread
From: Zhang, Qi Z @ 2020-10-30 9:41 UTC (permalink / raw)
To: Su, Simei; +Cc: dev, Guo, Jia, Guo, Junfeng
> -----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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH v2] net/iavf: fix invalid RSS type
2020-10-30 3:16 [dpdk-dev] [PATCH] net/iavf: fix invalid RSS type Simei Su
2020-10-30 9:41 ` Zhang, Qi Z
@ 2020-11-02 2:04 ` Simei Su
2020-11-02 11:39 ` [dpdk-dev] [PATCH v3] " Simei Su
1 sibling, 1 reply; 7+ messages in thread
From: Simei Su @ 2020-11-02 2:04 UTC (permalink / raw)
To: qi.z.zhang; +Cc: dev, junfeng.guo, jia.guo, Simei Su
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, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index be821b6..c58566c 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -834,10 +834,22 @@ static struct rss_attr_type rss_attr_to_valid_type[] = {
};
static bool
-iavf_any_invalid_rss_type(uint64_t rss_type, uint64_t allow_rss_type)
+iavf_any_invalid_rss_type(enum rte_eth_hash_function func,
+ uint64_t rss_type, uint64_t allow_rss_type)
{
uint32_t i;
+ /**
+ * Check if SRC/DST_ONLY is set for SYMMETRIC_TOEPLITZ
+ * hash function.
+ */
+ if (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 true;
+ }
+
/* check invalid combination */
for (i = 0; i < RTE_DIM(invalid_rss_comb); i++) {
if (__builtin_popcountll(rss_type & invalid_rss_comb[i]) > 1)
@@ -917,7 +929,7 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *match_item,
*/
rss_type = rte_eth_rss_hf_refine(rss_type);
- if (iavf_any_invalid_rss_type(rss_type,
+ if (iavf_any_invalid_rss_type(rss->func, rss_type,
match_item->input_set_mask))
return rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ACTION,
--
2.9.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] net/iavf: fix invalid RSS type
2020-10-30 9:41 ` Zhang, Qi Z
@ 2020-11-02 2:11 ` Su, Simei
0 siblings, 0 replies; 7+ messages in thread
From: Su, Simei @ 2020-11-02 2:11 UTC (permalink / raw)
To: Zhang, Qi Z; +Cc: dev, Guo, Jia, Guo, Junfeng
> -----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
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH v3] net/iavf: fix invalid RSS type
2020-11-02 2:04 ` [dpdk-dev] [PATCH v2] " Simei Su
@ 2020-11-02 11:39 ` Simei Su
2020-11-02 11:55 ` [dpdk-dev] [PATCH v4] " Simei Su
0 siblings, 1 reply; 7+ messages in thread
From: Simei Su @ 2020-11-02 11:39 UTC (permalink / raw)
To: qi.z.zhang; +Cc: dev, junfeng.guo, jia.guo, Simei Su
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>
v3:
* correct invalid case.
v2:
* move invalid check into "iavf_any_invalid_rss_type".
---
drivers/net/iavf/iavf_hash.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index be821b6..c7fef5b 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -834,10 +834,22 @@ static struct rss_attr_type rss_attr_to_valid_type[] = {
};
static bool
-iavf_any_invalid_rss_type(uint64_t rss_type, uint64_t allow_rss_type)
+iavf_any_invalid_rss_type(enum rte_eth_hash_function func,
+ uint64_t rss_type, uint64_t allow_rss_type)
{
uint32_t i;
+ /**
+ * Check if SRC/DST_ONLY is set for SYMMETRIC_TOEPLITZ
+ * hash function.
+ */
+ if (func == RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) {
+ if (rss_type & (VALID_RSS_ATTR &
+ ~(RTE_ETH_RSS_L3_PRE64 | ETH_RSS_L2_SRC_ONLY |
+ ETH_RSS_L2_DST_ONLY)))
+ return true;
+ }
+
/* check invalid combination */
for (i = 0; i < RTE_DIM(invalid_rss_comb); i++) {
if (__builtin_popcountll(rss_type & invalid_rss_comb[i]) > 1)
@@ -917,7 +929,7 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *match_item,
*/
rss_type = rte_eth_rss_hf_refine(rss_type);
- if (iavf_any_invalid_rss_type(rss_type,
+ if (iavf_any_invalid_rss_type(rss->func, rss_type,
match_item->input_set_mask))
return rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ACTION,
--
2.9.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH v4] net/iavf: fix invalid RSS type
2020-11-02 11:39 ` [dpdk-dev] [PATCH v3] " Simei Su
@ 2020-11-02 11:55 ` Simei Su
2020-11-02 12:18 ` Zhang, Qi Z
0 siblings, 1 reply; 7+ messages in thread
From: Simei Su @ 2020-11-02 11:55 UTC (permalink / raw)
To: qi.z.zhang; +Cc: dev, junfeng.guo, jia.guo, Simei Su
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>
v4:
* Simplify code to be more readable.
v3:
* Correct invalid case.
v2:
* Move invalid check into "iavf_any_invalid_rss_type".
---
drivers/net/iavf/iavf_hash.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index be821b6..915b7c5 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -834,10 +834,21 @@ static struct rss_attr_type rss_attr_to_valid_type[] = {
};
static bool
-iavf_any_invalid_rss_type(uint64_t rss_type, uint64_t allow_rss_type)
+iavf_any_invalid_rss_type(enum rte_eth_hash_function rss_func,
+ uint64_t rss_type, uint64_t allow_rss_type)
{
uint32_t i;
+ /**
+ * 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_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY |
+ ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY))
+ return true;
+ }
+
/* check invalid combination */
for (i = 0; i < RTE_DIM(invalid_rss_comb); i++) {
if (__builtin_popcountll(rss_type & invalid_rss_comb[i]) > 1)
@@ -917,7 +928,7 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *match_item,
*/
rss_type = rte_eth_rss_hf_refine(rss_type);
- if (iavf_any_invalid_rss_type(rss_type,
+ if (iavf_any_invalid_rss_type(rss->func, rss_type,
match_item->input_set_mask))
return rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ACTION,
--
2.9.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v4] net/iavf: fix invalid RSS type
2020-11-02 11:55 ` [dpdk-dev] [PATCH v4] " Simei Su
@ 2020-11-02 12:18 ` Zhang, Qi Z
0 siblings, 0 replies; 7+ messages in thread
From: Zhang, Qi Z @ 2020-11-02 12:18 UTC (permalink / raw)
To: Su, Simei; +Cc: dev, Guo, Junfeng, Guo, Jia
> -----Original Message-----
> From: Su, Simei <simei.su@intel.com>
> Sent: Monday, November 2, 2020 7:56 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>; Su, Simei <simei.su@intel.com>
> Subject: [PATCH v4] 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.
Need to specify l3/l4 SRC/DST_ONLY
>
> Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")
>
> Signed-off-by: Simei Su <simei.su@intel.com>
>
> v4:
> * Simplify code to be more readable.
>
> v3:
> * Correct invalid case.
>
> v2:
> * Move invalid check into "iavf_any_invalid_rss_type".
Version tracking should not be part of the commit log.
> ---
> drivers/net/iavf/iavf_hash.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> be821b6..915b7c5 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -834,10 +834,21 @@ static struct rss_attr_type rss_attr_to_valid_type[] =
> { };
>
> static bool
> -iavf_any_invalid_rss_type(uint64_t rss_type, uint64_t allow_rss_type)
> +iavf_any_invalid_rss_type(enum rte_eth_hash_function rss_func,
> + uint64_t rss_type, uint64_t allow_rss_type)
> {
> uint32_t i;
>
> + /**
> + * Check if SRC/DST_ONLY is set for SYMMETRIC_TOEPLITZ
> + * hash function.
Need to specifyl3/l4 SRC/DST_ONLY
> + */
> + if (rss_func == RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) {
> + if (rss_type & (ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY |
> + ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY))
> + return true;
> + }
> +
> /* check invalid combination */
> for (i = 0; i < RTE_DIM(invalid_rss_comb); i++) {
> if (__builtin_popcountll(rss_type & invalid_rss_comb[i]) > 1) @@
> -917,7 +928,7 @@ iavf_hash_parse_action(struct iavf_pattern_match_item
> *match_item,
> */
> rss_type = rte_eth_rss_hf_refine(rss_type);
>
> - if (iavf_any_invalid_rss_type(rss_type,
> + if (iavf_any_invalid_rss_type(rss->func, rss_type,
> match_item->input_set_mask))
> return rte_flow_error_set(error, ENOTSUP,
> RTE_FLOW_ERROR_TYPE_ACTION,
> --
> 2.9.5
Besides above minor captures
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel after fix those captures.
Thanks
Qi
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-11-02 12:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30 3:16 [dpdk-dev] [PATCH] net/iavf: fix invalid RSS type Simei Su
2020-10-30 9:41 ` Zhang, Qi Z
2020-11-02 2:11 ` Su, Simei
2020-11-02 2:04 ` [dpdk-dev] [PATCH v2] " Simei Su
2020-11-02 11:39 ` [dpdk-dev] [PATCH v3] " Simei Su
2020-11-02 11:55 ` [dpdk-dev] [PATCH v4] " Simei Su
2020-11-02 12:18 ` Zhang, Qi Z
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).