fix bugs for librte eal
cover fix bugs for librte eal
This patchset fixed some bugs for librte_eal.
Chengwen Feng (2):
eal: check mp reply result
eal: fix service core index validity
lib/librte_eal/common/eal_common_options.c | 2 ++ lib/librte_eal/common/malloc_mp.c | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/2 eal: check mp reply result
From: Chengwen Feng <[email protected]>
This patch adds checking for mp reply result in handle_sync().
--- lib/librte_eal/common/malloc_mp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
lib/librte_eal/common/malloc_mp.c +1 -3
@@ -171,9 +171,7 @@ handle_sync(const struct rte_mp_msg *msg, const void *peer) resp->id = req->id; resp->result = ret ==0 ?REQ_RESULT_SUCCESS :REQ_RESULT_FAIL ; -rte_mp_reply (&reply, peer); - -return 0 ; +return rte_mp_reply (&reply, peer); } static int
Signature · 1 line
2.7.4
PATCH 2/2 eal: fix service core index validity
In reply to Min Hu (Connor)From: Chengwen Feng <[email protected]>
This patch adds checking for service core index validity when parsing service corelist.
--- lib/librte_eal/common/eal_common_options.c | 2 ++ 1 file changed, 2 insertions(+)
lib/librte_eal/common/eal_common_options.c +2 -0
@@ -785,6 +785,8 @@ eal_parse_service_corelist(const char *corelist) idx =strtoul (corelist, &end,10 );if (errno || end ==NULL )return -1 ; +if (idx <0 || idx >=RTE_MAX_LCORE ) +return -1 ;while (isblank (*end)) end++;if (*end =='-' ) {
Signature · 1 line
2.7.4
Re: [dpdk-dev] [PATCH 2/2] eal: fix service core index validity
lib/librte_eal/common/eal_common_options.c eal_parse_service_corelist(const char *corelist) · line 788
Quoted 4 lines · On Wed, 21 Apr 2021 09:17:17 +0800 "Min Hu (Connor)" <[email protected]> wrote:
lib/librte_eal/common/eal_common_options.c +1
-0idx =strtoul (corelist, &end,10 );if (errno || end ==NULL )return -1 ; +if (idx <0 || idx >=RTE_MAX_LCORE )
Wondered at first how strtoul() could ever return an negative value but then noticed that idx is int here.
The code that does would be clearer and safer if the variables were an unsigned type. idx, min, max should be the same type everywhere.
Looks like the original code was written in old C style of "all the world's an int"
Re: [dpdk-dev] [PATCH 2/2] eal: fix service core index validity
Hi, fixed in v2, thanks.
Quoted 17 lines · Stephen Hemminger
lib/librte_eal/common/eal_common_options.c eal_parse_service_corelist(const char *corelist) · line 788
Quoted 4 lines · On Wed, 21 Apr 2021 09:17:17 +0800 "Min Hu (Connor)" <[email protected]> wrote:
idx = strtoul(corelist, &end, 10); if (errno || end == NULL) return -1;lib/librte_eal/common/eal_common_options.c +1
-0+if (idx <0 || idx >=RTE_MAX_LCORE )Wondered at first how
strtoul()could ever return an negative value but then noticed that idx is int here.The code that does would be clearer and safer if the variables were an unsigned type. idx, min, max should be the same type everywhere.
Looks like the original code was written in old C style of "all the world's an int" .
v2 cover fix bugs for librte eal
In reply to Min Hu (Connor)This patchset fixed some bugs for librte_eal.
Min Hu (Connor) (2):
eal: check mp reply result
eal: fix service core index validity
---
v2:
* set variables an unsigned type.
lib/eal/common/eal_common_options.c | 6 ++++-- lib/eal/common/malloc_mp.c | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
PATCH v2 1/2 eal: check mp reply result
This patch adds checking for mp reply result in handle_sync().
--- lib/eal/common/malloc_mp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
lib/eal/common/malloc_mp.c +1 -3
@@ -171,9 +171,7 @@ handle_sync(const struct rte_mp_msg *msg, const void *peer) resp->id = req->id; resp->result = ret ==0 ?REQ_RESULT_SUCCESS :REQ_RESULT_FAIL ; -rte_mp_reply (&reply, peer); - -return 0 ; +return rte_mp_reply (&reply, peer); } static int
Signature · 1 line
2.7.4
Re: [dpdk-dev] [PATCH v2 1/2] eal: check mp reply result
+Cc Anatoly
29/04/2021 04:34, Min Hu (Connor):
Quoted 24 lines
This patch adds checking for mp reply result in
handle_sync().Fixes 07dcbfe0101f ("malloc: support multiprocess memory hotplug")Signed-off-by Chengwen Feng <[email protected]>Signed-off-by Min Hu (Connor) <[email protected]>--- lib/eal/common/malloc_mp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)lib/eal/common/malloc_mp.c +1
-3@@ -171,9 +171,7 @@ handle_sync(const struct rte_mp_msg *msg, const void *peer) resp->id = req->id; resp->result = ret ==0 ?REQ_RESULT_SUCCESS :REQ_RESULT_FAIL ; -rte_mp_reply (&reply, peer); - -return 0 ; +return rte_mp_reply (&reply, peer); }
PATCH v2 2/2 eal: fix service core index validity
In reply to Min Hu (Connor)This patch adds checking for service core index validity when parsing service corelist.
--- lib/eal/common/eal_common_options.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_options.c +4 -2
@@ -758,10 +758,10 @@ static int eal_parse_service_corelist(const char *corelist) {struct rte_config *cfg =rte_eal_get_configuration (); -int i, idx =0 ; +int i;unsigned count =0 ;char *end =NULL ; -int min, max; +uint32_t min, max, idx;uint32_t taken_lcore_count =0 ;if (corelist ==NULL )
@@ -785,6 +785,8 @@ eal_parse_service_corelist(const char *corelist) idx =strtoul (corelist, &end,10 );if (errno || end ==NULL )return -1 ; +if (idx >=RTE_MAX_LCORE ) +return -1 ;while (isblank (*end)) end++;if (*end =='-' ) {
Signature · 1 line
2.7.4
Re: [dpdk-dev] [PATCH v2 2/2] eal: fix service core index validity
+Cc Harry
29/04/2021 04:34, Min Hu (Connor):
Quoted 39 lines
This patch adds checking for service core index validity when parsing service corelist.
Fixes 7dbd7a6413ef ("service: add -S corelist option")Signed-off-by Chengwen Feng <[email protected]>Signed-off-by Min Hu (Connor) <[email protected]>--- lib/eal/common/eal_common_options.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)lib/eal/common/eal_common_options.c +4
-2@@ -758,10 +758,10 @@ static int eal_parse_service_corelist(const char *corelist) {struct rte_config *cfg =rte_eal_get_configuration (); -int i, idx =0 ; +int i;unsigned count =0 ;char *end =NULL ; -int min, max; +uint32_t min, max, idx;uint32_t taken_lcore_count =0 ;if (corelist ==NULL )@@ -785,6 +785,8 @@ eal_parse_service_corelist(const char *corelist) idx =strtoul (corelist, &end,10 );if (errno || end ==NULL )return -1 ; +if (idx >=RTE_MAX_LCORE ) +return -1 ;while (isblank (*end)) end++;if (*end =='-' ) {
v3 cover fix bugs for librte eal
In reply to Min Hu (Connor)This patchset fixed some bugs for librte_eal.
v3:
* change patch's author
v2:
* set variables an unsigned type.
Chengwen Feng (2):
eal: check mp reply result
eal: fix service core index validity
lib/eal/common/eal_common_options.c | 6 ++++-- lib/eal/common/malloc_mp.c | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.8.1
PATCH v3 1/2 eal: check mp reply result
This patch adds checking for mp reply result in handle_sync().
---v2->v3:
* change patch's author
--- lib/eal/common/malloc_mp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
lib/eal/common/malloc_mp.c +1 -3
@@ -171,9 +171,7 @@ handle_sync(const struct rte_mp_msg *msg, const void *peer) resp->id = req->id; resp->result = ret ==0 ?REQ_RESULT_SUCCESS :REQ_RESULT_FAIL ; -rte_mp_reply (&reply, peer); - -return 0 ; +return rte_mp_reply (&reply, peer); } static int
Signature · 1 line
2.8.1
PATCH v3 2/2 eal: fix service core index validity
In reply to Chengwen FengThis patch adds checking for service core index validity when parsing service corelist.
---v2->v3:
* change patch's author
--- lib/eal/common/eal_common_options.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_options.c +4 -2
@@ -758,10 +758,10 @@ static int eal_parse_service_corelist(const char *corelist) {struct rte_config *cfg =rte_eal_get_configuration (); -int i, idx =0 ; +int i;unsigned count =0 ;char *end =NULL ; -int min, max; +uint32_t min, max, idx;uint32_t taken_lcore_count =0 ;if (corelist ==NULL )
@@ -785,6 +785,8 @@ eal_parse_service_corelist(const char *corelist) idx =strtoul (corelist, &end,10 );if (errno || end ==NULL )return -1 ; +if (idx >=RTE_MAX_LCORE ) +return -1 ;while (isblank (*end)) end++;if (*end =='-' ) {
Signature · 1 line
2.8.1
Re: [dpdk-dev] [PATCH v3 2/2] eal: fix service core index validity
Quoted 10 lines
-----Original Message-----
From: Chengwen Feng <[email protected]>
Sent: Wednesday, May 5, 2021 5:10 AM
To: [email protected]; Yigit, Ferruh <[email protected]>; [email protected]; [email protected]; Burakov, Anatoly <[email protected]>; Van Haaren, Harry <[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: [PATCH v3 2/2] eal: fix service core index validity
Quoted 8 lines
This patch adds checking for service core index validity when parsing service corelist.
Fixes 7dbd7a6413ef ("service: add -S corelist option")Signed-off-by Chengwen Feng <[email protected]>Signed-off-by Min Hu (Connor) <[email protected]>
Thanks,
Re: [dpdk-dev] [PATCH v3 2/2] eal: fix service core index validity
05/05/2021 12:43, Van Haaren, Harry:
Quoted 8 lines
From: Chengwen Feng <[email protected]>
Quoted 7 lines
This patch adds checking for service core index validity when parsing service corelist.
Fixes 7dbd7a6413ef ("service: add -S corelist option")
Quoted 6 lines
Quoted 2 lines
Signed-off-by Chengwen Feng <[email protected]>Signed-off-by Min Hu (Connor) <[email protected]>Thanks,
Acked-by Harry van Haaren <[email protected]>
Series applied, thanks.