[PATCH] netfilter: ebtables: allocate chainstack on CPU local nodes

Subsystems: ethernet bridge, networking [general], the rest

STALE1764d

2 messages, 2 authors, 2021-10-17 · open the first message on its own page

[PATCH] netfilter: ebtables: allocate chainstack on CPU local nodes

From: Davidlohr Bueso <dave@stgolabs.net>
Date: 2021-10-10 18:24:54

Keep the per-CPU memory allocated for chainstacks local.

Signed-off-by: Davidlohr Bueso <redacted>
---
 net/bridge/netfilter/ebtables.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 83d1798dfbb4..ba045f35114d 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -926,7 +926,9 @@ static int translate_table(struct net *net, const char *name,
 			return -ENOMEM;
 		for_each_possible_cpu(i) {
 			newinfo->chainstack[i] =
-			  vmalloc(array_size(udc_cnt, sizeof(*(newinfo->chainstack[0]))));
+			  vmalloc_node(array_size(udc_cnt,
+					  sizeof(*(newinfo->chainstack[0]))),
+				       cpu_to_node(i));
 			if (!newinfo->chainstack[i]) {
 				while (i)
 					vfree(newinfo->chainstack[--i]);
-- 
2.26.2

Re: [PATCH] netfilter: ebtables: allocate chainstack on CPU local nodes

From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: 2021-10-17 22:23:52

On Sun, Oct 10, 2021 at 11:24:39AM -0700, Davidlohr Bueso wrote:
Keep the per-CPU memory allocated for chainstacks local.
Applied to nf.git, thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help