DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal/windows: detect insufficient privileges for hugepages
@ 2020-07-07 20:22 Dmitry Kozlyuk
  2020-07-07 23:45 ` Ranjit Menon
  2020-07-08 21:48 ` [dpdk-dev] [PATCH v2] " Dmitry Kozlyuk
  0 siblings, 2 replies; 8+ messages in thread
From: Dmitry Kozlyuk @ 2020-07-07 20:22 UTC (permalink / raw)
  To: dev
  Cc: Narcisa Ana Maria Vasile, Ranjit Menon, Pallavi Kadam,
	Tal Shnaiderman, Dmitry Kozlyuk

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 <dmitry.kozliuk@gmail.com>
---
 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() != ERROR_SUCCESS)
+		goto exit;
+
 	ret = 0;
 
 exit:
-- 
2.25.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-07-10 21:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07 20:22 [dpdk-dev] [PATCH] eal/windows: detect insufficient privileges for hugepages Dmitry Kozlyuk
2020-07-07 23:45 ` Ranjit Menon
2020-07-08  0:20   ` Dmitry Kozlyuk
2020-07-08  6:43     ` Tal Shnaiderman
2020-07-08  7:49       ` Dmitry Kozlyuk
2020-07-08 21:48 ` [dpdk-dev] [PATCH v2] " Dmitry Kozlyuk
2020-07-08 22:27   ` Ranjit Menon
2020-07-10 21:25     ` Thomas Monjalon

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git