[dpdk-dev,v2] examples/qos_sched: fix core limit for lower num of lcore

Message ID 1500280631-6634-1-git-send-email-hemant.agrawal@nxp.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Hemant Agrawal July 17, 2017, 8:37 a.m. UTC
  APP_MAX_LCORES is hardcoded as 64.
This will cause build err when RTE_MAX_LCORE is less then 64.

"args.c:127:22: error: iteration 8 invokes undefined behavior
	[-Werror=aggressive-loop-optimizations]
   if (cfg->lcore_role[i] == ROLE_RTE)
       ~~~~~~~~~~~~~~~^~~
args.c:126:2: note: within this loop
  for (i = 0; i < APP_MAX_LCORE; i++) {"

Fixes: d52b5e735aa3 ("examples/qos_sched: fix lcore limit")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
v2: fix the compilation error for higher number of cores

 examples/qos_sched/main.h | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Thomas Monjalon July 19, 2017, 5:24 a.m. UTC | #1
17/07/2017 11:37, Hemant Agrawal:
> --- a/examples/qos_sched/main.h
> +++ b/examples/qos_sched/main.h
> @@ -69,8 +69,13 @@ extern "C" {
>  #define BURST_TX_DRAIN_US 100
>  
>  #ifndef APP_MAX_LCORE
> +#if (APP_MAX_LCORE > 64)
>  #define APP_MAX_LCORE 64

If APP_MAX_LCORE is not defined, it cannot be > 64, right?
Or what am I missing?

> +#else
> +#define APP_MAX_LCORE RTE_MAX_LCORE
> +#endif
>  #endif
  
Hemant Agrawal July 19, 2017, 7:58 a.m. UTC | #2
On 7/19/2017 10:54 AM, Thomas Monjalon wrote:
> 17/07/2017 11:37, Hemant Agrawal:
>> --- a/examples/qos_sched/main.h
>> +++ b/examples/qos_sched/main.h
>> @@ -69,8 +69,13 @@ extern "C" {
>>  #define BURST_TX_DRAIN_US 100
>>
>>  #ifndef APP_MAX_LCORE
>> +#if (APP_MAX_LCORE > 64)
>>  #define APP_MAX_LCORE 64
>
> If APP_MAX_LCORE is not defined, it cannot be > 64, right?
> Or what am I missing?
>
It should be RTE_MAX_LCORE

>> +#else
>> +#define APP_MAX_LCORE RTE_MAX_LCORE
>> +#endif
>>  #endif
>
>
>
  

Patch

diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h
index c7490c6..7134e92 100644
--- a/examples/qos_sched/main.h
+++ b/examples/qos_sched/main.h
@@ -69,8 +69,13 @@  extern "C" {
 #define BURST_TX_DRAIN_US 100
 
 #ifndef APP_MAX_LCORE
+#if (APP_MAX_LCORE > 64)
 #define APP_MAX_LCORE 64
+#else
+#define APP_MAX_LCORE RTE_MAX_LCORE
+#endif
 #endif
+
 #define MAX_DATA_STREAMS (APP_MAX_LCORE/2)
 #define MAX_SCHED_SUBPORTS		8
 #define MAX_SCHED_PIPES		4096