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 E3AB441C8C; Mon, 13 Feb 2023 21:01:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B246D42F9E; Mon, 13 Feb 2023 21:00:03 +0100 (CET) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id 0288242D94 for ; Mon, 13 Feb 2023 20:59:50 +0100 (CET) Received: by mail-pj1-f52.google.com with SMTP id nh19-20020a17090b365300b00233ceae8407so5772092pjb.3 for ; Mon, 13 Feb 2023 11:59:49 -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=fv/Zf9MqkBAhObUGSX70onEs/rVmNuW3gBelMtg90IQ=; b=e4yDwExCF1Ocxb3Gwa8p8p0hZdr/co+o4513PBqvTixBjgXSo30GRLODcVZn3C9urH 2UCLNdj5+W9ADVOI6U6+fyMYE0oC0iTqA3gqO0POJhNKr+SbERMvSIjtNsQcmDdD2ERe bV9OcOzB4cbEFruCOX91DGdpgrqa2d0fJCAW9Fx0Odg11F/MBi1Yr6TEQQDzsRm/CyQB cQP188n119rlLAs6y3pG8U8yYmKkkanxQXZBkjzBjykuz4AMz1diDKTlwbOH5bi8CON+ sd0qnE/XW7KKiT6EEtPPbjgdc/MCmL57sgBL2XBPPqYaRrj+SBhTv5UH2NP2eyhIomc0 d4fw== 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=fv/Zf9MqkBAhObUGSX70onEs/rVmNuW3gBelMtg90IQ=; b=qQSaaWQMARHIsDgqpkl5kdIc1Z9tJDKITgQG7tT5PH2Yrt1vwll1VTLJu0tYFrDhSy 1SsF222MGcny0ObNOHec12RWc8Wwc+2VbXBLz50Lb4ou+1m/+L1nE4el34chFkAg6/O3 8Ph92XRksuBUQ1GcKCFDBNXfXLIu3KVPChOXTJ1/UL7Z07MeBE1EFKWiqjfODyvPjBcX LB1odEx1P6nPut831pICufp3xrNS7qmILMk26r+tmCZNbUN/QJPB97GOa+e++hLWHvpV x62q+Ebw0PcryHUNiGmtiNou3SkQHOzE7QXXeM95W12kZ+dmMRhOaD/gQBEbX3mw3CiU kToA== X-Gm-Message-State: AO0yUKWYXT6757NSi8J1NUlqFngmNNTvTNQmbZ8TVjbt9ZLrRtYzpPvm ESp23e+5Z60KW1hnyGafLOP3lnreiOekYE5ne2I= X-Google-Smtp-Source: AK7set9XKTZCs8pMMEtT8HJzBkQcSBqxMuFjLog1lKD/zB82UW1J4wq9IppyEEa2Aj22SwMiwzckOw== X-Received: by 2002:a17:902:f693:b0:196:7d1b:f1c0 with SMTP id l19-20020a170902f69300b001967d1bf1c0mr157669plg.18.1676318389282; Mon, 13 Feb 2023 11:59:49 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 11:59:48 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v4 19/19] hash: convert RTE_LOGTYPE_HASH to dynamic type Date: Mon, 13 Feb 2023 11:55:51 -0800 Message-Id: <20230213195551.1146298-20-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 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 | 3 +++ lib/hash/rte_hash_crc.c | 3 +++ lib/hash/rte_thash.c | 3 +++ lib/hash/rte_thash_gfni.c | 3 +++ 7 files changed, 18 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..a5026193070a 100644 --- a/lib/hash/rte_fbk_hash.c +++ b/lib/hash/rte_fbk_hash.c @@ -18,6 +18,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_hash_crc.c b/lib/hash/rte_hash_crc.c index c59eebccb1eb..7c544a669f8a 100644 --- a/lib/hash/rte_hash_crc.c +++ b/lib/hash/rte_hash_crc.c @@ -7,6 +7,9 @@ #include "rte_hash_crc.h" +RTE_LOG_REGISTER_SUFFIX(hash_crc_logtype, crc, INFO); +#define RTE_LOGTYPE_HASH hash_crc_logtype + /** * Allow or disallow use of SSE4.2/ARMv8 intrinsics for CRC32 hash * calculation. 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 7617b9d4f630..f17ca222dc32 100644 --- a/lib/hash/rte_thash_gfni.c +++ b/lib/hash/rte_thash_gfni.c @@ -8,6 +8,9 @@ #include #include +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