Re: [PATCH v1 bpf-next 1/8] selftests/bpf: Introduce sock_addr_testmod

2024-04-02 Thread Jordan Rife
Martin and Andrii, > This function can be made as a new kfunc in bpf_testmod.c. The > sock_create_kern() could be moved to here also. Take a look at the > register_btf_kfunc_id_set() usage in bpf_testmod.c and how those registered > kfunc(s) can be called by the bpf prog in progs/*. Thanks for th

Re: [PATCH v1 bpf-next 1/8] selftests/bpf: Introduce sock_addr_testmod

2024-04-02 Thread Martin KaFai Lau
On 3/29/24 12:18 PM, Jordan Rife wrote: +static int do_sock_op(int op, struct sockaddr *addr, int addrlen) This function can be made as a new kfunc in bpf_testmod.c. The sock_create_kern() could be moved to here also. Take a look at the register_btf_kfunc_id_set() usage in bpf_testmod.c and h

Re: [PATCH v1 bpf-next 1/8] selftests/bpf: Introduce sock_addr_testmod

2024-03-29 Thread Andrii Nakryiko
On Fri, Mar 29, 2024 at 12:20 PM Jordan Rife wrote: > > sock_addr_testmod provides a mechanism for the sock_addr_kern prog_test > to drive socket operations in kernel space. On init, one of the > following socket operations is performed based on the module parameters: > kernel_bind(), kernel_conne

[PATCH v1 bpf-next 1/8] selftests/bpf: Introduce sock_addr_testmod

2024-03-29 Thread Jordan Rife
sock_addr_testmod provides a mechanism for the sock_addr_kern prog_test to drive socket operations in kernel space. On init, one of the following socket operations is performed based on the module parameters: kernel_bind(), kernel_connect(), or sock_sendmsg()/kernel_sendmsg() and results are expose