nfp: bpf: read from packet data cache for PTR_TO_PACKET
authorJiong Wang <jiong.wang@netronome.com>
Thu, 29 Mar 2018 00:48:25 +0000 (17:48 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 29 Mar 2018 02:36:12 +0000 (19:36 -0700)
commitbe75923786aa28774bf2b5ef8184590a52429103
tree30e4964b10004950731a37c8f8ff3dd550bec108
parentf6ef56589374670b7c1939720dfa00212bd80a5b
nfp: bpf: read from packet data cache for PTR_TO_PACKET

This patch assumes there is a packet data cache, and would try to read
packet data from the cache instead of from memory.

This patch only implements the optimisation "backend", it doesn't build
the packet data cache, so this optimisation is not enabled.

This patch has only enabled aligned packet data read, i.e. when the read
offset to the start of cache is REG_WIDTH aligned.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
drivers/net/ethernet/netronome/nfp/bpf/jit.c
drivers/net/ethernet/netronome/nfp/bpf/main.h
drivers/net/ethernet/netronome/nfp/nfp_asm.h