linux/drivers/net/ethernet/netronome/nfp
Jiong Wang 9879a3814b nfp: bpf: implement memory bulk copy for length within 32-bytes
For NFP, we want to re-group a sequence of load/store pairs lowered from
memcpy/memmove into single memory bulk operation which then could be
accelerated using NFP CPP bus.

This patch extends the existing load/store auxiliary information by adding
two new fields:

	struct bpf_insn *paired_st;
	s16 ldst_gather_len;

Both fields are supposed to be carried by the the load instruction at the
head of the sequence. "paired_st" is the corresponding store instruction at
the head and "ldst_gather_len" is the gathered length.

If "ldst_gather_len" is negative, then the sequence is doing memory
load/store in descending order, otherwise it is in ascending order. We need
this information to detect overlapped memory access.

This patch then optimize memory bulk copy when the copy length is within
32-bytes.

The strategy of read/write used is:

  * Read.
    Use read32 (direct_ref), always.

  * Write.
    - length <= 8-bytes
      write8 (direct_ref).
    - length <= 32-bytes and is 4-byte aligned
      write32 (direct_ref).
    - length <= 32-bytes but is not 4-byte aligned
      write8 (indirect_ref).

NOTE: the optimization should not change program semantics. The destination
register of the last load instruction should contain the same value before
and after this optimization.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2017-12-01 20:59:20 +01:00
..
bpf nfp: bpf: implement memory bulk copy for length within 32-bytes 2017-12-01 20:59:20 +01:00
flower nfp: flower: add missing kdoc 2017-11-21 20:24:37 +09:00
nfpcore nfp: fix old kdoc issues 2017-12-01 20:59:19 +01:00
nic nfp: separate app vNIC init/clean from alloc/free 2017-09-03 21:22:04 -07:00
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
nfp_app_nic.c nfp: separate app vNIC init/clean from alloc/free 2017-09-03 21:22:04 -07:00
nfp_app.c nfp: refactor nfp_app_reprs_set 2017-11-05 23:23:26 +09:00
nfp_app.h nfp: register flower reprs for egress dev offload 2017-11-17 14:09:36 +09:00
nfp_asm.c nfp: bpf: implement memory bulk copy for length within 32-bytes 2017-12-01 20:59:20 +01:00
nfp_asm.h nfp: bpf: implement memory bulk copy for length within 32-bytes 2017-12-01 20:59:20 +01:00
nfp_devlink.c nfp: devlink add support for getting eswitch mode 2017-06-25 11:42:01 -04:00
nfp_hwmon.c nfp: add hwmon support 2017-05-30 11:27:06 -04:00
nfp_main.c nfp: make use of MAC reinit 2017-11-05 23:23:26 +09:00
nfp_main.h nfp: add basic SR-IOV ndo functions 2017-08-25 19:24:58 -07:00
nfp_net_common.c Merge branch 'akpm' (patches from Andrew) 2017-11-15 19:42:40 -08:00
nfp_net_ctrl.h nfp: bpf: move to datapath ABI version 2 2017-10-09 09:51:03 -07:00
nfp_net_debugfs.c nfp: don't reuse pointers in ring dumping 2017-08-18 22:39:28 -07:00
nfp_net_ethtool.c nfp: fix vlan receive MAC statistics typo 2017-11-17 14:09:35 +09:00
nfp_net_main.c nfp: resync repr state when port table sync 2017-11-05 23:23:26 +09:00
nfp_net_repr.c nfp: register flower reprs for egress dev offload 2017-11-17 14:09:36 +09:00
nfp_net_repr.h nfp: resync repr state when port table sync 2017-11-05 23:23:26 +09:00
nfp_net_sriov.c nfp: inform the VF driver needs to be restarted after changing the MAC 2017-10-28 18:59:48 +09:00
nfp_net_sriov.h nfp: add basic SR-IOV ndo functions 2017-08-25 19:24:58 -07:00
nfp_net.h nfp: fix old kdoc issues 2017-12-01 20:59:19 +01:00
nfp_netvf_main.c nfp: advertise support for NFD ABI 0.5 2017-06-07 12:51:42 -04:00
nfp_port.c nfp: store pointer to MAC statistics in nfp_port 2017-08-18 22:39:28 -07:00
nfp_port.h nfp: fix vlan receive MAC statistics typo 2017-11-17 14:09:35 +09:00