public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org
Subject: [PATCH net 8/8] netfilter: ebtables: allocate chainstack on CPU local nodes
Date: Thu, 21 Oct 2021 12:08:21 +0200	[thread overview]
Message-ID: <20211021100821.964677-9-pablo@netfilter.org> (raw)
In-Reply-To: <20211021100821.964677-1-pablo@netfilter.org>

From: Davidlohr Bueso <dave@stgolabs.net>

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>
---
 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.30.2


      parent reply	other threads:[~2021-10-21 10:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 10:08 [PATCH net 0/8] Netfilter/IPVS fixes for net Pablo Neira Ayuso
2021-10-21 10:08 ` [PATCH net 1/8] netfilter: xt_IDLETIMER: fix panic that occurs when timer_type has garbage value Pablo Neira Ayuso
2021-10-21 11:40   ` patchwork-bot+netdevbpf
2021-10-21 10:08 ` [PATCH net 2/8] netfilter: Kconfig: use 'default y' instead of 'm' for bool config option Pablo Neira Ayuso
2021-10-21 10:08 ` [PATCH net 3/8] netfilter: nf_tables: skip netdev events generated on netns removal Pablo Neira Ayuso
2021-10-21 10:08 ` [PATCH net 4/8] selftests: nft_nat: add udp hole punch test case Pablo Neira Ayuso
2021-10-21 10:08 ` [PATCH net 5/8] netfilter: ip6t_rt: fix rt0_hdr parsing in rt_mt6 Pablo Neira Ayuso
2021-10-21 10:08 ` [PATCH net 6/8] netfilter: ipvs: make global sysctl readonly in non-init netns Pablo Neira Ayuso
2021-10-21 10:08 ` [PATCH net 7/8] selftests: netfilter: remove stray bash debug line Pablo Neira Ayuso
2021-10-21 10:08 ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211021100821.964677-9-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox