lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 Jan 2016 23:56:52 +0800
From:	Ming Lei <tom.leiming@...il.com>
To:	linux-kernel@...r.kernel.org, Alexei Starovoitov <ast@...nel.org>
Cc:	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	Daniel Borkmann <daniel@...earbox.net>,
	Martin KaFai Lau <kafai@...com>
Subject: [PATCH 0/9] bpf: support percpu ARRAY map

Hi,

In case of ARRAY map, the index of the array is used as key
of the map, then inevitably the mapped element/value can be
accessed from more than one CPU concurrently, so expensive
atomic operations are often required in eBPF prog. And we can
see these usages in tracex3, sockex1 and sockex3 in sample/bpf/
of kernel tree.

This patchset trys to introduce percpu ARRAY map to address
the issue.

The 1st two patches prepares for supporting percpu map, and
introduces one file to hold the map common functions.

The following 3 patches introdues percpu version of update/
lookup element in bpf_map_ops, bpf helpers and syscall, so
that percpu value can be retrieved/updated from eBPF prog
and syscall. 

The 6th patch implements percpu array map.

The last 3 patches are changes in samples/bpf, and implements
test for perpcu array and converts to percpu array in sockex1
exmaple.

 include/linux/bpf.h        |  10 ++++
 include/uapi/linux/bpf.h   |  10 ++++
 kernel/bpf/Makefile        |   2 +-
 kernel/bpf/arraymap.c      | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++---------
 kernel/bpf/bpf_map.h       |  15 ++++++
 kernel/bpf/core.c          |   2 +
 kernel/bpf/hashtab.c       |   4 ++
 kernel/bpf/helpers.c       |  53 +++++++++++++++++++++
 kernel/bpf/map.c           |  43 +++++++++++++++++
 kernel/bpf/syscall.c       |  48 +++++++++++++++----
 net/core/filter.c          |   4 ++
 samples/bpf/bpf_helpers.h  |   5 ++
 samples/bpf/libbpf.c       |  42 +++++++++++++++++
 samples/bpf/libbpf.h       |   5 ++
 samples/bpf/sockex1_kern.c |   7 +--
 samples/bpf/sockex1_user.c |  20 ++++++--
 samples/bpf/test_maps.c    | 110 +++++++++++++++++++++++++++++++++++++++++++
 17 files changed, 493 insertions(+), 40 deletions(-)



thanks,
Ming


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ