From patchwork Thu Apr 29 02:34:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 92363 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9D3AEA0A0E; Thu, 29 Apr 2021 04:34:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14C164067E; Thu, 29 Apr 2021 04:34:16 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 0A16A4067E for ; Thu, 29 Apr 2021 04:34:15 +0200 (CEST) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FVzz43Jq0zvTnL; Thu, 29 Apr 2021 10:31:44 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Thu, 29 Apr 2021 10:34:08 +0800 From: "Min Hu (Connor)" To: CC: , , , Date: Thu, 29 Apr 2021 10:34:12 +0800 Message-ID: <1619663653-22771-2-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619663653-22771-1-git-send-email-humin29@huawei.com> References: <1618967837-2341-1-git-send-email-humin29@huawei.com> <1619663653-22771-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2 1/2] eal: check mp reply result X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Signed-off-by: Min Hu (Connor) --- 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 From patchwork Thu Apr 29 02:34:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 92365 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B0B53A0A0E; Thu, 29 Apr 2021 04:34:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 85EBA412D4; Thu, 29 Apr 2021 04:34:20 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 3956440697 for ; Thu, 29 Apr 2021 04:34:15 +0200 (CEST) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FVzz42pcszvTSb; Thu, 29 Apr 2021 10:31:44 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Thu, 29 Apr 2021 10:34:09 +0800 From: "Min Hu (Connor)" To: CC: , , , Date: Thu, 29 Apr 2021 10:34:13 +0800 Message-ID: <1619663653-22771-3-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619663653-22771-1-git-send-email-humin29@huawei.com> References: <1618967837-2341-1-git-send-email-humin29@huawei.com> <1619663653-22771-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2 2/2] eal: fix service core index validity X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Signed-off-by: Min Hu (Connor) --- 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 == '-') {