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 D4BBDA00BE; Wed, 8 Jul 2020 08:44:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F09871DC08; Wed, 8 Jul 2020 08:44:00 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2058.outbound.protection.outlook.com [40.107.21.58]) by dpdk.org (Postfix) with ESMTP id 4D87F1DBE6 for ; Wed, 8 Jul 2020 08:43:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b/gECEzzczzxW/FVP4krhvF6+CY98KSOel1DlnYFg2XK+ROCMMtq11+EQ8sTvgbZwWA7+oNF1S3AX42Wil9bOZoy2JricTzMgaY+uB7cF0sBUmA91VpPrKr3DKEGLlqwzddRiDs8uWWkv/BWz5qaWJKooThM7XpmY8uX+cFdDr5VxlbFjp4GfGdl4614dwcXEDELnvR7A3ZRm3flW/vWfeTHGm7SFyIBdI1sk/+IaseKYKgfC01P1deJlBelr9j1ICXhLLX2PPD00xeR2YK6qBbsJVdJvzYb0Fl+Kp8vSHwqtwhRw4la/H1TdlhLHJVeEukB5SGQkGX7HQIZJl280w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dsomU87Oe/sHHLrOTzxitFsqm7/nh9qATCSX59F7SHE=; b=EzSrty2Ez+1c2qHQTlbyHAmkhXGbJxQsrju1Y0FPdFLYeTFwRkmg5kZyM/tItlrWwxFnehUgC5sr50NMA8dJ0Eg5Ih1S2SF4PZlTNQ/N+9V6B/w2W9L3TgW9JvoDfAK2QvQf1JKRALNFsQufzOkISwZqYKd/T1roJaQ9185rRRXPKuWKBbK/HrsV/JqxAHxdTq+YZUUeWWndhjoRgAzN4i7zxnGXKkSE5tLop7lnOuj8VfvN1Jwm6Vgdtvy9cIt0oGwshpJJLsCwFrbBGVztzCi2/gmQw8epz0iippjaIT7XJDzeJXiHk+SJ/B5qPeL/2tr00XSEjbsY7Ks5Q78l+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dsomU87Oe/sHHLrOTzxitFsqm7/nh9qATCSX59F7SHE=; b=pXZz74cuqKKQep/4agpoOSH4lXMglRldM0Nwjh7hpxyCbGshlIcyhE+UW381bHJJ2qNoU2jwD/UCMJPmXbwAQ6LzghAWnQ6BfKn3e5g2KbFuq8z+bAXV7QQNn1Wu7gTxC67luEmfHIzus5JVQERpWHH6x7GnP+uyGvGUSR4YmOc= Received: from AM0PR05MB5313.eurprd05.prod.outlook.com (2603:10a6:208:f2::28) by AM0PR05MB6450.eurprd05.prod.outlook.com (2603:10a6:208:13e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.23; Wed, 8 Jul 2020 06:43:57 +0000 Received: from AM0PR05MB5313.eurprd05.prod.outlook.com ([fe80::9da9:e159:add2:64ee]) by AM0PR05MB5313.eurprd05.prod.outlook.com ([fe80::9da9:e159:add2:64ee%3]) with mapi id 15.20.3174.021; Wed, 8 Jul 2020 06:43:57 +0000 From: Tal Shnaiderman To: Dmitry Kozlyuk , Ranjit Menon CC: "dev@dpdk.org" , Narcisa Ana Maria Vasile , Pallavi Kadam Thread-Topic: [PATCH] eal/windows: detect insufficient privileges for hugepages Thread-Index: AQHWVJxO7sIr9aJEr0mTSDp3CBr+aKj8yBGAgAAJ5ICAAGaRcA== Date: Wed, 8 Jul 2020 06:43:57 +0000 Message-ID: References: <20200707202203.8780-1-dmitry.kozliuk@gmail.com> <4bcaa42f-1a72-b80e-8afa-327fddd7c7a2@intel.com> <20200708032031.2ceaca0b@sovereign> In-Reply-To: <20200708032031.2ceaca0b@sovereign> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [37.142.1.17] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 98b763be-8b77-45c8-c20c-08d8230a4a6f x-ms-traffictypediagnostic: AM0PR05MB6450: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 04583CED1A x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WN1tlxcrIRaWmXA4L3hLsXzEenm3yRCPDflZiqWdxt1nPPnlIu/t8RDlyrEYbZUFBjD4gBlE8QnLvbGfnJJWiK/qv/dzMytrKmd2z9oXUpxLbBt9hAHqbZWibMiWAa3xFQu57ysJ17jwXwjxBF7ZYzbzA0RRnptsbMKupOXPEkjoZfR/d1kDLDW3+jZZhFfoJ4DiZzsWnpBSyUjc7HPI6vYi7O8DX3IC2BiT03lbodOEDAWsy6NYaXIoYltrMmjjmezea4UV/LVkZ838JFo9GpmIAWLBqFhThkfF6Q9AwD0y1n9A7/S8NwJchyC65n1H x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB5313.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(346002)(366004)(376002)(396003)(136003)(52536014)(71200400001)(26005)(86362001)(33656002)(83380400001)(478600001)(5660300002)(8936002)(8676002)(54906003)(110136005)(316002)(66446008)(6506007)(55016002)(7696005)(64756008)(66946007)(4326008)(66556008)(76116006)(66476007)(53546011)(186003)(9686003)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: SJw/FLDLI5tZO8WpmOcR0roR1f1eNKC8erIlkLeORiUGGi8jexK/02nZRD/PHaZGEGCrLHIlq72c8CMqnXQUYd2kGAvB/Ya6ga1udcsdVO8xjL1pcc+w57g5hopYOBSy2w3dsUwslyJ/lKNEA962UCRQ5xp3zoQwNeHVMQMU3tQDGtjZKgWywgqHsl91zucraewgNfru2PKXPXaUxI7/299vNW/xlDIk2cvgsjOxNPEQZNDqDc+GKj4tjQvgYhNcZBOukZylWfC0cbWPHzWkAroBp2aclOQr3ZUqePO41oErUgx/GEMlcLykSfWbVhxMycGJ1RNrsKVihq9af/oBAttnccSAfm6mIWCpSJ0xQPHyWJswJTRFGcjHr1foreDh6ijPCqVoNUsQrhm42Uwae2Peypz2WY4mcZbiUa0C5xwWy6gdNxfc60kdTfkluQdN+YwVfP8ac8kpRbnPvF9D+c+/y0fB57GD+VeJfcO1xsw= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB5313.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98b763be-8b77-45c8-c20c-08d8230a4a6f X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2020 06:43:57.7059 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: iMcJJOfIPAeMWo8NQA4xgcqn8YYLF2H8vwz3BHUjIY9ldRtexlQZC3McPDAVsTU1vGnZ04EaHV+EiGGZorlSpw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6450 Subject: Re: [dpdk-dev] [PATCH] 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" > Subject: Re: [PATCH] eal/windows: detect insufficient privileges for > hugepages >=20 > On Tue, 7 Jul 2020 16:45:07 -0700, Ranjit Menon wrote: > > On 7/7/2020 1:22 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. > > > > > > Signed-off-by: Dmitry Kozlyuk > > > --- > > > lib/librte_eal/windows/eal_hugepages.c | 4 ++++ > > > 1 file changed, 4 insertions(+) > > > > > > diff --git a/lib/librte_eal/windows/eal_hugepages.c > > > b/lib/librte_eal/windows/eal_hugepages.c > > > index 5779cd325..07a5467d0 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() !=3D ERROR_SUCCESS) > > > + goto exit; > > > + > > > ret =3D 0; > > > > > > exit: > > > > Wouldn't this be better if we could print a message here after > > explicitly checking for the ERROR_NOT_ALL_ASSIGNED return value? > > > > Otherwise, the caller simply gets a -1 return value for a failure with > > no message. >=20 > Message is printed at ERR level by the caller. There's no context to add = here. >=20 Tested successfully on Windows server 2019. =20 The output in case of missing privilege is: EAL: Cannot claim hugepage privilege EAL: FATAL: Cannot get hugepage information EAL: Cannot get hugepage information Do you think this is enough or do we want to give the user further indicati= on that configuration action from his side might be needed? Something alike= "Please verify OS Large-Page support is enabled for the current user" > -- > Dmitry Kozlyuk Tested-by: Tal Shnaiderman