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(-)
This patch adds checking for mp reply result in handle_sync().
Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug") Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng fengchengwen@huawei.com Signed-off-by: Min Hu (Connor) humin29@huawei.com --- v2->v3: * change patch's author --- lib/eal/common/malloc_mp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c index c7101b3..2e597a1 100644 --- a/lib/eal/common/malloc_mp.c +++ b/lib/eal/common/malloc_mp.c @@ -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
This patch adds checking for service core index validity when parsing service corelist.
Fixes: 7dbd7a6413ef ("service: add -S corelist option") Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng fengchengwen@huawei.com Signed-off-by: Min Hu (Connor) humin29@huawei.com --- v2->v3: * change patch's author --- lib/eal/common/eal_common_options.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c index 66f9114..97ab6e0 100644 --- a/lib/eal/common/eal_common_options.c +++ b/lib/eal/common/eal_common_options.c @@ -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 == '-') {
-----Original Message----- From: Chengwen Feng fengchengwen@huawei.com Sent: Wednesday, May 5, 2021 5:10 AM To: thomas@monjalon.net; Yigit, Ferruh ferruh.yigit@intel.com; skori@marvell.com; jerinj@marvell.com; Burakov, Anatoly anatoly.burakov@intel.com; Van Haaren, Harry harry.van.haaren@intel.com; stephen@networkplumber.org Cc: dev@dpdk.org; linuxarm@openeuler.org Subject: [PATCH v3 2/2] eal: fix service core index validity
This patch adds checking for service core index validity when parsing service corelist.
Fixes: 7dbd7a6413ef ("service: add -S corelist option") Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng fengchengwen@huawei.com Signed-off-by: Min Hu (Connor) humin29@huawei.com
Thanks,
Acked-by: Harry van Haaren harry.van.haaren@intel.com
05/05/2021 12:43, Van Haaren, Harry:
From: Chengwen Feng fengchengwen@huawei.com
This patch adds checking for service core index validity when parsing service corelist.
Fixes: 7dbd7a6413ef ("service: add -S corelist option") Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng fengchengwen@huawei.com Signed-off-by: Min Hu (Connor) humin29@huawei.com
Thanks,
Acked-by: Harry van Haaren harry.van.haaren@intel.com
Series applied, thanks.