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 67CA1A0C4B; Wed, 14 Jul 2021 10:04:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED67440140; Wed, 14 Jul 2021 10:04:39 +0200 (CEST) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by mails.dpdk.org (Postfix) with ESMTP id 8FEFC4003E for ; Wed, 14 Jul 2021 10:04:38 +0200 (CEST) Received: by mail-ed1-f49.google.com with SMTP id ee25so1912526edb.5 for ; Wed, 14 Jul 2021 01:04:38 -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=1s38SZt8SGJJA11uJ46U/Lp0eYu32qroO4V8vmANn6k=; b=gyHa5UTZvoZImaQHcVvFJVUJqmWtOdR12hT+4snvrTl78/m6oGO0lA4jzsg3J6lzIe drb2VMoAfZDXuZGUeN5TqEGg9QEyhW5CUK2rC8wiZ4eBiVXhPN4AtNQ454/ezkp5qbT5 WmD1+O76rCIznFvwGWLQ3zmjbCVVvtCh2QHimRVwrp7+03NEvgg34WQ9EDSot/XIvCAD oJF5eydynrgG0opve+y2JRU4cVBsfHge9uLea1cYEWnhn8vfpIrHTFw237P9rib+3Tj7 JAO3dN+fisYTNDwVSKIDwAyD86exqNInqboylPKaBLQV/REJi/89v52ksuXzDA4X94ie zWnw== 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=1s38SZt8SGJJA11uJ46U/Lp0eYu32qroO4V8vmANn6k=; b=bvLFIBZ/bfyC1Y+iBa5KrQjArYgB0MsP8t7yJDxxvPqrEMSdgqSc9Wsj9Ws3LfneKt 0Xz/qRxl3qKSJtNgALTTneHVLc3R9lNmS/B7OJdBHXF+0/gNclmMvebcfSI1NmcR3SZs b6vSKF8+sqKOlyy22EDFHME9BLlSCvpApIjRk/xJ4rZL8sUyCbJ9749sljyxp0uAcsUf KS3+aoQsiPGkLFqsYKDrNZ6sPVUG3jjXr9OHh0PakZBQHPiWfc1rxvr6hjva3x1V2Xpg GFRAsYpqxd9f9qM6bMnf7f49fEgBuv9VyI38Sz46of1qCZoISp5tYqOSCXKxERBpKaEx o3/A== X-Gm-Message-State: AOAM532GfmKGFBOtTJyWdTlAODNE8Yl3MOpR9EB90pokbb9gbHHm+Yzb BSl5tCygaOc6HmBi8CN5O2xfuHjiOAmyQnQM/hQ= X-Google-Smtp-Source: ABdhPJzTpFVN3csd7yKXRGEXNaePqOo1DhGJv6op909GMJ7ds7snzaEv0en1nqiDlK6C0m2XtZk8S3JtaONYgaLqttU= X-Received: by 2002:a05:6402:14d4:: with SMTP id f20mr11952166edx.316.1626249878301; Wed, 14 Jul 2021 01:04:38 -0700 (PDT) MIME-Version: 1.0 References: <20210713154118.32111-1-mk@semihalf.com> <20210713154118.32111-6-mk@semihalf.com> In-Reply-To: <20210713154118.32111-6-mk@semihalf.com> From: Vladimir Medvedkin Date: Wed, 14 Jul 2021 11:04:27 +0300 Message-ID: To: Michal Krawczyk Cc: dev@dpdk.org, ndagan@amazon.com, shaibran@amazon.com, 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" Hi Michal, =D0=B2=D1=82, 13 =D0=B8=D1=8E=D0=BB. 2021 =D0=B3. =D0=B2 18:42, Michal Kraw= czyk : > 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 being > 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. --=20 > 2.25.1 > > --=20 Regards, Vladimir