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 D4B77A0C4B; Wed, 14 Jul 2021 10:21:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C9F540140; Wed, 14 Jul 2021 10:21:07 +0200 (CEST) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by mails.dpdk.org (Postfix) with ESMTP id 5A9F94003E for ; Wed, 14 Jul 2021 10:21:05 +0200 (CEST) Received: by mail-io1-f51.google.com with SMTP id p186so971223iod.13 for ; Wed, 14 Jul 2021 01:21:05 -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=riq0vmlXB3Ra8Q6C6+d2mjUkfxSDsNuaAIPz2IHlGqQ=; b=l2svZU9rZXqp1s9pzQ+hQ0szOwQ1SVOa1AUgmAsGUUuWqI51V9WFY+g8ii/d6XRJ8o 7yp/ij4twm/0p1YxRoEKofJYk9Rwti/mAjrMQVWDKM0qfF1cj3L0fLtd1fXAnq2kDd7M 303egR9E0iSMym2YCxNTmTYVngWH6BJgz5UsfkguvvqdJouBZUZpEiU3fy72lChFe2tL dvrJr7UqOJKRjMiddXmgEftrYygNFgZxWlZ4fKeV7eg80SVwKkKNwZ6NHONhs33pZF0l arpyN1ZqWuqRqila/gPRfT9tMrzcGN5LquQQrnasgNGws7R1RUWCJJP0D91+Z5YqACKj csrA== 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=riq0vmlXB3Ra8Q6C6+d2mjUkfxSDsNuaAIPz2IHlGqQ=; b=VYhc9TCdHCphja9c7jP+JwKS9lbxrJb5/8SNbYvXdEwN3LyFCG/BOYuZadeb55A0ik 22G9uQ6264TzPX7fuqWBZkRmRWZatF2OoBRDPJTaWKW/Ag/stxSBMFpU5I/GOpTXN6UJ 1kRJgTeH1YlEqFIEyl6GnrNRnFrWSkO1RXjFLPB46cMD388S86EomPdtHyJfWfBl8x7H gEOyvzp+mOPF969fOhjQGEJzC4SzXKxlRQ5WGPzTH0Ymga2bcYYpI8jTWS60Le2Ushpc pU3U8RZS5H3FlDe7NKWm9tvRLLk/QTMxQRpf7j7QlK2YWOY4bA63xw25og50m/KnmczS ARfA== X-Gm-Message-State: AOAM532xj9negHI5KIfMUtaWn1gWQgOF0C5cxB10XcGHfRtxkBkq+SKe +N1qWYQA6o0YViCmNoTjA9TyeOEla4vQ9lQu+DAkbg== X-Google-Smtp-Source: ABdhPJwY/U49TVDhuBDdV/XfxXg6wE5QLFt1KgVztTff9HLeBu8D0PYhCTkhrSm1q6rRKFE0Cai6dDN1lMr1hW0fE9Y= X-Received: by 2002:a05:6602:d9:: with SMTP id z25mr6546457ioe.154.1626250864742; Wed, 14 Jul 2021 01:21:04 -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 10:20:53 +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 10:04 Vladimir Medvedkin nap= isa=C5=82(a): > > Hi Michal, > > =D0=B2=D1=82, 13 =D0=B8=D1=8E=D0=BB. 2021 =D0=B3. =D0=B2 18:42, Michal Kr= awczyk : >> >> 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 endia= n >> + * notation (uint32_t values instead of bytes). Because of that, the ke= y 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-b= yte 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_con= vert_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