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 C3E5445AAE; Fri, 4 Oct 2024 14:03:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71B8340EE3; Fri, 4 Oct 2024 14:03:14 +0200 (CEST) Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) by mails.dpdk.org (Postfix) with ESMTP id 0B3AC40E5E for ; Fri, 4 Oct 2024 14:03:13 +0200 (CEST) Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-2877d7ae3f6so1042258fac.0 for ; Fri, 04 Oct 2024 05:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728043392; x=1728648192; 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=IVO3q2U+s9alLRSI4stR/kN70sWwvdALVRxs1hA/LP4=; b=hIcVni5uSwwaJdmg9+dgY9J6Wp7IqXJLmW0fb4b9xl9NdxNJg40idVC3U2Bz5AQ3/q 0DSm+wghjantg4b6/OpWFhynUUTacHxdqhDay0PxIof1d9GG2WhRN0zhKh5QGKFcMqLV P0e8Tqrm2UHXkoNXt/ZVbqgTBmWwJr6B+9GCKmBRfPMWBXlRO20zpxAfSzLRA0A85je1 zYmF3yoYiTHXFz+FiC+zgY4fk3nuX33JOCwvcMhDrvqNcdK0pQ+dbjKH+u+K0+hpSsJV OSrqUKVkHnXeBZdMLZyiOEluOWPV7hMqmcATjHlNR6NnPWOcprJDb9pR5v1uw94SgcsT QXsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728043392; x=1728648192; 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=IVO3q2U+s9alLRSI4stR/kN70sWwvdALVRxs1hA/LP4=; b=F6oRFqnIQtRob7gGefZYJXn5ZCbodft7zAsadQwQ3k12xUSZOPfv/0zDmSJBeSV7qP Y5F6UAgIQ7boCmMuSLdGFnRetJjmAJFdHp+PrWQNaQ6m9QVvxTqWzX38jjGC3GTWaqBM g4qVb0gF/TAgLbv8Pi3Gy82dnb4Jm14bOfDlzGAmzvj8cZGTLAKxl2WRMmYt8d6rRKRl m0iQ4VHaqCI2iTtiXpvnCkpcXwO7huTUlE60BfuFEf5VfgoPvl3sq458ODz1FdO7j6U/ t/UG35BXH7E908S/PIAZ94ZxYwVdai8n/l4lcoLKEhVUkCUUhlAMb4R22+3WCZd5y6Fc bEcQ== X-Forwarded-Encrypted: i=1; AJvYcCV9kOWCqvjYpoPiSNih0o0HEgVi68sIHdvF3v3jStp0CqkDpi5Xb8xVslfcYd79vz7Wh6U=@dpdk.org X-Gm-Message-State: AOJu0Yyy9cLhdNVO7LNnwmkZqVXxFiXgDqLDBjYrDhuXbQ4+Ga42oOVX IpsNYxgFrphGFjB15JZiZHiF5b1F3O7D4KkK/t+jTPuJl0KkIThrV0HOik9fex+DcJvpDdcFOcw h+EtLl9fzUrcfmYDPsW/kU4EWBaE= X-Google-Smtp-Source: AGHT+IF7mu6Aqf+sjR5TaHLLKaFrnFyesgfMSYjwrKagVtfqY2zl7QIzANL3WpIFUqxnVcfIF9Ew3geRxeWRyYbf/OE= X-Received: by 2002:a05:6871:4908:b0:277:e6bc:330c with SMTP id 586e51a60fabf-287cd4c61f3mr394176fac.29.1728043392171; Fri, 04 Oct 2024 05:03:12 -0700 (PDT) MIME-Version: 1.0 References: <20240906170907.1325808-1-vladimir.medvedkin@intel.com> In-Reply-To: From: Vladimir Medvedkin Date: Fri, 4 Oct 2024 13:03:01 +0100 Message-ID: Subject: Re: [PATCH] fib: implement RCU rule reclamation To: David Marchand Cc: Robin Jarry , Vladimir Medvedkin , dev@dpdk.org, ruifeng.wang@arm.com, honnappa.nagarahalli@arm.com Content-Type: multipart/alternative; boundary="0000000000008c0bf50623a574f9" 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 --0000000000008c0bf50623a574f9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi David, Robin, Thanks, I'll send v2 with the fix. =D1=81=D0=B1, 28 =D1=81=D0=B5=D0=BD=D1=82. 2024=E2=80=AF=D0=B3. =D0=B2 00:5= 9, David Marchand : > On Fri, Sep 27, 2024 at 6:13=E2=80=AFPM Robin Jarry w= rote: > > > > Vladimir Medvedkin, Sep 06, 2024 at 13:09: > > > Currently, for DIR24-8 algorithm, the tbl8 group is freed even though > the > > > readers might be using the tbl8 group entries. The freed tbl8 group c= an > > > be reallocated quickly. As a result, lookup may be performed > incorrectly. > > > > > > To address that, RCU QSBR is integrated for safe tbl8 group > reclamation. > > > > > > Signed-off-by: Vladimir Medvedkin > > > --- > > > > > diff --git a/lib/fib/meson.build b/lib/fib/meson.build > > > index 6795f41a0a..1895f37050 100644 > > > --- a/lib/fib/meson.build > > > +++ b/lib/fib/meson.build > > > @@ -11,6 +11,7 @@ endif > > > sources =3D files('rte_fib.c', 'rte_fib6.c', 'dir24_8.c', 'trie.c') > > > headers =3D files('rte_fib.h', 'rte_fib6.h') > > > deps +=3D ['rib'] > > > +deps +=3D ['rcu'] > > > > Hi Vladimir, > > > > thanks a lot for working on this! > > > > I tested with static linking and there is a missing dependency to > > static_rte_rcu: > > > > In file included from ../subprojects/dpdk/lib/fib/dir24_8_avx512.c:6: > > ../subprojects/dpdk/lib/fib/rte_fib.h:19:10: fatal error: > rte_rcu_qsbr.h: No such file or directory > > 19 | #include > > | ^~~~~~~~~~~~~~~~ > > > > After adding it: > > > > @@ -45,7 +45,7 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok > > elif cc.has_multi_arguments('-mavx512f', '-mavx512dq') > > dir24_8_avx512_tmp =3D static_library('dir24_8_avx512_tmp', > > 'dir24_8_avx512.c', > > - dependencies: static_rte_eal, > > + dependencies: [static_rte_eal, static_rte_rcu], > > c_args: cflags + ['-mavx512f', '-mavx512dq']) > > objs +=3D dir24_8_avx512_tmp.extract_objects('dir24_8_avx512.c= ') > > cflags +=3D ['-DCC_DIR24_8_AVX512_SUPPORT'] > > > > I get another error: > > > > In file included from > /usr/lib/gcc/x86_64-redhat-linux/14/include/immintrin.h:65, > > from > /usr/lib/gcc/x86_64-redhat-linux/14/include/x86intrin.h:32, > > from > ../subprojects/dpdk/lib/eal/x86/include/rte_vect.h:26, > > from ../subprojects/dpdk/lib/fib/dir24_8_avx512.c:5: > > /usr/lib/gcc/x86_64-redhat-linux/14/include/avx512bwintrin.h: In > function =E2=80=98dir24_8_vec_lookup_x16=E2=80=99: > > /usr/lib/gcc/x86_64-redhat-linux/14/include/avx512bwintrin.h:1947:1: > error: inlining failed in call to =E2=80=98always_inline=E2=80=99 =E2=80= =98_mm512_shuffle_epi8=E2=80=99: > target specific option mismatch > > 1947 | _mm512_shuffle_epi8 (__m512i __A, __m512i __B) > > | ^~~~~~~~~~~~~~~~~~~ > > ../subprojects/dpdk/lib/fib/dir24_8_avx512.c:38:26: note: called from > here > > 38 | ip_vec =3D _mm512_shuffle_epi8(ip_vec, bswap32)= ; > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > /usr/lib/gcc/x86_64-redhat-linux/14/include/avx512bwintrin.h:1947:1: > error: inlining failed in call to =E2=80=98always_inline=E2=80=99 =E2=80= =98_mm512_shuffle_epi8=E2=80=99: > target specific option mismatch > > 1947 | _mm512_shuffle_epi8 (__m512i __A, __m512i __B) > > | ^~~~~~~~~~~~~~~~~~~ > > ../subprojects/dpdk/lib/fib/dir24_8_avx512.c:38:26: note: called from > here > > 38 | ip_vec =3D _mm512_shuffle_epi8(ip_vec, bswap32)= ; > > | ^~~~~~~~~ > > The latter issue is because you had applied the endianness change. > I replied in the other thread. > > > -- > David Marchand > > --=20 Regards, Vladimir --0000000000008c0bf50623a574f9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi David, Robin,

Thanks, I'll send = v2 with the fix.

=D1=81=D0=B1, 28 =D1=81=D0=B5=D0=BD=D1=82. 2024=E2=80= =AF=D0=B3. =D0=B2 00:59, David Marchand <david.marchand@redhat.com>:
= On Fri, Sep 27, 2024 at 6:13=E2=80=AFPM Robin Jarry <rjarry@redhat.com> wrote:
>
> Vladimir Medvedkin, Sep 06, 2024 at 13:09:
> > Currently, for DIR24-8 algorithm, the tbl8 group is freed even th= ough the
> > readers might be using the tbl8 group entries. The freed tbl8 gro= up can
> > be reallocated quickly. As a result, lookup may be performed inco= rrectly.
> >
> > To address that, RCU QSBR is integrated for safe tbl8 group recla= mation.
> >
> > Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>=
> > ---
>
> > diff --git a/lib/fib/meson.build b/lib/fib/meson.build
> > index 6795f41a0a..1895f37050 100644
> > --- a/lib/fib/meson.build
> > +++ b/lib/fib/meson.build
> > @@ -11,6 +11,7 @@ endif
> >=C2=A0 sources =3D files('rte_fib.c', 'rte_fib6.c'= , 'dir24_8.c', 'trie.c')
> >=C2=A0 headers =3D files('rte_fib.h', 'rte_fib6.h'= )
> >=C2=A0 deps +=3D ['rib']
> > +deps +=3D ['rcu']
>
> Hi Vladimir,
>
> thanks a lot for working on this!
>
> I tested with static linking and there is a missing dependency to
> static_rte_rcu:
>
> In file included from ../subprojects/dpdk/lib/fib/dir24_8_avx512.c:6:<= br> > ../subprojects/dpdk/lib/fib/rte_fib.h:19:10: fatal error: rte_rcu_qsbr= .h: No such file or directory
>=C2=A0 =C2=A0 19 | #include <rte_rcu_qsbr.h>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~~~= ~~~~~~~~
>
> After adding it:
>
> @@ -45,7 +45,7 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binu= tils_ok
>=C2=A0 =C2=A0 =C2=A0 elif cc.has_multi_arguments('-mavx512f', &= #39;-mavx512dq')
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dir24_8_avx512_tmp =3D static_librar= y('dir24_8_avx512_tmp',
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'dir= 24_8_avx512.c',
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dependencies:= static_rte_eal,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dependencies:= [static_rte_eal, static_rte_rcu],
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 c_args: = cflags + ['-mavx512f', '-mavx512dq'])
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 objs +=3D dir24_8_avx512_tmp.extract= _objects('dir24_8_avx512.c')
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cflags +=3D ['-DCC_DIR24_8_AVX51= 2_SUPPORT']
>
> I get another error:
>
> In file included from /usr/lib/gcc/x86_64-redhat-linux/14/include/immi= ntrin.h:65,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 from /us= r/lib/gcc/x86_64-redhat-linux/14/include/x86intrin.h:32,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 from ../= subprojects/dpdk/lib/eal/x86/include/rte_vect.h:26,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 from ../= subprojects/dpdk/lib/fib/dir24_8_avx512.c:5:
> /usr/lib/gcc/x86_64-redhat-linux/14/include/avx512bwintrin.h: In funct= ion =E2=80=98dir24_8_vec_lookup_x16=E2=80=99:
> /usr/lib/gcc/x86_64-redhat-linux/14/include/avx512bwintrin.h:1947:1: e= rror: inlining failed in call to =E2=80=98always_inline=E2=80=99 =E2=80=98_= mm512_shuffle_epi8=E2=80=99: target specific option mismatch
>=C2=A0 1947 | _mm512_shuffle_epi8 (__m512i __A, __m512i __B)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0| ^~~~~~~~~~~~~~~~~~~
> ../subprojects/dpdk/lib/fib/dir24_8_avx512.c:38:26: note: called from = here
>=C2=A0 =C2=A0 38 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0ip_vec =3D _mm512_shuffle_epi8(ip_vec, bswap32);
>=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 =C2=A0 =C2=A0 ^~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~
> /usr/lib/gcc/x86_64-redhat-linux/14/include/avx512bwintrin.h:1947:1: e= rror: inlining failed in call to =E2=80=98always_inline=E2=80=99 =E2=80=98_= mm512_shuffle_epi8=E2=80=99: target specific option mismatch
>=C2=A0 1947 | _mm512_shuffle_epi8 (__m512i __A, __m512i __B)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0| ^~~~~~~~~~~~~~~~~~~
> ../subprojects/dpdk/lib/fib/dir24_8_avx512.c:38:26: note: called from = here
>=C2=A0 =C2=A0 38 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0ip_vec =3D _mm512_shuffle_epi8(ip_vec, bswap32);
>=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 =C2=A0 =C2=A0 ^~~~~~~~~

The latter issue is because you had applied the endianness change.
I replied in the other thread.


--
David Marchand



--
Regards,
Vladimir
--0000000000008c0bf50623a574f9--