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 AB775A0A0C; Wed, 14 Jul 2021 13:43:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 834A840E3C; Wed, 14 Jul 2021 13:43:32 +0200 (CEST) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mails.dpdk.org (Postfix) with ESMTP id E360D4069F for ; Wed, 14 Jul 2021 13:43:31 +0200 (CEST) Received: by mail-ej1-f41.google.com with SMTP id go30so2819861ejc.8 for ; Wed, 14 Jul 2021 04:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9hMbHkqdlCCKPDS5rLGovHR04JKo0aYn3zqr/WybXcY=; b=P8OJOoeyC7pyfM5FJ/QVdW4U69M9LYmE8Zl0EmDZy7LpOL1cNg2uUCMBHD/YsYc+4k A2kRVScme39BcG35GZVqZUGw77mqpXTogfXlXRgGcxfs/EWJUdHLtftoo8u9uwq32lFZ usJxY7jwM9Xfemk0iRoJRWQqHeY+zqQo3OisLpVXgtBTvpo7FYGBETLRH8Non3ffCeO0 HidK62t+coQTTGThQNeM2jrajzLFTuwXitv2ItjADGFUMpKey/UigDDqlTtHeo6FLWXB XQ9kCUp+IN87zF1iWh4my6wyvgpTcvZfHklTcE3WC+Ae3EAA5gUIjQvTNGI2O6i7QbF0 0LTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9hMbHkqdlCCKPDS5rLGovHR04JKo0aYn3zqr/WybXcY=; b=eto99vLotVIdzAvQcabjRX1SAqsbasyy3frpMWwaGt456F73lF/NZ8nehJPsqajfO+ ATs06dbIHOfVo4PAfQLcW2Qh9XhyElYJQgal5kG5C3GELo0lmMKYMyZkifScZNR2JiKY 8uo6WrtvXnj6wCdiDZFxRSv9oOyFhznDvimJLSACRB/n/qoUrB6Q5NHV9vDPwK4Fcdz+ vwtP8DSAzQyvju21UL95iFI7vexUOyBlqR8M+5Ad2KFBogOXSFPEBSA8Ue8x/5l5sUAX rIQAIrvyt8GcJ/O4/VjTes2rVJYX7NlDNvwWExF0VXD4C/JKc/w3qBt/w3wbPBQoIrKJ 10Pw== X-Gm-Message-State: AOAM532ldVkn2AnjE2IThYLsLlkT8iEYWXDu6YaY9NsaKfoIihOVznYe GvDCDaGE5ItSAol2ED9m7dRixZ/6x3Wy3imZCDo= X-Google-Smtp-Source: ABdhPJw4Z++KSwpmOjC8O1OkjngUdXkO0PzN15TOP1sHqXCReN6LqD0EujbkIpbpo5FqvLBhyJeKgLkorUtqbVqoVRQ= X-Received: by 2002:a17:907:9884:: with SMTP id ja4mr11617395ejc.406.1626263011654; Wed, 14 Jul 2021 04:43:31 -0700 (PDT) MIME-Version: 1.0 References: <20210713154118.32111-1-mk@semihalf.com> <20210713154118.32111-6-mk@semihalf.com> In-Reply-To: From: Vladimir Medvedkin Date: Wed, 14 Jul 2021 14:43:20 +0300 Message-ID: To: =?UTF-8?Q?Micha=C5=82_Krawczyk?= Cc: dev , "Dagan, Noam" , "Brandes, Shai" , upstream@semihalf.com, Shay Agroskin , Amit Bernstein Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH 5/6] net/ena: rework RSS configuration 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" Great, thanks! BTW, you can check with a given hash_key if the rss hash value calculated by the NIC and by the rte_softrss() are the same. =D1=81=D1=80, 14 =D0=B8=D1=8E=D0=BB. 2021 =D0=B3. =D0=B2 11:21, Micha=C5=82= Krawczyk : > =C5=9Br., 14 lip 2021 o 10:04 Vladimir Medvedkin > napisa=C5=82(a): > > > > Hi Michal, > > > > =D0=B2=D1=82, 13 =D0=B8=D1=8E=D0=BB. 2021 =D0=B3. =D0=B2 18:42, Michal = Krawczyk : > >> > >> Allow user to specify his own hash key and hash ctrl if the > >> device is supporting that. HW interprets the key in reverse byte order= , > >> so the PMD reorders the key before passing it to the ena_com layer. > >> > >> Default key is being set in random matter each time the device is bein= g > >> initialized. > >> > >> Moreover, make minor adjustments for reta size setting in terms > >> of returning error values. > >> > >> RSS code was moved to ena_rss.c file to improve readability. > >> > >> Signed-off-by: Michal Krawczyk > >> Reviewed-by: Shai Brandes > >> Reviewed-by: Shay Agroskin > >> Reviewed-by: Amit Bernstein > >> --- > >> doc/guides/nics/features/ena.ini | 1 + > >> doc/guides/rel_notes/release_21_08.rst | 1 + > >> drivers/net/ena/ena_ethdev.c | 230 ++-------- > >> drivers/net/ena/ena_ethdev.h | 34 ++ > >> drivers/net/ena/ena_rss.c | 592 ++++++++++++++++++++++++= + > >> drivers/net/ena/meson.build | 1 + > >> 6 files changed, 664 insertions(+), 195 deletions(-) > >> create mode 100644 drivers/net/ena/ena_rss.c > > > > > > > > > >> + > >> +/* ENA HW interprets the RSS key in reverse order and as in a big > endian > >> + * notation (uint32_t values instead of bytes). Because of that, the > key must be > >> + * processed upon interaction with ena_com layer. > >> + */ > >> +static void ena_reorder_rss_hash_key(uint8_t *reordered_key, > >> + uint8_t *key, > >> + size_t key_size) > >> +{ > >> + size_t i, rev_i; > >> + > >> + for (i =3D 0, rev_i =3D key_size - 1; i < key_size; ++i, --rev= _i) > >> + reordered_key[i] =3D key[rev_i]; > >> +} > >> + > >> > > > > If I understand the description correctly, you need to byteswap every > 4-byte chunk of the key, but instead here it swaps all ENA_HASH_KEY_SIZE > bytes (i.e. key[0] =3D key[39] and so on). Consider doing something like > rte_convert_rss_key() from hash/rte_thash.h. > > > > Hi Vladimir, > > Thanks for the review. > > It looks like documentation for the function is out of date (that was > my initial approach regarding HW key interpretation). The current > reordering function is fine, I just need to fix the comment above. > I'll do so in v2. > > Thanks, > Michal > > > > >> -- > >> 2.25.1 > >> > > > > > > -- > > Regards, > > Vladimir > --=20 Regards, Vladimir