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 0C90FA0526; Thu, 9 Jul 2020 00:27:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CDD831DDBE; Thu, 9 Jul 2020 00:27:31 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id B4D271DDB4 for ; Thu, 9 Jul 2020 00:27:29 +0200 (CEST) IronPort-SDR: KJuoW0TqjpB2n1np/KJEkWsSJSzjw8N2hIscKBnJbt8F1+IZ6/T3PQvzVzF2KF2dpTEuhrkgyZ U2oCoAeMHrgw== X-IronPort-AV: E=McAfee;i="6000,8403,9676"; a="147904591" X-IronPort-AV: E=Sophos;i="5.75,329,1589266800"; d="scan'208";a="147904591" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2020 15:27:28 -0700 IronPort-SDR: ChsUJKTrgFuK0OxumBPuxafc4dueutkRrs1tjStxT2YUqvMq2SBNgIJftOEe6N31seVGEp5HoR yLPgDVsaBXbg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,329,1589266800"; d="scan'208";a="457669569" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga005.jf.intel.com with ESMTP; 08 Jul 2020 15:27:28 -0700 Received: from [10.166.30.253] (10.166.30.253) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 8 Jul 2020 15:27:28 -0700 To: Dmitry Kozlyuk , CC: Narcisa Ana Maria Vasile , Pallavi Kadam , Tal Shnaiderman References: <20200707202203.8780-1-dmitry.kozliuk@gmail.com> <20200708214843.3080-1-dmitry.kozliuk@gmail.com> From: Ranjit Menon Message-ID: <8b219c6c-7ad2-6987-ce59-13316bc7c223@intel.com> Date: Wed, 8 Jul 2020 15:27:28 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200708214843.3080-1-dmitry.kozliuk@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.166.30.253] Subject: Re: [dpdk-dev] [PATCH v2] eal/windows: detect insufficient privileges for hugepages 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 7/8/2020 2:48 PM, Dmitry Kozlyuk wrote: > AdjustTokenPrivileges() succeeds even if no requested privileges have > been granted; this behavior is documented. Check last error code in > addition to return value to detect such case. > > Make error messages more specific and add troubleshooting hint. > > Signed-off-by: Dmitry Kozlyuk > --- > > v2: > Improve error reporting (Tal Shnaiderman). > > lib/librte_eal/windows/eal_hugepages.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_eal/windows/eal_hugepages.c b/lib/librte_eal/windows/eal_hugepages.c > index 5779cd325..7f8a7dfca 100644 > --- a/lib/librte_eal/windows/eal_hugepages.c > +++ b/lib/librte_eal/windows/eal_hugepages.c > @@ -41,6 +41,10 @@ hugepage_claim_privilege(void) > goto exit; > } > > + /* AdjustTokenPrivileges() may succeed with ERROR_NOT_ALL_ASSIGNED. */ > + if (GetLastError() != ERROR_SUCCESS) > + goto exit; > + > ret = 0; > > exit: > @@ -98,12 +102,14 @@ int > eal_hugepage_info_init(void) > { > if (hugepage_claim_privilege() < 0) { > - RTE_LOG(ERR, EAL, "Cannot claim hugepage privilege\n"); > + RTE_LOG(ERR, EAL, "Cannot claim hugepage privilege\n" > + "Verify that large-page support privilege " > + "is assigned to the current user\n"); > return -1; > } > > if (hugepage_info_init() < 0) { > - RTE_LOG(ERR, EAL, "Cannot get hugepage information\n"); > + RTE_LOG(ERR, EAL, "Cannot discover available hugepages\n"); > return -1; > } > Acked-by: Ranjit Menon