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 0819B430C3; Mon, 21 Aug 2023 18:11:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B7AE432A1; Mon, 21 Aug 2023 18:10:10 +0200 (CEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id 1DAF743281 for ; Mon, 21 Aug 2023 18:10:05 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1bf5c314a57so7959025ad.1 for ; Mon, 21 Aug 2023 09:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634204; x=1693239004; 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=We/xZdUAxyM5b7hvcdwbi9lv9krFR0ggEJp9/aOINh4=; b=DQ4E/2XtaOHRCCJFRCjq7dDcLccbRix3iKh7zyFtHImlEtFjd5P+EGQsWPeLdNab1Q x2bJNP/aVqFTtE3kzDFkG2yirWWOXkz7dRAb/60/3A+sXqNAQVoDaJaWbCYxxBxcZR6c teNdqGTVcAgf2qj9XNbO2pSWrLU/tvUK9EokvJ0Dn+Y+WXS/a0YBKFKp24V1bYN0MBjW LDVEchIlqQNJiSWXdWSjv0RYKUSzPp0T2CARQh1A3zITVGmeoR54cQnfRJ5XqhWgo+ks gyEM3dVB6I7Ba4s2cC3vEGS5OlE5/d6FLzEkhOQk896ssAwYmv5pQi2Ogpemx2OBK7K4 LVQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634204; x=1693239004; 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=We/xZdUAxyM5b7hvcdwbi9lv9krFR0ggEJp9/aOINh4=; b=lxeFwhTl3RKXong9z6souKncbYxT00nB3Cqr/tBO0ufJbtEBVw0uVRxGV8i+th6mP0 mlpE3Mj90D1grL6W37Opfjrb6SRtUnWhFOA1JtobbXyWwwwdDWkPa43esGmZXUQStt/N CbwZi0f+vG+E/WhmA6e7LXMke7V4der/S/v8Orprd8nEtKWHdEAi7xRoknLvsOkoIFeW GDdRITc9E91ZJd2OHCMHSBNWPFEgQNx4Tn0cynkU8n209wjvSnQ7dTxlj9hGURijo6Yq O4gSu9HHW3pAlUBLqQ241pDwj6NM82vyQwo/k9mGhDopx7TfyA+5o7iH413P47l5FFu3 aYwg== X-Gm-Message-State: AOJu0YxClUa7LaGumCjQIMbAj9q9o0vRF+ULWnZTWpQByOpfq4Fj4GyL wM6m6RU0TYzWjnSKoT5p/GIrcM73vafNI07hhPy7vA4K X-Google-Smtp-Source: AGHT+IFyzA10eg+l/xUG31cFsDwdVSchw1rP+FgmxFI8A4lYLqIywxv9a4VDAPP4742gBGj5QGNOjA== X-Received: by 2002:a17:903:32c6:b0:1b3:d4ed:8306 with SMTP id i6-20020a17090332c600b001b3d4ed8306mr5983024plr.19.1692634203962; Mon, 21 Aug 2023 09:10:03 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:03 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Vladimir Medvedkin , Bruce Richardson Subject: [PATCH v13 12/21] lpm: convert RTE_LOGTYPE_LPM to dynamic types Date: Mon, 21 Aug 2023 09:09:12 -0700 Message-Id: <20230821160921.383832-13-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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 Split lpm and lpm6 into separate log types since they are in different files and user may want to change log levels for IPv4 vs IPv6. For rib and fib libraries give them own types as well. Signed-off-by: Stephen Hemminger --- lib/fib/fib_log.h | 4 ++++ lib/fib/rte_fib.c | 3 +++ lib/fib/rte_fib6.c | 2 ++ lib/log/log.c | 1 - lib/log/rte_log.h | 2 +- lib/lpm/lpm_log.h | 4 ++++ lib/lpm/rte_lpm.c | 3 +++ lib/lpm/rte_lpm6.c | 1 + lib/rib/rib_log.h | 4 ++++ lib/rib/rte_rib.c | 3 +++ lib/rib/rte_rib6.c | 3 +++ 11 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 lib/fib/fib_log.h create mode 100644 lib/lpm/lpm_log.h create mode 100644 lib/rib/rib_log.h diff --git a/lib/fib/fib_log.h b/lib/fib/fib_log.h new file mode 100644 index 000000000000..c731c820f621 --- /dev/null +++ b/lib/fib/fib_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int fib_logtype; +#define RTE_LOGTYPE_LPM fib_logtype diff --git a/lib/fib/rte_fib.c b/lib/fib/rte_fib.c index 0c3b20e00a5a..f88e71a59d5a 100644 --- a/lib/fib/rte_fib.c +++ b/lib/fib/rte_fib.c @@ -17,6 +17,9 @@ #include #include "dir24_8.h" +#include "fib_log.h" + +RTE_LOG_REGISTER_DEFAULT(fib_logtype, INFO); TAILQ_HEAD(rte_fib_list, rte_tailq_entry); static struct rte_tailq_elem rte_fib_tailq = { diff --git a/lib/fib/rte_fib6.c b/lib/fib/rte_fib6.c index 28c69b38999f..ab1d9604796f 100644 --- a/lib/fib/rte_fib6.c +++ b/lib/fib/rte_fib6.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -17,6 +18,7 @@ #include #include "trie.h" +#include "fib_log.h" TAILQ_HEAD(rte_fib6_list, rte_tailq_entry); static struct rte_tailq_elem rte_fib6_tailq = { diff --git a/lib/log/log.c b/lib/log/log.c index 58184548bb85..ab28edec11b8 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -354,7 +354,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h index 48976fea1c3e..dc2454a0d9de 100644 --- a/lib/log/rte_log.h +++ b/lib/log/rte_log.h @@ -33,7 +33,7 @@ extern "C" { /* 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. */ -#define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ + /* was RTE_LOGTYPE_LPM */ /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ diff --git a/lib/lpm/lpm_log.h b/lib/lpm/lpm_log.h new file mode 100644 index 000000000000..a0621b70a5fe --- /dev/null +++ b/lib/lpm/lpm_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int lpm_logtype; +#define RTE_LOGTYPE_LPM lpm_logtype diff --git a/lib/lpm/rte_lpm.c b/lib/lpm/rte_lpm.c index cdcd1b7f9e47..0ca82147866a 100644 --- a/lib/lpm/rte_lpm.c +++ b/lib/lpm/rte_lpm.c @@ -18,6 +18,9 @@ #include #include "rte_lpm.h" +#include "lpm_log.h" + +RTE_LOG_REGISTER_DEFAULT(lpm_logtype, INFO); TAILQ_HEAD(rte_lpm_list, rte_tailq_entry); diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c index 8d21aeddb83c..873cc8bc267d 100644 --- a/lib/lpm/rte_lpm6.c +++ b/lib/lpm/rte_lpm6.c @@ -20,6 +20,7 @@ #include #include "rte_lpm6.h" +#include "lpm_log.h" #define RTE_LPM6_TBL24_NUM_ENTRIES (1 << 24) #define RTE_LPM6_TBL8_GROUP_NUM_ENTRIES 256 diff --git a/lib/rib/rib_log.h b/lib/rib/rib_log.h new file mode 100644 index 000000000000..f3ee513ca854 --- /dev/null +++ b/lib/rib/rib_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int rib_logtype; +#define RTE_LOGTYPE_LPM rib_logtype diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c index 812a2597d117..a62e951a8e0e 100644 --- a/lib/rib/rte_rib.c +++ b/lib/rib/rte_rib.c @@ -16,6 +16,9 @@ #include +RTE_LOG_REGISTER_DEFAULT(rib_logtype, INFO); +#define RTE_LOGTYPE_LPM rib_logtype + TAILQ_HEAD(rte_rib_list, rte_tailq_entry); static struct rte_tailq_elem rte_rib_tailq = { .name = "RTE_RIB", diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c index ae44281ae105..5765995197f8 100644 --- a/lib/rib/rte_rib6.c +++ b/lib/rib/rte_rib6.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -16,6 +17,8 @@ #include +#include "rib_log.h" + #define RTE_RIB_VALID_NODE 1 #define RIB6_MAXDEPTH 128 /* Maximum length of a RIB6 name. */ -- 2.39.2