From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id E16EE1B010 for ; Wed, 16 May 2018 12:09:52 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id v5-v6so259563wrf.9 for ; Wed, 16 May 2018 03:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2NnDiNLAzz1XXgKMSZQtpUGYd/3VwzaAhDxMQL9wK5I=; b=OgLK1jG7/oAsi3av05Kiwyo8zExgQuqY6H18C3OEai4F6Y0kTsFg0XR0tx/n/Ij+Z5 9/e45fhl04vZPW5cUMrNKkmj+UzWlVOUNqlnC366BZSPA5vSpL8MxhBT+zOSuiuDMy6S AObMymi333nUeoqDnJxhDezuOjzU8TnS6dy7a7i497rcj44BvKiu/v8VodFgoUovfwZN sZ84rYc/Rf26L9nuz687QuP15oXwUTLvL17xgQrglCQyZ8vb7U5UIRkGiFOWWu1NKPXh myw2TRw6hj6WBkEOQOjk/jufCAPYbaU9jJRFzx1i7W+lLrVNaEeMVdCaATQ0F5DBkDwZ tCmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2NnDiNLAzz1XXgKMSZQtpUGYd/3VwzaAhDxMQL9wK5I=; b=HpRDhixUFnzCZMDAY4Ycb3E46kGUBS77GmBGPFsb/KpJsknJkc2Vg31i86oyvhwCvw Xk5kATPyQGOrTHt9w84TBi0lOKCfHOL+XQVhVxT8nfxIv9PsNB4j+ssvg57GtyupLSmw Tpwi+TRoAfSAFtuhlNrlrTPJJrMmsnhpqPJ6tOxY7kU2NhStdJNcp8pOtJOR2rBN/mDV 9cZiuWQtmV7b6KgFKjN0QQJROsvBPiHensXpWRskXVwCvtyJWZv9sVo2yzbHcqADeEEt XF0uui398dr0LiHnevrCiTNMuNHbjfUWPw5m+rA+GhKRJKdnCd1NUgwRUtBUkkDlW3/a ojQw== X-Gm-Message-State: ALKqPwf27yxa9v+AIArMCyfNIesd929obxsmGwKY4+4DxXSsHSmdYBTj xhpqW0BQAOAkyf6bDF81n+I= X-Google-Smtp-Source: AB8JxZoHc5lPGXXnHgk1f0wRySdRXKSw37QKIILTXWz5I7YG8fSgvuuBviXCDgrcK82HWC+Y8CELvg== X-Received: by 2002:adf:85b8:: with SMTP id 53-v6mr249163wrt.31.1526465392553; Wed, 16 May 2018 03:09:52 -0700 (PDT) Received: from localhost (slip139-92-244-193.lon.uk.prserv.net. [139.92.244.193]) by smtp.gmail.com with ESMTPSA id l69-v6sm4041033wmb.30.2018.05.16.03.09.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 03:09:51 -0700 (PDT) From: luca.boccassi@gmail.com To: Anatoly Burakov Cc: Olivier Matz , Andrew Rybchenko , dpdk stable Date: Wed, 16 May 2018 11:09:42 +0100 Message-Id: <20180516100945.4449-1-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180515171933.12882-2-luca.boccassi@gmail.com> References: <20180515171933.12882-2-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'mempool: fix virtual address population' has been queued to LTS release 16.11.7 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: Wed, 16 May 2018 10:09:53 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.7 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/18/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 0aa7812512918fbe4886d57b0f8be3f39a80e1b3 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 011fa9bbd..3cb9e42c3 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -462,9 +462,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; @@ -628,7 +625,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.14.2