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 8B19643B6B for ; Thu, 22 Feb 2024 07:49:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2570C4067C; Thu, 22 Feb 2024 07:49:21 +0100 (CET) Received: from mail-vk1-f176.google.com (mail-vk1-f176.google.com [209.85.221.176]) by mails.dpdk.org (Postfix) with ESMTP id 713D040281; Thu, 22 Feb 2024 07:49:18 +0100 (CET) Received: by mail-vk1-f176.google.com with SMTP id 71dfb90a1353d-4ccce61a1b2so864122e0c.1; Wed, 21 Feb 2024 22:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708584558; x=1709189358; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QnJdjZNxw1iwXx1KXtTC6I+OQ45l/io2+WGosIu5d7U=; b=IiG4zYDxxDUrEsnTZIhfFfVijmFPQI+Xkifu/wkpNN5tfv+YIFwkA0rn4tNT9APkt7 Pmkz75gPVSor3yqag03sixBfPYs9621SExQ7Wjp2KJf51Nix4BGJd/khNqiRBaYLlJs2 vNOVLMhAVf/lrgL6he0/VRAnpw20mDpVGM0V9G9tEdQ94w1kIhXsf+/UjYcHFCfhvH+z eTErGb+rWR0twejXU88nGe7EMKP9A3N7ML1tSqH4BZCwZFp+KrVJmk3cZw5n0FguHbxt oBXiMU6yokzaMJUiAvByKJ1agLKL1JzBB8nlDaHSa/o0S4q+cYSUKUJ9Xo2i/1k401bP IOSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708584558; x=1709189358; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QnJdjZNxw1iwXx1KXtTC6I+OQ45l/io2+WGosIu5d7U=; b=ossLxufm+ElSZHB6r6MJzwrnj/8cml4tJO4hz1trXD+Isw1sfQ8a5m3WLq1IZl6CZD u5JiqKub4Jwoms2IIYllYg8AXsnQtMGm0keHF9PmS+ShX7kX+XirLCnUqjni1rbi+vzn DDpgB9v8VWjrwAo5H1MHJav4UoDSzeJjROTBEaDO/kNcnHWEjS/g0kkFgZfToVSYu2RM kvd74FIqiWEKqyOsBEzwpiMqyS6F/rR8Cb2yzjz1S3mk9ufmRiosGSk+PKwBjuIckVyy MStkB9C46T8Xsq+YWt8HP3dk8sYXpFpUIPG+roT84HaGiZnD7gkkiAHVacF8S+fvZ+sa 7JRQ== X-Forwarded-Encrypted: i=1; AJvYcCUuJewXlSGevvxrVqX0yyJyIrL4p9yBr2Ep5YGsXuS0Z83YeV3PDkNytweSs3pnmFBB8AidjuXmn+0eohVbkrk3s6Gzu/W0X0TyxIwr X-Gm-Message-State: AOJu0Yzq5f9oc45TgYqzK3up4WDFIdoGRwzYjz/HgqgQvBrECME/j4qG ySpyZhfqa7IuwTf65xqQHF0CzUySAMUx8GHhOxKaHnUmg4igjcqcQ2SnGOX/xMdVOVgkfJtqQgc wutrzc0YvQp2Uv8oEZQZBpJEmeeM= X-Google-Smtp-Source: AGHT+IHu9R7MMqnlkw47xwWtAK1ThBpGVczlskwaREi7t1abK4Iaf+NlP4qsdTKKV9JreCuG548FyAi35oDxNs0RAnk= X-Received: by 2002:a1f:c342:0:b0:4c0:75d9:c88d with SMTP id t63-20020a1fc342000000b004c075d9c88dmr17851090vkf.7.1708584557675; Wed, 21 Feb 2024 22:49:17 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Pavel Vazharov Date: Thu, 22 Feb 2024 08:49:03 +0200 Message-ID: Subject: Re: rss calculation as the nic To: Yaron Illouz Cc: Ori Kam , "dev@dpdk.org" , "users@dpdk.org" Content-Type: multipart/alternative; boundary="000000000000a10a2b0611f2d7bf" X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --000000000000a10a2b0611f2d7bf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 21, 2024 at 9:40=E2=80=AFPM Yaron Illouz wr= ote: > 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+port= 1 > arrive to another instance > > How can I solve this? > > > > *From:* Ori Kam > *Sent:* Wednesday, February 14, 2024 6:07 PM > *To:* Yaron Illouz ; dev@dpdk.org; 'users@dpdk.org' < > 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 =3D rss_key; port_conf.rx_adv_conf.rss_conf.rss_key_len =3D rss_key_size; HTH. > > *From:* Yaron Illouz > *Sent:* Saturday, February 3, 2024 7:03 PM > *To:* dev@dpdk.org; '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 =3D static_cast(rte_pktmbuf_mtod(pi_mbuf, vo= id* > )); > > IpHeader * pIpHeader =3D (IpHeader *)(pRawPacket + offsetOfIp); > > if(pIpHeader->GetVersion()=3D=3D4) > > { > > ipv4_tuple.src_addr =3D > rte_be_to_cpu_32(pIpHeader->dwSrcAddressBigEndian); > > ipv4_tuple.dst_addr =3D > rte_be_to_cpu_32(pIpHeader->dwDstAddressBigEndian); > > [Ori] here you are converting BE to CPU > > ipv4_tuple.sport =3D *(uint16_t*)(pRawPacket + transportLayerOffs= et); > > ipv4_tuple.dport =3D *(uint16_t*)(pRawPacket + > transportLayerOffset+2); > > [Ori] here you keep the values as BE > > input_len =3D 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 =3D 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 > > > --000000000000a10a2b0611f2d7bf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Feb 21, 2024 at 9:40=E2=80=AF= PM Yaron Illouz <yaroni@radcom.com<= /a>> wrote:
<= div class=3D"msg-7692156074670919738">

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?

=C2=A0

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

=C2=A0

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

=C2=A0=

Hi Yaron,<= /p>

=C2=A0

I can see some possible issues = with your code, please see below.

If I understand your case correctly, you need to use a symme= tric RSS key.
And you'll ne= ed to set it accordingly when configuring the device:
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 port_conf.rx_adv_conf.rss_conf.rss_key =C2=A0 =C2=A0 =3D rss_key= ; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port_conf.rx_adv_conf.rss_conf.rss_key_l= en =3D rss_key_size;

HTH.

=C2=A0

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

=C2=A0

[Snip]

=C2=A0

static inline uint32_t<= /u>

do_softrss(struct rte_mbuf= *m)

{

=C2=A0=C2=A0=C2=A0 uint32_= t input_len;

=C2=A0=C2=A0=C2=A0 struct = rte_ipv4_tuple ipv4_tuple;

=C2=A0=C2=A0=C2=A0

=C2=A0=C2=A0=C2=A0=C2=A0ch= ar * pRawPacket =3D static_cast<char*>(rte_pktmbuf_mtod(pi_mbuf, void* ));

=C2=A0=C2=A0=C2=A0 IpHeade= r * pIpHeader =3D (IpHeader *)(pRawPacket + offsetOfIp);

=C2=A0=C2=A0=C2=A0 if(pIpH= eader->GetVersion()=3D=3D4)

=C2=A0=C2=A0=C2=A0 {

=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 ipv4_tuple.src_addr =3D rte_be_to_cpu_32(pIpHeader->d= wSrcAddressBigEndian);

=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 ipv4_tuple.dst_addr =3D rte_be_to_cpu_32(pIpHeader->d= wDstAddressBigEndian);

[Ori= ] here you are converting BE to CPU

=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 ipv4_tuple.sport =3D *(uint16_t*)(pRawPacket + transportLayerOffset);

=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 ipv4_tuple.dport =3D *(uint16_t*)(pRawPacket + transportLayerOffset+2);

[Ori= ] here you keep the values as BE

=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 input_len =3D RTE_THASH_V4_L3_LEN;<= /p>

=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 return rte_softrss_be((uint32_t *)&ipv4_tuple, input_len, rss_key_be);

[Ori] the above function ex= pects to get everything in BE and =C2=A0you should also call rte_convert_rss_key before the use of= the above function.

=C2=A0=C2=A0=C2=A0 }

=C2=A0=C2=A0=C2=A0 return = 0;

}

new_rss =3D do_softrss(mbu= f_pointer);

std::cout<< std::hex= << mbuf_pointer->hash.rss << " -> " << new_rss << std::dec << std::endl;=

=C2=A0

And i get a different value than the mb= uf_pointer->hash.rss

5ed28a5c -> 33eb33eb=

974c1896 -> 24e224e2=

1edf1638 -> 21752175=

8a54c19 -> 80638063<= /u>

459a6f76 -> 1b351b35=

1cdf1d1c -> e53be53b=

=C2=A0

=C2=A0

****=C2=A0 I understand it is possible = to do it, but i don't get the same value=C2=A0 ***=

ethtool -i ens5f0

driver: mlx5_core

version: 5.8-3.0.7<= u>

firmware-version: 22.32.20= 04 (MT_0000000437)

expansion-rom-version:<= /u>

bus-info: 0000:83:00.0<= /u>

supports-statistics: yes

supports-test: yes<= u>

supports-eeprom-access: no=

supports-register-dump: no=

supports-priv-flags: yes

=C2=A0

--000000000000a10a2b0611f2d7bf--