public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Lawrence Brakmo <brakmo@fb•com>
To: netdev <netdev@vger•kernel.org>
Cc: Kernel Team <kernel-team@fb•com>, Alexei Starovoitov <ast@fb•com>,
	Daniel Borkmann <daniel@iogearbox•net>,
	Blake Matheny <bmatheny@fb•com>, Lawrence Brakmo <brakmo@fb•com>
Subject: [PATCH net-next 5/5] bpf: create samples/bpf/tcp_bpf.readme
Date: Fri, 20 Oct 2017 11:05:43 -0700	[thread overview]
Message-ID: <20171020180543.4156833-6-brakmo@fb.com> (raw)
In-Reply-To: <20171020180543.4156833-1-brakmo@fb.com>

Readme file explaining how to create a cgroupv2 and attach one
of the tcp_*_kern.o socket_ops BPF program.

Signed-off-by: Lawrence Brakmo <brakmo@fb•com>
Acked-by: Daniel Borkmann <daniel@iogearbox•net>
Acked_by: Alexei Starovoitov <ast@fb•com>
---
 samples/bpf/tcp_bbf.readme | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 samples/bpf/tcp_bbf.readme

diff --git a/samples/bpf/tcp_bbf.readme b/samples/bpf/tcp_bbf.readme
new file mode 100644
index 0000000..3692056
--- /dev/null
+++ b/samples/bpf/tcp_bbf.readme
@@ -0,0 +1,27 @@
+This file describes how to run the tcp_*_kern.o tcp_bpf (or socket_ops)
+programs. These programs attach to a cgroupv2. The following commands create
+a cgroupv2 and attach a bash shell to the group.
+
+  mkdir -p /tmp/cgroupv2
+  mount -t cgroup2 none /tmp/cgroupv2
+  mkdir -p /tmp/cgroupv2/foo
+  bash
+  echo $$ >> /tmp/cgroupv2/foo/cgroup.procs
+
+Anything that runs under this shell belongs to the foo cgroupv2 To load
+(attach) one of the tcp_*_kern.o programs:
+
+  ./load_sock_ops -l /tmp/cgroupv2/foo tcp_basertt_kern.o
+
+If the "-l" flag is used, the load_sock_ops program will continue to run
+printing the BPF log buffer. The tcp_*_kern.o programs use special print
+functions to print logging information (if enabled by the ifdef).
+
+If using netperf/netserver to create traffic, you need to run them under the
+cgroupv2 to which the BPF programs are attached (i.e. under bash shell
+attached to the cgroupv2).
+
+To remove (unattach) a socket_ops BPF program from a cgroupv2:
+
+  ./load_sock_ops -r /tmp/cgroupv2/foo
+
-- 
2.9.5

  parent reply	other threads:[~2017-10-20 18:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-20 18:05 [PATCH net-next 0/5] bpf: add support for BASE_RTT Lawrence Brakmo
2017-10-20 18:05 ` [PATCH net-next 1/5] bpf: add support for BPF_SOCK_OPS_BASE_RTT Lawrence Brakmo
2017-10-20 18:05 ` [PATCH net-next 2/5] bpf: Adding helper function bpf_getsockops Lawrence Brakmo
2017-10-20 18:05 ` [PATCH net-next 3/5] bpf: Add BPF_SOCKET_OPS_BASE_RTT support to tcp_nv Lawrence Brakmo
2017-10-21 19:37   ` Alexei Starovoitov
2017-10-20 18:05 ` [PATCH net-next 4/5] bpf: sample BPF_SOCKET_OPS_BASE_RTT program Lawrence Brakmo
2017-10-20 18:05 ` Lawrence Brakmo [this message]
2017-10-22  2:12 ` [PATCH net-next 0/5] bpf: add support for BASE_RTT David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171020180543.4156833-6-brakmo@fb.com \
    --to=brakmo@fb$(echo .)com \
    --cc=ast@fb$(echo .)com \
    --cc=bmatheny@fb$(echo .)com \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=kernel-team@fb$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox