From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id AD1E01BA3A for ; Thu, 26 Oct 2017 00:39:16 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id b189so4509515wmd.4 for ; Wed, 25 Oct 2017 15:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=/ZZhmE8hr8UULL4stu1w5PghDdd3QTWn8Ow0Q/rALfM=; b=m9xHmBh6byB8jnlqCUXsMDphVqWqPhYyUCHN5Km+FsSgkX3/5KvLLUh0YuwMkq7YIz I+S4c6MkQYP1T+2JtOyYfLxlrLsEMV/6ohHQMMCPlz59EqL4AQyCVoN4CCk2lLKAmpIG lVR5XkNkcn0B2NIugdunU6OGlG4k3FiOxU6aDd9l9Td1iAJhoy6WrLcP2MoeFUNdeFvC dsn/Q2TacTR0KAzXi0E5w6h4F9cX6WBSQHOOZmhMGWlZoiU1zz4A+TuIsA2Fro+lCN1d x4rGsQunOlU070yGJimRz7Gnu2Hr75msjvjlTI/hjkGzqLpLd9F/PQL5/obUScor1ZPF Wx1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=/ZZhmE8hr8UULL4stu1w5PghDdd3QTWn8Ow0Q/rALfM=; b=SGmAY5bMe37m4a99kvR0dVPuBRjtMu6ultWZDRZgk5yzyep5zJ1ftLO64fviCUrQzm zyZUufW1s+IqWwR3nsdkmH6D1hzy3Dia0KyZxnf2T+5XipyMQ5szGUHZbh9XouU+3sxw 4kJjY7ODF9IRR3NSOFFfhNy60Be1c+18NooLLnnDcdvxrIt+PacP2PyyjQofUDnKTAkN yM6b59IkOIRIjGpvikjC8bPPAn/oLcOnWe9j/nMV96lcJMoEBIVmmGH+Pu/u6RUQbN3n cANaaHTlqYs+Iqi2i8uyh79uuuvuLOcZ5bbfsavn30WtiQ0W3+wADfF8N8TrZD5Aploq LOsw== X-Gm-Message-State: AMCzsaXl59orZ3MGyGHgbkAPtGrFCAGZ29dSopGfXwHYKG/pk/FmHJje VZmRoVX7PNV50AfwWVmDwLBZy/PE X-Google-Smtp-Source: ABhQp+To1elrgQv3Yt5DGP1drbOX1WEkfezj1H1HxkbLT4tb4QUSapSkE4qwQoZnOfR02RS121yJSQ== X-Received: by 10.28.63.134 with SMTP id m128mr3222571wma.137.1508971156008; Wed, 25 Oct 2017 15:39:16 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id r63sm4466124wmg.13.2017.10.25.15.39.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 15:39:15 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 26 Oct 2017 00:38:27 +0200 Message-Id: <1c39cb7f60eb5b1f3f9d1cef52e13df42194b754.1508970254.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v7 05/25] eal: expose rte_eal_using_phys_addrs 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: , X-List-Received-Date: Wed, 25 Oct 2017 22:39:16 -0000 This function was previously private to the EAL layer. Other subsystems requires it, such as the PCI bus. In order not to force other components to include stdbool, which is incompatible with several NIC drivers, the return type has been changed from bool to int. Signed-off-by: Gaetan Rivet --- lib/librte_eal/bsdapp/eal/eal_memory.c | 6 ++++++ lib/librte_eal/common/eal_private.h | 11 ----------- lib/librte_eal/common/include/rte_memory.h | 11 +++++++++++ lib/librte_eal/linuxapp/eal/eal_memory.c | 2 +- lib/librte_eal/rte_eal_version.map | 1 + 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c index 3614da8..65c96b0 100644 --- a/lib/librte_eal/bsdapp/eal/eal_memory.c +++ b/lib/librte_eal/bsdapp/eal/eal_memory.c @@ -192,3 +192,9 @@ rte_eal_hugepage_attach(void) close(fd_hugepage); return -1; } + +int +rte_eal_using_phys_addrs(void) +{ + return 0; +} diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h index 9340b6e..80fea24 100644 --- a/lib/librte_eal/common/eal_private.h +++ b/lib/librte_eal/common/eal_private.h @@ -345,17 +345,6 @@ int rte_eal_hugepage_init(void); int rte_eal_hugepage_attach(void); /** - * Returns true if the system is able to obtain - * physical addresses. Return false if using DMA - * addresses through an IOMMU. - * - * Drivers based on uio will not load unless physical - * addresses are obtainable. It is only possible to get - * physical addresses when running as a privileged user. - */ -bool rte_eal_using_phys_addrs(void); - -/** * Find a bus capable of identifying a device. * * @param str diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h index c545963..271d2bb 100644 --- a/lib/librte_eal/common/include/rte_memory.h +++ b/lib/librte_eal/common/include/rte_memory.h @@ -187,6 +187,17 @@ unsigned rte_memory_get_nchannel(void); */ unsigned rte_memory_get_nrank(void); +/** + * Drivers based on uio will not load unless physical + * addresses are obtainable. It is only possible to get + * physical addresses when running as a privileged user. + * + * @return + * 1 if the system is able to obtain physical addresses. + * 0 if using DMA addresses through an IOMMU. + */ +int rte_eal_using_phys_addrs(void); + #ifdef __cplusplus } #endif diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index 187d338..ddf88c5 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -1494,7 +1494,7 @@ rte_eal_hugepage_attach(void) return -1; } -bool +int rte_eal_using_phys_addrs(void) { return phys_addrs_available; diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index 8eb53ab..bcc594d 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -244,6 +244,7 @@ DPDK_17.11 { rte_bus_get_iommu_class; rte_eal_iova_mode; rte_eal_mbuf_default_mempool_ops; + rte_eal_using_phys_addrs; rte_lcore_has_role; rte_memcpy_ptr; rte_pci_get_iommu_class; -- 2.1.4