From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 74CDCA00C2; Wed, 17 Mar 2021 15:57:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 394BB4067E; Wed, 17 Mar 2021 15:57:39 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 8E82A4014D for ; Wed, 17 Mar 2021 15:57:37 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 320E15C025B; Wed, 17 Mar 2021 10:57:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 17 Mar 2021 10:57:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm3; bh= 59u3knUQRdaEe3RfC9BtyxI4bIkKuGEy3xeuMDPDMSE=; b=cBeh0xdDE2GBoj92 7CLC7ROzaqu5cropmZRs7NwtHZL3njDV6iKcVK6ftfd7zFG9gUPEturgplZWqw8C 9bW2Qcf6FHjhkcoYSrBQVIuua3IT68GEQHazX2GCGzWqjnf2UOvCoEJyCSBlJ8TU CpysE/06Rh26zg0SiIEWvZ+lJ0JbJXk3ZBocyuE61o/DzmtbU/M+kCoeJ3HILwuy yQNVreHm1Ubvsq0IleNmU0oFeLDeYbbj6hwJyvo8x6S6ca+iJg2EgEQekJeHj6Dn Grd+M81Hpr6c/eYNut80at6bYb5bme0IqHnVamDasumKQE2hhHvA8b8RUinUBiJH W4+2wg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=59u3knUQRdaEe3RfC9BtyxI4bIkKuGEy3xeuMDPDM SE=; b=hTlo2rf+9AwYbUN0oxR4Yb5XU9y4M6XcKhQvJ6i3rv0yMji0C5Il7ddMe 4W3n/LVMuMv6onXu7WATQnhVFXophxHqSGT/ie2Ue6CMJUA2RYPLLh4yuqNs9lk+ nvYwVW5sdOC3qxcBFbZ1XzuH/61pXMmYpMkhDA2uk5HoKlhD62bpuugknM8UZgmr EbGBBE8JZvbVdx12vRdpCD3edaB1JLTSxOvB5AMTm6LRuygaOyI05xxNKHHfWqCD f4hHS8b6+pNsmo6/RnjqEFM+YBH9Inbc2ihKYIctHVthMjOy4ZUxiyjcFkAVeBDB bMm6g4BrWXw+RUoLiqrMLDa2wP7fg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefgedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 2F9441080067; Wed, 17 Mar 2021 10:57:34 -0400 (EDT) From: Thomas Monjalon To: Aaron Conole Cc: dev@dpdk.org, David Marchand , anatoly.burakov@intel.com Date: Wed, 17 Mar 2021 15:57:31 +0100 Message-ID: <2080877.JXBMkDg2Jp@thomas> In-Reply-To: <20210317144409.288346-1-aconole@redhat.com> References: <20210317144409.288346-1-aconole@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] test: make hugepage check more robust under Linux X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" 17/03/2021 15:44, Aaron Conole: > The hugepage test really needs to check multiple things on Linux: > > 1. Are hugepages reserved in the system? > > 2. Is the hugepage mountpoint available so that we can allocate them? > > 3. Do we have permissions to write into the hugepage mountpoint? > > The existing hugepage check only verifies the first. On some setups, > a non-root user won't have access to the mountpoint for hugepages to > be allocated and that needs to be reflected in the test as well. Add > such checks for Linux OS to give a more check when running test suites. Requirements 2 & 3 are optional. You don't need a mount point if using the option --in-memory. [...] > + perm="" perm= should do the same. > + for mount in `mount | grep hugetlbfs | awk '{ print $3; }'`; do Please prefer $() syntax. Are spaces in awk required? > + test ! -w $mount/. || perm="$mount" Why /. ? > + done > + if [ "$perm" = "" -o "$nr_hugepages" = "0" ]; then = "" can be replaced with -z "0" can be simply 0 > + echo 0 > + else > + echo $nr_hugepages > + fi