nfp: bpf: remember maps by ID
authorJakub Kicinski <jakub.kicinski@netronome.com>
Thu, 26 Jul 2018 02:53:34 +0000 (19:53 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 27 Jul 2018 05:14:35 +0000 (07:14 +0200)
commitab01f4ac5faf6a0ea532fa65cf6b1c9b2019e49b
tree912509196852693d40307bf7a3e6a1c6443040a9
parent0958762748e4cfeb19d881aa8d3fe5ba8b5bc50b
nfp: bpf: remember maps by ID

Record perf maps by map ID, not raw kernel pointer.  This helps
with debug messages, because printing pointers to logs is frowned
upon, and makes debug easier for the users, as map ID is something
they should be more familiar with.  Note that perf maps are offload
neutral, therefore IDs won't be orphaned.

While at it use a rate limited print helper for the error message.

Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/ethernet/netronome/nfp/bpf/cmsg.c
drivers/net/ethernet/netronome/nfp/bpf/jit.c
drivers/net/ethernet/netronome/nfp/bpf/main.c
drivers/net/ethernet/netronome/nfp/bpf/main.h
drivers/net/ethernet/netronome/nfp/bpf/offload.c