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 <stephen@networkplumber.org>
---
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
@@ -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"},
@@ -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. */
new file mode 100644
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+
+extern int mbuf_logtype;
+#define RTE_LOGTYPE_MBUF mbuf_logtype
@@ -20,6 +20,10 @@
#include <rte_errno.h>
#include <rte_memcpy.h>
+#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
@@ -17,6 +17,8 @@
#include <rte_mbuf.h>
#include <rte_mbuf_dyn.h>
+#include "mbuf_log.h"
+
#define RTE_MBUF_DYN_MZNAME "rte_mbuf_dyn"
struct mbuf_dynfield_elt {
@@ -8,6 +8,8 @@
#include <rte_errno.h>
#include <rte_mbuf_pool_ops.h>
+#include "mbuf_log.h"
+
int
rte_mbuf_set_platform_mempool_ops(const char *ops_name)
{