History

tools/lib/bpf: add support for BPF_PROG_TEST_RUN command

add support for BPF_PROG_TEST_RUN command to libbpf.a

Alexei Starovoitov committed 9 years ago

Commit 30848871 parent 1cf1cae3 files · +51 −1Browse files

Showing the changes to tools/include/uapi/linux (1 of 3 files). Show all

Unified · Split

tools/include/uapi/linux/bpf.h+24−0
@@ -81,6 +81,7 @@ enum bpf_cmd { · 80 unmodified lines
8181 BPF_OBJ_GET,
8282 BPF_PROG_ATTACH,
8383 BPF_PROG_DETACH,
84+ BPF_PROG_TEST_RUN,
8485 };
8586
8687 enum bpf_map_type {
@@ -189,6 +190,17 @@ union bpf_attr { · 102 unmodified lines
189190 __u32 attach_type;
190191 __u32 attach_flags;
191192 };
193+
194+ struct { /* anonymous struct used by BPF_PROG_TEST_RUN command */
195+ __u32 prog_fd;
196+ __u32 retval;
197+ __u32 data_size_in;
198+ __u32 data_size_out;
199+ __aligned_u64 data_in;
200+ __aligned_u64 data_out;
201+ __u32 repeat;
202+ __u32 duration;
203+ } test;
192204 } __attribute__((aligned(8)));
193205
194206 /* BPF helper function descriptions:
@@ -459,6 +471,18 @@ union bpf_attr { · 264 unmodified lines
459471 * Return:
460472 * > 0 length of the string including the trailing NUL on success
461473 * < 0 error
474+ *
475+ * u64 bpf_bpf_get_socket_cookie(skb)
476+ * Get the cookie for the socket stored inside sk_buff.
477+ * @skb: pointer to skb
478+ * Return: 8 Bytes non-decreasing number on success or 0 if the socket
479+ * field is missing inside sk_buff
480+ *
481+ * u32 bpf_get_socket_uid(skb)
482+ * Get the owner uid of the socket stored inside sk_buff.
483+ * @skb: pointer to skb
484+ * Return: uid of the socket owner on success or 0 if the socket pointer
485+ * inside sk_buff is NULL
462486 */
463487 #define __BPF_FUNC_MAPPER(FN) \
464488 FN(unspec), \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t