diff options
author | Jiong Wang <jiong.wang@netronome.com> | 2018-03-29 03:48:25 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-03-29 05:36:12 +0300 |
commit | be75923786aa28774bf2b5ef8184590a52429103 (patch) | |
tree | 30e4964b10004950731a37c8f8ff3dd550bec108 /drivers/net/ethernet/netronome/nfp/bpf/main.h | |
parent | f6ef56589374670b7c1939720dfa00212bd80a5b (diff) | |
download | linux-be75923786aa28774bf2b5ef8184590a52429103.tar.xz |
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>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/bpf/main.h')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/bpf/main.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/bpf/main.h b/drivers/net/ethernet/netronome/nfp/bpf/main.h index 054df3dc0698..861211e27ea6 100644 --- a/drivers/net/ethernet/netronome/nfp/bpf/main.h +++ b/drivers/net/ethernet/netronome/nfp/bpf/main.h @@ -199,6 +199,10 @@ typedef int (*instr_cb_t)(struct nfp_prog *, struct nfp_insn_meta *); * @ldst_gather_len: memcpy length gathered from load/store sequence * @paired_st: the paired store insn at the head of the sequence * @ptr_not_const: pointer is not always constant + * @pkt_cache: packet data cache information + * @pkt_cache.range_start: start offset for associated packet data cache + * @pkt_cache.range_end: end offset for associated packet data cache + * @pkt_cache.do_init: this read needs to initialize packet data cache * @jmp_dst: destination info for jump instructions * @func_id: function id for call instructions * @arg1: arg1 for call instructions @@ -219,6 +223,11 @@ struct nfp_insn_meta { struct bpf_insn *paired_st; s16 ldst_gather_len; bool ptr_not_const; + struct { + s16 range_start; + s16 range_end; + bool do_init; + } pkt_cache; }; struct nfp_insn_meta *jmp_dst; struct { |