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 EFCC841CA8; Wed, 15 Feb 2023 18:24:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4192842D8E; Wed, 15 Feb 2023 18:24:08 +0100 (CET) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by mails.dpdk.org (Postfix) with ESMTP id 85D7B42D5A for ; Wed, 15 Feb 2023 18:24:00 +0100 (CET) Received: by mail-pg1-f179.google.com with SMTP id b22so7810086pgw.3 for ; Wed, 15 Feb 2023 09:24:00 -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=AlByaf5IMaTfvm1mDjmmWlo0bOc0W1FTxvaf3ccaW7sFtdm82kEFhOTRVPOj9o4HUD L6cNXaVEi+lCAi213j6VCZ/0aP6OlCzX60Tmc6sUyEdyI/Z8Q8Cj89si45s4kUIWeU1p /BriqUagyN7w86TsAw6n8oRBgMg0akD36M82Mj9G8IPVtHd12A0Ce581ZhjP7XMxqWW2 UpYvkEf0UcasZeSWH8nC8kS2D9oo2Yo7pbDWg3+LwvyD3SkKzfY2HbjPTpZO14dOBUTX wfoGPmGt/6//a9DtPNTA5cejdRo3gtRVrGxwtwdwljFxtm7H4Rs95yA+uaU8AujIO82I UCGQ== 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=4OHOu1Twe2Mwsbyyw411U3pzcei6Dy3Y2gbCNK0bcPDMar7XoYrNq+0LyfW4skSMxl qTay/z0WAsCcpg+WOwpNTYKCn9VVaslXowJdcpPfIFp2EGj+E9n/qM6Lk5w5QI1B6XUz 9S6MrZqWX1JiTrYYzyz2HfYl1RnOLNmezRc8gxtYv1Iu6J8NSQTj2bQROcEkR8wgRBX+ 8RO7aST5WGDQ9T+WIusg4LZfVtos9hzJziQMM7q6GGeQvKHItF64lZsSZpSaNezERfn0 8vtAW9WEGCp2cpcwVuW9WX7PZRoe4kmrKc/qDXqnTZo+MdeebPuT4+TXP7zsCOS8cvhY Vr4w== X-Gm-Message-State: AO0yUKVNOkR3Oe8C46CrD0noF0/3aeMNA6+evLtieGK6IvraVfWF6JbK AJcWnuCvdkW5HlWwH12eFKJeDWo+vWazGQ2wHWNs1A== X-Google-Smtp-Source: AK7set/gfPNeIWhvIHBm18+wvREYi8LjCT8aRIaOmPMHCYdJ+oOxsCCJKD7I1ARMVygOzIqSYhgTMA== X-Received: by 2002:aa7:94b4:0:b0:593:b309:aa55 with SMTP id a20-20020aa794b4000000b00593b309aa55mr2124104pfl.28.1676481839497; Wed, 15 Feb 2023 09:23:59 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id m7-20020aa79007000000b005a8da960fa8sm3705304pfo.144.2023.02.15.09.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 09:23:59 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz , Andrew Rybchenko Subject: [PATCH v7 11/22] mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic type Date: Wed, 15 Feb 2023 09:23:30 -0800 Message-Id: <20230215172341.1525320-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230215172341.1525320-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230215172341.1525320-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