From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <olivier.matz@6wind.com>
Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com
 [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 615CE9613
 for <dev@dpdk.org>; Fri, 13 May 2016 14:51:50 +0200 (CEST)
Received: from glumotte.dev.6wind.com (unknown [10.16.0.195])
 by proxy.6wind.com (Postfix) with ESMTP id 7491B28FC6;
 Fri, 13 May 2016 14:50:13 +0200 (CEST)
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Cc: david.marchand@6wind.com,
	chaozhu@linux.vnet.ibm.com
Date: Fri, 13 May 2016 14:50:54 +0200
Message-Id: <1463143859-3105-3-git-send-email-olivier.matz@6wind.com>
X-Mailer: git-send-email 2.8.0.rc3
In-Reply-To: <1463143859-3105-1-git-send-email-olivier.matz@6wind.com>
References: <1463143859-3105-1-git-send-email-olivier.matz@6wind.com>
Subject: [dpdk-dev] [PATCH 2/7] eal/linux: only call iopl on x86
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 13 May 2016 12:51:50 -0000

>>From iopl(2) man page: "This call is mostly for the x86 architecture. On
many other architectures it does not exist or will always return an
error".

This patch removes the call to iopl() in rte_eal_iopl_init() for
architectures other than x86, and always return 0 (success). This was
already done for ARM in
commit 0291476ae364 ("eal/linux: never check iopl for arm")

Next patches will introduce the support of memory mapped IO resources
for architectures != x86.

On BSD, there is nothing to do as open("/dev/io") already does the
proper thing. See man IO(4).

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_eal/linuxapp/eal/eal.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 8aafd51..bba8fea 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -715,12 +715,8 @@ rte_eal_iopl_init(void)
 #if defined(RTE_ARCH_X86)
 	if (iopl(3) != 0)
 		return -1;
-	return 0;
-#elif defined(RTE_ARCH_ARM) || defined(RTE_ARCH_ARM64)
-	return 0; /* iopl syscall not supported for ARM/ARM64 */
-#else
-	return -1;
 #endif
+	return 0;
 }
 
 /* Launch threads, called at application init(). */
-- 
2.8.0.rc3