mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ali Firas <alishmery18@gmail.com>
To: netdev@vger.kernel.org, idosch@nvidia.com
Cc: kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net,
	edumazet@google.com, andrew+netdev@lunn.ch, horms@kernel.org,
	razor@blackwall.org, roopa@nvidia.com,
	linux-kernel@vger.kernel.org, Ali Firas <alishmery18@gmail.com>
Subject: [PATCH net-next v2 4/5] vxlan: vnifilter: account the VNI node to memcg
Date: Wed, 16 Sep 2026 22:34:48 +0300	[thread overview]
Message-ID: <20260916193449.2552039-5-alishmery18@gmail.com> (raw)
In-Reply-To: <20260916193449.2552039-1-alishmery18@gmail.com>

vxlan_vni_alloc() allocates a struct vxlan_vni_node for every VNI with
plain GFP_KERNEL. The per-CPU stats block it allocates next is now
charged to the caller's cgroup, but the node itself is not.

Use GFP_KERNEL_ACCOUNT. The only caller already handles a NULL return.

Assisted-by: LLM
Signed-off-by: Ali Firas <alishmery18@gmail.com>
---
v1: https://lore.kernel.org/netdev/20260909092645.3105263-1-alishmery18@gmail.com/
 drivers/net/vxlan/vxlan_vnifilter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c
index 9a1baca39d8b..fbff52c450c0 100644
--- a/drivers/net/vxlan/vxlan_vnifilter.c
+++ b/drivers/net/vxlan/vxlan_vnifilter.c
@@ -710,7 +710,7 @@ static struct vxlan_vni_node *vxlan_vni_alloc(struct vxlan_dev *vxlan,
 {
 	struct vxlan_vni_node *vninode;
 
-	vninode = kzalloc_obj(*vninode);
+	vninode = kzalloc_obj(*vninode, GFP_KERNEL_ACCOUNT);
 	if (!vninode)
 		return NULL;
 	vninode->stats = netdev_alloc_pcpu_stats(struct vxlan_vni_stats_pcpu);
-- 
2.53.0


  parent reply	other threads:[~2026-09-16 19:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 19:34 [PATCH net-next v2 0/5] vxlan: vnifilter: bound one request and account per-VNI memory Ali Firas
2026-09-16 19:34 ` [PATCH net-next v2 1/5] vxlan: vnifilter: reject VNIs outside the 24-bit space Ali Firas
2026-09-19  0:21   ` netdev-bot+sashiko
2026-09-16 19:34 ` [PATCH net-next v2 2/5] vxlan: vnifilter: bound the number of VNIs one request may touch Ali Firas
2026-09-19  0:21   ` netdev-bot+sashiko
2026-09-16 19:34 ` [PATCH net-next v2 3/5] net: account per-CPU netdev stats to memcg Ali Firas
2026-09-19  0:21   ` netdev-bot+sashiko
2026-09-16 19:34 ` Ali Firas [this message]
2026-09-19  0:21   ` [PATCH net-next v2 4/5] vxlan: vnifilter: account the VNI node " netdev-bot+sashiko
2026-09-16 19:34 ` [PATCH net-next v2 5/5] selftests: net: test the vxlan vnifilter VNI limit Ali Firas
2026-09-19  0:21   ` netdev-bot+sashiko

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=20260916193449.2552039-5-alishmery18@gmail.com \
    --to=alishmery18@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=roopa@nvidia.com \
    /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

all inboxes | Powered by JetHome®