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 BDFE141C8C; Mon, 13 Feb 2023 21:01:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D88C142D7C; Mon, 13 Feb 2023 21:00:00 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id 1614142D81 for ; Mon, 13 Feb 2023 20:59:48 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id oa11-20020a17090b1bcb00b002341a2656e5so1805583pjb.1 for ; Mon, 13 Feb 2023 11:59:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; 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=dGm9hn4jY/wq6ATDlBoMznoK+SGsfKps427n+SePoU8=; b=XMIkP5cUxGpkg7PzrQ/2INDsM7aHtaJcympOJXSlqGmiVyeYhSDgcl8ctoZz1agA5Z naR217qDdxn+nVhrbLgLVZ9zmx++NYd2tHC2THsd1LdpzHW+fVioJdGQ89r5y5aYe0gg FgY/F6cQ2obdUxx8PZJ76cyV/aUiZYakK/d12tXKk+xyAZlQj0Ih+aEw+dW6e7bnF6Vu 5XxFKVjU1xajbe/pmT1mYooM039NENm+bl2GGLmijHPzC0K/+CH7EPBAioPlCEx6CtO3 2LHEKQO1dOhb8Fm8C3z66s4pNIA0V27/xhgvd6Gp5nEOAbkrp0LaIo1SUP9RLOm1Y4OH 7UQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=dGm9hn4jY/wq6ATDlBoMznoK+SGsfKps427n+SePoU8=; b=VdnUl/sMdHWgReNZtkxLoAhU+ARcQT6feV0lQNVF7cm069SJiIbjIC8S1DVfnDGTJR tccP7owYr6XaGOtwFL1nqp6iKi0peXK75H3ciCExEpLJelPkWBulbPNRPaw5J5sovSv9 uirGcNwtRRh/GZ8GkVfCXvc5vMPx8XfuPY8R/D4N1fgunGUoTB0UhcTfy6h/15ME3FCK Qz+BSN5XQJllJFMDz1RnZpTNEl68Fq3BMqCiMzHVas0slxObBBmMuWLyAkeywl2BOF+3 NLfwPH6TD2+pJdcJg/2N/AyiVXpgi8CFt4FTsZs3AuNJay+jgXirgLpOUbjJLKN3pxL9 6OiA== X-Gm-Message-State: AO0yUKU67L7yfXI8zUfS+80rPzV03z2EWZrqI+XaheCEPjQV2yyymS6F OT74nU5FT+EHsdYDzIjWsrQVehYBQUgzBRJdjco= X-Google-Smtp-Source: AK7set+7vf9FeH7sB4oO1Yt1dY069un/iZPTudpNAy3Z9zIcKelEFFsd9nErDaP80ze2cGHJbTaeaw== X-Received: by 2002:a17:902:cec6:b0:196:725c:6ea with SMTP id d6-20020a170902cec600b00196725c06eamr149768plg.19.1676318387343; Mon, 13 Feb 2023 11:59:47 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id n20-20020a170902d0d400b001994e74c094sm8578911pln.275.2023.02.13.11.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 11:59:46 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v4 17/19] hash: move rte_thash_gfni stubs out of header file Date: Mon, 13 Feb 2023 11:55:49 -0800 Message-Id: <20230213195551.1146298-18-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213195551.1146298-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230213195551.1146298-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 Having stubs in header file makes it harder to update RTE_LOG(). Also modify to only print warning once. Signed-off-by: Stephen Hemminger --- lib/hash/meson.build | 8 +++++++- lib/hash/rte_thash_gfni.c | 43 +++++++++++++++++++++++++++++++++++++++ lib/hash/rte_thash_gfni.h | 28 +++++-------------------- lib/hash/version.map | 4 ++++ 4 files changed, 59 insertions(+), 24 deletions(-) create mode 100644 lib/hash/rte_thash_gfni.c diff --git a/lib/hash/meson.build b/lib/hash/meson.build index 2f757d45f9bc..e56ee8572564 100644 --- a/lib/hash/meson.build +++ b/lib/hash/meson.build @@ -17,7 +17,13 @@ indirect_headers += files( 'rte_thash_x86_gfni.h', ) -sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c', 'rte_thash.c') +sources = files( + 'rte_cuckoo_hash.c', + 'rte_fbk_hash.c', + 'rte_thash.c', + 'rte_thash_gfni.c' +) + deps += ['net'] deps += ['ring'] deps += ['rcu'] diff --git a/lib/hash/rte_thash_gfni.c b/lib/hash/rte_thash_gfni.c new file mode 100644 index 000000000000..7617b9d4f630 --- /dev/null +++ b/lib/hash/rte_thash_gfni.c @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2021 Intel Corporation + */ + +#include + +#include +#include +#include + +uint32_t +rte_thash_gfni(const uint64_t *mtrx __rte_unused, + const uint8_t *key __rte_unused, int len __rte_unused) +{ + static bool warned; + + if (!warned) { + warned = true; + RTE_LOG(ERR, HASH, + "%s is undefined under given arch\n", __func__); + } + + return 0; +} + +void +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) +{ + unsigned int i; + + static bool warned; + + if (!warned) { + warned = true; + RTE_LOG(ERR, HASH, + "%s is undefined under given arch\n", __func__); + } + + for (i = 0; i < num; i++) + val[i] = 0; +} diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h index ef90faa302d1..86208eb45ebb 100644 --- a/lib/hash/rte_thash_gfni.h +++ b/lib/hash/rte_thash_gfni.h @@ -9,13 +9,8 @@ extern "C" { #endif -#include -#include - #ifdef RTE_ARCH_X86 - #include - #endif #ifndef RTE_THASH_GFNI_DEFINED @@ -38,13 +33,8 @@ extern "C" { * Calculated Toeplitz hash value. */ __rte_experimental -static inline uint32_t -rte_thash_gfni(const uint64_t *mtrx __rte_unused, - const uint8_t *key __rte_unused, int len __rte_unused) -{ - RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__); - return 0; -} +uint32_t +rte_thash_gfni(const uint64_t *mtrx, const uint8_t *key, int len); /** * Bulk implementation for Toeplitz hash. @@ -67,17 +57,9 @@ rte_thash_gfni(const uint64_t *mtrx __rte_unused, * Number of tuples to hash. */ __rte_experimental -static inline void -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) -{ - unsigned int i; - - RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__); - for (i = 0; i < num; i++) - val[i] = 0; -} +void +rte_thash_gfni_bulk(const uint64_t *mtrx, int len, uint8_t *tuple[], + uint32_t val[], uint32_t num); #endif /* RTE_THASH_GFNI_DEFINED */ diff --git a/lib/hash/version.map b/lib/hash/version.map index bdcebd19c29b..f03b047b2eec 100644 --- a/lib/hash/version.map +++ b/lib/hash/version.map @@ -51,4 +51,8 @@ EXPERIMENTAL { rte_thash_complete_matrix; rte_thash_get_gfni_matrices; rte_thash_gfni_supported; + + # added in 22.07 + rte_thash_gfni; + rte_thash_gfni_bulk; }; -- 2.39.1