diff options
| author | Lawrence Brakmo <brakmo@fb.com> | 2017-10-20 14:05:40 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-10-21 22:12:05 -0400 |
| commit | cd86d1fd21025fdd6daf23d1288da405e7ad0ec6 (patch) | |
| tree | b3c9cf105f588261cf2d7b03fd3a52a431cb76f9 /include/uapi/linux | |
| parent | e6546ef6d86d0fc38e0e84ccae80e641f3fc0087 (diff) | |
bpf: Adding helper function bpf_getsockops
Adding support for helper function bpf_getsockops to socket_ops BPF
programs. This patch only supports TCP_CONGESTION.
Signed-off-by: Vlad Vysotsky <vlad@cs.ucla.edu>
Acked-by: Lawrence Brakmo <brakmo@fb.com>
Acked-by: Alexei Starovoitov <ast@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/bpf.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 1aca744c220f..f650346aaa1a 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h | |||
| @@ -613,12 +613,22 @@ union bpf_attr { | |||
| 613 | * int bpf_setsockopt(bpf_socket, level, optname, optval, optlen) | 613 | * int bpf_setsockopt(bpf_socket, level, optname, optval, optlen) |
| 614 | * Calls setsockopt. Not all opts are available, only those with | 614 | * Calls setsockopt. Not all opts are available, only those with |
| 615 | * integer optvals plus TCP_CONGESTION. | 615 | * integer optvals plus TCP_CONGESTION. |
| 616 | * Supported levels: SOL_SOCKET and IPROTO_TCP | 616 | * Supported levels: SOL_SOCKET and IPPROTO_TCP |
| 617 | * @bpf_socket: pointer to bpf_socket | 617 | * @bpf_socket: pointer to bpf_socket |
| 618 | * @level: SOL_SOCKET or IPROTO_TCP | 618 | * @level: SOL_SOCKET or IPPROTO_TCP |
| 619 | * @optname: option name | 619 | * @optname: option name |
| 620 | * @optval: pointer to option value | 620 | * @optval: pointer to option value |
| 621 | * @optlen: length of optval in byes | 621 | * @optlen: length of optval in bytes |
| 622 | * Return: 0 or negative error | ||
| 623 | * | ||
| 624 | * int bpf_getsockopt(bpf_socket, level, optname, optval, optlen) | ||
| 625 | * Calls getsockopt. Not all opts are available. | ||
| 626 | * Supported levels: IPPROTO_TCP | ||
| 627 | * @bpf_socket: pointer to bpf_socket | ||
| 628 | * @level: IPPROTO_TCP | ||
| 629 | * @optname: option name | ||
| 630 | * @optval: pointer to option value | ||
| 631 | * @optlen: length of optval in bytes | ||
| 622 | * Return: 0 or negative error | 632 | * Return: 0 or negative error |
| 623 | * | 633 | * |
| 624 | * int bpf_skb_adjust_room(skb, len_diff, mode, flags) | 634 | * int bpf_skb_adjust_room(skb, len_diff, mode, flags) |
| @@ -721,7 +731,8 @@ union bpf_attr { | |||
| 721 | FN(sock_map_update), \ | 731 | FN(sock_map_update), \ |
| 722 | FN(xdp_adjust_meta), \ | 732 | FN(xdp_adjust_meta), \ |
| 723 | FN(perf_event_read_value), \ | 733 | FN(perf_event_read_value), \ |
| 724 | FN(perf_prog_read_value), | 734 | FN(perf_prog_read_value), \ |
| 735 | FN(getsockopt), | ||
| 725 | 736 | ||
| 726 | /* integer value in 'imm' field of BPF_CALL instruction selects which helper | 737 | /* integer value in 'imm' field of BPF_CALL instruction selects which helper |
| 727 | * function eBPF program intends to call | 738 | * function eBPF program intends to call |
