netfilter: ebtables: allocate chainstack on CPU local nodes

Keep the per-CPU memory allocated for chainstacks local.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
Davidlohr Bueso 2021-10-10 11:24:39 -07:00 committed by Pablo Neira Ayuso
parent 3e6ed7703d
commit d9aaaf2232

View File

@ -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]);