app/eventdev: fix lcore parsing skipping last core

Message ID 20210506210310.308-1-pbhagavatula@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series app/eventdev: fix lcore parsing skipping last core |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues
ci/github-robot success github build: passed
ci/intel-Testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional fail Functional Testing issues
ci/iol-mellanox-Functional success Functional Testing PASS

Commit Message

Pavan Nikhilesh Bhagavatula May 6, 2021, 9:03 p.m. UTC
  From: Pavan Nikhilesh <pbhagavatula@marvell.com>

The last lcore declared in the list is also a valid lcore in the list.

Fixes: 32d7dbf269be ("app/eventdev: fix overflow in lcore list parsing")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 app/test-eventdev/parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.17.1
  

Comments

Jerin Jacob May 9, 2021, 4:03 p.m. UTC | #1
On Fri, May 7, 2021 at 2:33 AM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> The last lcore declared in the list is also a valid lcore in the list.
>
> Fixes: 32d7dbf269be ("app/eventdev: fix overflow in lcore list parsing")
> Cc: stable@dpdk.org
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>


Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-eventdev/for-main. Thanks.

> ---
>  app/test-eventdev/parser.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/app/test-eventdev/parser.c b/app/test-eventdev/parser.c
> index 7a973cbb23..8818c37ff8 100644
> --- a/app/test-eventdev/parser.c
> +++ b/app/test-eventdev/parser.c
> @@ -345,7 +345,7 @@ parse_lcores_list(bool lcores[], int lcores_num, const char *corelist)
>                         max = idx;
>                         if (min == RTE_MAX_LCORE)
>                                 min = idx;
> -                       for (idx = min; idx < max; idx++) {
> +                       for (idx = min; idx <= max; idx++) {
>                                 if (lcores[idx] == 1)
>                                         return -E2BIG;
>                                 lcores[idx] = 1;
> --
> 2.17.1
>
  

Patch

diff --git a/app/test-eventdev/parser.c b/app/test-eventdev/parser.c
index 7a973cbb23..8818c37ff8 100644
--- a/app/test-eventdev/parser.c
+++ b/app/test-eventdev/parser.c
@@ -345,7 +345,7 @@  parse_lcores_list(bool lcores[], int lcores_num, const char *corelist)
 			max = idx;
 			if (min == RTE_MAX_LCORE)
 				min = idx;
-			for (idx = min; idx < max; idx++) {
+			for (idx = min; idx <= max; idx++) {
 				if (lcores[idx] == 1)
 					return -E2BIG;
 				lcores[idx] = 1;