]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: remove artificial bpf_skb_{load, store}_bytes buffer limitation
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 19 Feb 2016 22:05:24 +0000 (23:05 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Feb 2016 03:07:10 +0000 (22:07 -0500)
commite6aa91123af6257a563564f64bfe6978942dbf4a
tree90d093b6a8a87b8619ab4a78a6c1174d30d7b58f
parent3b157947183ea0634da2b9a4f1b8273296d6df05
bpf: remove artificial bpf_skb_{load, store}_bytes buffer limitation

We currently limit bpf_skb_store_bytes() and bpf_skb_load_bytes()
helpers to only store or load a maximum buffer of 16 bytes. Thus,
loading, rewriting and storing headers require several bpf_skb_load_bytes()
and bpf_skb_store_bytes() calls.

Also here we can use a per-cpu scratch buffer instead in order to not
pressure stack space any further. I do suspect that this limit was mainly
set in place for this particular reason. So, ease program development
by removing this limitation and make the scratchpad generic, so it can
be reused.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/filter.c