summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2018-01-10 13:49:36 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2018-01-10 13:49:37 +0100
commit632130ed3bddca3644d58a5cb6e20915f36e4d44 (patch)
treebd26e78addbbd2c5afb46e8d4a37e5924a114580 /kernel
parent148989d8bac36a5f9823715c9910adedbe847ae6 (diff)
parentff627e3d07a07f7ed1105f459ee9586d4be7818e (diff)
downloadlwn-632130ed3bddca3644d58a5cb6e20915f36e4d44.tar.gz
lwn-632130ed3bddca3644d58a5cb6e20915f36e4d44.zip
Merge branch 'bpf-nfp-misc-improvements'
Jakub Kicinski says: ==================== This series starts with a fix to Jesper's recent work, somehow I forgot about control rings during review. Second patch is cleaning up a vNIC header, in kdoc we should not use @ for #define constants. Aligning of the top of the stack as well as bottom (last bytes will be unused) helps the performance. We should check offload datapath's max MTU when program is loaded and we can allow TC hw offload flag to be changed freely while XDP offload is active. Next group of patches adds more fully featured relocation support. Due to limited amount of code space we only load the image to NIC's memory when program is attached. Since we can't predict which programs are loaded later, we should translate as if image was to be loaded at offset zero and only apply relocations at load time. Many more advanced features (eg. tail class, subprograms, dynamic allocation of program space and sharing it between ports) will depend on this. Nic adds support for signed comparison instructions. Quentin makes use of the verifier log in our driver, the verifier print function (verbose()) has to be renamed and exported. v2: - replace #define by function aliasing for verbose() in patch 13 ==================== Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/bpf/verifier.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index d921ab387b0b..3b2b47666180 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -169,11 +169,11 @@ struct bpf_call_arg_meta {
static DEFINE_MUTEX(bpf_verifier_lock);
/* log_level controls verbosity level of eBPF verifier.
- * verbose() is used to dump the verification trace to the log, so the user
- * can figure out what's wrong with the program
+ * bpf_verifier_log_write() is used to dump the verification trace to the log,
+ * so the user can figure out what's wrong with the program
*/
-static __printf(2, 3) void verbose(struct bpf_verifier_env *env,
- const char *fmt, ...)
+__printf(2, 3) void bpf_verifier_log_write(struct bpf_verifier_env *env,
+ const char *fmt, ...)
{
struct bpf_verifer_log *log = &env->log;
unsigned int n;
@@ -197,6 +197,14 @@ static __printf(2, 3) void verbose(struct bpf_verifier_env *env,
else
log->ubuf = NULL;
}
+EXPORT_SYMBOL_GPL(bpf_verifier_log_write);
+/* Historically bpf_verifier_log_write was called verbose, but the name was too
+ * generic for symbol export. The function was renamed, but not the calls in
+ * the verifier to avoid complicating backports. Hence the alias below.
+ */
+static __printf(2, 3) void verbose(struct bpf_verifier_env *env,
+ const char *fmt, ...)
+ __attribute__((alias("bpf_verifier_log_write")));
static bool type_is_pkt_pointer(enum bpf_reg_type type)
{