From patchwork Wed Nov 14 14:51:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 48078 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 10F901B113; Wed, 14 Nov 2018 15:51:16 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 3BD511B104 for ; Wed, 14 Nov 2018 15:51:14 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2018 06:51:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,232,1539673200"; d="scan'208";a="104325081" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 14 Nov 2018 06:51:12 -0800 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id wAEEpBNu000599; Wed, 14 Nov 2018 14:51:11 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id wAEEpBm3007862; Wed, 14 Nov 2018 14:51:11 GMT Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id wAEEpBXf007857; Wed, 14 Nov 2018 14:51:11 GMT From: Anatoly Burakov To: dev@dpdk.org Cc: yuwei1.zhang@intel.com Date: Wed, 14 Nov 2018 14:51:11 +0000 Message-Id: <8533ab3a49f63e9700764ead8b9147a098911b41.1542204687.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] memalloc: check for contiguousness in external segments X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" For IOVA as VA mode, we assume that memory is contiguous. However, for external segments that assumption may not necessarily hold. Fix the code to not assume that external memory segments are contiguous even in IOVA as VA mode. Fixes: 5282bb1c3695 ("mem: allow memseg lists to be marked as external") Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/eal_common_memalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_memalloc.c b/lib/librte_eal/common/eal_common_memalloc.c index 1d41ea112..371271979 100644 --- a/lib/librte_eal/common/eal_common_memalloc.c +++ b/lib/librte_eal/common/eal_common_memalloc.c @@ -77,7 +77,7 @@ eal_memalloc_is_contig(const struct rte_memseg_list *msl, void *start, const struct rte_memseg *ms; /* for IOVA_VA, it's always contiguous */ - if (rte_eal_iova_mode() == RTE_IOVA_VA) + if (rte_eal_iova_mode() == RTE_IOVA_VA && !msl->external) return true; /* for legacy memory, it's always contiguous */