From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 55A5241C8C;
	Mon, 13 Feb 2023 21:00:23 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id C55A242D8A;
	Mon, 13 Feb 2023 20:59:47 +0100 (CET)
Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com
 [209.85.214.176])
 by mails.dpdk.org (Postfix) with ESMTP id 0801A41151
 for <dev@dpdk.org>; Mon, 13 Feb 2023 20:59:40 +0100 (CET)
Received: by mail-pl1-f176.google.com with SMTP id b5so14697837plz.5
 for <dev@dpdk.org>; Mon, 13 Feb 2023 11:59:39 -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=0i/gH84bdYkufpcWRlv8xuzd83PdQwvUvYcNDHhlb0Q=;
 b=Wk+JZj0u7BqC0BIimC6yMkeNCMxgnsGu4R9I5jWnAI2isNyKYfNLCRHBgVWWxPdkfe
 Jg/dfKUZ4jL0WctBFK4ZUpP2RHdk2X/PjlD0+o2/p6xbKj93q6ibIHLzQ1/+rSeGYBti
 4sYiVKM8eH1rVSd6JAAru+gcwaYNxh+zy/eQheBP6Ua0q+nY5AXg83H4wASVFqgf4GZM
 hAPJC3s84wDvtYO/Cz9aDlG8o6O7bcxFoxwSV7ovFM741U54IiBTFztRg65r7HggdLrX
 szx5DRn8Ae/UA7p4+fhsv675cDBzQlxE9FXMFv6ktXVcrOXGUZ2OKUx+bxqu4t6Skk1c
 Mq0A==
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=0i/gH84bdYkufpcWRlv8xuzd83PdQwvUvYcNDHhlb0Q=;
 b=43i8OhIGLvNnlmUdBDtKTCamKgAFCca20e4yYfwga9CcYOpQP6BNaNz3c1n3INDmzU
 5/vQt6svsMiD+/neCXLAmsfne5+5doE0rdEzNnMffuDh6ex1/kt48ljNcv8/TLIl2gwI
 /P/EzggcXjjlhe9F3PZebKeKhbBYAOtyNQL4Rt1+OE6SlgLmod0Ng+OgoFoqpyGL7jI2
 7cTED0KAkYiURP0+JrGDVBinUTRtYHeb2rwkqKLPeCsSU+xhC+2au+kVGYxpOmH65pBQ
 1Yw1L5SbsHpU+99V5wnR3IVbWXXb4RP6r8rB4HVvGonUKvZdxM9psxt4Ya3tCe4TcT0j
 a2cA==
X-Gm-Message-State: AO0yUKVOqwojg61kCl/ozEHUYgXwTciKGK6dVJGC5IQwBoaoeBECZGSG
 7qsJLluGGlglhRFPd/bG+sJBjl6vi39qnIacoLI=
X-Google-Smtp-Source: AK7set/1UBOxjLx7KWwNuiGfm7pi8eyfAkZpydR2e0FSviTr3DBvE5gfl+Tj4c67YA/kNf4Lp1bpDg==
X-Received: by 2002:a17:902:c60b:b0:19a:703d:c1c6 with SMTP id
 r11-20020a170902c60b00b0019a703dc1c6mr74627plr.26.1676318379328; 
 Mon, 13 Feb 2023 11:59:39 -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.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 13 Feb 2023 11:59:39 -0800 (PST)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
 Olivier Matz <olivier.matz@6wind.com>,
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: [PATCH v4 09/19] mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic
 type
Date: Mon, 13 Feb 2023 11:55:41 -0800
Message-Id: <20230213195551.1146298-10-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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Convert from RTE_LOGTYPE_MEMPOOL to logtype_mempool.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/eal/common/eal_common_log.c | 1 -
 lib/eal/include/rte_log.h       | 2 +-
 lib/mempool/rte_mempool.c       | 3 +++
 lib/mempool/rte_mempool_log.h   | 4 ++++
 lib/mempool/rte_mempool_ops.c   | 1 +
 5 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 lib/mempool/rte_mempool_log.h

diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c
index 5f15e312f15b..4025d2039d55 100644
--- a/lib/eal/common/eal_common_log.c
+++ b/lib/eal/common/eal_common_log.c
@@ -349,7 +349,6 @@ struct logtype {
 
 static const struct logtype logtype_strings[] = {
 	{RTE_LOGTYPE_EAL,        "lib.eal"},
-	{RTE_LOGTYPE_MEMPOOL,    "lib.mempool"},
 	{RTE_LOGTYPE_PMD,        "pmd"},
 	{RTE_LOGTYPE_HASH,       "lib.hash"},
 	{RTE_LOGTYPE_LPM,        "lib.lpm"},
diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h
index 31a2ee2f6b6f..9f86bfdd0198 100644
--- a/lib/eal/include/rte_log.h
+++ b/lib/eal/include/rte_log.h
@@ -29,7 +29,7 @@ extern "C" {
 #define RTE_LOGTYPE_EAL        0 /**< Log related to eal. */
 				 /* was RTE_LOGTYPE_MALLOC */
 				 /* was RTE_LOGTYPE_RING */
-#define RTE_LOGTYPE_MEMPOOL    3 /**< Log related to mempool. */
+				 /* 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. */
diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index 45b5df6199b0..841abe53e3b9 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -30,6 +30,9 @@
 
 #include "rte_mempool.h"
 #include "rte_mempool_trace.h"
+#include "rte_mempool_log.h"
+
+RTE_LOG_REGISTER_DEFAULT(mempool_logtype, INFO);
 
 TAILQ_HEAD(rte_mempool_list, rte_tailq_entry);
 
diff --git a/lib/mempool/rte_mempool_log.h b/lib/mempool/rte_mempool_log.h
new file mode 100644
index 000000000000..216401c9f2cd
--- /dev/null
+++ b/lib/mempool/rte_mempool_log.h
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+
+extern int mempool_logtype;
+#define RTE_LOGTYPE_MEMPOOL	mempool_logtype
diff --git a/lib/mempool/rte_mempool_ops.c b/lib/mempool/rte_mempool_ops.c
index 3b43edc548a0..ad7c81823ce1 100644
--- a/lib/mempool/rte_mempool_ops.c
+++ b/lib/mempool/rte_mempool_ops.c
@@ -12,6 +12,7 @@
 #include <dev_driver.h>
 
 #include "rte_mempool_trace.h"
+#include "rte_mempool_log.h"
 
 /* indirect jump table to support external memory pools. */
 struct rte_mempool_ops_table rte_mempool_ops_table = {
-- 
2.39.1