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 D3F8AA0C45 for ; Mon, 13 Sep 2021 11:41:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C21BB4014F; Mon, 13 Sep 2021 11:41:16 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 7EE7C4014F for ; Mon, 13 Sep 2021 11:41:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631526074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cVse8XtsNBMsd6dWc/sEeAUeQVrrLqXROS/5tFK/9nE=; b=gWZ06ZxLbwgGjhWebUi/s2n5hUhfEM12O9uZNUJjb14wcff958MYMUSfecYLUwWjlzVk4J uPEln0cG1KUFpGnX4IfdNB9vTH6EzoTKx1+AEuBDVz5UOZmnlBShM/MeZQwF73LTgzCISa aF5TG90eEmwbqZa8ARj9EwVGtKN9BM4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-437-Ty1xkDhtM_aRoV8hqx-gDQ-1; Mon, 13 Sep 2021 05:41:13 -0400 X-MC-Unique: Ty1xkDhtM_aRoV8hqx-gDQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C49041084689; Mon, 13 Sep 2021 09:41:11 +0000 (UTC) Received: from [10.39.208.12] (unknown [10.39.208.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF75C6A907; Mon, 13 Sep 2021 09:41:05 +0000 (UTC) To: =?UTF-8?Q?N=c3=a9lio_Laranjeiro?= , 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 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> From: Maxime Coquelin Message-ID: <1daeb2f2-2122-c546-3eb4-f0d7fba035f0@redhat.com> Date: Mon, 13 Sep 2021 11:41:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-stable] [PATCH 2/3] app/testpmd: fix RSS hash type update X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 >>>>> --- >>>>> 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? Given how the drivers implément the callback, do you agree with the fix, or do you have something else in mind? Thanks, Maxime >>> Also, even without 8205e241b2b0, the function was broken because the >>> key length was overiden. >> >> I see, many thanks for explanations. >