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 1E88A41CF1; Tue, 21 Feb 2023 00:37:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B9BC43179; Tue, 21 Feb 2023 00:36:36 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id 3142B43141 for ; Tue, 21 Feb 2023 00:36:17 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id fd25so599668pfb.1 for ; Mon, 20 Feb 2023 15:36:17 -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=vBkc4YJNUrlP1wsMTIgrmdYDirgd14vI7/3Q3i10dh0ATeoC9Vs8Rn3XMfJ8l4RCOX /pMCa0D1L960gu7WE190ADnu8ZLQzu2K2uo8XnLISC4caFR6/wy1qW9Z18JkKPAFJsLE 1KuFk+HQZ0T+juMoaUkExpfUGuONw0kBgvaNyh9C50oJmVHW7fA/9MOwlLNdX9CEeze+ cLQ8ohVnjzD/k65Mzzfj54ef0YMZBaE7Qtq3ZtVwY5GLtW/wkdGhN+VkNBD4p6mMqVGx DrsugRlViUWMhci9JXEGEuib8mAiPSV4MM8ytpr3ei1eooAzLLYa1pSfOkgXYArDxwco VeRQ== 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=uK0BM5LVFzGbDy81Q8tuc0kzbzjEKkTOG011ipvxiSkvC95B/1Poag8rPF0Bo9YYf/ kaefcHksyPnJhGUcUVm3WuE/4CwS+Vt7YTWuA49RLuOeAl/TLB6GDsAMFqoeIwv9cI2p 2XhqDS9vETDpVEqDFh5AworI0PS7CYlWLsx1p8MalZeTSjTIeE4VrgehfyHZeuMR7Ti0 Uo4Q3DGEvi26wEoHJlKb63xerJlmhW0zSyKq766j3WeR0le5epTeuoXAN6bqXQypHs0n 1EOnN2Etg0Z6HuFjjEE7Rt83G6G9PLG4mLCt0PT3zVgiMSb3C0DzShxDckv/+4zoHhuD S2zQ== X-Gm-Message-State: AO0yUKVPMknoXtYZFjVJtUq8uTgDPftQjF6au7VCoSDBcOYdzO6CGqXD TOKJAo6fqyemWAy9iJudqgXy3vLeQ/smqEde1dM= X-Google-Smtp-Source: AK7set94BBxMJqRFJTZNnZ3MYMEq1nJXHjppdeYa8jr2v2PLejzGA27NE0LOlsG6H1SlrtE5C0lPug== X-Received: by 2002:a62:1d4e:0:b0:5a8:cec9:6ab6 with SMTP id d75-20020a621d4e000000b005a8cec96ab6mr2999980pfd.31.1676936176410; Mon, 20 Feb 2023 15:36:16 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:15 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 20/22] hash: move rte_thash_gfni stubs out of header file Date: Mon, 20 Feb 2023 15:35:54 -0800 Message-Id: <20230220233556.168553-21-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-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