Skip to content

bpf: per-cpu cgroup local storage

Roman Gushchin lkml netdev 4 versions – Applied

Status from this message: Applied to bpf-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest10 patches 1 replyApplied
  2. v310 patches 11 repliesApplied
  3. v210 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v19 patches3 repliesSuperseded

v4->v3 from the cover letter

1) incorporated Alexei's feedback

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/10bpf: extend cgroup bpf core to allow multiple cgroup storage typesinclude/linux/bpf-cgroup.h include/linux/bpf.h kernel/bpf/cgroup.c +5 more+136 -570 replies
2/10bpf: rework cgroup storage pointer passinginclude/linux/bpf-cgroup.h kernel/bpf/helpers.c kernel/bpf/local_storage.c+12 -120 replies
3/10bpf: introduce per-cpu cgroup local storageinclude/linux/bpf-cgroup.h include/linux/bpf.h include/linux/bpf_types.h +5 more+179 -280 replies
4/10bpf: don't allow create maps of per-cpu cgroup local storageskernel/bpf/map_in_map.c+2 -10 replies
5/10bpf: sync include/uapi/linux/bpf.h to tools/include/uapi/linux/bpf.htools/include/uapi/linux/bpf.h+1 -00 replies
6/10bpftool: add support for PERCPU_CGROUP_STORAGE mapstools/bpf/bpftool/map.c+3 -10 replies
7/10selftests/bpf: add verifier per-cpu cgroup storage teststools/testing/selftests/bpf/test_verifier.c+133 -60 replies
8/10selftests/bpf: extend the storage test to test per-cpu cgroup storagetools/testing/selftests/bpf/test_cgroup_storage.c+57 -30 replies
9/10samples/bpf: extend test_cgrp2_attach2 test to use per-cpu cgroup storagesamples/bpf/test_cgrp2_attach2.c+18 -10 replies
10/10selftests/bpf: cgroup local storage-based network counterstools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/netcnt_common.h tools/testing/selftests/bpf/netcnt_prog.c +1 more+257 -20 replies

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by.

PatchSong LiuJakub Kicinski
1/10A-b
2/10A-b
3/10A-b
4/10A-b
5/10A-b
6/10A-b A-b
7/10A-b
8/10A-b
9/10A-b
10/10A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 bpf-next 00/10] bpf: per-cpu cgroup local storage

This patchset implements per-cpu cgroup local storage and provides an example how per-cpu and shared cgroup local storage can be used for efficient accounting of network traffic.

v4->v3:
1) incorporated Alexei's feedback

v3->v2:
1) incorporated Song's feedback
2) rebased on top of current bpf-next

v2->v1:
1) added a selftest implementing network counters
2) added a missing free() in cgroup local storage selftest

Roman Gushchin (10):
bpf: extend cgroup bpf core to allow multiple cgroup storage types
bpf: rework cgroup storage pointer passing
bpf: introduce per-cpu cgroup local storage
bpf: don't allow create maps of per-cpu cgroup local storages
bpf: sync include/uapi/linux/bpf.h to tools/include/uapi/linux/bpf.h
bpftool: add support for PERCPU_CGROUP_STORAGE maps selftests/bpf: add verifier per-cpu cgroup storage tests selftests/bpf: extend the storage test to test per-cpu cgroup storage samples/bpf: extend test_cgrp2_attach2 test to use per-cpu cgroup
storage
selftests/bpf: cgroup local storage-based network counters

 include/linux/bpf-cgroup.h                    |  55 ++++--
 include/linux/bpf.h                           |  12 +-
 include/linux/bpf_types.h                     |   1 +
 include/uapi/linux/bpf.h                      |   1 +
 kernel/bpf/cgroup.c                           |  74 +++++---
 kernel/bpf/helpers.c                          |  25 ++-
 kernel/bpf/local_storage.c                    | 169 +++++++++++++++---
 kernel/bpf/map_in_map.c                       |   3 +-
 kernel/bpf/syscall.c                          |  20 ++-
 kernel/bpf/verifier.c                         |  23 ++-
 net/bpf/test_run.c                            |  20 ++-
 samples/bpf/test_cgrp2_attach2.c              |  19 +-
 tools/bpf/bpftool/map.c                       |   4 +-
 tools/include/uapi/linux/bpf.h                |   1 +
 tools/testing/selftests/bpf/Makefile          |   6 +-
 tools/testing/selftests/bpf/netcnt_common.h   |  24 +++
 tools/testing/selftests/bpf/netcnt_prog.c     |  71 ++++++++
 .../selftests/bpf/test_cgroup_storage.c       |  60 ++++++-
 tools/testing/selftests/bpf/test_netcnt.c     | 158 ++++++++++++++++
 tools/testing/selftests/bpf/test_verifier.c   | 139 +++++++++++++-
 20 files changed, 786 insertions(+), 99 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/netcnt_common.h
 create mode 100644 tools/testing/selftests/bpf/netcnt_prog.c
 create mode 100644 tools/testing/selftests/bpf/test_netcnt.c
Signature · 1 line
2.17.1