bpf: Make redirect_info accessible from modules

We are going to add kern_flags field in redirect_info for kernel
internal use.
In order to avoid function call to access the flags, make redirect_info
accessible from modules. Also as it is now non-static, add prefix bpf_
to redirect_info.

v6:
- Fix sparse warning around EXPORT_SYMBOL.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
Toshiaki Makita
2018-08-03 16:58:15 +09:00
committed by Daniel Borkmann
parent af87a3aa1b
commit 0b19cc0a86
2 changed files with 21 additions and 18 deletions

View File

@@ -537,6 +537,16 @@ struct sk_msg_buff {
struct list_head list;
};
struct bpf_redirect_info {
u32 ifindex;
u32 flags;
struct bpf_map *map;
struct bpf_map *map_to_flush;
unsigned long map_owner;
};
DECLARE_PER_CPU(struct bpf_redirect_info, bpf_redirect_info);
/* Compute the linear packet data range [data, data_end) which
* will be accessed by various program types (cls_bpf, act_bpf,
* lwt, ...). Subsystems allowing direct data access must (!)