samples/bpf: add a test for bpf_override_return
[linux-block.git] / tools / include / uapi / linux / bpf.h
index e880ae6434eed9eb29db99169c716c94c7cf30aa..cf446c25c0ec73326710ee49df6a1749d1c65d0c 100644 (file)
@@ -262,7 +262,7 @@ union bpf_attr {
                __u32           kern_version;   /* checked when prog_type=kprobe */
                __u32           prog_flags;
                char            prog_name[BPF_OBJ_NAME_LEN];
-               __u32           prog_target_ifindex;    /* ifindex of netdev to prep for */
+               __u32           prog_ifindex;   /* ifindex of netdev to prep for */
        };
 
        struct { /* anonymous struct used by BPF_OBJ_* commands */
@@ -677,6 +677,10 @@ union bpf_attr {
  *     @buf: buf to fill
  *     @buf_size: size of the buf
  *     Return : 0 on success or negative error code
+ *
+ * int bpf_override_return(pt_regs, rc)
+ *     @pt_regs: pointer to struct pt_regs
+ *     @rc: the return value to set
  */
 #define __BPF_FUNC_MAPPER(FN)          \
        FN(unspec),                     \
@@ -736,7 +740,8 @@ union bpf_attr {
        FN(xdp_adjust_meta),            \
        FN(perf_event_read_value),      \
        FN(perf_prog_read_value),       \
-       FN(getsockopt),
+       FN(getsockopt),                 \
+       FN(override_return),
 
 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
  * function eBPF program intends to call
@@ -897,10 +902,6 @@ enum sk_action {
 
 #define BPF_TAG_SIZE   8
 
-enum bpf_prog_status {
-       BPF_PROG_STATUS_DEV_BOUND       = (1 << 0),
-};
-
 struct bpf_prog_info {
        __u32 type;
        __u32 id;
@@ -914,8 +915,6 @@ struct bpf_prog_info {
        __u32 nr_map_ids;
        __aligned_u64 map_ids;
        char name[BPF_OBJ_NAME_LEN];
-       __u32 ifindex;
-       __u32 status;
 } __attribute__((aligned(8)));
 
 struct bpf_map_info {