]> git.baikalelectronics.ru Git - kernel.git/commit
xsk: Support allocations of large umems
authorMagnus Karlsson <magnus.karlsson@intel.com>
Tue, 14 Jan 2020 09:49:25 +0000 (10:49 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 15 Jan 2020 19:41:52 +0000 (11:41 -0800)
commit6eac365a9c215e5495952ba43538047fccd5156c
tree91d9e96017c76e1a3cc7c1d1c741e571988f731f
parent242c562a01034c94f4d175b570ee6cd0d6b107df
xsk: Support allocations of large umems

When registering a umem area that is sufficiently large (>1G on an
x86), kmalloc cannot be used to allocate one of the internal data
structures, as the size requested gets too large. Use kvmalloc instead
that falls back on vmalloc if the allocation is too large for kmalloc.

Also add accounting for this structure as it is triggered by a user
space action (the XDP_UMEM_REG setsockopt) and it is by far the
largest structure of kernel allocated memory in xsk.

Reported-by: Ryan Goodfellow <rgoodfel@isi.edu>
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Link: https://lore.kernel.org/bpf/1578995365-7050-1-git-send-email-magnus.karlsson@intel.com
net/xdp/xdp_umem.c