From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DE377A0547; Fri, 10 Sep 2021 16:17:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC89E41150; Fri, 10 Sep 2021 16:17:20 +0200 (CEST) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id 0B430410FE for ; Fri, 10 Sep 2021 16:17:19 +0200 (CEST) Received: by mail-wr1-f44.google.com with SMTP id m9so2874514wrb.1 for ; Fri, 10 Sep 2021 07:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=Kn/YhHgDEdt6N8/6uT7vmoiBGdBJwWWzH+HeoFzBbpU=; b=KNEW44pFF2tDRQ0j14F8TBOx/rpCp7Rk0rDm8xpNOaf2Nlgso5zvPbAM/7xn3ih56I tymqHiadOblbi9pbL2wawxOw04uryIrrZ1yD7FJt5iKpEqg+Sjaap1LFpFEmTqRbg8BH eDVFf8XLJABVA7la4SQgxfyOln8rdkmNVhna1ZibhwLWfKRxrEKRZqJJycp6J1AGT4Cj /MLyVEc5huWV1G7RyBv4e7F8bnO7B/dJ0o8876O0kQaLf+1+XRjMMZFpfR9Zf3tFON5P 84jzANnXES+IY+EFt+xHm4lmSWeGiXquOiZwMH5OhTBj+v5RF3c2HfDjvn206vNyA9iG qGlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Kn/YhHgDEdt6N8/6uT7vmoiBGdBJwWWzH+HeoFzBbpU=; b=y94/q74WKnVqmZw6FT5SzQLJvPWF8EY/D/J5VUYfSvhN2ac/h0a1ndTL4trTQQmgXL 20McaEzL/4dq8DjOzAVRbaU2Jcl88Sikw7dgmDutsk5eKxk1Cu34+A9FCUhpYuMLKmQ+ gjhcb5TmQLjo1ZVD+dwHvhwo+gHPfxZNx/MrgnRpqg6oNRq2P15frIcWuMfuWfrx1gPM CxeE7qbj2HvoONKrIsKqYtZqZL6rXkvUpv+xJi3r7rkthfetxkg7cuyppnSCoN+NuanR x5AlrdsrmcrJ/p6jdSHxJShN/ye28tXk2Rl+av9nq4+ac4ssWLwT9vtN645TXAuoLzL2 OyEQ== X-Gm-Message-State: AOAM532ZqBkoNScHzWFPaTgcxZd6w/Gt6MRozOw/u5isK+WnW1lm1Q8C FmuveTR9aH+zsXS3IKspB15g X-Google-Smtp-Source: ABdhPJya0HVYbZZ4D+jBAeU0tJgHt8/EysqolJSSp2cKrdWKJf+sle6XEmNM0KtFSThiOyfko/NIag== X-Received: by 2002:adf:9ccc:: with SMTP id h12mr9648938wre.385.1631283438783; Fri, 10 Sep 2021 07:17:18 -0700 (PDT) Received: from acdc.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id u13sm4797784wrg.68.2021.09.10.07.17.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Sep 2021 07:17:18 -0700 (PDT) Date: Fri, 10 Sep 2021 16:16:54 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Maxime Coquelin , Andrew Rybchenko Cc: dev@dpdk.org, chenbo.xia@intel.com, amorenoz@redhat.com, david.marchand@redhat.com, ferruh.yigit@intel.com, michaelba@nvidia.com, viacheslavo@nvidia.com, stable@dpdk.org Message-ID: References: <20210910091734.7023-1-maxime.coquelin@redhat.com> <20210910091734.7023-3-maxime.coquelin@redhat.com> <7548b2d2-fd23-4a1a-59d7-b3424912afcc@redhat.com> <85036fee-62f0-5d61-b451-65ee428ee2bc@oktetlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <85036fee-62f0-5d61-b451-65ee428ee2bc@oktetlabs.ru> Subject: Re: [dpdk-dev] [PATCH 2/3] app/testpmd: fix RSS hash type update X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > >>> --- > >>> 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. > > Also, even without 8205e241b2b0, the function was broken because the > > key length was overiden. > > I see, many thanks for explanations. -- Nélio Laranjeiro 6WIND