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 2268F41C99; Tue, 14 Feb 2023 23:49:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C7DF43019; Tue, 14 Feb 2023 23:48:09 +0100 (CET) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id 28EB842FFC for ; Tue, 14 Feb 2023 23:48:01 +0100 (CET) Received: by mail-pj1-f54.google.com with SMTP id mg23so9943400pjb.0 for ; Tue, 14 Feb 2023 14:48:01 -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=YaHpmn8gUXMa+v6wJ3XrQzCBzRpYUne3caEmzmvBJd5qSGGIY5AfYA9wYpRcojh7Oj wC3841tWa5/K1jKA13J/N8mP4xQ4pYsvFuc/MdifkDmzZEivoAEmY7wZz4Xjk4omLof7 Ygl7zGkTl9scqA2E1n/GwwLCvFaoMYMa1QGn6kackJ+dN71w0vZQe9Fl+Erd8T3VkNT1 R2ODspSUl4CDPvphANIuBADHJZ7uMalRcVDIYuvssXM6sOzBsI3lqoklC59ddzp33H0s zIxYA89zdaLFS9QpG/7xLE5L2qGqPBugPifLyp1TBGMhRYWp2Cdd90cE6MwSzxh5KXIS 3A1Q== 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=VwJCFW3Qv7/r+yHA+2H043gv3nKmjPG17HiEItnjgpWcpoGIwaRNkwxCTp/1ZOKXLs a7JEo1SZyvMb7oyaQg5t0sTNJAzymLBxbOTj5Lpz4d+JBGbuL0wAW8TCTeukZR1lHz5d egE+Fwq6f3wHk3CKgVvJ2nldxHSfBQAK2ncTE8F8ps+7bt++dq5VKXMvWMbgqCzGVJWN +XT+qPTbSw0wIQGvAR3WTmP8KZ9HgL0RkyBGdHMfL4V6WX9B24zITlxcbo1LSpo2apFU EqncJ6VHl+Ro/9kpoM0ZQCyXJQoBL/vNew3nW3PE/7351PJPiUOYCOmqa3att50PcRQO w+DQ== X-Gm-Message-State: AO0yUKUkkgC+PX09kEnwu81r6UQpYsXs52Iahzll8xch8kHuQxbF5bnY OiP7KHIbgTIaSVYOMzgFT0J5mvrMo6hYmb2xh4Q= X-Google-Smtp-Source: AK7set+tRxx/Ry5Gj4B8X2DsdggDBzsXymLUQYUxTU5c55q55PoqU2idp6CRUbNX6T6KIMTyG75CoA== X-Received: by 2002:a17:903:284:b0:19a:9859:be26 with SMTP id j4-20020a170903028400b0019a9859be26mr955889plr.22.1676414880381; Tue, 14 Feb 2023 14:48:00 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.47.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:47:59 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz , Andrew Rybchenko Subject: [PATCH v6 11/22] mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic type Date: Tue, 14 Feb 2023 14:47:24 -0800 Message-Id: <20230214224735.1404326-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-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 Convert from RTE_LOGTYPE_MEMPOOL to logtype_mempool. Signed-off-by: Stephen Hemminger --- 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 #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