From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 198071B79A for ; Wed, 7 Feb 2018 09:59:31 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C2C9C20C0D; Wed, 7 Feb 2018 03:59:29 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 07 Feb 2018 03:59:29 -0500 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=D7Oydf+0GQ7bkgaI0 RRGaazFlQ3Uzz3OAElV26zcHBQ=; b=A/Z+010q8wDnkKLpLCtaBJsjFLcgUCtNN HgfkSzift59dQOlVPf09/GZnx698lC7BrXaCiIMgsUjJ4g9UXRG5p55vVWtgzCqw fKZssmKjXhCeZVC5M03Uyb0F9jHXJB2VHFj60Lik3C5Ac/Sz83uQXAjm3YapBe/c cSwZBNT2FvJKkcWaPC09aL23LBRX1VfZ5oyaEcOwbTZKNSwqFnKeIRnLV4PKcx8f /ADxPG8jSzcCVypWw+PzaAh5DaVSZuplp/GIqGMMvjsxJWnkdKvYbjtMr2EBxLTx ot+Zsl+rDeNNMvJ+oSphIs2Dw3NYYL+VVB4C1x7vyEcc7lWhH+Exg== 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= fm1; bh=D7Oydf+0GQ7bkgaI0RRGaazFlQ3Uzz3OAElV26zcHBQ=; b=jDlb0ZwW eRWbxoyjTxDuCzlIkRnZs73OvAVaVk8vTU3cl0qjyVxY43Cta0X65xZVoqDqP/0i kTHg3gf7K/VL2P7VLPw8lPDCGbc9Lqt/Oe2/vdzrv8yEkuHagcsTednqntrC1wHj e5uvmrZgdHeDnQI93XTvTV5XtBT7gk+bussuX2ylVuXIUG5w3mrnLnbaTvXvSw70 /kwF4LqhOLfg/Cj4gxI2LWv1eDZfBDL676vYAXdlQhnyd2bdToBAiHXocAT66ZVH MgtEcD95dBnkhrNfZHnb1MyxppB3947LRg5aQXhlZMJ3WMi6752vTW4/cCYStV4f A4z3djpbtzqVKQ== X-ME-Sender: Received: from localhost.localdomain (unknown [182.84.161.100]) by mail.messagingengine.com (Postfix) with ESMTPA id E257F240DE; Wed, 7 Feb 2018 03:59:27 -0500 (EST) From: Yuanhan Liu To: Andrew Rybchenko Cc: Santosh Shukla , dpdk stable Date: Wed, 7 Feb 2018 16:56:57 +0800 Message-Id: <1517993838-26692-3-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517993838-26692-1-git-send-email-yliu@fridaylinux.org> References: <1517993838-26692-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'mempool: fix physical contiguous check' has been queued to LTS release 17.11.1 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, 07 Feb 2018 08:59:31 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/09/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 8b4341b7b7d851d355fa402f9dff1bf85389b0e8 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Thu, 1 Feb 2018 14:02:23 +0000 Subject: [PATCH] mempool: fix physical contiguous check [ upstream commit ce42ae42bc0f577d9d91c6120216b3b007170d5a ] There is not specified dependency between rte_mempool_populate_default() and rte_mempool_populate_iova(). So, the second should not rely on the fact that the first adds capability flags to the mempool flags. Fixes: 65cf769f5e6a ("mempool: detect physical contiguous objects") Signed-off-by: Andrew Rybchenko Acked-by: Santosh Shukla --- lib/librte_mempool/rte_mempool.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 6d17022..5bd74ea 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -362,6 +362,7 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr, void *opaque) { unsigned total_elt_sz; + unsigned int mp_capa_flags; unsigned i = 0; size_t off; struct rte_mempool_memhdr *memhdr; @@ -386,8 +387,17 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr, total_elt_sz = mp->header_size + mp->elt_size + mp->trailer_size; + /* Get mempool capabilities */ + mp_capa_flags = 0; + ret = rte_mempool_ops_get_capabilities(mp, &mp_capa_flags); + if ((ret < 0) && (ret != -ENOTSUP)) + return ret; + + /* update mempool capabilities */ + mp->flags |= mp_capa_flags; + /* Detect pool area has sufficient space for elements */ - if (mp->flags & MEMPOOL_F_CAPA_PHYS_CONTIG) { + if (mp_capa_flags & MEMPOOL_F_CAPA_PHYS_CONTIG) { if (len < total_elt_sz * mp->size) { RTE_LOG(ERR, MEMPOOL, "pool area %" PRIx64 " not enough\n", @@ -407,7 +417,7 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr, memhdr->free_cb = free_cb; memhdr->opaque = opaque; - if (mp->flags & MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS) + if (mp_capa_flags & MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS) /* align object start address to a multiple of total_elt_sz */ off = total_elt_sz - ((uintptr_t)vaddr % total_elt_sz); else if (mp->flags & MEMPOOL_F_NO_CACHE_ALIGN) -- 2.7.4