Lines Matching refs:args

21 	u64 args[MAX_BPF_FUNC_ARGS];  member
31 struct bpf_dummy_ops_test_args *args; in dummy_ops_init_args() local
39 args = kzalloc(sizeof(*args), GFP_KERNEL); in dummy_ops_init_args()
40 if (!args) in dummy_ops_init_args()
44 if (copy_from_user(args->args, ctx_in, size_in)) in dummy_ops_init_args()
48 u_state = u64_to_user_ptr(args->args[0]); in dummy_ops_init_args()
49 if (u_state && copy_from_user(&args->state, u_state, in dummy_ops_init_args()
50 sizeof(args->state))) in dummy_ops_init_args()
53 return args; in dummy_ops_init_args()
55 kfree(args); in dummy_ops_init_args()
59 static int dummy_ops_copy_args(struct bpf_dummy_ops_test_args *args) in dummy_ops_copy_args() argument
63 u_state = u64_to_user_ptr(args->args[0]); in dummy_ops_copy_args()
64 if (u_state && copy_to_user(u_state, &args->state, sizeof(args->state))) in dummy_ops_copy_args()
70 static int dummy_ops_call_op(void *image, struct bpf_dummy_ops_test_args *args) in dummy_ops_call_op() argument
76 if (args->args[0]) in dummy_ops_call_op()
77 state = &args->state; in dummy_ops_call_op()
78 return test(state, args->args[1], args->args[2], in dummy_ops_call_op()
79 args->args[3], args->args[4]); in dummy_ops_call_op()
96 static int check_test_run_args(struct bpf_prog *prog, struct bpf_dummy_ops_test_args *args) in check_test_run_args() argument
106 if (args->args[arg_no] != 0) in check_test_run_args()
134 struct bpf_dummy_ops_test_args *args; in bpf_struct_ops_test_run() local
153 args = dummy_ops_init_args(kattr, btf_type_vlen(func_proto)); in bpf_struct_ops_test_run()
154 if (IS_ERR(args)) in bpf_struct_ops_test_run()
155 return PTR_ERR(args); in bpf_struct_ops_test_run()
157 err = check_test_run_args(prog, args); in bpf_struct_ops_test_run()
189 prog_ret = dummy_ops_call_op(image, args); in bpf_struct_ops_test_run()
191 err = dummy_ops_copy_args(args); in bpf_struct_ops_test_run()
197 kfree(args); in bpf_struct_ops_test_run()