diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-07-26 05:53:34 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-07-27 08:14:35 +0300 |
commit | ab01f4ac5faf6a0ea532fa65cf6b1c9b2019e49b (patch) | |
tree | 912509196852693d40307bf7a3e6a1c6443040a9 /drivers/net/ethernet/netronome/nfp/bpf/main.h | |
parent | 0958762748e4cfeb19d881aa8d3fe5ba8b5bc50b (diff) | |
download | linux-ab01f4ac5faf6a0ea532fa65cf6b1c9b2019e49b.tar.xz |
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>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/bpf/main.h')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/bpf/main.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/bpf/main.h b/drivers/net/ethernet/netronome/nfp/bpf/main.h index 017e0ae5e736..57573bfa8c03 100644 --- a/drivers/net/ethernet/netronome/nfp/bpf/main.h +++ b/drivers/net/ethernet/netronome/nfp/bpf/main.h @@ -47,6 +47,8 @@ #include "../nfp_asm.h" #include "fw.h" +#define cmsg_warn(bpf, msg...) nn_dp_warn(&(bpf)->app->ctrl->dp, msg) + /* For relocation logic use up-most byte of branch instruction as scratch * area. Remember to clear this before sending instructions to HW! */ @@ -221,6 +223,7 @@ struct nfp_bpf_map { struct nfp_bpf_neutral_map { struct rhash_head l; struct bpf_map *ptr; + u32 map_id; u32 count; }; |