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 F25FA43760; Fri, 22 Dec 2023 18:45:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D17F410F9; Fri, 22 Dec 2023 18:45:53 +0100 (CET) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mails.dpdk.org (Postfix) with ESMTP id 3FA4540A73 for ; Fri, 22 Dec 2023 18:45:51 +0100 (CET) Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-5c65ca2e1eeso1086674a12.2 for ; Fri, 22 Dec 2023 09:45:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1703267150; x=1703871950; darn=dpdk.org; 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=+6E6SuqdtuBvFHp/my/xxyT7/7/sgR1S4DxG1JAesUo=; b=VxfjqiHdd5Xw2XmdGKbXkb/6lqSegZu+KdhpQEalYe7LCA4lCwI2f6BrEZ0RdJ1c4N hTnNUhN6Mt91y8zvWQWaPjojrq55vUbrj6/xZIr9vBX0VyfttTGBor+l84ToGtfEUQe0 xiDd+PdM9b87dijtGMMO2EYKqJm8vHi/KC2Tgs5z0ZPCIQ5SSQEBfJgFeboeG9xDxCiU vfjGltKYE0EE4qD0PiZi+pBvlyGC6BzTQcEBZyzKd2xAJT1k4v4gHINwI6ljq/66FvVP v0FmxILU8+ruC+zh16tHZJimnpEAaPoMFm6HFRV9p5IRuC8Ka1eHz+FN9uKXU/CPfwq3 U4zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703267150; x=1703871950; 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=+6E6SuqdtuBvFHp/my/xxyT7/7/sgR1S4DxG1JAesUo=; b=CPtT8yGqfnJmORdPr0ujQgWTEvFP3amJc+uFSft6U8IfyNXnFPCzz0xa/EXsW+hecK KZf+dAGzp7+d8Anw34W/77/QStJDnWtnahXQtJ2Kgsj657MDuqHwNIrp4BezEYSsCRqp KljmIubJjtABDCqTQTyuTIQOVi4x/czcTHZJu8d4moClXuN/RmlVWc0YfsDfjM/OdVhl viLpEv/wiBNkF8jwK7dH09wki3wIoxMpgUk2Fdb8bwMFgz6614h6N8VshT5fu2gS/CPC fzhY8LX78R9rplTOPH128Asb9GSsGYeUUi2g/YdJQqaD7x1lkj0jRXsIQJm9cquDFjMF UowQ== X-Gm-Message-State: AOJu0YweMOuE55JCF0WqtxkGl5RgsNWa6OzVOIRkS0DhC+/8Om2Wxw8o GMhfF5AaxhzYTDcggbf4DsRr9MCtVtZdKzpHjATAb9pqVcSZMw== X-Google-Smtp-Source: AGHT+IHg1hFEDHCJjM1nhIqNZ+CWknNIykA1A8FTHmJYvmQLQNPcW3NTxYHVtc7h3Eu2D5rMaLjUOQ== X-Received: by 2002:a05:6a20:3ca6:b0:195:2618:aa89 with SMTP id b38-20020a056a203ca600b001952618aa89mr1213172pzj.94.1703267150465; Fri, 22 Dec 2023 09:45:50 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id ne17-20020a17090b375100b0028b493c8c2esm7724935pjb.22.2023.12.22.09.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:45:50 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH 2/3] table: convert to dynamic logtype Date: Fri, 22 Dec 2023 09:44:03 -0800 Message-ID: <20231222174539.13431-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174539.13431-1-stephen@networkplumber.org> References: <20231222174539.13431-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 Replace static RTE_LOGTYPE_TABLE with dynamic type. Signed-off-by: Stephen Hemminger --- lib/log/log.c | 1 - lib/log/rte_log.h | 2 +- lib/port/port_log.c | 7 +++++++ lib/table/meson.build | 2 ++ lib/table/table_log.c | 7 +++++++ lib/table/table_log.h | 4 +++- 6 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 lib/port/port_log.c create mode 100644 lib/table/table_log.c diff --git a/lib/log/log.c b/lib/log/log.c index 853acaf07eb2..7ae798493e51 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -353,7 +353,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, - {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h index 5c73e689e8aa..6bfa66dc8986 100644 --- a/lib/log/rte_log.h +++ b/lib/log/rte_log.h @@ -41,7 +41,7 @@ extern "C" { /* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ -#define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ + /* was RTE_LOGTYPE_TABLE */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */ /* was RTE_LOGTYPE_CRYPTODEV */ diff --git a/lib/port/port_log.c b/lib/port/port_log.c new file mode 100644 index 000000000000..1984b17bc4f7 --- /dev/null +++ b/lib/port/port_log.c @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Red Hat, Inc. + */ + +#include + +RTE_LOG_REGISTER_DEFAULT(port_logtype, INFO); diff --git a/lib/table/meson.build b/lib/table/meson.build index f8cef24b5918..9b3d9ac759eb 100644 --- a/lib/table/meson.build +++ b/lib/table/meson.build @@ -18,7 +18,9 @@ sources = files( 'rte_table_lpm.c', 'rte_table_lpm_ipv6.c', 'rte_table_stub.c', + 'table_log.c', ) + headers = files( 'rte_lru.h', 'rte_swx_hash_func.h', diff --git a/lib/table/table_log.c b/lib/table/table_log.c new file mode 100644 index 000000000000..8c84ed84671c --- /dev/null +++ b/lib/table/table_log.c @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Red Hat, Inc. + */ + +#include + +RTE_LOG_REGISTER_DEFAULT(table_logtype, INFO); diff --git a/lib/table/table_log.h b/lib/table/table_log.h index 0330f89d4192..b24b8614c227 100644 --- a/lib/table/table_log.h +++ b/lib/table/table_log.h @@ -4,6 +4,8 @@ #include +extern int table_logtype; +#define RTE_LOGTYPE_TABLE table_logtype + #define TABLE_LOG(level, ...) \ RTE_LOG_LINE(level, TABLE, "" __VA_ARGS__) - -- 2.43.0