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 B7D8941CF1; Tue, 21 Feb 2023 00:36:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A4AD743126; Tue, 21 Feb 2023 00:36:10 +0100 (CET) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id 83CAB43120 for ; Tue, 21 Feb 2023 00:36:03 +0100 (CET) Received: by mail-pf1-f171.google.com with SMTP id e24so1532495pfn.3 for ; Mon, 20 Feb 2023 15:36:03 -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=XhWRpJQsp5imdcvq0PIuBzX1gbd/UZc8K08WO2FGJ+s=; b=Dx1O3mE9oP0hXHCS+a8cbszMexVw8Zq8XZS7ikkkI2PIqoLMnNuLtWPl3CmorHb7/D 2f4eKI4H3nPMqVDS6ZScnokrdyVhdEmmgVoaRKbgvU/dEy/CdB133jt6xoT3s32oJ/1i yLadT1WxGo7GUP2klvAEJK49bjjiQ5t1Nmv4W7Zcm57+YKRzxvqBboL9bykQ9mhvRiLz 3u+cV22dIZ5EINf7/56tsENfYGqlZGf75kNuDHpDyvrd5LOHbc6iw7YmvRMZbjhZ8w8g A1WhxkMz85wGsSAuoDIyqDwUYDvB8Xlv28HhJZYt3OfXFpzHkv5u2j19sKEU1Xsv6g8L StNQ== 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=XhWRpJQsp5imdcvq0PIuBzX1gbd/UZc8K08WO2FGJ+s=; b=4jlsnpKdD5UGDLky3r07PokjwYp2VDu4tgS7W1dWWvDluhhsW2lwAHJNkSaogeTPd2 v2S+VwXnk8TrFY2x5HN5wUwy4nVj8IMTbdZYF/erzegoT9pXkPSqMX95Kowh97RPNzFH kWzJSH4vx1Jg3rxJs5VVWQOTisO6FMTQ/F4mHvF+WhHZ6kuyeub4L21O/X76luplNWe5 VWJuiXKGMHQX6bIlZQw7OPxUl9Wq9P4kLyDID6yJWw2DgPTw6FwDPa1Yx9TlF2BuYQhu QgVxIMhXwHFJ6TcgWFQWwxc8tosOYrMdcfvf1gJ3JO0xdRBmSulZLlLRZlrlBdCcZXHk MADg== X-Gm-Message-State: AO0yUKW3a6L8kmxW4LMTh0ozvMQVkZj3xTYHOxD/5g86S88L7G8Ow5hG EefRu86JHHfEjUAMj0CvZWo5sG6lL4xQqAmlVxg= X-Google-Smtp-Source: AK7set9fA4Obn0Ls7iKMQgfAW01/zSyETU7h4SPTssGdle+e56vBPiFiYQm9twtLNMrpezjqK9oBdQ== X-Received: by 2002:a62:502:0:b0:5a9:9744:5757 with SMTP id 2-20020a620502000000b005a997445757mr1870425pff.21.1676936162526; Mon, 20 Feb 2023 15:36:02 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:01 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 05/22] mbuf: replace RTE_LOGTYPE_MBUF with dynamic type Date: Mon, 20 Feb 2023 15:35:39 -0800 Message-Id: <20230220233556.168553-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-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 cfd8062f1e6a..4a379a5185d5 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 35839e938cc5..01654db03fc8 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.1