summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2016-12-15 12:12:54 -0800
committerDavid S. Miller <davem@davemloft.net>2016-12-17 11:48:55 -0500
commitf23bc46c30ca5ef58b8549434899fcbac41b2cfc (patch)
tree390ef0bceeecca2cbad8641150c828fe572565ec /net
parent08abb79542c9e8c367d1d8e44fe1026868d3f0a7 (diff)
downloadop-kernel-dev-f23bc46c30ca5ef58b8549434899fcbac41b2cfc.zip
op-kernel-dev-f23bc46c30ca5ef58b8549434899fcbac41b2cfc.tar.gz
net: xdp: add invalid buffer warning
This adds a warning for drivers to use when encountering an invalid buffer for XDP. For normal cases this should not happen but to catch this in virtual/qemu setups that I may not have expected from the emulation layer having a standard warning is useful. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/filter.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index b146170..7190bd6 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2972,6 +2972,12 @@ void bpf_warn_invalid_xdp_action(u32 act)
}
EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_action);
+void bpf_warn_invalid_xdp_buffer(void)
+{
+ WARN_ONCE(1, "Illegal XDP buffer encountered, expect throughput degradation\n");
+}
+EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_buffer);
+
static u32 sk_filter_convert_ctx_access(enum bpf_access_type type, int dst_reg,
int src_reg, int ctx_off,
struct bpf_insn *insn_buf,
OpenPOWER on IntegriCloud