Re: [net-next 1/1] samples: bpf: Refactor test_cgrp2_attach -- use getopt, and add mode
From: Alexei Starovoitov <hidden>
Date: 2016-11-29 03:50:28
From: Alexei Starovoitov <hidden>
Date: 2016-11-29 03:50:28
On Mon, Nov 28, 2016 at 02:52:42PM -0800, Sargun Dhillon wrote:
This patch modifies test_cgrp2_attach to use getopt so we can use standard command line parsing. It also adds an option to run the program in detach only mode. This does not attach a new filter at the cgroup, but only runs the detach command. Lastly, it changes the attach code to not detach and then attach. It relies on the 'hotswap' behaviour of CGroup BPF programs to be able to change in-place. If detach-then-attach behaviour needs to be tested, the example can be run in detach only mode prior to attachment. Signed-off-by: Sargun Dhillon <redacted>
looks fine to me. I'd really prefer this example to become an automated test eventually. Acked-by: Alexei Starovoitov <ast@kernel.org>