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 51B4CA0583; Fri, 20 Mar 2020 14:25:16 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 86D492BB9; Fri, 20 Mar 2020 14:25:15 +0100 (CET) Received: from mail-il1-f195.google.com (mail-il1-f195.google.com [209.85.166.195]) by dpdk.org (Postfix) with ESMTP id C6189F94 for ; Fri, 20 Mar 2020 14:25:13 +0100 (CET) Received: by mail-il1-f195.google.com with SMTP id p2so5521591ile.9 for ; Fri, 20 Mar 2020 06:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IDEvsBYa5QKMDmh22atNVsslXBjPRgbiWeJLVw95rrg=; b=BhlhCpdkHOADVYOCSpZveyY2pj917ruGdZJsXd3JGMa4VOaGdq0k8/c9/EiZwQH/98 b9rTmtPzTrqTu/1Y8tckckn1Hak2VAl5FV4e73sevs7t0Ckfu4x0iXOjPuF4qtNeYeUY DOi75iGHCN5koE9tvWMkcvtdkoySf9vz3SXgQd2c+zkbYYwn/atQz96oYc465/17gbXK pZslfZpyusFNmHeCc0Ox1SAeYnLpCxp08o88s/humqZ1OiVyZGVgm8GR+GTxKs/w2gU+ QJzCpJpdqUP57IiInqAQNpctK6L+IsZ5543QdY8WDuWVhJ+2z1d8CQF5FK1zlMokmXVy 8oJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IDEvsBYa5QKMDmh22atNVsslXBjPRgbiWeJLVw95rrg=; b=W3MPS9q81hiEb2Oua07ylAN5BUIC4fk2uROLLHQEcHa1ocCG5rXZWez1mbqOYuLRy+ LMoUSbMUNilvm/Wsou81WdYglQneLnNf9nwZGN4FGOMqi3G8nVQ0EnF1IH5Cv706X0vD f02cd/ET5FSKRPGaXPNFeAQAbZ2Nf+A83gpZKxL0dMMXm1dSdcMmrSZJaTEsYpp9cfQ/ YUVxGr8CUtSK16akSyJV0kv3iJZAvGzqXAIBNW4LZDSy7AaG+UkKyBqG7YDYXn/1Conn TVLP1lne+rk0pyjeO1ewdcuGFu9k+ukXaC9e48J//34LU7PrMCqgC9Cr0Da13V6MQVY5 jwbg== X-Gm-Message-State: ANhLgQ3PAeOOTd2WLGeJEel+hdBvWj+2/HS36PHYI0mRd71lrSehoieG 9SoHbIKNgSHynG3fNZAA3oZEDyc9Uv5+rcy2erE= X-Google-Smtp-Source: ADFU+vtkscnqmt3A+XHmy2ljRHjT37zXhjjeuWL0Ea1/f4VZauHqhcAoPs8QrjOnGAuLcS+gSvPITDgx7eBiDohPlu4= X-Received: by 2002:a92:c0c2:: with SMTP id t2mr8131277ilf.271.1584710712935; Fri, 20 Mar 2020 06:25:12 -0700 (PDT) MIME-Version: 1.0 References: <20200220225207.30411-1-dwilder@us.ibm.com> <20200220225207.30411-2-dwilder@us.ibm.com> In-Reply-To: <20200220225207.30411-2-dwilder@us.ibm.com> From: Jerin Jacob Date: Fri, 20 Mar 2020 18:54:56 +0530 Message-ID: To: David Wilder Cc: Aaron Conole , Michael Santana , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , dpdk-dev , "Ruifeng Wang (Arm Technology China)" , David Marchand , David Christensen , wilder@us.ibm.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3 1/3] eal/linux: select iova-mode va with no-huge option 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" On Fri, Feb 21, 2020 at 4:22 AM David Wilder wrote: > > If --no-huge is set and iova-mode has not been specified force VA mode. > If --no-huge and --iova-mode=PA is requested error out as this is > an impossible configuration. > > Signed-off-by: David Wilder > --- > lib/librte_eal/linux/eal/eal.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c > index 9530ee55f..d3a0a1731 100644 > --- a/lib/librte_eal/linux/eal/eal.c > +++ b/lib/librte_eal/linux/eal/eal.c > @@ -1062,9 +1062,16 @@ rte_eal_init(int argc, char **argv) > > /* if no EAL option "--iova-mode=", use bus IOVA scheme */ > if (internal_config.iova_mode == RTE_IOVA_DC) { > + > /* autodetect the IOVA mapping mode */ > enum rte_iova_mode iova_mode = rte_bus_get_iommu_class(); > > + if (iova_mode == RTE_IOVA_PA && !rte_eal_has_hugepages()) { > + iova_mode = RTE_IOVA_VA; What if igb_uio or vfio_nommu has been loaded(i.e no iommu support enabled from the driver)? This would fail. > + RTE_LOG(WARNING, EAL, "Some buses want 'PA' but forcing 'VA' because --no-huge is requested.\n"); > + RTE_LOG(WARNING, EAL, "Not all buses may be able to initialize.\n"); > + } > + > if (iova_mode == RTE_IOVA_DC) { > RTE_LOG(DEBUG, EAL, "Buses did not request a specific IOVA mode.\n"); > > @@ -1111,6 +1118,13 @@ rte_eal_init(int argc, char **argv) > internal_config.iova_mode; > } > > + if (rte_eal_iova_mode() == RTE_IOVA_PA && > + rte_eal_has_hugepages() == 0) { > + rte_eal_init_alert("Cannot use IOVA as 'PA' with --no-huge"); Top of the tree already detecting this case. am I missing anything? [master]dell[dpdk.org] $ sudo ./build/app/test/dpdk-test -c 0x3 --no-huge --iova-mode=pa EAL: Detected 56 lcore(s) EAL: Detected 2 NUMA nodes EAL: Static memory layout is selected, amount of reserved memory can be adjusted with -m or --socket-mem EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: FATAL: Cannot use IOVA as 'PA' since physical addresses are not available EAL: Cannot use IOVA as 'PA' since physical addresses are not available > + rte_errno = EINVAL; > + return -1; > + } > + > if (rte_eal_iova_mode() == RTE_IOVA_PA && !phys_addrs) { > rte_eal_init_alert("Cannot use IOVA as 'PA' since physical addresses are not available"); > rte_errno = EINVAL; > -- > 2.25.0 >