From: Lijun Ou <oulijun@huawei.com>
To: <wenzhuo.lu@intel.com>, <beilei.xing@intel.com>,
<adrien.mazarguil@6wind.com>, <ferruh.yigit@intel.com>
Cc: <dev@dpdk.org>, <linuxarm@huawei.com>
Subject: [dpdk-dev] [PATCH] app/testpmd: set default RSS key as null
Date: Wed, 21 Oct 2020 18:07:10 +0800 [thread overview]
Message-ID: <1603274830-25490-1-git-send-email-oulijun@huawei.com> (raw)
In-Reply-To: <1602765018-29810-1-git-send-email-oulijun@huawei.com>
From: Ophir Munk <ophirmu@mellanox.com>
When creating an RSS rule without specifying a key (see [1]) it is
expected that the device will use the default key.
A NULL key is used to indicate to a PMD it should use
its default key, however testpmd assigns a non-NULL dummy key
(see [2]) instead.
This does not enable testing any PMD behavior when the RSS key is not
specified. This commit fixes this limitation by setting key to NULL.
Also, it fixes the Scenario [3] that enable default RSS action by
setting key=NULL and key_len!=0.
[1]
RSS rule example without specifying a key:
flow create 0 ingress <pattern> / end actions rss queues 0 1 end / end
[2]
Testpmd default key assignment:
.key= "testpmd's default RSS hash key, "
"override it for better balancing"
[3]
flow create 0 <pattern> actions rss queues 0 1 end key_len 40 / end
fixes refer to the link: https://patches.dpdk.org/patch/80898/
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
app/test-pmd/cmdline_flow.c | 19 ++-----------------
lib/librte_ethdev/rte_flow.c | 2 +-
2 files changed, 3 insertions(+), 18 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index cd35d5b..3d1dd05 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -4850,30 +4850,15 @@ parse_vc_action_rss(struct context *ctx, const struct token *token,
.func = RTE_ETH_HASH_FUNCTION_DEFAULT,
.level = 0,
.types = rss_hf,
- .key_len = sizeof(action_rss_data->key),
+ .key_len = 0,
.queue_num = RTE_MIN(nb_rxq, ACTION_RSS_QUEUE_NUM),
- .key = action_rss_data->key,
+ .key = NULL,
.queue = action_rss_data->queue,
},
- .key = "testpmd's default RSS hash key, "
- "override it for better balancing",
.queue = { 0 },
};
for (i = 0; i < action_rss_data->conf.queue_num; ++i)
action_rss_data->queue[i] = i;
- if (!port_id_is_invalid(ctx->port, DISABLED_WARN) &&
- ctx->port != (portid_t)RTE_PORT_ALL) {
- struct rte_eth_dev_info info;
- int ret2;
-
- ret2 = rte_eth_dev_info_get(ctx->port, &info);
- if (ret2 != 0)
- return ret2;
-
- action_rss_data->conf.key_len =
- RTE_MIN(sizeof(action_rss_data->key),
- info.hash_key_size);
- }
action->conf = &action_rss_data->conf;
return ret;
}
diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c
index d3e5cbc..a06f64c 100644
--- a/lib/librte_ethdev/rte_flow.c
+++ b/lib/librte_ethdev/rte_flow.c
@@ -577,7 +577,7 @@ rte_flow_conv_action_conf(void *buf, const size_t size,
}),
size > sizeof(*dst.rss) ? sizeof(*dst.rss) : size);
off = sizeof(*dst.rss);
- if (src.rss->key_len) {
+ if (src.rss->key_len && src.rss->key) {
off = RTE_ALIGN_CEIL(off, sizeof(*dst.rss->key));
tmp = sizeof(*src.rss->key) * src.rss->key_len;
if (size >= off + tmp)
--
2.7.4
next prev parent reply other threads:[~2020-10-21 10:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-15 12:30 [dpdk-dev] [PATCH v5] app/testpmd: fix the default RSS key configuration Lijun Ou
2020-10-21 10:07 ` Lijun Ou [this message]
2020-10-26 10:36 ` [dpdk-dev] [PATCH] app/testpmd: set default RSS key as null Ferruh Yigit
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=1603274830-25490-1-git-send-email-oulijun@huawei.com \
--to=oulijun@huawei.com \
--cc=adrien.mazarguil@6wind.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=linuxarm@huawei.com \
--cc=wenzhuo.lu@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).