On 06/30, Jordan Rife wrote: > Prepare for bucket resume tests for established TCP sockets by creating > established sockets. Collect socket fds from connect() and accept() > sides and pass them to test cases. > > Signed-off-by: Jordan Rife <jordan@xxxxxxxx> > --- > .../bpf/prog_tests/sock_iter_batch.c | 83 ++++++++++++++++++- > 1 file changed, 79 insertions(+), 4 deletions(-) > > diff --git a/tools/testing/selftests/bpf/prog_tests/sock_iter_batch.c b/tools/testing/selftests/bpf/prog_tests/sock_iter_batch.c > index 4c145c5415f1..2b0504cb127b 100644 > --- a/tools/testing/selftests/bpf/prog_tests/sock_iter_batch.c > +++ b/tools/testing/selftests/bpf/prog_tests/sock_iter_batch.c > @@ -153,8 +153,66 @@ static void check_n_were_seen_once(int *fds, int fds_len, int n, > ASSERT_EQ(seen_once, n, "seen_once"); > } > > +static int accept_from_one(int *server_fds, int server_fds_len) > +{ > + int i = 0; > + int fd; > + [..] > + for (; i < server_fds_len; i++) { nit: move i=0 here?