All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] eal: add config option to enable asserts
@ 2017-08-23 14:00 Xueming Li
  2017-08-23 14:09 ` Gaëtan Rivet
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Xueming Li @ 2017-08-23 14:00 UTC (permalink / raw)
  To: dev; +Cc: Xueming Li

Currently, enabling assertion have to set CONFIG_RTE_LOG_LEVEL to
RTE_LOG_DEBUG. CONFIG_RTE_LOG_LEVEL is the default log level of control
path, RTE_LOG_DP_LEVEL is the log level of data path. It's a little bit
hard to understand literally that assertion is decided by control path
LOG_LEVEL, especially assertion used on data path.

On the other hand, DPDK need an assertion enabling switch w/o impacting
log output level, assuming "--log-level" not specified.

Assertion is an important API to balance DPDK high performance and
robustness. To promote assertion usage, it's valuable to unhide
assertion out of COFNIG_RTE_LOG_LEVEL.

In one word, log is log, assertion is assertion, debug is hot pot :)

Rationale of this patch is to introduce an independant switch of
assertion.

BTW, CONFIG_RTE_LOG_LEVEL is merely a default value of runtime global
log level, not sure the value to keep it in compile time configuration.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 config/common_base                        | 1 +
 lib/librte_eal/common/include/rte_debug.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/config/common_base b/config/common_base
index 5e97a08b6..ce14b1cac 100644
--- a/config/common_base
+++ b/config/common_base
@@ -93,6 +93,7 @@ CONFIG_RTE_MAX_NUMA_NODES=8
 CONFIG_RTE_MAX_MEMSEG=256
 CONFIG_RTE_MAX_MEMZONE=2560
 CONFIG_RTE_MAX_TAILQ=32
+CONFIG_RTE_ASSERTION=n
 CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO
 CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO
 CONFIG_RTE_LOG_HISTORY=256
diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h
index cab6fb4c9..d1104c240 100644
--- a/lib/librte_eal/common/include/rte_debug.h
+++ b/lib/librte_eal/common/include/rte_debug.h
@@ -79,7 +79,7 @@ void rte_dump_registers(void);
 #define rte_panic(...) rte_panic_(__func__, __VA_ARGS__, "dummy")
 #define rte_panic_(func, format, ...) __rte_panic(func, format "%.0s", __VA_ARGS__)
 
-#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
+#ifdef RTE_ASSERTION
 #define RTE_ASSERT(exp)	RTE_VERIFY(exp)
 #else
 #define RTE_ASSERT(exp) do {} while (0)
-- 
2.13.3

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

* Re: [PATCH] eal: add config option to enable asserts
  2017-08-23 14:00 [PATCH] eal: add config option to enable asserts Xueming Li
@ 2017-08-23 14:09 ` Gaëtan Rivet
  2017-08-23 14:50   ` Wiles, Keith
  2017-08-24  8:10 ` [PATCH v2] " Xueming Li
  2017-08-24  8:23 ` Xueming Li
  2 siblings, 1 reply; 6+ messages in thread
From: Gaëtan Rivet @ 2017-08-23 14:09 UTC (permalink / raw)
  To: Xueming Li; +Cc: dev

Hi,

On Wed, Aug 23, 2017 at 10:00:08PM +0800, Xueming Li wrote:
> Currently, enabling assertion have to set CONFIG_RTE_LOG_LEVEL to
> RTE_LOG_DEBUG. CONFIG_RTE_LOG_LEVEL is the default log level of control
> path, RTE_LOG_DP_LEVEL is the log level of data path. It's a little bit
> hard to understand literally that assertion is decided by control path
> LOG_LEVEL, especially assertion used on data path.
> 
> On the other hand, DPDK need an assertion enabling switch w/o impacting
> log output level, assuming "--log-level" not specified.
> 
> Assertion is an important API to balance DPDK high performance and
> robustness. To promote assertion usage, it's valuable to unhide
> assertion out of COFNIG_RTE_LOG_LEVEL.
> 
> In one word, log is log, assertion is assertion, debug is hot pot :)
> 
> Rationale of this patch is to introduce an independant switch of
> assertion.
> 
> BTW, CONFIG_RTE_LOG_LEVEL is merely a default value of runtime global
> log level, not sure the value to keep it in compile time configuration.
> 

I agree.

> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> ---
>  config/common_base                        | 1 +
>  lib/librte_eal/common/include/rte_debug.h | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/config/common_base b/config/common_base
> index 5e97a08b6..ce14b1cac 100644
> --- a/config/common_base
> +++ b/config/common_base
> @@ -93,6 +93,7 @@ CONFIG_RTE_MAX_NUMA_NODES=8
>  CONFIG_RTE_MAX_MEMSEG=256
>  CONFIG_RTE_MAX_MEMZONE=2560
>  CONFIG_RTE_MAX_TAILQ=32
> +CONFIG_RTE_ASSERTION=n

I'm not sure about the name, but I'm not maintainer.
I'd suggest something like RTE_ASSERT_ENABLE.

>  CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO
>  CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO
>  CONFIG_RTE_LOG_HISTORY=256
> diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h
> index cab6fb4c9..d1104c240 100644
> --- a/lib/librte_eal/common/include/rte_debug.h
> +++ b/lib/librte_eal/common/include/rte_debug.h
> @@ -79,7 +79,7 @@ void rte_dump_registers(void);
>  #define rte_panic(...) rte_panic_(__func__, __VA_ARGS__, "dummy")
>  #define rte_panic_(func, format, ...) __rte_panic(func, format "%.0s", __VA_ARGS__)
>  
> -#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
> +#ifdef RTE_ASSERTION
>  #define RTE_ASSERT(exp)	RTE_VERIFY(exp)
>  #else
>  #define RTE_ASSERT(exp) do {} while (0)
> -- 
> 2.13.3
> 

Regardless of which name is used:

Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>

-- 
Gaëtan Rivet
6WIND

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

* Re: [PATCH] eal: add config option to enable asserts
  2017-08-23 14:09 ` Gaëtan Rivet
@ 2017-08-23 14:50   ` Wiles, Keith
  0 siblings, 0 replies; 6+ messages in thread
From: Wiles, Keith @ 2017-08-23 14:50 UTC (permalink / raw)
  To: Gaëtan Rivet; +Cc: Xueming Li, dev


> On Aug 23, 2017, at 9:09 AM, Gaëtan Rivet <gaetan.rivet@6wind.com> wrote:
> 
> Hi,
> 
> On Wed, Aug 23, 2017 at 10:00:08PM +0800, Xueming Li wrote:
>> Currently, enabling assertion have to set CONFIG_RTE_LOG_LEVEL to
>> RTE_LOG_DEBUG. CONFIG_RTE_LOG_LEVEL is the default log level of control
>> path, RTE_LOG_DP_LEVEL is the log level of data path. It's a little bit
>> hard to understand literally that assertion is decided by control path
>> LOG_LEVEL, especially assertion used on data path.
>> 
>> On the other hand, DPDK need an assertion enabling switch w/o impacting
>> log output level, assuming "--log-level" not specified.
>> 
>> Assertion is an important API to balance DPDK high performance and
>> robustness. To promote assertion usage, it's valuable to unhide
>> assertion out of COFNIG_RTE_LOG_LEVEL.
>> 
>> In one word, log is log, assertion is assertion, debug is hot pot :)
>> 
>> Rationale of this patch is to introduce an independant switch of
>> assertion.
>> 
>> BTW, CONFIG_RTE_LOG_LEVEL is merely a default value of runtime global
>> log level, not sure the value to keep it in compile time configuration.
>> 
> 
> I agree.
> 
>> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
>> ---
>> config/common_base                        | 1 +
>> lib/librte_eal/common/include/rte_debug.h | 2 +-
>> 2 files changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/config/common_base b/config/common_base
>> index 5e97a08b6..ce14b1cac 100644
>> --- a/config/common_base
>> +++ b/config/common_base
>> @@ -93,6 +93,7 @@ CONFIG_RTE_MAX_NUMA_NODES=8
>> CONFIG_RTE_MAX_MEMSEG=256
>> CONFIG_RTE_MAX_MEMZONE=2560
>> CONFIG_RTE_MAX_TAILQ=32
>> +CONFIG_RTE_ASSERTION=n
> 
> I'm not sure about the name, but I'm not maintainer.
> I'd suggest something like RTE_ASSERT_ENABLE.

I believe the define should be readable and state what it does, so I would suggest we use RTE_ASSERT_ENABLE or RTE_ENABLE_ASSERT the last one is more readable from you point of view.

> 
>> CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO
>> CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO
>> CONFIG_RTE_LOG_HISTORY=256
>> diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h
>> index cab6fb4c9..d1104c240 100644
>> --- a/lib/librte_eal/common/include/rte_debug.h
>> +++ b/lib/librte_eal/common/include/rte_debug.h
>> @@ -79,7 +79,7 @@ void rte_dump_registers(void);
>> #define rte_panic(...) rte_panic_(__func__, __VA_ARGS__, "dummy")
>> #define rte_panic_(func, format, ...) __rte_panic(func, format "%.0s", __VA_ARGS__)
>> 
>> -#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
>> +#ifdef RTE_ASSERTION
>> #define RTE_ASSERT(exp)	RTE_VERIFY(exp)
>> #else
>> #define RTE_ASSERT(exp) do {} while (0)
>> -- 
>> 2.13.3
>> 
> 
> Regardless of which name is used:
> 
> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> 
> -- 
> Gaëtan Rivet
> 6WIND

Regards,
Keith


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

* [PATCH v2] eal: add config option to enable asserts
  2017-08-23 14:00 [PATCH] eal: add config option to enable asserts Xueming Li
  2017-08-23 14:09 ` Gaëtan Rivet
@ 2017-08-24  8:10 ` Xueming Li
  2017-08-24  8:23 ` Xueming Li
  2 siblings, 0 replies; 6+ messages in thread
From: Xueming Li @ 2017-08-24  8:10 UTC (permalink / raw)
  To: Gaetan Rivet, Wiles Keith; +Cc: xuemingl, dev

Currently, enabling assertion have to set CONFIG_RTE_LOG_LEVEL to
RTE_LOG_DEBUG. CONFIG_RTE_LOG_LEVEL is the default log level of control
path, RTE_LOG_DP_LEVEL is the log level of data path. It's a little bit
hard to understand literally that assertion is decided by control path
LOG_LEVEL, especially assertion used on data path.

On the other hand, DPDK need an assertion enabling switch w/o impacting
log output level, assuming "--log-level" not specified.

Assertion is an important API to balance DPDK high performance and
robustness. To promote assertion usage, it's valuable to unhide
assertion out of COFNIG_RTE_LOG_LEVEL.

In one word, log is log, assertion is assertion, debug is hot pot :)

Rationale of this patch is to introduce an dedicate switch of
assertion: RTE_ENABLE_ASSERT

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>

---
v2: Changed macro name from RTE_ASSERTION to RTE_ENABLE_ASSERT
---
 config/common_base                        | 1 +
 lib/librte_eal/common/include/rte_debug.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/config/common_base b/config/common_base
index 5e97a08b6..2cb445b6d 100644
--- a/config/common_base
+++ b/config/common_base
@@ -93,6 +93,7 @@ CONFIG_RTE_MAX_NUMA_NODES=8
 CONFIG_RTE_MAX_MEMSEG=256
 CONFIG_RTE_MAX_MEMZONE=2560
 CONFIG_RTE_MAX_TAILQ=32
+CONFIG_RTE_ENABLE_ASSERT=n
 CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO
 CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO
 CONFIG_RTE_LOG_HISTORY=256
diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h
index cab6fb4c9..79b67b3ec 100644
--- a/lib/librte_eal/common/include/rte_debug.h
+++ b/lib/librte_eal/common/include/rte_debug.h
@@ -79,7 +79,7 @@ void rte_dump_registers(void);
 #define rte_panic(...) rte_panic_(__func__, __VA_ARGS__, "dummy")
 #define rte_panic_(func, format, ...) __rte_panic(func, format "%.0s", __VA_ARGS__)
 
-#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
+#ifdef RTE_ENABLE_ASSERT
 #define RTE_ASSERT(exp)	RTE_VERIFY(exp)
 #else
 #define RTE_ASSERT(exp) do {} while (0)
-- 
2.13.3

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

* [PATCH v2] eal: add config option to enable asserts
  2017-08-23 14:00 [PATCH] eal: add config option to enable asserts Xueming Li
  2017-08-23 14:09 ` Gaëtan Rivet
  2017-08-24  8:10 ` [PATCH v2] " Xueming Li
@ 2017-08-24  8:23 ` Xueming Li
  2017-10-09 21:01   ` Thomas Monjalon
  2 siblings, 1 reply; 6+ messages in thread
From: Xueming Li @ 2017-08-24  8:23 UTC (permalink / raw)
  To: Gaetan Rivet, Wiles Keith; +Cc: Xueming Li, dev

Currently, enabling assertion have to set CONFIG_RTE_LOG_LEVEL to
RTE_LOG_DEBUG. CONFIG_RTE_LOG_LEVEL is the default log level of control
path, RTE_LOG_DP_LEVEL is the log level of data path. It's a little bit
hard to understand literally that assertion is decided by control path
LOG_LEVEL, especially assertion used on data path.

On the other hand, DPDK need an assertion enabling switch w/o impacting
log output level, assuming "--log-level" not specified.

Assertion is an important API to balance DPDK high performance and
robustness. To promote assertion usage, it's valuable to unhide
assertion out of COFNIG_RTE_LOG_LEVEL.

In one word, log is log, assertion is assertion, debug is hot pot :)

Rationale of this patch is to introduce an dedicate switch of
assertion: RTE_ENABLE_ASSERT

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>

---
v2: Changed macro name from RTE_ASSERTION to RTE_ENABLE_ASSERT
---
 config/common_base                        | 1 +
 lib/librte_eal/common/include/rte_debug.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/config/common_base b/config/common_base
index 5e97a08b6..2cb445b6d 100644
--- a/config/common_base
+++ b/config/common_base
@@ -93,6 +93,7 @@ CONFIG_RTE_MAX_NUMA_NODES=8
 CONFIG_RTE_MAX_MEMSEG=256
 CONFIG_RTE_MAX_MEMZONE=2560
 CONFIG_RTE_MAX_TAILQ=32
+CONFIG_RTE_ENABLE_ASSERT=n
 CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO
 CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO
 CONFIG_RTE_LOG_HISTORY=256
diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h
index cab6fb4c9..79b67b3ec 100644
--- a/lib/librte_eal/common/include/rte_debug.h
+++ b/lib/librte_eal/common/include/rte_debug.h
@@ -79,7 +79,7 @@ void rte_dump_registers(void);
 #define rte_panic(...) rte_panic_(__func__, __VA_ARGS__, "dummy")
 #define rte_panic_(func, format, ...) __rte_panic(func, format "%.0s", __VA_ARGS__)
 
-#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
+#ifdef RTE_ENABLE_ASSERT
 #define RTE_ASSERT(exp)	RTE_VERIFY(exp)
 #else
 #define RTE_ASSERT(exp) do {} while (0)
-- 
2.13.3

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

* Re: [PATCH v2] eal: add config option to enable asserts
  2017-08-24  8:23 ` Xueming Li
@ 2017-10-09 21:01   ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2017-10-09 21:01 UTC (permalink / raw)
  To: Xueming Li; +Cc: dev, Gaetan Rivet, Wiles Keith

24/08/2017 10:23, Xueming Li:
> Currently, enabling assertion have to set CONFIG_RTE_LOG_LEVEL to
> RTE_LOG_DEBUG. CONFIG_RTE_LOG_LEVEL is the default log level of control
> path, RTE_LOG_DP_LEVEL is the log level of data path. It's a little bit
> hard to understand literally that assertion is decided by control path
> LOG_LEVEL, especially assertion used on data path.
> 
> On the other hand, DPDK need an assertion enabling switch w/o impacting
> log output level, assuming "--log-level" not specified.
> 
> Assertion is an important API to balance DPDK high performance and
> robustness. To promote assertion usage, it's valuable to unhide
> assertion out of COFNIG_RTE_LOG_LEVEL.
> 
> In one word, log is log, assertion is assertion, debug is hot pot :)
> 
> Rationale of this patch is to introduce an dedicate switch of
> assertion: RTE_ENABLE_ASSERT
> 
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>

Applied, thanks

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

end of thread, other threads:[~2017-10-09 21:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 14:00 [PATCH] eal: add config option to enable asserts Xueming Li
2017-08-23 14:09 ` Gaëtan Rivet
2017-08-23 14:50   ` Wiles, Keith
2017-08-24  8:10 ` [PATCH v2] " Xueming Li
2017-08-24  8:23 ` Xueming Li
2017-10-09 21:01   ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.