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 6632643C60; Thu, 7 Mar 2024 02:37:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 214B242F01; Thu, 7 Mar 2024 02:37:29 +0100 (CET) Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) by mails.dpdk.org (Postfix) with ESMTP id C183542EE3 for ; Thu, 7 Mar 2024 02:37:26 +0100 (CET) Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-3c1ea5f29a6so121569b6e.0 for ; Wed, 06 Mar 2024 17:37:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709775446; x=1710380246; 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=ib39tuChew5Z5HRONC+XqMx6/z/cwW2fbxqAH+2N6u8=; b=Nq3sRGCGf/iKaBUICmSe9mG3c3dkRFnDuWvQybqy8n1kVu/dfJSVms9TCQPO63g/pI SJYTHGI+Xz3ScvXWyzPlru24v2hGIsBkvNyy2c4ubgfGHKQXOfLW8rVG7KycLd8SljBh BOCvjU8x7P3G7IKVUHbnXT1uIMrqUv9tj+uCbliKiCgaOiBZhSTAbApqsnALyuJ3kN6I xQu8orZeNOfVYz8EK60LsxBm/IRZN+9eF344gZw1WFDZwNoMCoCr9JV6xXZ2YNyCxhpG j/RGZNvfJueZYLCLy0HktAr6U5kDHtNsTk1oLZ2CLk+zSf4yKNDGHV3Vtw4W0QR3pZwS Wh1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709775446; x=1710380246; 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=ib39tuChew5Z5HRONC+XqMx6/z/cwW2fbxqAH+2N6u8=; b=QOzROt41rUSIqVjzl013+RUnYdVvE5YpgB7y/6BgcwmuI+rd7vTEiysgzpHJrvZj2b iES9U4yP2ERKJyREbo72qRgVbmE39xLEgstnNmPeWITDNEOtAJXiBegRe+UUS2uQaapG cddxNXv3NO1GJhpy0xNkVtFNO1s3iyXiqDRgpwwtF52g6a2rjeMds0PA+5mwFOCWTxWu dd7XXM1e56qWjxw+uGYxXCQsTR4uTdHNbsZW7e1wNlaEEvVWdMQ5qI6IZGcQsApc0y6s +ifQX44a1h2H+5uz9mhvgcTqtQRL8yKFOzu0ENVESQuwJ5Wd/uzXoiIKYJjYpHx5s52Y Z7pQ== X-Gm-Message-State: AOJu0YzAd9N1NDDNCtBhlQvA6jiaj+wNhhCIM4Pbi9+2g0OxPaJ57fdh axb5POpP9m1QA+ltvGbGkk49DAsxQ8pdcdqClAjhoGqMT+qOuq9rKadNdrf639bNKVNk0J6KsLB U14Y= X-Google-Smtp-Source: AGHT+IEj+Xy+//cVW1kU46N7I0Am8ZiBMNs72DuzZKoh9IRhGUFIg6JmwBqcteVQ5dYk9+pTQ5neZg== X-Received: by 2002:a05:6808:1597:b0:3c1:8493:751f with SMTP id t23-20020a056808159700b003c18493751fmr8544608oiw.9.1709775445856; Wed, 06 Mar 2024 17:37:25 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id r16-20020a62e410000000b006e46047fe04sm11419029pfh.204.2024.03.06.17.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 17:37:25 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v3] hash: put GFNI stubs back Date: Wed, 6 Mar 2024 17:36:42 -0800 Message-ID: <20240307013715.114013-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 --- 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