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 05DB541D43; Wed, 22 Feb 2023 22:57:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3366443229; Wed, 22 Feb 2023 22:56:35 +0100 (CET) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mails.dpdk.org (Postfix) with ESMTP id 174C5431C4 for ; Wed, 22 Feb 2023 22:56:12 +0100 (CET) Received: by mail-pg1-f172.google.com with SMTP id q189so4872376pga.9 for ; Wed, 22 Feb 2023 13:56:12 -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=5NA6mvX+cVJ8QnJL/IRAQX0yxV5V0Dus9MqtpxM1xKc=; b=k8z5kPJI4q634TE85xwhzusTRXIQ1QH9KC9tToC5BlW0cMeRjxpEo8YK9NpTR3c/pN 59XKq4ygjpq0rAf+MQKQk6i8SxLV0ZrFvEoUAcLtBYg8AstVyB176npintbjxoJm7zJo t5yO+gKfwXPC37aU5ttDUAC0KayeeKGcqB4KzgFdQSIybBPbdJOrLxtJOoN03Nr8oMrk WJsAjwJ29wY1/ZhoLV/r/TvcHZ1ab9FIcn+vlM6S38eckyqjBo3A5zl0o9izxPoKwdr8 FNPbOzcMj9XWN8Ya6DrlQA6cujbwDW2w5mstugJHTcbYg4g7/n83gShESX9LYi1doOoz 20GA== 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=5NA6mvX+cVJ8QnJL/IRAQX0yxV5V0Dus9MqtpxM1xKc=; b=CTjea7/X5WQKGUfNfZaD7UOAyAni1Oah5EUayTU4SlUtzvEn2zRjSEgj6w04C4Xs7F srLFwJ5B6rtM+vm4fOItlIGBND7s9I63JdAmeNQoXQsBX4U1iX9VebGNXzxKeXHuOkq4 pYVJDdrsEd7Z9kG6uwFfD9BjvmFTGdVJ/qHLPm6ytRN6wdqrw287ipsEEYaFg3zkBntC kwhS8JaZgeq1pnEDq/LvJLsSkYXCv2+5JT4ele7kNcmEl2TlH32jKYfy08Dc7Q68BTG7 zlqOeRxQs8J5iKcOtzSbdc+EQ5gWhljReCg6J8GwTCpJi0HcGHCCABNgU6IQ5bDaEcHR QtJw== X-Gm-Message-State: AO0yUKWP3zAQibc8cdj4cmxPGlGCxWmeAborEcng80hYCHTdyZIjHKo4 EFoq/JuHS+Td4Vx6z89g/vaqI+FqnyB6MyKNRiU= X-Google-Smtp-Source: AK7set+woceDovSNIPy/MFVFr8pNtL8vOXV0XAlmE6UZm++ChP7WB3zAH2KB38/qoPHAnieVkJpQCg== X-Received: by 2002:aa7:8bd0:0:b0:5cd:d766:8a26 with SMTP id s16-20020aa78bd0000000b005cdd7668a26mr6367335pfd.8.1677102971024; Wed, 22 Feb 2023 13:56:11 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id d7-20020aa78147000000b00571cdbd0771sm6400722pfn.102.2023.02.22.13.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 13:56:10 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v11 22/22] hash: convert RTE_LOGTYPE_HASH to dynamic type Date: Wed, 22 Feb 2023 13:55:41 -0800 Message-Id: <20230222215541.158205-23-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222215541.158205-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222215541.158205-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 Use dynamic type for hash and add subtypes for crc and gfni. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/hash/rte_cuckoo_hash.c | 5 +++++ lib/hash/rte_fbk_hash.c | 5 +++++ lib/hash/rte_thash.c | 3 +++ lib/hash/rte_thash_gfni.c | 3 +++ 6 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index a3498d1a2faf..704924e822d0 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -350,7 +350,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, - {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 7473fd53505a..29db07881a5a 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -32,7 +32,7 @@ extern "C" { /* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ -#define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ + /* was RTE_LOGTYPE_HASH */ /* was RTE_LOGTYPE_LPM */ /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c index 829b79c89a27..e2b07bfbad71 100644 --- a/lib/hash/rte_cuckoo_hash.c +++ b/lib/hash/rte_cuckoo_hash.c @@ -24,6 +24,11 @@ #include #include "rte_hash.h" + +/* needs to be before rte_cuckoo_hash.h */ +RTE_LOG_REGISTER_DEFAULT(hash_logtype, INFO); +#define RTE_LOGTYPE_HASH hash_logtype + #include "rte_cuckoo_hash.h" /* Mask of all flags supported by this version */ diff --git a/lib/hash/rte_fbk_hash.c b/lib/hash/rte_fbk_hash.c index 538b23a4030a..b4c4c191abdc 100644 --- a/lib/hash/rte_fbk_hash.c +++ b/lib/hash/rte_fbk_hash.c @@ -8,6 +8,8 @@ #include #include + +#include #include #include #include @@ -18,6 +20,9 @@ #include "rte_fbk_hash.h" +RTE_LOG_REGISTER_SUFFIX(fbk_hash_logtype, fbk, INFO); +#define RTE_LOGTYPE_HASH fbk_hash_logtype + TAILQ_HEAD(rte_fbk_hash_list, rte_tailq_entry); static struct rte_tailq_elem rte_fbk_hash_tailq = { diff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c index 0249883b8d07..c1fd2e34c9d4 100644 --- a/lib/hash/rte_thash.c +++ b/lib/hash/rte_thash.c @@ -13,6 +13,9 @@ #include #include +RTE_LOG_REGISTER_SUFFIX(thash_logtype, thash, INFO); +#define RTE_LOGTYPE_HASH thash_logtype + #define THASH_NAME_LEN 64 #define TOEPLITZ_HASH_LEN 32 diff --git a/lib/hash/rte_thash_gfni.c b/lib/hash/rte_thash_gfni.c index eb334185725c..35206d575153 100644 --- a/lib/hash/rte_thash_gfni.c +++ b/lib/hash/rte_thash_gfni.c @@ -10,6 +10,9 @@ #ifndef RTE_THASH_GFNI_DEFINED +RTE_LOG_REGISTER_SUFFIX(hash_gfni_logtype, gfni, INFO); +#define RTE_LOGTYPE_HASH hash_gfni_logtype + uint32_t rte_thash_gfni(const uint64_t *mtrx __rte_unused, const uint8_t *key __rte_unused, int len __rte_unused) -- 2.39.1