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 86F52433FD; Tue, 5 Dec 2023 03:15:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94D9D42E07; Tue, 5 Dec 2023 03:14:12 +0100 (CET) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by mails.dpdk.org (Postfix) with ESMTP id 9052242DE3 for ; Tue, 5 Dec 2023 03:14:04 +0100 (CET) Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-3b844357f7cso2868088b6e.1 for ; Mon, 04 Dec 2023 18:14:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701742444; x=1702347244; 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=6yatbEXbk8JjdL02Xj5MmzSrD11/Ce5jY3XPRMVXuGc=; b=PyGmQl3MGn72eZHsXneKnDzm1SdRrbzHDnLVRcjQOoLjjjoHQ+302VM/J3ODxJzG3P J7r2ptWsgFcKM5CZZ4Gh+09ZwjCD/KuEGVPMDZ56qnUibOjmmugwvZ0vTXwpZVFGRywJ A5tTjivxnYyjABHbWNy/2dgCHx8J3r/PxMdDw4DHJQmHu3/Hfeb7C0nj690widbuZeDg lJD2r4P6vTgMvZNZ00vVBC6grd/VZ3cS3rXQOY3QkM5DsgBKAMwibsmZ3zeU8PPpTv0v 6ALcPkNShmaIuQW5VOG0HHcrIIKTPXHjdU6vRxG7+bzRETOLUtmmTtQHCKGQ+NVlz5xp 1IFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701742444; x=1702347244; 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=6yatbEXbk8JjdL02Xj5MmzSrD11/Ce5jY3XPRMVXuGc=; b=R3rTWX3wTyxsM8I2scEu9GuVE4tPeasC2UpvRkMIQtpUweyGR9jcSstTum5+iwHpFb r5sEYm1sDvbgHUICDO5QK0OQdXGMIOAZlOJLe9W01lzzymxvnRcZYngHUjr2GxXLxn+q gaVqpGWPRgqlEOxwGXgNSlQEPu+Pu8klvbUQqxXwuwkhoKJ/uM0Byv7K9xzkvNw+IHxu /BlIq5t0CheCLB+hhRMPwtxq3FasVAt7s1vi/yx6KjGqW44HdEvzEFyvic//4M08+vXw OKhiRhhz7au1m6TtQc4nmZsDC2DTnPBi6itvWg9lGNIRdhMdzVHb05mpho9JmqBBHWl4 wI9A== X-Gm-Message-State: AOJu0Yy8EMhzoXGMfuPkU1227/qX5a7q9iOHl10+GGv5HDXtxdF808Hc zgmP7l8r1kkHC4ggv5NyUc3mBDVAMUeUzEw6WKs= X-Google-Smtp-Source: AGHT+IHhlsqb9zm0gY+hoDNPVnkDWslWuGCLQtGkzvNgjUipnjjeYXm4M6iJX/j/cR757pgwYS54Yw== X-Received: by 2002:a05:6808:118a:b0:3b8:b063:6bb4 with SMTP id j10-20020a056808118a00b003b8b0636bb4mr6206359oil.99.1701742444007; Mon, 04 Dec 2023 18:14:04 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id p26-20020a62b81a000000b0069346777241sm355958pfe.97.2023.12.04.18.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 18:14:03 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH 18/18] hash: convert RTE_LOGTYPE_HASH to dynamic type Date: Mon, 4 Dec 2023 18:09:56 -0800 Message-ID: <20231205021330.260017-19-stephen@networkplumber.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231205021330.260017-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20231205021330.260017-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/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 +++ lib/log/log.c | 1 - lib/log/rte_log.h | 2 +- 6 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c index ccdc3b989489..8e4364f060a3 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 4ff567ee5adf..d819dddd84f4 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) diff --git a/lib/log/log.c b/lib/log/log.c index 56877d42e6b9..e3cd4cff0fbc 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -353,7 +353,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_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h index 189ad2bbd2cf..27fb6129a7aa 100644 --- a/lib/log/rte_log.h +++ b/lib/log/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 */ -- 2.42.0