On 4/28/24 10:47 AM, Jordan Rife wrote:
Also, all this setup (and test) has to be done in a new netns. Anything blocking the kfunc in patch 2 using the current task netns instead of the init_net? Add nodad to the "ip -6 addr add...". just in case it may add unnecessary delay. This interface/address ping should not be needed. Other tests under prog_tests/ don't need this interface/address ping also.
I was able to make these changes.
Does it need a veth pair? The %s2 interface is not used.
Can it be done in lo alone?
I think it may be better to keep it as-is for now with the veth pair. It turns out that these BPF programs (progs/bind6_prog.c, progs/bind4_prog.c, and progs/connect4_prog.c) expect the veth pair setup with these names (test_sock_addr1, test_sock_addr2). We may be able to update the logic in these BPF programs to allow us to just use lo, but I'm not sure if we'd be losing out on important test coverage. Additionally, since we aren't fully retiring test_sock_addr.c yet we'd also need to change test_sock_addr.sh if we changed progs/bind6_prog.c, progs/bind4_prog.c, and progs/connect4_prog.c. If there are no objections to leaving things as-is here, I will send out v3 with the rest of the changes listed above.
Yep, the veth cleanup could be done when the test_sock_addr.c is fully retired. Thanks for checking.
For the tests that moved to sock_addr.c, please also remove them from test_sock_addr.c.