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 889B842868; Thu, 30 Mar 2023 01:41:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1000C42D2D; Thu, 30 Mar 2023 01:41:06 +0200 (CEST) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id 3666442B8E for ; Thu, 30 Mar 2023 01:41:02 +0200 (CEST) Received: by mail-pj1-f48.google.com with SMTP id q102so15617607pjq.3 for ; Wed, 29 Mar 2023 16:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133261; 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=nkd0+uwHKBGg/oAuU64YEwUzRQiR4Ebnx8BWBk9lS24=; b=2dqR85qg93n5uLyMk1dvBqbg/E/gXFN64eeVETAQFgi1oATCYev7LjqY5mMffRcBUp F6udRayJW5E7f0L/PZjknSmlBvIiiSG7ZXDSsB/LBpPRjcePx+I0RIUQM58d9g5WijFX 7JgTAzfIMO3z+sWFE7o32xbxxkt1YgzcJVMMciJ3ACQKE4//nfc6PRBBg+6XJuPKyA1w epk+/XtR4mo0PYf1/BYk79HyIiMEXa1V2Vs+yNfO4+O3pIn0hKT85cxoYfyHN03OdpAU knh11dk29GHZjd8U3S2nJHi//9qFvqqzpvA5SBTTss+DpKgc1fIFbausNFANz+OJSpdC zKPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133261; 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=nkd0+uwHKBGg/oAuU64YEwUzRQiR4Ebnx8BWBk9lS24=; b=Bbf1VjtkUJCjRfUiv35cIemTuTzespjR8h0HyWc827gXPhRIatiikiAYBU3Zr4ucWq NWXgKdj7HkS2nivBlq9RxP28RHCjAwNHtJcPqozYi7oQo+xIO6Fd3UGeGGz5VkUCAWMb oK8lmgcRd/USb7tYw9X6xP2s4hcSVXuFeLUhhhV5TBfTE0erx681M2m5VST27pYZwvq5 pn6GA7zVYFQT67S/2a/Z9/ZVwZ7IAWo2cK6OLuL2X55QaJIPEOZ2kG8fwI66iNZlihI9 /qXCGdmt8c9NNG41MJoO2QiAi2ZaPXKrj/bI81tsC9/Mf8TxwlEbIZNrNe9a7okk9g1j zTew== X-Gm-Message-State: AAQBX9cNwHRty3M8Q7ad4+g1QeD2lk9t4iz5uEXbLjlMnhVqGf1xQhRQ OuLoPv2uKr4oVCzuSFz10pJ8DsCexNea9lzWfJbyYg== X-Google-Smtp-Source: AKy350amyMKyJGI/9dE+xojrwszRPIk7QO+ma3MP7at0heDGxMDV+0sWWze3jMkML1n7jrm3Ih036w== X-Received: by 2002:a17:90b:1e43:b0:23f:8752:98be with SMTP id pi3-20020a17090b1e4300b0023f875298bemr24529094pjb.4.1680133261067; Wed, 29 Mar 2023 16:41:01 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:00 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz Subject: [PATCH v12 05/22] mbuf: convert RTE_LOGTYPE_MBUF to dynamic type Date: Wed, 29 Mar 2023 16:40:32 -0700 Message-Id: <20230329234049.11071-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-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 Introduce a new dynamic logtype for mbuf related messages. Since this is used in multiple files put one macro in mbuf_log.h Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/mbuf/mbuf_log.h | 4 ++++ lib/mbuf/rte_mbuf.c | 4 ++++ lib/mbuf/rte_mbuf_dyn.c | 2 ++ lib/mbuf/rte_mbuf_pool_ops.c | 2 ++ 6 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 lib/mbuf/mbuf_log.h diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 25bb17938cc1..d4389e436913 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -363,7 +363,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, - {RTE_LOGTYPE_MBUF, "lib.mbuf"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 0b39795b4d06..941fbe51fd30 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -42,7 +42,7 @@ extern "C" { #define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ #define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ -#define RTE_LOGTYPE_MBUF 16 /**< Log related to mbuf. */ + /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ /* was RTE_LOGTYPE_EFD */ #define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */ diff --git a/lib/mbuf/mbuf_log.h b/lib/mbuf/mbuf_log.h new file mode 100644 index 000000000000..d759a9a25501 --- /dev/null +++ b/lib/mbuf/mbuf_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int mbuf_logtype; +#define RTE_LOGTYPE_MBUF mbuf_logtype diff --git a/lib/mbuf/rte_mbuf.c b/lib/mbuf/rte_mbuf.c index 686e797c80c4..3eccc618270b 100644 --- a/lib/mbuf/rte_mbuf.c +++ b/lib/mbuf/rte_mbuf.c @@ -20,6 +20,10 @@ #include #include +#include "mbuf_log.h" + +RTE_LOG_REGISTER_DEFAULT(mbuf_logtype, INFO); + /* * pktmbuf pool constructor, given as a callback function to * rte_mempool_create(), or called directly if using diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c index 5049508bea6e..4fb1863a1043 100644 --- a/lib/mbuf/rte_mbuf_dyn.c +++ b/lib/mbuf/rte_mbuf_dyn.c @@ -17,6 +17,8 @@ #include #include +#include "mbuf_log.h" + #define RTE_MBUF_DYN_MZNAME "rte_mbuf_dyn" struct mbuf_dynfield_elt { diff --git a/lib/mbuf/rte_mbuf_pool_ops.c b/lib/mbuf/rte_mbuf_pool_ops.c index 4c91f4ce8569..5318430126cb 100644 --- a/lib/mbuf/rte_mbuf_pool_ops.c +++ b/lib/mbuf/rte_mbuf_pool_ops.c @@ -8,6 +8,8 @@ #include #include +#include "mbuf_log.h" + int rte_mbuf_set_platform_mempool_ops(const char *ops_name) { -- 2.39.2