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 2D4B345AF0; Wed, 9 Oct 2024 11:51:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2F724065D; Wed, 9 Oct 2024 11:51:46 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id B3C06402DB for ; Wed, 9 Oct 2024 11:51:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728467505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XHzLG2TBE/tc/v1kJiXqrg0EJ+N8kOvy+lp1MEV+msc=; b=US/XJq0UZGJyM3kducWJVpPiRjc8GAwIWUa4xVnaDP6+/AsKcfWbklUVLhFdA2OzVTIZU1 lvnhcD8P//REyOjlxaw6CIOmrlt2ZCbEv05dwPoFnUKN4VENDRx25gm/fDPc1bFETK25lp C1MVG/0LOFeV06THYdqQl1QAgBMZ1wg= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-360-_aGHTtUUP5amy51WCTCOaQ-1; Wed, 09 Oct 2024 05:51:42 -0400 X-MC-Unique: _aGHTtUUP5amy51WCTCOaQ-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2f75cf9472dso55890071fa.3 for ; Wed, 09 Oct 2024 02:51:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728467500; x=1729072300; h=content-transfer-encoding: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=XHzLG2TBE/tc/v1kJiXqrg0EJ+N8kOvy+lp1MEV+msc=; b=gJ5PZO5aVr4kDRXdNQGuJAO4/Y7xze7JmBwx5yRZYzBAIj24AlCevdf4xKHhORnWRi k45mGuDbgehC249yMRnbb6v3Hy+O0mlsgZCVNNHhH+lkjaFJkMJKas53uRAwOTXAcMyg IvAjLLAoV2dj0Zsodytl68x/WRJqpcNClmNxriY4tdZf08V2t/nae7GSKnmo43UaMRss cgHUJvei4coU4dUwBBfOvTeyGiMRttS91A+CTw1GYRMd5hBuGA3NF6ZkmrP3DXyVNMWR V+hd76Xefs+qpG04AZsJpeCGKyQLJsPkSu/VkVeFmAJi+XDTJdcEeL6tEv243BZc/kH3 rL1w== X-Gm-Message-State: AOJu0Yx/QyQF28/iE3AehPkteD12y3Ry/96P+rlJtdBng85E3R/lebX5 M8Z/cX7YsnHWhXC/0qy7RwPq5i5bgGR8EjTBhiBkRFMsr6TDfAcdoz/yQz9N0h7hRsM1XZZvvXj pkjSTphUVcRIGUxl1KxPOMQ3oiRks5pDOfEH6C/rLxTnx1eChe6PBpUFsB7GQnCZwEheHzvIXK6 Ift6Cqibj3QCJ3sDg= X-Received: by 2002:a05:651c:b0f:b0:2fa:d58d:dcf3 with SMTP id 38308e7fff4ca-2fb187cd62fmr12101491fa.33.1728467500304; Wed, 09 Oct 2024 02:51:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGstRPK0Bh/IJeRiKLoWa1Z3qMeAnSxmo53rLDbw1mDzy5J8WUA2YswYsENfNaXC7dbVL4UFlyxL45fNTK0FfE= X-Received: by 2002:a05:651c:b0f:b0:2fa:d58d:dcf3 with SMTP id 38308e7fff4ca-2fb187cd62fmr12101311fa.33.1728467499837; Wed, 09 Oct 2024 02:51:39 -0700 (PDT) MIME-Version: 1.0 References: <20241008171605.378069-1-vladimir.medvedkin@intel.com> In-Reply-To: <20241008171605.378069-1-vladimir.medvedkin@intel.com> From: David Marchand Date: Wed, 9 Oct 2024 11:51:27 +0200 Message-ID: Subject: Re: [PATCH v2] fib: network byte order IPv4 lookup To: Vladimir Medvedkin Cc: dev@dpdk.org, rjarry@redhat.com, mb@smartsharesystems.com, Stephen Hemminger X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hi Vladimir, On Tue, Oct 8, 2024 at 7:16=E2=80=AFPM Vladimir Medvedkin wrote: > diff --git a/lib/fib/dir24_8_avx512.c b/lib/fib/dir24_8_avx512.c > index 43dba28cfb..edd802abe4 100644 > --- a/lib/fib/dir24_8_avx512.c > +++ b/lib/fib/dir24_8_avx512.c > @@ -10,7 +10,7 @@ > > static __rte_always_inline void > dir24_8_vec_lookup_x16(void *p, const uint32_t *ips, > - uint64_t *next_hops, int size) > + uint64_t *next_hops, int size, bool be_addr) > { > struct dir24_8_tbl *dp =3D (struct dir24_8_tbl *)p; > __mmask16 msk_ext; > @@ -28,6 +28,16 @@ dir24_8_vec_lookup_x16(void *p, const uint32_t *ips, > res_msk =3D _mm512_set1_epi32(UINT16_MAX); > > ip_vec =3D _mm512_loadu_si512(ips); > + if (be_addr) { > + const __m512i bswap32 =3D _mm512_set_epi8( Some toolchains do not like _mm512_set_epi8 (reported by the CI). > + 12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2= , 3, > + 12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2= , 3, > + 12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2= , 3, > + 12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2= , 3 > + ); > + ip_vec =3D _mm512_shuffle_epi8(ip_vec, bswap32); > + } > + > /* mask 24 most significant bits */ > idxes =3D _mm512_srli_epi32(ip_vec, 8); > [snip] > diff --git a/lib/fib/meson.build b/lib/fib/meson.build > index 6795f41a0a..8c03496cdc 100644 > --- a/lib/fib/meson.build > +++ b/lib/fib/meson.build > @@ -25,40 +25,28 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok > # linked into main lib. > > # check if all required flags already enabled (variant a). > - acl_avx512_flags =3D ['__AVX512F__','__AVX512DQ__'] > - acl_avx512_on =3D true > - foreach f:acl_avx512_flags > + fib_avx512_flags =3D ['__AVX512F__','__AVX512DQ__', '__AVX512BW__'] > + fib_avx512_on =3D true > + foreach f:fib_avx512_flags > if cc.get_define(f, args: machine_args) =3D=3D '' > - acl_avx512_on =3D false > + fib_avx512_on =3D false > endif > endforeach Please reuse the common checks recently merged, see for example: https://git.dpdk.org/dpdk/diff/drivers/event/dlb2/meson.build?id=3Def7a4025= cd714189dc333bb19ea60c2abdeffb7d > > - if acl_avx512_on =3D=3D true > - cflags +=3D ['-DCC_DIR24_8_AVX512_SUPPORT'] > - sources +=3D files('dir24_8_avx512.c') > - # TRIE AVX512 implementation uses avx512bw intrinsics along with > - # avx512f and avx512dq > - if cc.get_define('__AVX512BW__', args: machine_args) !=3D '' > - cflags +=3D ['-DCC_TRIE_AVX512_SUPPORT'] > - sources +=3D files('trie_avx512.c') > - endif > - elif cc.has_multi_arguments('-mavx512f', '-mavx512dq') > + if fib_avx512_on =3D=3D true > + cflags +=3D ['-DCC_DIR24_8_AVX512_SUPPORT', '-DCC_TRIE_AVX512_SU= PPORT'] Nit: now that both dir24_8 and trie share the same requirement, can we go with a simple CC_AVX512_SUPPORT? --=20 David Marchand