aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/linux/bpf.txt10
-rw-r--r--sys/linux/bpf.txt.const6
-rw-r--r--sys/linux/test/bpf_helpers4
3 files changed, 12 insertions, 8 deletions
diff --git a/sys/linux/bpf.txt b/sys/linux/bpf.txt
index c66ab24b5..b0166b0cd 100644
--- a/sys/linux/bpf.txt
+++ b/sys/linux/bpf.txt
@@ -478,6 +478,7 @@ type bpf_insn_alu_t[CLASS_TYPE, CLASS, SOURCE_TYPE, SOURCE, OP_TYPE, OP, DST, SR
type bpf_insn_alu bpf_insn_alu_t[flags, bpf_alu_insn, flags, bpf_alu_source, flags, bpf_alu_op, flags[bpf_reg, int8:4], flags[bpf_reg, int8:4], flags[bpf_insn_offsets, int16], flags[bpf_insn_immediates, int32]]
type bpf_insn_mov_imm[DST, IMM] bpf_insn_alu_t[const, BPF_ALU64, const, BPF_K0, const, BPF_MOV0, const[DST, int8:4], const[0, int8:4], const[0, int16], const[IMM, int32]]
type bpf_insn_mov_imm_any[DST] bpf_insn_alu_t[const, BPF_ALU64, const, BPF_K0, const, BPF_MOV0, const[DST, int8:4], const[0, int8:4], const[0, int16], int32]
+type bpf_insn_mov_imm_flag[DST, FLAG] bpf_insn_alu_t[const, BPF_ALU64, const, BPF_K0, const, BPF_MOV0, const[DST, int8:4], const[0, int8:4], const[0, int16], flags[FLAG, int32]]
type bpf_insn_mov_reg[SRC, DST] bpf_insn_alu_t[const, BPF_ALU64, const, BPF_X0, const, BPF_MOV0, const[DST, int8:4], const[SRC, int8:4], const[0, int16], const[0, int32]]
type bpf_insn_op_imm[DST, OP, IMM] bpf_insn_alu_t[const, BPF_ALU64, const, BPF_K0, const, OP, const[DST, int8:4], const[0, int8:4], const[0, int16], const[IMM, int32]]
@@ -775,12 +776,12 @@ bpf_insn_ringbuf_reserve {
}
# (bf) r1 = r9
-# (b7) r2 = 0
+# (b7) r2 = BPF_RB_X
# (85) call bpf_ringbuf_{submit,discard}#322192
# (bf) r0 = 0
bpf_insn_ringbuf_free {
insn1 bpf_insn_mov_reg[BPF_REG_9, BPF_REG_1]
- insn2 bpf_insn_mov_imm[BPF_REG_2, 0]
+ insn2 bpf_insn_mov_imm_flag[BPF_REG_2, bpf_ringbuf_wakeup_flags]
insn3 bpf_insn_call_helper_t[flags[bpf_helpers_ringbuf_free, int32]]
insn4 bpf_insn_mov_imm[BPF_REG_0, 0]
}
@@ -802,7 +803,7 @@ bpf_insn_ringbuf_query {
# (bf) r2 = r10
# (07) r2 += -8
# (b7) r3 = 8
-# (b7) r4 = 0
+# (b7) r4 = BPF_RB_X
# (85) call bpf_ringbuf_output#322192
bpf_insn_ringbuf_output {
insn1 bpf_insn_tail_call_map_fd[BPF_REG_1]
@@ -811,7 +812,7 @@ bpf_insn_ringbuf_output {
insn4 bpf_insn_mov_reg[BPF_REG_10, BPF_REG_2]
insn5 bpf_insn_op_imm[BPF_REG_2, BPF_ADD0, -8]
insn6 bpf_insn_mov_imm[BPF_REG_3, 8]
- insn7 bpf_insn_mov_imm[BPF_REG_4, 0]
+ insn7 bpf_insn_mov_imm_flag[BPF_REG_4, bpf_ringbuf_wakeup_flags]
insn8 bpf_insn_call_helper_t[const[BPF_FUNC_ringbuf_output, int32]]
}
@@ -1285,3 +1286,4 @@ bpf_link_create_kprobe_multi_flags = BPF_F_KPROBE_MULTI_RETURN
nf_dev_hooks = NF_NETDEV_INGRESS, NF_NETDEV_EGRESS
bpf_link_create_netfilter_flags = BPF_F_NETFILTER_IP_DEFRAG
bpf_link_create_uprobe_multi_flags = BPF_F_UPROBE_MULTI_RETURN
+bpf_ringbuf_wakeup_flags = 0, BPF_RB_NO_WAKEUP, BPF_RB_FORCE_WAKEUP
diff --git a/sys/linux/bpf.txt.const b/sys/linux/bpf.txt.const
index 53cfb9bd7..6ce73ca73 100644
--- a/sys/linux/bpf.txt.const
+++ b/sys/linux/bpf.txt.const
@@ -66,11 +66,11 @@ BPF_EXIST = 2
BPF_EXIT0 = 9
BPF_FLOW_DISSECTOR = 17
BPF_FUNC_INFO_SIZE = 8
-BPF_FUNC_ringbuf_output = 130
BPF_FUNC_ringbuf_discard = 133
+BPF_FUNC_ringbuf_output = 130
+BPF_FUNC_ringbuf_query = 134
BPF_FUNC_ringbuf_reserve = 131
BPF_FUNC_ringbuf_submit = 132
-BPF_FUNC_ringbuf_query = 134
BPF_FUNC_snprintf = 165
BPF_FUNC_tail_call = 12
BPF_FUNC_trace_printk = 6
@@ -249,6 +249,8 @@ BPF_PSEUDO_MAP_FD = 1
BPF_PSEUDO_MAP_IDX = 5
BPF_PSEUDO_MAP_IDX_VALUE = 6
BPF_PSEUDO_MAP_VALUE = 2
+BPF_RB_FORCE_WAKEUP = 2
+BPF_RB_NO_WAKEUP = 1
BPF_REG_0 = 0
BPF_REG_1 = 1
BPF_REG_10 = 10
diff --git a/sys/linux/test/bpf_helpers b/sys/linux/test/bpf_helpers
index d45a468e3..1675071af 100644
--- a/sys/linux/test/bpf_helpers
+++ b/sys/linux/test/bpf_helpers
@@ -25,7 +25,7 @@ r4 = bpf$PROG_LOAD(AUTO, &AUTO={0x3, AUTO, &AUTO=@framed={{AUTO, AUTO, AUTO, AUT
r1 = bpf$MAP_CREATE_RINGBUF(AUTO, &AUTO={AUTO, AUTO, AUTO, 0x40000, AUTO, 0x0, 0x0, "00000000000000000000000000000000", 0x0, 0x0, 0x0, 0x0, 0x0, AUTO}, 0x48)
-r2 = bpf$PROG_LOAD(AUTO, &AUTO={0x3, AUTO, &AUTO=@ringbuf={{AUTO, AUTO, AUTO, AUTO, 0x0, AUTO, AUTO, AUTO, 0x0}, {{AUTO, AUTO, AUTO, AUTO, r1, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}}, {{AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO}}, [], {{AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, 0x84}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}}, {AUTO, AUTO, AUTO, AUTO}}, &AUTO='GPL\x00', 0x0, 0x0, 0x0, 0x0, 0x0, "00000000000000000000000000000000", 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, 0xa0)
+r2 = bpf$PROG_LOAD(AUTO, &AUTO={0x3, AUTO, &AUTO=@ringbuf={{AUTO, AUTO, AUTO, AUTO, 0x0, AUTO, AUTO, AUTO, 0x0}, {{AUTO, AUTO, AUTO, AUTO, r1, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}}, {{AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO}}, [], {{AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, 0x1}, {AUTO, AUTO, AUTO, 0x84}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}}, {AUTO, AUTO, AUTO, AUTO}}, &AUTO='GPL\x00', 0x0, 0x0, 0x0, 0x0, 0x0, "00000000000000000000000000000000", 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, 0xa0)
# Prepare, load, and execute a BPF program that calls bpf_ringbuf_query
@@ -33,4 +33,4 @@ r3 = bpf$PROG_LOAD(AUTO, &AUTO={0x3, AUTO, &AUTO=@framed={{AUTO, AUTO, AUTO, AUT
# Load, and execute a BPF program that calls bpf_ringbuf_output
-r3 = bpf$PROG_LOAD(AUTO, &AUTO={0x3, AUTO, &AUTO=@framed={{AUTO, AUTO, AUTO, AUTO, 0x0, AUTO, AUTO, AUTO, 0x0}, [@ringbuf_output={{AUTO, AUTO, AUTO, AUTO, r1, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, 0x1234}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO}}], {AUTO, AUTO, AUTO, AUTO}}, &AUTO='GPL\x00', 0x0, 0x0, 0x0, 0x0, 0x0, "00000000000000000000000000000000", 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, 0xa0)
+r3 = bpf$PROG_LOAD(AUTO, &AUTO={0x3, AUTO, &AUTO=@framed={{AUTO, AUTO, AUTO, AUTO, 0x0, AUTO, AUTO, AUTO, 0x0}, [@ringbuf_output={{AUTO, AUTO, AUTO, AUTO, r1, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, 0x1234}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, 0x2}, {AUTO, AUTO, AUTO, AUTO}}], {AUTO, AUTO, AUTO, AUTO}}, &AUTO='GPL\x00', 0x0, 0x0, 0x0, 0x0, 0x0, "00000000000000000000000000000000", 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, 0xa0)