DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ori Kam <orika@nvidia.com>
To: Pavel Vazharov <freakpv@gmail.com>, Yaron Illouz <yaroni@radcom.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "users@dpdk.org" <users@dpdk.org>
Subject: RE: rss calculation as the nic
Date: Sun, 25 Feb 2024 08:22:13 +0000	[thread overview]
Message-ID: <MW2PR12MB46668D5D13F8B334FA95FE58D65B2@MW2PR12MB4666.namprd12.prod.outlook.com> (raw)
In-Reply-To: <CAK9EM18_wzpUpBDG0Yh8VR3AqmzAb8TRqhm0zABqQczw9PcCMg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3819 bytes --]

Hi Pavel,

You can use a symmetric key,
Or even better, in case of MLNX devices you can use RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT as the hash function,
This will sort the fields based on their value and only do the hash, resulting in a symmetric hash.

Best,
Ori


From: Pavel Vazharov <freakpv@gmail.com>
Sent: Thursday, February 22, 2024 8:49 AM
To: Yaron Illouz <yaroni@radcom.com>
Cc: Ori Kam <orika@nvidia.com>; dev@dpdk.org; users@dpdk.org
Subject: Re: rss calculation as the nic



On Wed, Feb 21, 2024 at 9:40 PM Yaron Illouz <yaroni@radcom.com<mailto:yaroni@radcom.com>> wrote:
Hi Ori

Thank you for your answer it helped me

But I can see the load balancing is not done to the same instance for both directions
I would like to have ip + port pairs arrive to same instance

Now ip1+port1 -> ip2+port2 arrive to instance x and ip2+port2 -> ip1+port1 arrive to another instance

How can I solve this?

From: Ori Kam <orika@nvidia.com<mailto:orika@nvidia.com>>
Sent: Wednesday, February 14, 2024 6:07 PM
To: Yaron Illouz <yaroni@radcom.com<mailto:yaroni@radcom.com>>; dev@dpdk.org<mailto:dev@dpdk.org>; 'users@dpdk.org<mailto:users@dpdk.org>' <users@dpdk.org<mailto:users@dpdk.org>>
Subject: RE: rss calculation as the nic

EXTERNAL EMAIL: Do not click links or attachments unless you recognize the sender and know the content is safe

Hi Yaron,

I can see some possible issues with your code, please see below.
If I understand your case correctly, you need to use a symmetric RSS key.
We use this one in production - https://www.ndsl.kaist.edu/~kyoungsoo/papers/TR-symRSS.pdf
And you'll need to set it accordingly when configuring the device:
        port_conf.rx_adv_conf.rss_conf.rss_key     = rss_key;
        port_conf.rx_adv_conf.rss_conf.rss_key_len = rss_key_size;
HTH.


From: Yaron Illouz <yaroni@radcom.com<mailto:yaroni@radcom.com>>
Sent: Saturday, February 3, 2024 7:03 PM
To: dev@dpdk.org<mailto:dev@dpdk.org>; 'users@dpdk.org<mailto:users@dpdk.org>' <users@dpdk.org<mailto:users@dpdk.org>>
Subject: rss calculation as the nic

[Snip]

static inline uint32_t
do_softrss(struct rte_mbuf *m)
{
    uint32_t input_len;
    struct rte_ipv4_tuple ipv4_tuple;

    char * pRawPacket = static_cast<char*>(rte_pktmbuf_mtod(pi_mbuf, void* ));
    IpHeader * pIpHeader = (IpHeader *)(pRawPacket + offsetOfIp);
    if(pIpHeader->GetVersion()==4)
    {
        ipv4_tuple.src_addr = rte_be_to_cpu_32(pIpHeader->dwSrcAddressBigEndian);
        ipv4_tuple.dst_addr = rte_be_to_cpu_32(pIpHeader->dwDstAddressBigEndian);
[Ori] here you are converting BE to CPU
        ipv4_tuple.sport = *(uint16_t*)(pRawPacket + transportLayerOffset);
        ipv4_tuple.dport = *(uint16_t*)(pRawPacket + transportLayerOffset+2);
[Ori] here you keep the values as BE
        input_len = RTE_THASH_V4_L3_LEN;
        return rte_softrss_be((uint32_t *)&ipv4_tuple, input_len, rss_key_be);
[Ori] the above function expects to get everything in BE and  you should also call rte_convert_rss_key before the use of the above function.
    }
    return 0;
}
new_rss = do_softrss(mbuf_pointer);
std::cout<< std::hex << mbuf_pointer->hash.rss << " -> " << new_rss << std::dec << std::endl;

And i get a different value than the mbuf_pointer->hash.rss
5ed28a5c -> 33eb33eb
974c1896 -> 24e224e2
1edf1638 -> 21752175
8a54c19 -> 80638063
459a6f76 -> 1b351b35
1cdf1d1c -> e53be53b


****  I understand it is possible to do it, but i don't get the same value  ***
ethtool -i ens5f0
driver: mlx5_core
version: 5.8-3.0.7
firmware-version: 22.32.2004 (MT_0000000437)
expansion-rom-version:
bus-info: 0000:83:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: yes


[-- Attachment #2: Type: text/html, Size: 24382 bytes --]

      reply	other threads:[~2024-02-25  8:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-03 17:03 Yaron Illouz
2024-02-14 16:07 ` Ori Kam
2024-02-21 17:10   ` Yaron Illouz
2024-02-22  6:49     ` Pavel Vazharov
2024-02-25  8:22       ` Ori Kam [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW2PR12MB46668D5D13F8B334FA95FE58D65B2@MW2PR12MB4666.namprd12.prod.outlook.com \
    --to=orika@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=freakpv@gmail.com \
    --cc=users@dpdk.org \
    --cc=yaroni@radcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).