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 28D1B41C8E; Tue, 14 Feb 2023 03:20:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C716942D86; Tue, 14 Feb 2023 03:19:39 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 85D1C42D5A for ; Tue, 14 Feb 2023 03:19:31 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id rm7-20020a17090b3ec700b0022c05558d22so14074772pjb.5 for ; Mon, 13 Feb 2023 18:19:31 -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=fMPr0cHVcX0iVipLaZkJwujlKdPnvJTuXs6980ZjWcYapINHVwqrMbb6m9cRsDBB50 j+6TtpvqfLm9FcxXSE2HkeQb1T3ICudBjRAAyhOk3kZKEUPAzERE8PSlyXMaCpUDQe+X C5hHeRzVTsrVJi7gYHcwZvD07TyNqnAgFyf02FHqHIRkcvM+p8w5sNMwY7U2VDcAhlNo NPzdTT4WZjIERBc9BqVBZQzgzkQJ3VkVp4UR6Nvz208eiOvoTNTbgIHQMw/iHCX3+ctJ xfG16KRNvHkpcwtUz0jfKoGUHaBn4mt5HxbR7b9H0FJn8q4YI01Uiter3fYaftiOVaDT LtUA== 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=XxEeeObHRj4E0vOtBElhukOhkpFVz8N4JvOPVJvc5bxTqCEZAg65mBneaFc5md2wCf y7Aejnfx/QN4U/6cWQAZRHaBk3TZv+SEOJECWzN1S/UabKDInv6xZ2uloWNP/XauTCKZ Qt3oRd5uNY4blLIGUIJwKQ4McyOpzCx+C5nbVxZ63s97hW/HkwHgvW1K3vXYMcVlb+SY N3huhLyLt4CaGMt3NlXmc+WZC+/ZamySDbbk9Rp0UqCSycjrgBY1pb+i2L5GKuOv+WEn F0dXFx3SOhMCakWJP/oZA9emXW3MO96G66unmcvX0mrQzDeAW57oVDUyY1HjdAgkH9w+ cy1Q== X-Gm-Message-State: AO0yUKWKqMEOIMMZnzgb12SxpyEgH/dz+MDyCo78JorM9Cbq9GwJXzJ8 r6fupwXdHb3IsAGG5RVsY5FAnNspS3LId20suLg= X-Google-Smtp-Source: AK7set/umkIDYTeDiM7qcI4tyIsRa5i7+SeRR1+jAJ8CrNhjnuNcjgy7YcC35s27xR7ZMQUsJxC6XQ== X-Received: by 2002:a05:6a20:7d92:b0:b8:d032:6486 with SMTP id v18-20020a056a207d9200b000b8d0326486mr793013pzj.16.1676341170514; Mon, 13 Feb 2023 18:19:30 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id e16-20020aa78250000000b005a75d85c0c7sm8494840pfn.51.2023.02.13.18.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 18:19:30 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz , Andrew Rybchenko Subject: [PATCH v5 11/22] mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic type Date: Mon, 13 Feb 2023 18:18:57 -0800 Message-Id: <20230214021908.1396498-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214021908.1396498-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214021908.1396498-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