nfp: bpf: don't depend on high order allocations for program image
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 10 Jan 2018 12:26:02 +0000 (12:26 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 10 Jan 2018 12:49:35 +0000 (13:49 +0100)
commit44a12ecc1cab7dcf4647dfef7d94f5c559c01407
treef5fa8149f2de8a7826ee0ad8ef63ef3485b30d28
parent2314fe9ed0a1760ceab96b81e6b7181963c93254
nfp: bpf: don't depend on high order allocations for program image

The translator pre-allocates a buffer of maximal program size.
Due to HW/FW limitations the program buffer can't currently be
longer than 128Kb, so we used to kmalloc() it, and then map for
DMA directly.

Now that the late branch resolution is copying the program image
anyway, we can just kvmalloc() the buffer.  While at it, after
translation reallocate the buffer to save space.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/ethernet/netronome/nfp/bpf/jit.c
drivers/net/ethernet/netronome/nfp/bpf/offload.c