lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241022162359.2713094-8-ap420073@gmail.com>
Date: Tue, 22 Oct 2024 16:23:58 +0000
From: Taehee Yoo <ap420073@...il.com>
To: davem@...emloft.net,
	kuba@...nel.org,
	pabeni@...hat.com,
	edumazet@...gle.com,
	almasrymina@...gle.com,
	donald.hunter@...il.com,
	corbet@....net,
	michael.chan@...adcom.com,
	andrew+netdev@...n.ch,
	hawk@...nel.org,
	ilias.apalodimas@...aro.org,
	ast@...nel.org,
	daniel@...earbox.net,
	john.fastabend@...il.com,
	dw@...idwei.uk,
	sdf@...ichev.me,
	asml.silence@...il.com,
	brett.creeley@....com,
	linux-doc@...r.kernel.org,
	netdev@...r.kernel.org
Cc: kory.maincent@...tlin.com,
	maxime.chevallier@...tlin.com,
	danieller@...dia.com,
	hengqi@...ux.alibaba.com,
	ecree.xilinx@...il.com,
	przemyslaw.kitszel@...el.com,
	hkallweit1@...il.com,
	ahmed.zaki@...el.com,
	rrameshbabu@...dia.com,
	idosch@...dia.com,
	jiri@...nulli.us,
	bigeasy@...utronix.de,
	lorenzo@...nel.org,
	jdamato@...tly.com,
	aleksander.lobakin@...el.com,
	kaiyuanz@...gle.com,
	willemb@...gle.com,
	daniel.zahka@...il.com,
	ap420073@...il.com
Subject: [PATCH net-next v4 7/8] net: netmem: add netmem_is_pfmemalloc() helper function

The netmem_is_pfmemalloc() is a netmem version of page_is_pfmemalloc().

Tested-by: Stanislav Fomichev <sdf@...ichev.me>
Suggested-by: Mina Almasry <almasrymina@...gle.com>
Signed-off-by: Taehee Yoo <ap420073@...il.com>
---

v4:
 - Patch added.

 include/net/netmem.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/net/netmem.h b/include/net/netmem.h
index 8a6e20be4b9d..49ae2bf05362 100644
--- a/include/net/netmem.h
+++ b/include/net/netmem.h
@@ -171,4 +171,12 @@ static inline unsigned long netmem_get_dma_addr(netmem_ref netmem)
 	return __netmem_clear_lsb(netmem)->dma_addr;
 }
 
+static inline bool netmem_is_pfmemalloc(netmem_ref netmem)
+{
+	if (netmem_is_net_iov(netmem))
+		return false;
+
+	return page_is_pfmemalloc(netmem_to_page(netmem));
+}
+
 #endif /* _NET_NETMEM_H */
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ