[PATCH bpf-next v2 0/4] Add RISC-V (RV64G) BPF JIT

2019-02-05 Thread bjorn . topel
From: Björn Töpel Hi! This v2 series adds an RV64G BPF JIT to the kernel. At the moment the RISC-V Linux port does not support CONFIG_HAVE_KPROBES (Patrick Stählin sent out an RFC last year), which means that CONFIG_BPF_EVENTS is not supported. Thus, no tests involving BPF_PROG_TYPE_TRACEPOINT,

[PATCH bpf-next v2 3/4] bpf, doc: add RISC-V JIT to BPF documentation

2019-02-05 Thread bjorn . topel
From: Björn Töpel Update Documentation/networking/filter.txt and Documentation/sysctl/net.txt to mention RISC-V. Signed-off-by: Björn Töpel --- Documentation/networking/filter.txt | 16 +--- Documentation/sysctl/net.txt| 1 + 2 files changed, 10 insertions(+), 7 deletions(

[PATCH bpf-next v2 2/4] MAINTAINERS: add RISC-V BPF JIT maintainer

2019-02-05 Thread bjorn . topel
From: Björn Töpel Add Björn Töpel as RISC-V BPF JIT maintainer. Signed-off-by: Björn Töpel --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 019a2bcfbd09..b4491132b9ce 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2907,6 +2907,12 @@ L:

[PATCH bpf-next v2 4/4] selftests/bpf: add "any alignment" annotation for some tests

2019-02-05 Thread bjorn . topel
From: Björn Töpel RISC-V does, in-general, not have "efficient unaligned access". When testing the RISC-V BPF JIT, some selftests failed in the verification due to misaligned access. Annotate these tests with the F_NEEDS_EFFICIENT_UNALIGNED_ACCESS flag. Signed-off-by: Björn Töpel --- .../selft

[PATCH bpf-next v2 1/4] bpf, riscv: add BPF JIT for RV64G

2019-02-05 Thread bjorn . topel
From: Björn Töpel This commit adds a BPF JIT for RV64G. The JIT is a two-pass JIT, and has a dynamic prolog/epilogue (similar to the MIPS64 BPF JIT) instead of static ones (e.g. x86_64). At the moment the RISC-V Linux port does not support CONFIG_HAVE_KPROBES, which means that CONFIG_BPF_EVENTS

[PATCH bpf-next 1/3] bpf, riscv: add BPF JIT for RV64G

2019-02-03 Thread bjorn . topel
From: Björn Töpel This commit adds BPF JIT for RV64G. The JIT is a two-pass JIT, and has a dynamic prolog/epilogue (similar to the MIPS64 BPF JIT) instead of static ones (e.g. x86_64). At the moment the RISC-V Linux port does not support HAVE_KPROBES, which means that CONFIG_BPF_EVENTS is not s

[PATCH bpf-next 0/3] Add RISC-V (RV64G) BPF JIT

2019-02-03 Thread bjorn . topel
From: Björn Töpel Hi! This series adds an RV64G BPF JIT to the kernel. I've sent out a RFC for a couple of weeks ago, and think this code is feature-complete/stable enough (famous last words) for a proper patch. Unfortunately, kprobes isn't supported by RISC-V yet (Patrick Stählin sent out an R

[PATCH bpf-next 2/3] MAINTAINERS: add RISC-V BPF JIT maintainer

2019-02-03 Thread bjorn . topel
From: Björn Töpel Add Björn Töpel as RISC-V BPF JIT maintainer. Signed-off-by: Björn Töpel --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 019a2bcfbd09..b4491132b9ce 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2907,6 +2907,12 @@ L:

[PATCH bpf-next 3/3] bpf, doc: add RISC-V to filter.txt

2019-02-03 Thread bjorn . topel
From: Björn Töpel Update Documentation/networking/filter.txt to mention RISC-V. Signed-off-by: Björn Töpel --- Documentation/networking/filter.txt | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Documentation/networking/filter.txt b/Documentation/networkin

[PATCH iproute2-next v2] ss: add AF_XDP support

2019-01-29 Thread bjorn . topel
From: Björn Töpel AF_XDP is an address family that is optimized for high performance packet processing. This patch adds AF_XDP support to ss(8) so that sockets can be queried and monitored. Example: $ sudo ss --xdp -e -p -m Recv-Q Send-Q Local Address:Port Peer Addres

[PATCH v2] i40e: replace switch-statement to speed-up retpoline-enabled builds

2019-01-29 Thread bjorn . topel
From: Björn Töpel GCC will generate jump tables for switch-statements with more than 5 case statements. An entry into the jump table is an indirect call, which means that for CONFIG_RETPOLINE builds, this is rather expensive. This commit replaces the switch-statement that acts on the XDP program

[PATCH iproute2-next 1/2] uapi: add xdp_diag.h

2019-01-24 Thread bjorn . topel
From: Björn Töpel Import xdp_diag.h that was introduced in Linux kernel commit a36b38aa2af6 ("xsk: add sock_diag interface for AF_XDP"). Signed-off-by: Björn Töpel --- include/uapi/linux/xdp_diag.h | 72 +++ 1 file changed, 72 insertions(+) create mode 100644 i

[PATCH iproute2-next 2/2] ss: add AF_XDP support

2019-01-24 Thread bjorn . topel
From: Björn Töpel AF_XDP is an address family that is optimized for high performance packet processing. This patch adds AF_XDP support to ss(8) so that sockets can be queried and monitored. Signed-off-by: Björn Töpel --- man/man8/ss.8 | 9 ++- misc/ss.c | 168 +++

[PATCH iproute2-next 0/2] ss: AF_XDP monitoring support

2019-01-24 Thread bjorn . topel
From: Björn Töpel Hi! This short series teaches ss about AF_XDP monitoring support using the sock_diag interface. The AF_XDP monitoring support was merged to kernel in commit dbbd79ae166f ("Merge branch 'af-xdp-sock-diag'"), via the bpf-next tree. Note libc has to know about AF_XDP for iproute

[PATCH bpf-next v2 2/3] xsk: add id to umem

2019-01-24 Thread bjorn . topel
From: Björn Töpel This commit adds an id to the umem structure. The id uniquely identifies a umem instance, and will be exposed to user-space via the socket monitoring interface. Signed-off-by: Björn Töpel --- include/net/xdp_sock.h | 1 + net/xdp/xdp_umem.c | 13 + 2 files ch

[PATCH bpf-next v2 3/3] xsk: add sock_diag interface for AF_XDP

2019-01-24 Thread bjorn . topel
From: Björn Töpel This patch adds the sock_diag interface for querying sockets from user space. Tools like iproute2 ss(8) can use this interface to list open AF_XDP sockets. The user-space ABI is defined in linux/xdp_diag.h and includes netlink request and response structs. The request can query

[PATCH bpf-next v2 1/3] net: xsk: track AF_XDP sockets on a per-netns list

2019-01-24 Thread bjorn . topel
From: Björn Töpel Track each AF_XDP socket in a per-netns list. This will be used later by the sock_diag interface for querying sockets from userspace. Signed-off-by: Björn Töpel --- include/net/net_namespace.h | 4 include/net/netns/xdp.h | 13 + net/xdp/xsk.c

[PATCH bpf-next v2 0/3] AF_XDP: add socket monitoring support

2019-01-24 Thread bjorn . topel
From: Björn Töpel This series adds an AF_XDP sock_diag interface for querying sockets from user-space. Tools like iproute2 ss(8) can use this interface to list open AF_XDP sockets. The diagnostic provides information about the Rx/Tx/fill/completetion rings, umem, memory usage and such. For a com

[PATCH] i40e: replace switch-statement with if-clause

2019-01-21 Thread bjorn . topel
From: Björn Töpel GCC will generate jump tables for switch-statements with more than 5 case statements. An entry into the jump table is an indirect call, which means that for CONFIG_RETPOLINE builds, this is rather expensive. This commit replaces the switch-statement that acts on the XDP program

[PATCH bpf-next 3/3] xsk: add sock_diag interface for AF_XDP

2019-01-18 Thread bjorn . topel
From: Björn Töpel This patch adds the sock_diag interface for querying sockets from user space. Tools like iproute2 ss(8) can use this interface to list open AF_XDP sockets. The user-space ABI is defined in linux/xdp_diag.h and includes netlink request and response structs. The request can query

[PATCH bpf-next 1/3] net: xsk: track AF_XDP sockets on a per-netns list

2019-01-18 Thread bjorn . topel
From: Björn Töpel Track each AF_XDP socket in a per-netns list. This will be used later by the sock_diag interface for querying sockets from userspace. Signed-off-by: Björn Töpel --- include/net/net_namespace.h | 4 include/net/netns/xdp.h | 13 + net/xdp/xsk.c

[PATCH bpf-next 2/3] xsk: add id to umem

2019-01-18 Thread bjorn . topel
From: Björn Töpel This commit adds an id to the umem structure. The id uniquely identifies a umem instance, and will be exposed to user-space via the socket monitoring interface. Signed-off-by: Björn Töpel --- include/net/xdp_sock.h | 1 + net/xdp/xdp_umem.c | 13 + 2 files ch

[PATCH bpf-next 0/3] AF_XDP: add socket monitoring support

2019-01-18 Thread bjorn . topel
From: Björn Töpel This series adds an AF_XDP sock_diag interface for querying sockets from user-space. Tools like iproute2 ss(8) can use this interface to list open AF_XDP sockets. The diagnostic provides information about the Rx/Tx/fill/completetion rings, umem, memory usage and such. For a com

[PATCH bpf-next] xsk: simplify AF_XDP socket teardown

2018-12-19 Thread bjorn . topel
From: Björn Töpel Prior this commit, when the struct socket object was being released, the UMEM did not have its reference count decreased. Instead, this was done in the struct sock sk_destruct function. There is no reason to keep the UMEM reference around when the socket is being orphaned, so i