Skip to contentSkip to conversation

bpf: Network Resource Manager (NRM)

PATCH Superseded brakmo 2 participants 2 messages Feb 19, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

brakmo

author
#0 lore raw

cover bpf: Network Resource Manager (NRM)

Network Resource Manager is a framework for limiting the bandwidth used by v2 cgroups. It consists of 4 BPF helpers and a sample BPF program to limit egress bandwdith as well as a sample user program and script to simplify NRM testing.

The sample NRM BPF program is not meant to be production quality, it is provided as proof of concept. A lot more information, including sample runs in some cases, are provided in the commit messages of the individual patches.

Two more BPF programs, one to limit ingress and one that limits egress and uses fq's Earliest Departure Time feature, will be provided in an upcomming patchset.

brakmo (9):
bpf: Add bpf helper bpf_tcp_enter_cwr
bpf: Test bpf_tcp_enter_cwr in test_verifier
bpf: add bpf helper bpf_skb_set_ecn
bpf: Add bpf helper bpf_tcp_check_probe_timer
bpf: sync bpf.h to tools and update bpf_helpers.h
bpf: Sample program to load cg skb BPF programs
bpf: Sample NRM BPF program to limit egress bw
bpf: User program for testing NRM
bpf: NRM test script

 include/linux/bpf.h                         |   1 +
 include/uapi/linux/bpf.h                    |  27 +-
 kernel/bpf/verifier.c                       |   4 +
 net/core/filter.c                           |  70 ++++
 samples/bpf/Makefile                        |   7 +
 samples/bpf/do_nrm_test.sh                  | 429 +++++++++++++++++++
 samples/bpf/load_cg_skb.c                   | 109 +++++
 samples/bpf/nrm.c                           | 439 ++++++++++++++++++++
 samples/bpf/nrm.h                           |  31 ++
 samples/bpf/nrm_kern.h                      | 109 +++++
 samples/bpf/nrm_out_kern.c                  | 213 ++++++++++
 tools/include/uapi/linux/bpf.h              |  27 +-
 tools/testing/selftests/bpf/bpf_helpers.h   |   6 +
 tools/testing/selftests/bpf/verifier/sock.c |  33 ++
 14 files changed, 1503 insertions(+), 2 deletions(-)
 create mode 100755 samples/bpf/do_nrm_test.sh
 create mode 100644 samples/bpf/load_cg_skb.c
 create mode 100644 samples/bpf/nrm.c
 create mode 100644 samples/bpf/nrm.h
 create mode 100644 samples/bpf/nrm_kern.h
 create mode 100644 samples/bpf/nrm_out_kern.c
Signature · 1 line
2.17.1
#1 lore raw
Quoted 38 lines · brakmo

Network Resource Manager is a framework for limiting the bandwidth used by v2 cgroups. It consists of 4 BPF helpers and a sample BPF program to limit egress bandwdith as well as a sample user program and script to simplify NRM testing.

The sample NRM BPF program is not meant to be production quality, it is provided as proof of concept. A lot more information, including sample runs in some cases, are provided in the commit messages of the individual patches.

Two more BPF programs, one to limit ingress and one that limits egress and uses fq's Earliest Departure Time feature, will be provided in an upcomming patchset.

brakmo (9):
bpf: Add bpf helper bpf_tcp_enter_cwr
bpf: Test bpf_tcp_enter_cwr in test_verifier
bpf: add bpf helper bpf_skb_set_ecn
bpf: Add bpf helper bpf_tcp_check_probe_timer
bpf: sync bpf.h to tools and update bpf_helpers.h
bpf: Sample program to load cg skb BPF programs
bpf: Sample NRM BPF program to limit egress bw
bpf: User program for testing NRM
bpf: NRM test script

 include/linux/bpf.h                         |   1 +
 include/uapi/linux/bpf.h                    |  27 +-
 kernel/bpf/verifier.c                       |   4 +
 net/core/filter.c                           |  70 ++++
 samples/bpf/Makefile                        |   7 +
 samples/bpf/do_nrm_test.sh                  | 429 +++++++++++++++++++
 samples/bpf/load_cg_skb.c                   | 109 +++++
 samples/bpf/nrm.c                           | 439 ++++++++++++++++++++
 samples/bpf/nrm.h                           |  31 ++
 samples/bpf/nrm_kern.h                      | 109 +++++
 samples/bpf/nrm_out_kern.c                  | 213 ++++++++++
 tools/include/uapi/linux/bpf.h              |  27 +-
 tools/testing/selftests/bpf/bpf_helpers.h   |   6 +
Quoted 8 lines
 tools/testing/selftests/bpf/verifier/sock.c |  33 ++
 14 files changed, 1503 insertions(+), 2 deletions(-)
 create mode 100755 samples/bpf/do_nrm_test.sh
 create mode 100644 samples/bpf/load_cg_skb.c
 create mode 100644 samples/bpf/nrm.c
 create mode 100644 samples/bpf/nrm.h
 create mode 100644 samples/bpf/nrm_kern.h
 create mode 100644 samples/bpf/nrm_out_kern.c

Looks okay to me modulo few minor comments, but lets also Cc TCP maintainers to given them a chance to comment/ACK helper functions.

Thanks,
Daniel