Skip to content
Commit 7d4553b6 authored by Jun'ichi Nomura's avatar Jun'ichi Nomura Committed by Daniel Borkmann
Browse files

bpf, devmap: Use GFP_KERNEL for xdp bulk queue allocation



The devmap bulk queue is allocated with GFP_ATOMIC and the allocation
may fail if there is no available space in existing percpu pool.

Since commit 75ccae62 ("xdp: Move devmap bulk queue into struct net_device")
moved the bulk queue allocation to NETDEV_REGISTER callback, whose context
is allowed to sleep, use GFP_KERNEL instead of GFP_ATOMIC to let percpu
allocator extend the pool when needed and avoid possible failure of netdev
registration.

As the required alignment is natural, we can simply use alloc_percpu().

Fixes: 75ccae62 ("xdp: Move devmap bulk queue into struct net_device")
Signed-off-by: default avatarJun'ichi Nomura <junichi.nomura@nec.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Cc: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/20210209082451.GA44021@jeru.linux.bs1.fc.nec.co.jp
parent 17d8beda
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment