śr., 14 lip 2021 o 13:43 Vladimir Medvedkin <medvedk...@gmail.com> napisał(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.

> ср, 14 июл. 2021 г. в 11:21, Michał Krawczyk <m...@semihalf.com>:
>>
>> śr., 14 lip 2021 o 10:04 Vladimir Medvedkin <medvedk...@gmail.com> 
>> napisał(a):
>> >
>> > Hi Michal,
>> >
>> > вт, 13 июл. 2021 г. в 18:42, Michal Krawczyk <m...@semihalf.com>:
>> >>
>> >> 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 <m...@semihalf.com>
>> >> Reviewed-by: Shai Brandes <shaib...@amazon.com>
>> >> Reviewed-by: Shay Agroskin <shay...@amazon.com>
>> >> Reviewed-by: Amit Bernstein <amitb...@amazon.com>
>> >> ---
>> >>  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
>> >
>> >
>> > <snip>
>> >
>> >> +
>> >> +/* 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 = 0, rev_i = key_size - 1; i < key_size; ++i, --rev_i)
>> >> +               reordered_key[i] = 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] = 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

Reply via email to