From patchwork Fri Dec 22 17:44:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 135528 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F80643760; Fri, 22 Dec 2023 18:45:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D93D40E96; Fri, 22 Dec 2023 18:45:52 +0100 (CET) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id 8C4FD402B9 for ; Fri, 22 Dec 2023 18:45:50 +0100 (CET) Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-5cd8e2988ddso1084760a12.3 for ; Fri, 22 Dec 2023 09:45:50 -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=pfFvkxcfqNiKh+lkbXj9lLzDw2damUq/hfXtoZnPPwo=; b=tQMz5smrH0eEcWfSQWYuwc7fb1EOk9DJyKdnpyNEsG/S53C3GMqY6svpUDvB/irry8 b0UsXPiqVsP98elireEZ7Q91Zs2IQLfXMYg2WiXfOv2d7bYlGwM3U+JmE1Tzawh/7JZG UJp8p8a/FIUKKE/pigBVzm8Ps0VgFyDN8+tP9X/kJKWjExTumrL3COUA93yCgUQVrE0z 50hwhaO91mKXoe6buse3j9gowGUcq+nQwRVkBy8m+irdc2Mede35RPsET0oHScPx7cPp NacRpXd4DdTm3qkF/riFfrxa+D091stzPgrd+4g5c/jo/6GztryJ8B70H2SnETA2AUSl 9w1g== 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=pfFvkxcfqNiKh+lkbXj9lLzDw2damUq/hfXtoZnPPwo=; b=VZSiMykmpCBAOIlU1hgEQSO3xyhOJ5UVzTPWmAcxjNyiD528TJka0MLsabJk9Gg4XZ 1KEeWrqEQU9zr3mtpDlUkSmSz+z9p/Pc6eFVAvRdNktJiYsl/Ea0NhNbIGNEuXktRwpA 7Ku/NwYvQ+1uBDk9VO+Ol2taweOyuR0tPM0QWJuwSxD5OQRE1Mp178geWx+AZ00TPMNQ UU1zuEiytvomDRu+zBQRZNTQXcEeffuFeSGdSEq7RmXUiuf1tyhjpeDQ5pmhcoYm99mn G+4Rgc5I5+QxcL8hf1scxA8QigpmvfwlYYfrXViFuwkQ+xI7ZEIcbaptgybyZOSZC9YD c4yA== X-Gm-Message-State: AOJu0YwFU6ON/AaKBcMRbgV6Dv7UJRTRQ05jqpNM8mLRbHbxDRUt8Qbz sTsQo3VL9W7o4j23ziYQPr5mwbQNclLQxvLpUkppQeUqrWpksw== X-Google-Smtp-Source: AGHT+IGChaatDz2TpjRjhHyvqJvpeCECkAO8RbEOVP0EGdDyZnP50Jn2oCaobe89nW4HttI9fxNYbw== X-Received: by 2002:a05:6a20:4295:b0:18f:fa8b:e0a2 with SMTP id o21-20020a056a20429500b0018ffa8be0a2mr1346820pzj.58.1703267149719; Fri, 22 Dec 2023 09:45:49 -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:49 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH 1/3] port: convert to dynamic log type Date: Fri, 22 Dec 2023 09:44:02 -0800 Message-ID: <20231222174539.13431-2-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 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_PORT with dynamic type. Since there are several types of port do initialization in a short standalone file. Signed-off-by: Stephen Hemminger --- lib/log/log.c | 1 - lib/log/rte_log.h | 2 +- lib/port/meson.build | 1 + lib/port/port_log.h | 4 +++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/log/log.c b/lib/log/log.c index ab06132a98a1..853acaf07eb2 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_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h index 5ba198ba2484..5c73e689e8aa 100644 --- a/lib/log/rte_log.h +++ b/lib/log/rte_log.h @@ -40,7 +40,7 @@ extern "C" { /* was RTE_LOGTYPE_POWER */ /* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ -#define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ + /* was RTE_LOGTYPE_PORT */ #define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */ diff --git a/lib/port/meson.build b/lib/port/meson.build index b0af2b185b39..b5977728723a 100644 --- a/lib/port/meson.build +++ b/lib/port/meson.build @@ -8,6 +8,7 @@ if is_windows endif sources = files( + 'port_log.c', 'rte_port_ethdev.c', 'rte_port_fd.c', 'rte_port_frag.c', diff --git a/lib/port/port_log.h b/lib/port/port_log.h index 99332a380323..28d75ee48b3b 100644 --- a/lib/port/port_log.h +++ b/lib/port/port_log.h @@ -4,6 +4,8 @@ #include +extern int port_logtype; +#define RTE_LOGTYPE_PORT port_logtype + #define PORT_LOG(level, ...) \ RTE_LOG_LINE(level, PORT, "" __VA_ARGS__) -