From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id BA60E8E69 for ; Wed, 16 May 2018 12:16:54 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id h5-v6so298037wrm.4 for ; Wed, 16 May 2018 03:16:54 -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=6vM2dc7qHj/KYNCl646ocAb5MYN9rseP36jh7m6LB4U=; b=AELvTRbgKcJua+pHsjOVY9fvqYu+RUMkd7Hoc87gdnj4UEyjsUtzg17DBPo0w3DSrj CKJLO09IA4jqYyglwcib88NV9o6jCjUfA5urgGYWr5EFpPxKAjdxcXGLsUjlb1lSgW4a d8BPRoZA3R9S5WesNk66UTBhcWu3bNyKZ24e/2+h15XLupm5AqE3ESw2Snmav11yNZlo dMniCpvcjszMtuph9Ffi3QcuaB43MELwQyAn0V6dbPL6KxOQKFm6h404oSAK1On96uRT xZ7CVWhCr6TvccGPMjsz1FsbsW0j6b/PDzW6Vr+YiHnynr6Vg3emlkgFNBo/7l9Rv4rr hUvQ== 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=6vM2dc7qHj/KYNCl646ocAb5MYN9rseP36jh7m6LB4U=; b=aXyt/1HgtbhgrWMOPeRT6AUdQ9tT1LfPol++2xuwehu3/F55ltZjlgJhVxDmh4I9V0 MCcOBje32iZ5LeImJLYKQQjH26Rvo1LBAgO5fH+2PLQhy+t24sbJfCEis3GKR1QTJEjt omupqRBjbUN+oBRGZXmceic0qj1IpqZiZHFi0qVZ3Hejed7eGqT2OqJMO8E42aEOdagg 5byu8U3ew8mOKrQQoWCSJYaBCLPYlPCw2Yajux/Ofa9rF4RcXnEnxW1TdQmjXy31cHjq 6Q+x75uWkIjZy1NWoobKZUJUNT2J5Wbsg9NfQvrXClsyzKB6XJ/w1kmEX0X7CozRNRSU wFgQ== X-Gm-Message-State: ALKqPwdrcN1/uJMw2E+H0oKOxpqCZ4y6+JaLGDB/s/vaj3IXDYwym+Xj n/PBqXWshQz8ArLEaoimFZk= X-Google-Smtp-Source: AB8JxZoRXJ9PjSYT4du9nzUIPr7AGg4phNlAvFFNZqBVyQfXigwLNv9wfAcbsoLC55/isY0/tgEm5Q== X-Received: by 2002:adf:b0e2:: with SMTP id j31-v6mr176810wra.263.1526465814288; Wed, 16 May 2018 03:16:54 -0700 (PDT) Received: from localhost (slip139-92-244-193.lon.uk.prserv.net. [139.92.244.193]) by smtp.gmail.com with ESMTPSA id y84-v6sm2036286wmg.44.2018.05.16.03.16.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 03:16:53 -0700 (PDT) From: luca.boccassi@gmail.com To: Anatoly Burakov Cc: Olivier Matz , Andrew Rybchenko , dpdk stable Date: Wed, 16 May 2018 11:13:20 +0100 Message-Id: <20180516101323.2234-1-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180515135335.10459-2-luca.boccassi@gmail.com> References: <20180515135335.10459-2-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'mempool: fix virtual address population' has been queued to stable release 18.02.2 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:16:54 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 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 0be1c573e0366a7ebec5c455799a63160952c00d 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 80bf941c9..abbee587a 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -491,9 +491,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; @@ -662,7 +659,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