From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 97051A0471 for ; Tue, 16 Jul 2019 15:46:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5E7341B9E7; Tue, 16 Jul 2019 15:46:39 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 0726C1B993 for ; Tue, 16 Jul 2019 15:46:34 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x6GDk6qJ031848; Tue, 16 Jul 2019 06:46:34 -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=RA282bat6+XKyADxqDZtvjy4WAC/EnFBwdHLfEXGFMo=; b=feD73uin0y2NSraOtkYRAgmhk40sXR9ZM4RLySFrJnkVkcMuTOgyCZe2d3CJne3oC7V+ FrOT7Powc7uenMQ4dOcFZLhU3FIcf45KLmg+XD8ncFM2ZvSKMp4dsZ46F4p/Tu7xGT2t Iwg5pAwUWP8en4XqEBuxmzgFku5YjUhCn9hMlAS2ic1L38y4jEAvkKFK4DanyUKhVoke pVI0JHxfwr+lYfX4twpruUCsydJf7OQY44dMT/CM6AjwODAxs4D0TQXiyMEgltVMG9Gv LZ4dBGkaOQhJxTgB0Ba+gXuwwygDm8uAbBC8X1bnADbGyMMNsyphvhEqB0GIE0LxGexv 1A== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2ts07vbf68-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 16 Jul 2019 06:46:34 -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; Tue, 16 Jul 2019 06:46:31 -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; Tue, 16 Jul 2019 06:46:31 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 3A4863F7040; Tue, 16 Jul 2019 06:46:29 -0700 (PDT) From: To: , Anatoly Burakov , John McNamara , Marko Kovacevic CC: , , Jerin Jacob Date: Tue, 16 Jul 2019 19:16:09 +0530 Message-ID: <20190716134609.40930-5-jerinj@marvell.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190716134609.40930-1-jerinj@marvell.com> References: <1562795329-16652-1-git-send-email-david.marchand@redhat.com> <20190716134609.40930-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-16_04:2019-07-16,2019-07-16 signatures=0 Subject: [dpdk-dev] [PATCH v2 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 --- doc/guides/prog_guide/env_abstraction_layer.rst | 10 ++++++++-- lib/librte_eal/linux/eal/eal.c | 6 ++---- 2 files changed, 10 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..1b0343eee 100644 --- a/doc/guides/prog_guide/env_abstraction_layer.rst +++ b/doc/guides/prog_guide/env_abstraction_layer.rst @@ -445,8 +445,14 @@ 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. + 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. 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