aboutsummaryrefslogtreecommitdiff
path: root/net/xdp
diff options
context:
space:
mode:
authorRoman Gushchin2020-12-01 13:58:43 -0800
committerAlexei Starovoitov2020-12-02 18:32:46 -0800
commit28e1dcdef0cbf5ff79aceb149c7ab14589598af0 (patch)
tree05fd574297dcb7df19cc770c8b448659c61159a9 /net/xdp
parent7846dd9f835e248901a9f77a43745f8f1de04741 (diff)
bpf: Refine memcg-based memory accounting for xskmap maps
Extend xskmap memory accounting to include the memory taken by the xsk_map_node structure. Signed-off-by: Roman Gushchin <guro@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20201201215900.3569844-18-guro@fb.com
Diffstat (limited to 'net/xdp')
-rw-r--r--net/xdp/xskmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/xdp/xskmap.c b/net/xdp/xskmap.c
index 66231ba6c348..9fff1e6dc9cd 100644
--- a/net/xdp/xskmap.c
+++ b/net/xdp/xskmap.c
@@ -16,7 +16,8 @@ static struct xsk_map_node *xsk_map_node_alloc(struct xsk_map *map,
{
struct xsk_map_node *node;
- node = kzalloc(sizeof(*node), GFP_ATOMIC | __GFP_NOWARN);
+ node = bpf_map_kzalloc(&map->map, sizeof(*node),
+ GFP_ATOMIC | __GFP_NOWARN);
if (!node)
return ERR_PTR(-ENOMEM);