DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] cryptodev: fix RTE_PMD_DEBUG_TRACE redefinition
@ 2016-03-02 23:34 Marc Sune
  2016-03-10 18:23 ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Sune @ 2016-03-02 23:34 UTC (permalink / raw)
  To: dev

RTE_PMD_DEBUG_TRACE used RTE_FUNC_PTR_OR_ERR_RET was redefined
in rte_cryptodev_pmd.h which produced MACRO redefinition warnings
when including both rte_cryptodev_pmd.h and rte_ethdev.h.

This commit moves MACRO definition to rte_cryptodev.c to prevent
this warning.
---
 lib/librte_cryptodev/rte_cryptodev.c     | 7 +++++++
 lib/librte_cryptodev/rte_cryptodev_pmd.h | 7 -------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 2838852..90d2c30 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -71,6 +71,13 @@
 #include "rte_cryptodev.h"
 #include "rte_cryptodev_pmd.h"
 
+#ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
+#define RTE_PMD_DEBUG_TRACE(...) \
+	rte_pmd_debug_trace(__func__, __VA_ARGS__)
+#else
+#define RTE_PMD_DEBUG_TRACE(fmt, args...)
+#endif
+
 struct rte_cryptodev rte_crypto_devices[RTE_CRYPTO_MAX_DEVS];
 
 struct rte_cryptodev *rte_cryptodevs = &rte_crypto_devices[0];
diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h
index 8270afa..c43680f 100644
--- a/lib/librte_cryptodev/rte_cryptodev_pmd.h
+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h
@@ -62,13 +62,6 @@ struct rte_cryptodev_qp_conf;
 
 enum rte_cryptodev_event_type;
 
-#ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
-#define RTE_PMD_DEBUG_TRACE(...) \
-	rte_pmd_debug_trace(__func__, __VA_ARGS__)
-#else
-#define RTE_PMD_DEBUG_TRACE(fmt, args...)
-#endif
-
 struct rte_cryptodev_session {
 	struct {
 		uint8_t dev_id;
-- 
2.1.4

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

* Re: [dpdk-dev] [PATCH] cryptodev: fix RTE_PMD_DEBUG_TRACE redefinition
  2016-03-02 23:34 [dpdk-dev] [PATCH] cryptodev: fix RTE_PMD_DEBUG_TRACE redefinition Marc Sune
@ 2016-03-10 18:23 ` Thomas Monjalon
  2016-03-14 22:16   ` Marc
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2016-03-10 18:23 UTC (permalink / raw)
  To: Marc Sune; +Cc: dev

2016-03-03 00:34, Marc Sune:
> RTE_PMD_DEBUG_TRACE used RTE_FUNC_PTR_OR_ERR_RET was redefined
> in rte_cryptodev_pmd.h which produced MACRO redefinition warnings
> when including both rte_cryptodev_pmd.h and rte_ethdev.h.
> 
> This commit moves MACRO definition to rte_cryptodev.c to prevent
> this warning.

It is not the right fix.

This macro should probably be renamed with a crypto prefix or defined
only once (same thing for ethdev).
The function rte_pmd_debug_trace() and the macros
RTE_PROC_PRIMARY_OR_ERR_RET,
RTE_PROC_PRIMARY_OR_RET,
RTE_FUNC_PTR_OR_ERR_RET,
RTE_FUNC_PTR_OR_RET
should not be in lib/librte_eal/common/include/rte_dev.h.
The macros call RTE_PMD_DEBUG_TRACE which is defined elsewhere.
The rte_log.h is probably a better place.
But why these macros have no PMD prefix?

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

* Re: [dpdk-dev] [PATCH] cryptodev: fix RTE_PMD_DEBUG_TRACE redefinition
  2016-03-10 18:23 ` Thomas Monjalon
@ 2016-03-14 22:16   ` Marc
  0 siblings, 0 replies; 3+ messages in thread
From: Marc @ 2016-03-14 22:16 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 10 March 2016 at 19:23, Thomas Monjalon <thomas.monjalon@6wind.com>
wrote:

> 2016-03-03 00:34, Marc Sune:
> > RTE_PMD_DEBUG_TRACE used RTE_FUNC_PTR_OR_ERR_RET was redefined
> > in rte_cryptodev_pmd.h which produced MACRO redefinition warnings
> > when including both rte_cryptodev_pmd.h and rte_ethdev.h.
> >
> > This commit moves MACRO definition to rte_cryptodev.c to prevent
> > this warning.
>
> It is not the right fix.
>

This MACRO is only used in that .c file, so it actually makes sense not to
be defined in the header file.


>
> This macro should probably be renamed with a crypto prefix or defined
> only once (same thing for ethdev).
> The function rte_pmd_debug_trace() and the macros
> RTE_PROC_PRIMARY_OR_ERR_RET,
> RTE_PROC_PRIMARY_OR_RET,
> RTE_FUNC_PTR_OR_ERR_RET,
> RTE_FUNC_PTR_OR_RET
> should not be in lib/librte_eal/common/include/rte_dev.h.
> The macros call RTE_PMD_DEBUG_TRACE which is defined elsewhere.
> The rte_log.h is probably a better place.
> But why these macros have no PMD prefix?
>

While I agree, this patch is only trying to solve the compilation error,
which I think it is a step forward from what we have now. I am working on
C++ linking automated test and I could not include both files in the test.

Marc

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

end of thread, other threads:[~2016-03-14 22:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-02 23:34 [dpdk-dev] [PATCH] cryptodev: fix RTE_PMD_DEBUG_TRACE redefinition Marc Sune
2016-03-10 18:23 ` Thomas Monjalon
2016-03-14 22:16   ` Marc

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).