[v2] app/testpmd: fix RSS key
Checks
Commit Message
From: Alvin Zhang <alvinx.zhang@intel.com>
Since the patch '1848b117' has initialized the variable 'key' in
'struct rte_flow_action_rss' with 'NULL', the PMD cannot get the
RSS key now. Details as bellow:
testpmd> flow create 0 ingress pattern eth / ipv4 / end actions
rss types ipv4-other end key
1234567890123456789012345678901234567890FFFFFFFFFFFF123
4567890123456789012345678901234567890FFFFFFFFFFFF
queues end / end
Flow rule #1 created
testpmd> show port 0 rss-hash key
RSS functions:
all ipv4-other ip
RSS key:
4439796BB54C5023B675EA5B124F9F30B8A2C03DDFDC4D02A08C9B3
34AF64A4C05C6FA343958D8557D99583AE138C92E81150366
This patch sets offset and size of the 'key' variable as the first
parameter of the token 'key'. Later, the address of the RSS key will
be copied to 'key' variable.
Fixes: 1848b117cca1 ("app/testpmd: fix RSS key for flow API RSS rule")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
app/test-pmd/cmdline_flow.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
Tested-by: Zhou, Jun <junx.w.zhou@intel.com>
-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang,Alvin
Sent: Thursday, January 21, 2021 5:42 PM
To: Yigit, Ferruh <ferruh.yigit@intel.com>
Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>; stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix RSS key
From: Alvin Zhang <alvinx.zhang@intel.com>
Since the patch '1848b117' has initialized the variable 'key' in 'struct rte_flow_action_rss' with 'NULL', the PMD cannot get the RSS key now. Details as bellow:
testpmd> flow create 0 ingress pattern eth / ipv4 / end actions
rss types ipv4-other end key
1234567890123456789012345678901234567890FFFFFFFFFFFF123
4567890123456789012345678901234567890FFFFFFFFFFFF
queues end / end
Flow rule #1 created
testpmd> show port 0 rss-hash key
RSS functions:
all ipv4-other ip
RSS key:
4439796BB54C5023B675EA5B124F9F30B8A2C03DDFDC4D02A08C9B3
34AF64A4C05C6FA343958D8557D99583AE138C92E81150366
This patch sets offset and size of the 'key' variable as the first parameter of the token 'key'. Later, the address of the RSS key will be copied to 'key' variable.
Fixes: 1848b117cca1 ("app/testpmd: fix RSS key for flow API RSS rule")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
app/test-pmd/cmdline_flow.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 0618611..067e120 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -3541,7 +3541,10 @@ static int comp_set_modify_field_id(struct context *, const struct token *,
.name = "key",
.help = "RSS hash key",
.next = NEXT(action_rss, NEXT_ENTRY(HEX)),
- .args = ARGS(ARGS_ENTRY_ARB(0, 0),
+ .args = ARGS(ARGS_ENTRY_ARB
+ (offsetof(struct action_rss_data, conf) +
+ offsetof(struct rte_flow_action_rss, key),
+ sizeof(((struct rte_flow_action_rss *)0)->key)),
ARGS_ENTRY_ARB
(offsetof(struct action_rss_data, conf) +
offsetof(struct rte_flow_action_rss, key_len),
--
1.8.3.1
On 1/22/2021 5:43 AM, Zhou, JunX W wrote:
<...>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang,Alvin
> Sent: Thursday, January 21, 2021 5:42 PM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix RSS key
>
> From: Alvin Zhang <alvinx.zhang@intel.com>
>
> Since the patch '1848b117' has initialized the variable 'key' in 'struct rte_flow_action_rss' with 'NULL', the PMD cannot get the RSS key now. Details as bellow:
>
> testpmd> flow create 0 ingress pattern eth / ipv4 / end actions
> rss types ipv4-other end key
> 1234567890123456789012345678901234567890FFFFFFFFFFFF123
> 4567890123456789012345678901234567890FFFFFFFFFFFF
> queues end / end
> Flow rule #1 created
> testpmd> show port 0 rss-hash key
> RSS functions:
> all ipv4-other ip
> RSS key:
> 4439796BB54C5023B675EA5B124F9F30B8A2C03DDFDC4D02A08C9B3
> 34AF64A4C05C6FA343958D8557D99583AE138C92E81150366
>
> This patch sets offset and size of the 'key' variable as the first parameter of the token 'key'. Later, the address of the RSS key will be copied to 'key' variable.
>
> Fixes: 1848b117cca1 ("app/testpmd: fix RSS key for flow API RSS rule")
> Cc: stable@dpdk.org
>
> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
>
> Tested-by: Zhou, Jun <junx.w.zhou@intel.com>
>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied to dpdk-next-net/main, thanks.
@@ -3541,7 +3541,10 @@ static int comp_set_modify_field_id(struct context *, const struct token *,
.name = "key",
.help = "RSS hash key",
.next = NEXT(action_rss, NEXT_ENTRY(HEX)),
- .args = ARGS(ARGS_ENTRY_ARB(0, 0),
+ .args = ARGS(ARGS_ENTRY_ARB
+ (offsetof(struct action_rss_data, conf) +
+ offsetof(struct rte_flow_action_rss, key),
+ sizeof(((struct rte_flow_action_rss *)0)->key)),
ARGS_ENTRY_ARB
(offsetof(struct action_rss_data, conf) +
offsetof(struct rte_flow_action_rss, key_len),