From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 2398F8DA0 for ; Sun, 20 May 2018 15:09:24 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C7166222E5; Sun, 20 May 2018 09:09:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 20 May 2018 09:09:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=W9i5hV/KyCAzssfBC /OfjikIKrajXG7PmWIEJHa6pOE=; b=kou7BtX/nYBLAaGJf6VRS6KjDhLjZ36Cv Th4IRsrEVzpsGujw6P77zbnTHy3f2sKdBo/bNOZx3nN0QNnwn/+UtdjimGY0Ht/B NNfPHrvqsH75nf9XV431VXs/EuNy6jbO4RulvUhPlmlczHQVGMnjRZFh7ER0ot+J Vpk1wgC3WElRNwNCT3HhJJvaoabMhfHHC0BUsIz01Frwh/IZHoHWana3zgv1oNl+ NGV+Wuzu598EyNM6EBBurDVU/ooa1irdduC6kIE/wN6MyqeBDtqXiVKdW4jRjaBS SE6I/ftA/kdXcK6dxOA1qXy0Er1RiqIqWXketKHXgNkNavJfMt/uw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=W9i5hV/KyCAzssfBC/OfjikIKrajXG7PmWIEJHa6pOE=; b=CsFBpk18 yrcdgaVUno4hY9UofH7iZi+zra/GMEsSjS4EYX65CkAM2saGHtFwXPvj14RmY/dY n2dcTvP8WBVcsstkIqOzIf9s1amjYiZOcTUwiFE928+rl4OuZ29UrExjbSrZ+VHd k7YYOyru68z6Bwmgk3B3I2oSfxH2M1IAqQqmmXc6OWS3q2FU9W3mogO02CZnQn9f IKKg3/VhXhqtZNEbkx73O1R4mCiMzWCLhUJH/fa82RRODIux6l+Ed8sfb+/zQsfT GVfxcUdsQsyk5Iy3c/qG7vSthWde+/GC2xiEfkmzn17PyeV4IXEa3enpFfReacr5 bf3sVxiw7ibvSg== X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from yuanhanliu-NB0.tencent.com (unknown [223.74.148.80]) by mail.messagingengine.com (Postfix) with ESMTPA id BCA5510262; Sun, 20 May 2018 09:09:21 -0400 (EDT) From: Yuanhan Liu To: Anatoly Burakov Cc: Olivier Matz , Andrew Rybchenko , dpdk stable Date: Sun, 20 May 2018 21:02:41 +0800 Message-Id: <20180520130246.16287-25-yliu@fridaylinux.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180520130246.16287-1-yliu@fridaylinux.org> References: <20180520130246.16287-1-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'mempool: fix virtual address population' has been queued to LTS release 17.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2018 13:09:24 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/27/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 3cfbb674d1f5a4f026975a9475fe58011ec6c55f Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Mon, 14 May 2018 17:06:15 +0100 Subject: [PATCH] mempool: fix virtual address population [ upstream commit 460354cd4ede8e8cf27710d645524caeecf49b47 ] Currently, populate_virt will check if mempool is already populated. This will cause inability to reserve multi-chunk mempools if contiguous memory is not a hard requirement, because if allocating all-contiguous memory fails, mempool will retry with virtual addresses and will call populate_virt. It seems that the original code never anticipated more than one non-physically contiguous area. Fix it by removing the check in populate virt. populate_anon() function calls populate_virt() also, and it can be reasonably inferred that it is expecting that virtual area is not already populated. Even though a similar check is already in place there, also add the check that was part of populate_virt() just in case. Fixes: aab4f62d6c1c ("mempool: support no hugepage mode") Signed-off-by: Anatoly Burakov Acked-by: Olivier Matz Reviewed-by: Andrew Rybchenko --- lib/librte_mempool/rte_mempool.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 5bb286a41..ad1745822 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -520,9 +520,6 @@ rte_mempool_populate_virt(struct rte_mempool *mp, char *addr, size_t off, phys_len; int ret, cnt = 0; - /* mempool must not be populated */ - if (mp->nb_mem_chunks != 0) - return -EEXIST; /* address and len must be page-aligned */ if (RTE_PTR_ALIGN_CEIL(addr, pg_sz) != addr) return -EINVAL; @@ -691,7 +688,7 @@ rte_mempool_populate_anon(struct rte_mempool *mp) char *addr; /* mempool is already populated, error */ - if (!STAILQ_EMPTY(&mp->mem_list)) { + if ((!STAILQ_EMPTY(&mp->mem_list)) || mp->nb_mem_chunks != 0) { rte_errno = EINVAL; return 0; } -- 2.11.0