From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2197C76191 for ; Thu, 18 Jul 2019 06:46:21 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 87D9421783 for ; Thu, 18 Jul 2019 06:46:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="Er92ZWud" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87D9421783 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=marvell.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DD4261B951; Thu, 18 Jul 2019 08:46:11 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id F14721B94E for ; Thu, 18 Jul 2019 08:46:09 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x6I6jVEU022133; Wed, 17 Jul 2019 23:46:09 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=hpT3oAyk4ItPaGrZU1DplorVT+LcnLqlYstjwDDej3Q=; b=Er92ZWud7eGshKq6D+qv5fUcRQ5+rdmID/zJAmjhWkcBXrPq3oVoybBPAuPkxgIykJdN fACfkvJhC6J/Rhq6wENWQuES5CZnXuAiY24BhtuJOjePJOCn2b8IX3lTG2YAXqfCf1iR 2lSSdoLq6bWtbzUcr9gcsAOovKxWDMWgatlukq6odBBoaUXSbOp3n+AlHeUbPa50Up4+ 8NmTMjC91PgzxPnohv9OlgL5wKv0N5lmiPDZgtq+AFE7CCuYVJ9dyfEWWAt9F9jinK0/ P+KQrTMajstIhbWSAHiYWSIu4CSWsUntUU4uZj3NM+BpskR0pLZLE5KyMQ616i7oXt2d 0g== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2ts0a2awbb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 17 Jul 2019 23:46:09 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 17 Jul 2019 23:46:07 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 17 Jul 2019 23:46:07 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id A87A93F7041; Wed, 17 Jul 2019 23:46:05 -0700 (PDT) From: To: , Anatoly Burakov , John McNamara , Marko Kovacevic CC: , , Jerin Jacob Date: Thu, 18 Jul 2019 12:15:42 +0530 Message-ID: <20190718064543.33383-5-jerinj@marvell.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190718064543.33383-1-jerinj@marvell.com> References: <20190716134609.40930-1-jerinj@marvell.com> <20190718064543.33383-1-jerinj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-18_02:2019-07-18,2019-07-18 signatures=0 Subject: [dpdk-dev] [PATCH v3 4/4] eal: select IOVA mode as VA for default case 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" From: Jerin Jacob When bus layer selected the preferred mode as RTE_IOVA_DC then select the IOVA mode as RTE_IOVA_VA. The RTE_IOVA_VA selected as the default because, 1) All drivers work in RTE_IOVA_VA mode, irrespective of physical address availability. 2) By default, the mempool, first asks for IOVA-contiguous memory using RTE_MEMZONE_IOVA_CONTIG and this is slow in IOVA as PA mode and it may affect the application boot time. Signed-off-by: Jerin Jacob Acked-by: Anatoly Burakov --- .../prog_guide/env_abstraction_layer.rst | 18 ++++++++++++++++-- lib/librte_eal/linux/eal/eal.c | 6 ++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst index 77307e3a6..b17c9dad9 100644 --- a/doc/guides/prog_guide/env_abstraction_layer.rst +++ b/doc/guides/prog_guide/env_abstraction_layer.rst @@ -445,11 +445,25 @@ kernels. - if the preferred mode is RTE_IOVA_PA but there is no access to Physical Addresses, then EAL init will fail early, since later probing of the devices would fail anyway, -- if the preferred mode is RTE_IOVA_DC then based on the Physical Addresses - availability, the preferred mode is adjusted to RTE_IOVA_PA or RTE_IOVA_VA. +- if the preferred mode is RTE_IOVA_DC then select the IOVA mode as RTE_IOVA_VA. + The RTE_IOVA_VA selected as the default because, + +#. All drivers work in RTE_IOVA_VA mode, irrespective of physical address availability. + +#. By default, the mempool, first asks for IOVA-contiguous memory using ``RTE_MEMZONE_IOVA_CONTIG``, + and this is slow in IOVA as PA mode and it may affect the application boot time. + +#. It is easy to enable large amount of IOVA-contiguous memory use-cases with IOVA in VA mode. + In the case when the buses had disagreed on the IOVA Mode at the first step, part of the buses won't work because of this decision. +.. note:: + + If the device driver needs IOVA as VA and it cannot work with IOVA as PA + then the driver must request the PCI bus layer using ``RTE_PCI_DRV_NEED_IOVA_AS_VA`` + requirement flag. Absence of this flag, dictates, the driver must support both IOVA as PA and VA modes. + IOVA Mode Configuration ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c index 2e5499f9b..34db78753 100644 --- a/lib/librte_eal/linux/eal/eal.c +++ b/lib/librte_eal/linux/eal/eal.c @@ -1061,10 +1061,8 @@ rte_eal_init(int argc, char **argv) enum rte_iova_mode iova_mode = rte_bus_get_iommu_class(); if (iova_mode == RTE_IOVA_DC) { - iova_mode = phys_addrs ? RTE_IOVA_PA : RTE_IOVA_VA; - RTE_LOG(DEBUG, EAL, - "Buses did not request a specific IOVA mode, using '%s' based on physical addresses availability.\n", - phys_addrs ? "PA" : "VA"); + iova_mode = RTE_IOVA_VA; + RTE_LOG(DEBUG, EAL, "Buses did not request a specific IOVA mode, select IOVA as VA mode.\n"); } #ifdef RTE_LIBRTE_KNI /* Workaround for KNI which requires physical address to work */ -- 2.22.0