DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v7 0/5] Convert us of RTE_LOGTYPE_USER1 in libraries
       [not found] <0230208044825.1682620-1-stephen@networkplumber.org>
@ 2023-02-21 18:55 ` Stephen Hemminger
  2023-02-21 18:55   ` [PATCH v7 1/5] ip_frag: use a dynamic logtype Stephen Hemminger
                     ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Stephen Hemminger @ 2023-02-21 18:55 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The DPDK libraries and drivers should not be using the USER1 logtype.

v7 - fix review comments. Replace USER1 in ip_frag and vhost crypto.

Stephen Hemminger (5):
  ip_frag: use a dynamic logtype
  reorder: use a dynamic logtype
  latencystats: use dynamic logtype
  vhost: use logtype instead of RTE_LOGTYPE_USER1
  ipsec: fix usage of RTE_LOGTYPE_USER1

 drivers/crypto/ipsec_mb/ipsec_mb_ops.c |  3 ++-
 lib/ip_frag/ip_frag_common.h           |  5 ++++-
 lib/ip_frag/rte_ip_frag_common.c       |  8 +++++---
 lib/latencystats/rte_latencystats.c    |  3 ++-
 lib/reorder/rte_reorder.c              |  6 +++---
 lib/vhost/fd_man.c                     |  4 ++--
 lib/vhost/vhost_crypto.c               | 22 +++++++++++-----------
 7 files changed, 29 insertions(+), 22 deletions(-)

-- 
2.39.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v7 1/5] ip_frag: use a dynamic logtype
  2023-02-21 18:55 ` [PATCH v7 0/5] Convert us of RTE_LOGTYPE_USER1 in libraries Stephen Hemminger
@ 2023-02-21 18:55   ` Stephen Hemminger
  2023-02-21 18:55   ` [PATCH v7 2/5] reorder: " Stephen Hemminger
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2023-02-21 18:55 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev

DPDK libraries should not be reusing RTE_LOGTYPE_USER1 in
lieu of doing proper logtype registration.

Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Fixes: 416707812c03 ("ip_frag: refactor reassembly code into a proper library")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/ip_frag/ip_frag_common.h     | 5 ++++-
 lib/ip_frag/rte_ip_frag_common.c | 8 +++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/lib/ip_frag/ip_frag_common.h b/lib/ip_frag/ip_frag_common.h
index 9c0dbdeb6eb9..95f1689d476d 100644
--- a/lib/ip_frag/ip_frag_common.h
+++ b/lib/ip_frag/ip_frag_common.h
@@ -8,9 +8,12 @@
 #include "rte_ip_frag.h"
 #include "ip_reassembly.h"
 
+extern int ipfrag_logtype;
+#define RTE_LOGTYPE_IPFRAG	ipfrag_logtype
+
 /* logging macros. */
 #ifdef RTE_LIBRTE_IP_FRAG_DEBUG
-#define	IP_FRAG_LOG(lvl, fmt, args...)	RTE_LOG(lvl, USER1, fmt, ##args)
+#define	IP_FRAG_LOG(lvl, fmt, args...)	RTE_LOG(lvl, IPFRAG, fmt, ##args)
 #else
 #define	IP_FRAG_LOG(lvl, fmt, args...)	do {} while(0)
 #endif /* IP_FRAG_DEBUG */
diff --git a/lib/ip_frag/rte_ip_frag_common.c b/lib/ip_frag/rte_ip_frag_common.c
index c1de2e81b6d0..eed399da6bc5 100644
--- a/lib/ip_frag/rte_ip_frag_common.c
+++ b/lib/ip_frag/rte_ip_frag_common.c
@@ -7,6 +7,8 @@
 
 #include <rte_log.h>
 
+RTE_LOG_REGISTER_DEFAULT(ipfrag_logtype, INFO);
+
 #include "ip_frag_common.h"
 
 #define	IP_FRAG_HASH_FNUM	2
@@ -52,20 +54,20 @@ rte_ip_frag_table_create(uint32_t bucket_num, uint32_t bucket_entries,
 	if (rte_is_power_of_2(bucket_entries) == 0 ||
 			nb_entries > UINT32_MAX || nb_entries == 0 ||
 			nb_entries < max_entries) {
-		RTE_LOG(ERR, USER1, "%s: invalid input parameter\n", __func__);
+		RTE_LOG(ERR, IPFRAG, "%s: invalid input parameter\n", __func__);
 		return NULL;
 	}
 
 	sz = sizeof (*tbl) + nb_entries * sizeof (tbl->pkt[0]);
 	if ((tbl = rte_zmalloc_socket(__func__, sz, RTE_CACHE_LINE_SIZE,
 			socket_id)) == NULL) {
-		RTE_LOG(ERR, USER1,
+		RTE_LOG(ERR, IPFRAG,
 			"%s: allocation of %zu bytes at socket %d failed do\n",
 			__func__, sz, socket_id);
 		return NULL;
 	}
 
-	RTE_LOG(INFO, USER1, "%s: allocated of %zu bytes at socket %d\n",
+	RTE_LOG(INFO, IPFRAG, "%s: allocated of %zu bytes at socket %d\n",
 		__func__, sz, socket_id);
 
 	tbl->max_cycles = max_cycles;
-- 
2.39.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v7 2/5] reorder: use a dynamic logtype
  2023-02-21 18:55 ` [PATCH v7 0/5] Convert us of RTE_LOGTYPE_USER1 in libraries Stephen Hemminger
  2023-02-21 18:55   ` [PATCH v7 1/5] ip_frag: use a dynamic logtype Stephen Hemminger
@ 2023-02-21 18:55   ` Stephen Hemminger
  2023-02-21 18:55   ` [PATCH v7 3/5] latencystats: use " Stephen Hemminger
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2023-02-21 18:55 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, sergio.gonzalez.monroy

Libraries should not be reusing RTE_LOGTYPE_USER1 instead
of doing proper logtype registration.

Fixes: b70b56032bff ("reorder: new library")
Cc: sergio.gonzalez.monroy@intel.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/reorder/rte_reorder.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c
index 6e029c9e02fd..7a3a97972cb7 100644
--- a/lib/reorder/rte_reorder.c
+++ b/lib/reorder/rte_reorder.c
@@ -15,6 +15,9 @@
 
 #include "rte_reorder.h"
 
+RTE_LOG_REGISTER_DEFAULT(reorder_logtype, INFO);
+#define RTE_LOGTYPE_REORDER reorder_logtype
+
 TAILQ_HEAD(rte_reorder_list, rte_tailq_entry);
 
 static struct rte_tailq_elem rte_reorder_tailq = {
@@ -26,9 +29,6 @@ EAL_REGISTER_TAILQ(rte_reorder_tailq)
 #define RTE_REORDER_PREFIX "RO_"
 #define RTE_REORDER_NAMESIZE 32
 
-/* Macros for printing using RTE_LOG */
-#define RTE_LOGTYPE_REORDER	RTE_LOGTYPE_USER1
-
 #define RTE_REORDER_SEQN_DYNFIELD_NAME "rte_reorder_seqn_dynfield"
 int rte_reorder_seqn_dynfield_offset = -1;
 
-- 
2.39.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v7 3/5] latencystats: use dynamic logtype
  2023-02-21 18:55 ` [PATCH v7 0/5] Convert us of RTE_LOGTYPE_USER1 in libraries Stephen Hemminger
  2023-02-21 18:55   ` [PATCH v7 1/5] ip_frag: use a dynamic logtype Stephen Hemminger
  2023-02-21 18:55   ` [PATCH v7 2/5] reorder: " Stephen Hemminger
@ 2023-02-21 18:55   ` Stephen Hemminger
  2023-02-21 18:55   ` [PATCH v7 4/5] vhost: use logtype instead of RTE_LOGTYPE_USER1 Stephen Hemminger
  2023-02-21 18:55   ` [PATCH v7 5/5] ipsec: fix usage " Stephen Hemminger
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2023-02-21 18:55 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, reshma.pattan

Libraries should not reuse RTE_LOGTYPE_USER1 for their
logging. Instead they should register their own type.

Fixes: 5cd3cac9ed22 ("latency: added new library for latency stats")
Cc: reshma.pattan@intel.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/latencystats/rte_latencystats.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/latencystats/rte_latencystats.c b/lib/latencystats/rte_latencystats.c
index 8985a377db4e..f3c1746cca00 100644
--- a/lib/latencystats/rte_latencystats.c
+++ b/lib/latencystats/rte_latencystats.c
@@ -26,7 +26,8 @@ latencystat_cycles_per_ns(void)
 }
 
 /* Macros for printing using RTE_LOG */
-#define RTE_LOGTYPE_LATENCY_STATS RTE_LOGTYPE_USER1
+RTE_LOG_REGISTER_DEFAULT(latencystat_logtype, INFO);
+#define RTE_LOGTYPE_LATENCY_STATS latencystat_logtype
 
 static uint64_t timestamp_dynflag;
 static int timestamp_dynfield_offset = -1;
-- 
2.39.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v7 4/5] vhost: use logtype instead of RTE_LOGTYPE_USER1
  2023-02-21 18:55 ` [PATCH v7 0/5] Convert us of RTE_LOGTYPE_USER1 in libraries Stephen Hemminger
                     ` (2 preceding siblings ...)
  2023-02-21 18:55   ` [PATCH v7 3/5] latencystats: use " Stephen Hemminger
@ 2023-02-21 18:55   ` Stephen Hemminger
  2023-02-21 18:55   ` [PATCH v7 5/5] ipsec: fix usage " Stephen Hemminger
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2023-02-21 18:55 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Chenbo Xia, Maxime Coquelin

Fix instances of USER1 logtype in fdset and crypto
sections.

Acked-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/vhost/fd_man.c       |  4 ++--
 lib/vhost/vhost_crypto.c | 22 +++++++++++-----------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/lib/vhost/fd_man.c b/lib/vhost/fd_man.c
index 1876fada3354..46037d02784e 100644
--- a/lib/vhost/fd_man.c
+++ b/lib/vhost/fd_man.c
@@ -10,8 +10,8 @@
 
 #include "fd_man.h"
 
-
-#define RTE_LOGTYPE_VHOST_FDMAN RTE_LOGTYPE_USER1
+RTE_LOG_REGISTER_SUFFIX(vhost_fdset_logtype, fdset, INFO);
+#define RTE_LOGTYPE_VHOST_FDMAN vhost_fdset_logtype
 
 #define FDPOLLERR (POLLERR | POLLHUP | POLLNVAL)
 
diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c
index f02bf865c349..fa49ffa07099 100644
--- a/lib/vhost/vhost_crypto.c
+++ b/lib/vhost/vhost_crypto.c
@@ -4,6 +4,7 @@
 #include <rte_malloc.h>
 #include <rte_hash.h>
 #include <rte_jhash.h>
+#include <rte_log.h>
 #include <rte_mbuf.h>
 #include <rte_cryptodev.h>
 
@@ -16,22 +17,21 @@
 #define IV_OFFSET		(sizeof(struct rte_crypto_op) + \
 				sizeof(struct rte_crypto_sym_op))
 
-#ifdef RTE_LIBRTE_VHOST_DEBUG
+RTE_LOG_REGISTER_SUFFIX(vhost_crypto_logtype, crypto, INFO);
+#define RTE_LOGTYPE_VHOST_CRYPTO	vhost_crypto_logtype
+
 #define VC_LOG_ERR(fmt, args...)				\
-	RTE_LOG(ERR, USER1, "[%s] %s() line %u: " fmt "\n",	\
-		"Vhost-Crypto",	__func__, __LINE__, ## args)
+	RTE_LOG(ERR, VHOST_CRYPTO, "%s() line %u: " fmt "\n",	\
+		__func__, __LINE__, ## args)
 #define VC_LOG_INFO(fmt, args...)				\
-	RTE_LOG(INFO, USER1, "[%s] %s() line %u: " fmt "\n",	\
-		"Vhost-Crypto",	__func__, __LINE__, ## args)
+	RTE_LOG(INFO, VHOST_CRYPTO, "%s() line %u: " fmt "\n",	\
+		__func__, __LINE__, ## args)
 
+#ifdef RTE_LIBRTE_VHOST_DEBUG
 #define VC_LOG_DBG(fmt, args...)				\
-	RTE_LOG(DEBUG, USER1, "[%s] %s() line %u: " fmt "\n",	\
-		"Vhost-Crypto",	__func__, __LINE__, ## args)
+	RTE_LOG(DEBUG, VHOST_CRYPTO, "%s() line %u: " fmt "\n",	\
+		__func__, __LINE__, ## args)
 #else
-#define VC_LOG_ERR(fmt, args...)				\
-	RTE_LOG(ERR, USER1, "[VHOST-Crypto]: " fmt "\n", ## args)
-#define VC_LOG_INFO(fmt, args...)				\
-	RTE_LOG(INFO, USER1, "[VHOST-Crypto]: " fmt "\n", ## args)
 #define VC_LOG_DBG(fmt, args...)
 #endif
 
-- 
2.39.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v7 5/5] ipsec: fix usage of RTE_LOGTYPE_USER1
  2023-02-21 18:55 ` [PATCH v7 0/5] Convert us of RTE_LOGTYPE_USER1 in libraries Stephen Hemminger
                     ` (3 preceding siblings ...)
  2023-02-21 18:55   ` [PATCH v7 4/5] vhost: use logtype instead of RTE_LOGTYPE_USER1 Stephen Hemminger
@ 2023-02-21 18:55   ` Stephen Hemminger
  4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2023-02-21 18:55 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, kai.ji

There already is a logtype in this driver, use it!

Fixes: b35848bc01f6 ("crypto/ipsec_mb: add multi-process IPC request handler")
Cc: kai.ji@intel.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
index 3e52f9567401..e9eb0d15b794 100644
--- a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
+++ b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
@@ -7,6 +7,7 @@
 
 #include <rte_common.h>
 #include <rte_malloc.h>
+#include <rte_log.h>
 
 #include "ipsec_mb_private.h"
 
@@ -125,7 +126,7 @@ ipsec_mb_secondary_qp_op(int dev_id, int qp_id,
 	qp_req_msg.num_fds = 0;
 	ret = rte_mp_request_sync(&qp_req_msg, &qp_resp, &ts);
 	if (ret) {
-		RTE_LOG(ERR, USER1, "Create MR request to primary process failed.");
+		IPSEC_MB_LOG(ERR, "Create MR request to primary process failed.");
 		return -1;
 	}
 	qp_resp_msg = &qp_resp.msgs[0];
-- 
2.39.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-21 18:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <0230208044825.1682620-1-stephen@networkplumber.org>
2023-02-21 18:55 ` [PATCH v7 0/5] Convert us of RTE_LOGTYPE_USER1 in libraries Stephen Hemminger
2023-02-21 18:55   ` [PATCH v7 1/5] ip_frag: use a dynamic logtype Stephen Hemminger
2023-02-21 18:55   ` [PATCH v7 2/5] reorder: " Stephen Hemminger
2023-02-21 18:55   ` [PATCH v7 3/5] latencystats: use " Stephen Hemminger
2023-02-21 18:55   ` [PATCH v7 4/5] vhost: use logtype instead of RTE_LOGTYPE_USER1 Stephen Hemminger
2023-02-21 18:55   ` [PATCH v7 5/5] ipsec: fix usage " Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).