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-prev] [day] [month] [year] [list]
Date:   Tue, 5 May 2020 11:50:13 -0700
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Stanislav Fomichev <sdf@...gle.com>
Cc:     Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrey Ignatov <rdna@...com>
Subject: Re: [PATCH bpf-next 1/4] selftests/bpf: generalize helpers to control
 backround listener

On Tue, May 5, 2020 at 9:08 AM <sdf@...gle.com> wrote:
>
> On 05/04, Andrii Nakryiko wrote:
> > On Mon, May 4, 2020 at 10:37 AM Stanislav Fomichev <sdf@...gle.com> wrote:
> > >
> > > Move the following routines that let us start a background listener
> > > thread and connect to a server by fd to the test_prog:
> > > * start_server_thread - start background INADDR_ANY thread
> > > * stop_server_thread - stop the thread
> > > * connect_to_fd - connect to the server identified by fd
> > >
> > > These will be used in the next commit.
> > >
> > > Also, extend these helpers to support AF_INET6 and accept the family
> > > as an argument.
> > >
> > > Cc: Andrey Ignatov <rdna@...com>
> > > Signed-off-by: Stanislav Fomichev <sdf@...gle.com>
> > > ---
> > >  .../selftests/bpf/prog_tests/tcp_rtt.c        | 115 +--------------
> > >  tools/testing/selftests/bpf/test_progs.c      | 138 ++++++++++++++++++
> > >  tools/testing/selftests/bpf/test_progs.h      |   3 +
> > >  3 files changed, 144 insertions(+), 112 deletions(-)
>
> > Can this functionality be moved into a separate file, similar to
> > cgroup_helpers.{c.h}? This doesn't seem like helper routines needed
> > for most tests, so it doesn't make sense to me to keep piling
> > everything into test_progs.{c,h}.
> test_progs_helpers.{c,h}? And maybe move existing helpers like
> bpf_find_map, spin_lock_thread, etc in there?

bpf_find_map is generic enough, I'd leave it in test_progs.c, at least
for now. spin_lock_thread is used in just two files, I'd just put it
(copy/pasted) in those two and remove it from test_progs. But that can
be done separately.

As for these new functions, they are network-specific, so I'd just add
a new network_helpers.c or something along those lines.




>
> Or do you think that these networking helpers should be completely
> independent
> from test_progs?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ