]> asedeno.scripts.mit.edu Git - linux.git/commit
nfp: bpf: perf event output helpers support
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 4 May 2018 01:37:12 +0000 (18:37 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 4 May 2018 21:41:03 +0000 (23:41 +0200)
commit9816dd35ececc095f3e3be29d30d3adc755908d9
tree27d3ce05f416a68b1ac0b41140945ea58d036c39
parentf4e3ec0d573e238f383b3da365127002579a07d6
nfp: bpf: perf event output helpers support

Add support for the perf_event_output family of helpers.

The implementation on the NFP will not match the host code exactly.
The state of the host map and rings is unknown to the device, hence
device can't return errors when rings are not installed.  The device
simply packs the data into a firmware notification message and sends
it over to the host, returning success to the program.

There is no notion of a host CPU on the device when packets are being
processed.  Device will only offload programs which set BPF_F_CURRENT_CPU.
Still, if map index doesn't match CPU no error will be returned (see
above).

Dropped/lost firmware notification messages will not cause "lost
events" event on the perf ring, they are only visible via device
error counters.

Firmware notification messages may also get reordered in respect
to the packets which caused their generation.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/ethernet/netronome/nfp/bpf/cmsg.c
drivers/net/ethernet/netronome/nfp/bpf/fw.h
drivers/net/ethernet/netronome/nfp/bpf/jit.c
drivers/net/ethernet/netronome/nfp/bpf/main.c
drivers/net/ethernet/netronome/nfp/bpf/main.h
drivers/net/ethernet/netronome/nfp/bpf/offload.c
drivers/net/ethernet/netronome/nfp/bpf/verifier.c