diff mbox series

[nf-next,03/10] netfilter: nf_tables: use GFP_KERNEL_ACCOUNT

Message ID 20260821143827.183963-3-pablo@netfilter.org
State Changes Requested
Headers show
Series [nf-next,01/10] netfilter: x_tables: use GFP_KERNEL_ACCOUNT in match/target | expand

Commit Message

Pablo Neira Ayuso Aug. 21, 2026, 2:38 p.m. UTC
GFP_KERNEL_ACCOUNT is preferred these days for memcg, replace
GFP_KERNEL by GFP_KERNEL_ACCOUNT.

Just a few leftover in nft_ct and the pipapo set backend.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nft_ct.c         | 7 ++++---
 net/netfilter/nft_set_pipapo.c | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c
index 9dbf127df9c8..89760874336c 100644
--- a/net/netfilter/nft_ct.c
+++ b/net/netfilter/nft_ct.c
@@ -365,7 +365,7 @@  static bool nft_ct_tmpl_alloc_pcpu(void)
 		return true;
 
 	for_each_possible_cpu(cpu) {
-		tmp = nf_ct_tmpl_alloc(&init_net, &zone, GFP_KERNEL);
+		tmp = nf_ct_tmpl_alloc(&init_net, &zone, GFP_KERNEL_ACCOUNT);
 		if (!tmp) {
 			nft_ct_tmpl_put_pcpu();
 			return false;
@@ -848,7 +848,8 @@  nft_ct_timeout_parse_policy(void *timeouts,
 	struct nlattr **tb;
 	int ret = 0;
 
-	tb = kzalloc_objs(*tb, l4proto->ctnl_timeout.nlattr_max + 1);
+	tb = kzalloc_objs(*tb, l4proto->ctnl_timeout.nlattr_max + 1,
+			  GFP_KERNEL_ACCOUNT);
 
 	if (!tb)
 		return -ENOMEM;
@@ -934,7 +935,7 @@  static int nft_ct_timeout_obj_init(const struct nft_ctx *ctx,
 	}
 
 	timeout = kzalloc(sizeof(struct nf_ct_timeout) +
-			  l4proto->ctnl_timeout.obj_size, GFP_KERNEL);
+			  l4proto->ctnl_timeout.obj_size, GFP_KERNEL_ACCOUNT);
 	if (timeout == NULL) {
 		ret = -ENOMEM;
 		goto err_proto_put;
diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c
index 978bb0c01106..3617bb66094d 100644
--- a/net/netfilter/nft_set_pipapo.c
+++ b/net/netfilter/nft_set_pipapo.c
@@ -2298,7 +2298,7 @@  static int nft_pipapo_init(const struct nft_set *set,
 	if (field_count > NFT_PIPAPO_MAX_FIELDS)
 		return -EINVAL;
 
-	m = kmalloc_flex(*m, f, field_count);
+	m = kmalloc_flex(*m, f, field_count, GFP_KERNEL_ACCOUNT);
 	if (!m)
 		return -ENOMEM;