From: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>, ferruh.yigit@intel.com
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
dev@dpdk.org, chenbo.xia@intel.com, amorenoz@redhat.com,
david.marchand@redhat.com, michaelba@nvidia.com,
viacheslavo@nvidia.com, stable@dpdk.org,
Shahaf Shuler <shahafs@nvidia.com>
Subject: Re: [dpdk-stable] [PATCH 2/3] app/testpmd: fix RSS hash type update
Date: Tue, 14 Sep 2021 09:20:14 +0200 [thread overview]
Message-ID: <YUBNLgeG+cIpeiKS@acdc.dev.6wind.com> (raw)
In-Reply-To: <1daeb2f2-2122-c546-3eb4-f0d7fba035f0@redhat.com>
+Shahaf,
Hi Maxime,
On Mon, Sep 13, 2021 at 11:41:04AM +0200, Maxime Coquelin wrote:
> Hi Nélio,
>
> On 9/10/21 4:16 PM, Nélio Laranjeiro wrote:
> > On Fri, Sep 10, 2021 at 01:06:53PM +0300, Andrew Rybchenko wrote:
> >> On 9/10/21 12:57 PM, Maxime Coquelin wrote:
> >>>
> >>>
> >>> On 9/10/21 11:51 AM, Andrew Rybchenko wrote:
> >>>> On 9/10/21 12:17 PM, Maxime Coquelin wrote:
> >>>>> port_rss_hash_key_update() initializes rss_conf with the
> >>>>> RSS hash type and key provided by the user, but it calls
> >>>>> rte_eth_dev_rss_hash_conf_get() before calling
> >>>>> rte_eth_dev_rss_hash_update(), which overides the parsed
> >>>>> config with current NIC's config.
> >>>>>
> >>>>> While the RSS key value is set again after, this is not
> >>>>> the case of the key length and the type of hash.
> >>>>>
> >>>>> There is no need to read the RSS config from the NIC, let's
> >>>>> just try to set the user defined one.
> >>>>>
> >>>>> Fixes: 8205e241b2b0 ("app/testpmd: add missing type to RSS hash commands")
> >>>>> Cc: stable@dpdk.org
> >>>>> Cc: nelio.laranjeiro@6wind.com
> >>>>>
> >>>>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >>>>> ---
> >>>>> app/test-pmd/config.c | 8 ++------
> >>>>> 1 file changed, 2 insertions(+), 6 deletions(-)
> >>>>>
> >>>>> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> >>>>> index 31d8ba1b91..451bda53b1 100644
> >>>>> --- a/app/test-pmd/config.c
> >>>>> +++ b/app/test-pmd/config.c
> >>>>> @@ -2853,18 +2853,14 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,
> >>>>> int diag;
> >>>>> unsigned int i;
> >>>>>
> >>>>> - rss_conf.rss_key = NULL;
> >>>>> + rss_conf.rss_key = hash_key;
> >>>>> rss_conf.rss_key_len = hash_key_len;
> >>>>> rss_conf.rss_hf = 0;
> >>>>> for (i = 0; rss_type_table[i].str; i++) {
> >>>>> if (!strcmp(rss_type_table[i].str, rss_type))
> >>>>> rss_conf.rss_hf = rss_type_table[i].rss_type;
> >>>>> }
> >>>>> - diag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf);
> >>>>> - if (diag == 0) {
> >>>>> - rss_conf.rss_key = hash_key;
> >>>>> - diag = rte_eth_dev_rss_hash_update(port_id, &rss_conf);
> >>>>> - }
> >>>>> + diag = rte_eth_dev_rss_hash_update(port_id, &rss_conf);
> >>>>
> >>>> I'm not 100% sure, but I'd say the intent above could be
> >>>> to update key only as the function name says. I.e. keep
> >>>> rss_hf as is. That could be the reason to get first.
> >
> > True,
> >
> >>> I think that was the intial purpose of the command, but patch
> >>> 8205e241b2b0 added setting the hash type as mandatory. There are
> >>> no other command to configure the hash type from testpmd AFAICT.
> >
> > Also for the same initial purpose, some NIC have an hash key per
> > protocol, by default it uses the same key for all of them but it can be
> > configured individually making for example key0 for all protocols expect
> > IPv4 which uses key1.
>
> Thanks for the info, I have looked at most drivers but didn't found one
> that support this feature, could you give some pointer?
Well, I have done the modification at that time for MLX5 PMD, since I
left DPDK in 2018 I don't know if they still support such configuration
from this API or if they fully moved to rte_flow.
> Given how the drivers implément the callback, do you agree with the fix,
> or do you have something else in mind?
I cannot answer if this get() is mandatory, this predates my arrival on
DPDK (original commit written in 2014), looking at DPDK state on
commit f79959ea1504 ("app/testpmd: allow to configure RSS hash key").
Maybe someone from Intel can help, eventually you can contact PMD
maintainers to review this patch.
Regards,
Nélio
> Thanks,
> Maxime
>
> >>> Also, even without 8205e241b2b0, the function was broken because the
> >>> key length was overiden.
> >>
> >> I see, many thanks for explanations.
> >
>
--
Nélio Laranjeiro
6WIND
next prev parent reply other threads:[~2021-09-14 7:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 9:17 [dpdk-stable] [PATCH 0/3] Virtio PMD RSS support & RSS fixes Maxime Coquelin
2021-09-10 9:17 ` [dpdk-stable] [PATCH 1/3] net/virtio: add initial RSS support Maxime Coquelin
2021-09-10 10:06 ` Andrew Rybchenko
2021-09-10 11:44 ` Maxime Coquelin
2021-09-10 12:58 ` Andrew Rybchenko
2021-09-10 13:10 ` Maxime Coquelin
2021-09-10 9:17 ` [dpdk-stable] [PATCH 2/3] app/testpmd: fix RSS hash type update Maxime Coquelin
2021-09-10 9:51 ` Andrew Rybchenko
2021-09-10 9:57 ` Maxime Coquelin
2021-09-10 10:06 ` Andrew Rybchenko
2021-09-10 14:16 ` Nélio Laranjeiro
2021-09-13 9:41 ` Maxime Coquelin
2021-09-14 7:20 ` Nélio Laranjeiro [this message]
2021-09-16 3:03 ` Li, Xiaoyun
2021-09-16 7:33 ` Maxime Coquelin
2021-09-16 7:41 ` Li, Xiaoyun
2021-09-16 8:08 ` Maxime Coquelin
2021-09-16 8:30 ` Li, Xiaoyun
2021-09-10 9:17 ` [dpdk-stable] [PATCH 3/3] net/mlx5: Fix RSS RETA update Maxime Coquelin
2021-09-21 9:55 ` Slava Ovsiienko
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=YUBNLgeG+cIpeiKS@acdc.dev.6wind.com \
--to=nelio.laranjeiro@6wind.com \
--cc=amorenoz@redhat.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=chenbo.xia@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=michaelba@nvidia.com \
--cc=shahafs@nvidia.com \
--cc=stable@dpdk.org \
--cc=viacheslavo@nvidia.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).