aboutsummaryrefslogtreecommitdiffstats
path: root/net/xdp
diff options
context:
space:
mode:
authorRoman Gushchin <guro@fb.com>2020-12-01 13:58:56 -0800
committerAlexei Starovoitov <ast@kernel.org>2020-12-02 18:32:47 -0800
commit819a4f323579b56cd942f14718edd1f308adbbe2 (patch)
treedb417adb5ec1d809cfd0e79aac06fb4a7ae420f2 /net/xdp
parentbpf: Eliminate rlimit-based memory accounting for stackmap maps (diff)
downloadlinux-dev-819a4f323579b56cd942f14718edd1f308adbbe2.tar.xz
linux-dev-819a4f323579b56cd942f14718edd1f308adbbe2.zip
bpf: Eliminate rlimit-based memory accounting for xskmap maps
Do not use rlimit-based memory accounting for xskmap maps. It has been replaced with the memcg-based memory accounting. Signed-off-by: Roman Gushchin <guro@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20201201215900.3569844-31-guro@fb.com
Diffstat (limited to 'net/xdp')
-rw-r--r--net/xdp/xskmap.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/net/xdp/xskmap.c b/net/xdp/xskmap.c
index 9fff1e6dc9cd..113fd9017203 100644
--- a/net/xdp/xskmap.c
+++ b/net/xdp/xskmap.c
@@ -58,9 +58,8 @@ static void xsk_map_sock_delete(struct xdp_sock *xs,
static struct bpf_map *xsk_map_alloc(union bpf_attr *attr)
{
- struct bpf_map_memory mem;
- int err, numa_node;
struct xsk_map *m;
+ int numa_node;
u64 size;
if (!capable(CAP_NET_ADMIN))
@@ -74,18 +73,11 @@ static struct bpf_map *xsk_map_alloc(union bpf_attr *attr)
numa_node = bpf_map_attr_numa_node(attr);
size = struct_size(m, xsk_map, attr->max_entries);
- err = bpf_map_charge_init(&mem, size);
- if (err < 0)
- return ERR_PTR(err);
-
m = bpf_map_area_alloc(size, numa_node);
- if (!m) {
- bpf_map_charge_finish(&mem);
+ if (!m)
return ERR_PTR(-ENOMEM);
- }
bpf_map_init_from_attr(&m->map, attr);
- bpf_map_charge_move(&m->map.memory, &mem);
spin_lock_init(&m->lock);
return &m->map;