History

bpf: Document BPF_PROG_TEST_RUN syscall command

Based on a brief read of the corresponding source code.

Joe Stringer committed 5 years ago

Commit 2a3fdca1 parent 32e76b11 file · +11 −3Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/bpf.h+11−3
@@ -306,14 +306,22 @@ union bpf_iter_link_info { · 305 unmodified lines
306 *306 *
307 * BPF_PROG_TEST_RUN307 * BPF_PROG_TEST_RUN
308 * Description308 * Description
309 * Run an eBPF program a number of times against a provided309 * Run the eBPF program associated with the *prog_fd* a *repeat*
310 * program context and return the modified program context and310 * number of times against a provided program context *ctx_in* and
311 * duration of the test run.311 * data *data_in*, and return the modified program context
312 * *ctx_out*, *data_out* (for example, packet data), result of the
313 * execution *retval*, and *duration* of the test run.
312 *314 *
313 * Return315 * Return
314 * Returns zero on success. On error, -1 is returned and *errno*316 * Returns zero on success. On error, -1 is returned and *errno*
315 * is set appropriately.317 * is set appropriately.
316 *318 *
319 * **ENOSPC**
320 * Either *data_size_out* or *ctx_size_out* is too small.
321 * **ENOTSUPP**
322 * This command is not supported by the program type of
323 * the program referred to by *prog_fd*.
324 *
317 * BPF_PROG_GET_NEXT_ID325 * BPF_PROG_GET_NEXT_ID
318 * Description326 * Description
319 * Fetch the next eBPF program currently loaded into the kernel.327 * Fetch the next eBPF program currently loaded into the kernel.