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 13C2B43C12; Thu, 7 Mar 2024 18:36:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ABDBB42DA1; Thu, 7 Mar 2024 18:36:54 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id A9C3A402BA for ; Thu, 7 Mar 2024 18:36:52 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id B342C20B74C0; Thu, 7 Mar 2024 09:36:51 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B342C20B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709833011; bh=11aQeX3sQ2iT0Pbn16FX+q4rxcIMz70TtAZLyO+n2uw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=soNGdY1KQpYfdWuRofi1izU9SR81KREA6pzezlN56rEkN5b0FMfjtdBxO6lLhnezJ Vj6g5/kyYsw1DkJg4WNTxhdXGtUFRE2fgqQKzTXEW+G417X+EgF31YbO7pL+KjCv8F arUoyCTV7QPXJa4fO+L4kOYoAj0no/a/DmJDd1yk= Date: Thu, 7 Mar 2024 09:36:51 -0800 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org, Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: Re: [PATCH v3] hash: put GFNI stubs back Message-ID: <20240307173651.GA13790@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20240304184508.89956-1-stephen@networkplumber.org> <20240307013715.114013-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240307013715.114013-1-stephen@networkplumber.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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 On Wed, Mar 06, 2024 at 05:36:42PM -0800, Stephen Hemminger wrote: > Make the GFNI stub functions always built. This solves the conditional > linking problem. If GFNI is available, they will never get used. > > Fixes: 07d836e5929d ("hash: uninline GFNI stubs") > Signed-off-by: Stephen Hemminger > --- I can confirm that v3 of the series allows me to complete build & link with LLVM 14 / clang. Tested-by: Tyler Retzlaff > v3 - fix typo in call to ___rte_thash_gfni_bulk > > lib/hash/rte_thash_gfni.c | 9 +++------ > lib/hash/rte_thash_gfni.h | 30 +++++++++++++++++++++++------- > lib/hash/version.map | 9 +++++++-- > 3 files changed, 33 insertions(+), 15 deletions(-) > > diff --git a/lib/hash/rte_thash_gfni.c b/lib/hash/rte_thash_gfni.c > index f1525f9838de..5ead51dd3426 100644 > --- a/lib/hash/rte_thash_gfni.c > +++ b/lib/hash/rte_thash_gfni.c > @@ -4,18 +4,17 @@ > > #include > > +#include > #include > #include > > -#ifndef RTE_THASH_GFNI_DEFINED > - > RTE_LOG_REGISTER_SUFFIX(hash_gfni_logtype, gfni, INFO); > #define RTE_LOGTYPE_HASH hash_gfni_logtype > #define HASH_LOG(level, ...) \ > RTE_LOG_LINE(level, HASH, "" __VA_ARGS__) > > uint32_t > -rte_thash_gfni(const uint64_t *mtrx __rte_unused, > +___rte_thash_gfni(const uint64_t *mtrx __rte_unused, > const uint8_t *key __rte_unused, int len __rte_unused) > { > static bool warned; > @@ -30,7 +29,7 @@ rte_thash_gfni(const uint64_t *mtrx __rte_unused, > } > > void > -rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, > +___rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, > int len __rte_unused, uint8_t *tuple[] __rte_unused, > uint32_t val[], uint32_t num) > { > @@ -47,5 +46,3 @@ rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, > for (i = 0; i < num; i++) > val[i] = 0; > } > - > -#endif > diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h > index eed55fc86c86..432d5b63a12e 100644 > --- a/lib/hash/rte_thash_gfni.h > +++ b/lib/hash/rte_thash_gfni.h > @@ -17,11 +17,22 @@ extern "C" { > > #endif > > -#ifndef RTE_THASH_GFNI_DEFINED > +/* > + * @internal > + * Stubs defined for only used when GFNI is not available > + */ > +__rte_internal > +uint32_t > +___rte_thash_gfni(const uint64_t *mtrx, const uint8_t *key, int len); > + > +__rte_internal > +void > +___rte_thash_gfni_bulk(const uint64_t *mtrx, int len, uint8_t *tuple[], > + uint32_t val[], uint32_t num); > > +#ifndef RTE_THASH_GFNI_DEFINED > /** > * Calculate Toeplitz hash. > - * Dummy implementation. > * > * @param m > * Pointer to the matrices generated from the corresponding > @@ -33,12 +44,14 @@ extern "C" { > * @return > * Calculated Toeplitz hash value. > */ > -uint32_t > -rte_thash_gfni(const uint64_t *mtrx, const uint8_t *key, int len); > +static inline uint32_t > +rte_thash_gfni(const uint64_t *mtrx, const uint8_t *key, int len) > +{ > + return ___rte_thash_gfni(mtrx, key, len); > +} > > /** > * Bulk implementation for Toeplitz hash. > - * Dummy implementation. > * > * @param m > * Pointer to the matrices generated from the corresponding > @@ -53,9 +66,12 @@ rte_thash_gfni(const uint64_t *mtrx, const uint8_t *key, int len); > * @param num > * Number of tuples to hash. > */ > -void > +static inline void > rte_thash_gfni_bulk(const uint64_t *mtrx, int len, uint8_t *tuple[], > - uint32_t val[], uint32_t num); > + uint32_t val[], uint32_t num) > +{ > + return ___rte_thash_gfni_bulk(mtrx, len, tuple, val, num); > +} > > #endif /* RTE_THASH_GFNI_DEFINED */ > > diff --git a/lib/hash/version.map b/lib/hash/version.map > index 6b2afebf6b46..942e2998578f 100644 > --- a/lib/hash/version.map > +++ b/lib/hash/version.map > @@ -41,10 +41,15 @@ DPDK_24 { > rte_thash_get_gfni_matrices; > rte_thash_get_helper; > rte_thash_get_key; > - rte_thash_gfni; > - rte_thash_gfni_bulk; > rte_thash_gfni_supported; > rte_thash_init_ctx; > > local: *; > }; > + > +INTERNAL { > + global: > + > + ___rte_thash_gfni; > + ___rte_thash_gfni_bulk; > +}; > -- > 2.43.0