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 B84F7A0C41; Wed, 14 Jul 2021 14:07:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 372B140E3C; Wed, 14 Jul 2021 14:07:15 +0200 (CEST) Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by mails.dpdk.org (Postfix) with ESMTP id 7C8C24069F for ; Wed, 14 Jul 2021 14:07:13 +0200 (CEST) Received: by mail-ej1-f49.google.com with SMTP id dt7so2891794ejc.12 for ; Wed, 14 Jul 2021 05:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=sr2dv7R4lcApy4PJHZN+Q/myjVO6cXGNRrZH6g/Cxp0=; b=pILfC48sJH2cDMDIq097CLoSFCGPKMsTmK2IiDEJIDHKcH2VA21WohQ/G365BZ03yI kLgRRUx4sjHN/u1+QQ0QB3Dz0nRGA0N/dUFugW5iwgxM27szuBtA/pHzRTMAF+nOkPAC YBTSse2VmTrNlSYJCC09o3o8euNLJlix+VPDzJf3rn9xY41NEfsj2uWlWk1MHH5dPjdg SePQCQI7A23vG8lAePf4yshPKvcagEALx0mia9FAzRdtJ54AKe2Wj7NqbaQaetU7aQ3N X9lx6f5+Co/at+6NYT/G/uw/ID6TQSOI/3/uGZtQ0855jXKXNtG53iMT2FV6XkLHmPGD qpAg== 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:content-transfer-encoding; bh=sr2dv7R4lcApy4PJHZN+Q/myjVO6cXGNRrZH6g/Cxp0=; b=fkKlLL4zG8WWgnvTRzubAalQefo6wBx2cUDMFU5GBqMqTE1yb+oTRZVLkd8Mpf7Rns 8Vm714KGC/2ND8/2nHpIcWo6VEJ5Ot0ZEA2xE+rYvGGaCeVo0+AeTn4zIWMpzPuAKEDU EnvMbhkbREGeG5xVitbHlMs/P3UAtyIOinMfLX31HSThiSEAL4PVxno8uuNtNNGZmSlq w4cz78kzL/rARyLuzKgARp/5eHTk9upPy3VI09WPcn9dWWAF+Anql61kpq7dft5+bRO4 HOcqQDnRZ/jq+3HAD+7rZxuF1mBBozIjQv/wu3YdYlI0/I19MtPxbqeLxRHRS91ZsoYd 1bZA== X-Gm-Message-State: AOAM5331DuxQrV1Afp4axkodwSCRcdxK617y/4yAvlRakQorgxsgBFtp kqTDHEgocYb0Kx3SwJBOB+n9HAFiAUDznxu3ZuOxjw== X-Google-Smtp-Source: ABdhPJx4Q3GNnJ9eEOLX3XkLwE9EXse+liAc1ZqdOz0rTIV/QSpC+KYdP1ArWXo4UirTwJ3ir1ELSXbUBpc83nPM8Eg= X-Received: by 2002:a17:906:4dcf:: with SMTP id f15mr12093662ejw.400.1626264433186; Wed, 14 Jul 2021 05:07:13 -0700 (PDT) MIME-Version: 1.0 References: <20210713154118.32111-1-mk@semihalf.com> <20210713154118.32111-6-mk@semihalf.com> In-Reply-To: From: =?UTF-8?Q?Micha=C5=82_Krawczyk?= Date: Wed, 14 Jul 2021 14:07:01 +0200 Message-ID: To: Vladimir Medvedkin 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 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" =C5=9Br., 14 lip 2021 o 13:43 Vladimir Medvedkin nap= isa=C5=82(a): > > 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. > I already verified it with a script using standard Teoplitz implementation with the key used by the NIC. But I just double checked it with the rte_softrss() - the results from the NIC and from 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 orde= r, >> >> 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 bei= ng >> >> 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 en= dian >> >> + * 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, --re= v_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 by= tes (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 > > > > -- > Regards, > Vladimir