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 D28A743C21; Thu, 7 Mar 2024 21:17:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 959D8402BA; Thu, 7 Mar 2024 21:17:54 +0100 (CET) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id 9EFCC40272 for ; Thu, 7 Mar 2024 21:17:52 +0100 (CET) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6e64997a934so1078276b3a.0 for ; Thu, 07 Mar 2024 12:17:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709842672; x=1710447472; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FyP7K0czIDCU4gKCZTWJldq3RGGEKoT+rm07jHhBHJU=; b=Oe8Njy95s+lnOWhOuc2e9yOzPoWQ6lNx8ihoEn20x0GYFVmjlPJXGSV4r/gseuMfEz 67XA69cAjAvcGQwlpe542YRGbPb2imetJIosF2ZZ7Sxlw6KvKdLgTYSQdq08EApRM5TW KlNy5gw8b7cNmg0CdQuWCb2J7ycPO2fSztO5Rd7Nx9W5iGXZP8hkSSXkgqZbPWBaJp+h XbypJVua0em8qikplG25XshPd83o5QTvxe+QMDQatjid46yTwc7lXsp631Cnial4OjcN zAgd34hiXT1zGgln+QQM+HSp5rd1hApR9Qwn08w4QAYmy2bvfmYRczM3xEBkHehxTg7y 5hYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709842672; x=1710447472; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FyP7K0czIDCU4gKCZTWJldq3RGGEKoT+rm07jHhBHJU=; b=fouWc5IIr2iETNlqv51F9aQqxBE86D6ZDEUmvuKqIqZaz9LqfvyMGiQURWM/y6QJWq 2iDXi0v6GP+baOvRk2HB5X3vwYjzJZKOmg39aEJKgGGDv6TfDH/CkOYGD80bWifvRKxW ECDqk57yzKvx/qNo8Ra+Ycg/0622gSIOGVSNGLKMLG7s6cX2riPqau1dUQM+tkaJbGSK dq+yjkWTGwfkqHk/2BOt10OImGf1JDipxZDHHkhkxxxIyRAr0pmGS2JYEP3h1WsT6eew nykL1aWaY52JuajUZL+L3gro+7u8gl/llai8G72whUWxisAcNQ75Zwe6O9HAknaUuOy0 SXGw== X-Gm-Message-State: AOJu0Yz+lWs228/U0hi5DIlwmhb1DSZJp1/hb1D+HggeoUyWO3tHlx9y 6vIBRwwBaMp06YDFDtIyRNJGasadYHAnDCogcoZkP+zb5bN7USlGc/CxsIakVoC2XrYJS0GtiuG BQjI= X-Google-Smtp-Source: AGHT+IFZdgDox5Az4rGSCehko4DXHeY9Zd1FL3gKkZSBqE4UGwJq3K7YkshQdKXhUWIbMkn+4gZ8Yw== X-Received: by 2002:a05:6a00:1808:b0:6e6:4516:4b3d with SMTP id y8-20020a056a00180800b006e645164b3dmr8804038pfa.21.1709842671721; Thu, 07 Mar 2024 12:17:51 -0800 (PST) Received: from hermes.lan (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id f31-20020a056a000b1f00b006e554b5f170sm9883751pfu.118.2024.03.07.12.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 12:17:51 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v4] hash: put GFNI stubs back Date: Thu, 7 Mar 2024 11:14:59 -0800 Message-ID: <20240307191545.26452-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240304184508.89956-1-stephen@networkplumber.org> References: <20240304184508.89956-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 --- v4 - fix build on aarch64 and __rte_internal lib/hash/rte_thash_gfni.c | 8 ++------ lib/hash/rte_thash_gfni.h | 32 ++++++++++++++++++++++++-------- lib/hash/version.map | 9 +++++++-- 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/lib/hash/rte_thash_gfni.c b/lib/hash/rte_thash_gfni.c index f1525f9838de..feb2b464de10 100644 --- a/lib/hash/rte_thash_gfni.c +++ b/lib/hash/rte_thash_gfni.c @@ -7,15 +7,13 @@ #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 +28,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 +45,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..2e169caef23f 100644 --- a/lib/hash/rte_thash_gfni.h +++ b/lib/hash/rte_thash_gfni.h @@ -9,7 +9,7 @@ extern "C" { #endif -#include +#include #ifdef RTE_ARCH_X86 @@ -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