On 12/14/23 22:02, Martin KaFai Lau wrote:
On 12/8/23 4:27 PM, thinker.li@xxxxxxxxx wrote:
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index c5c7cc4552f5..7384806ee74e 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -3321,4 +3321,16 @@ static inline bool bpf_is_subprog(const struct
bpf_prog *prog)
return prog->aux->func_idx != 0;
}
+enum bpf_struct_ops_state {
+ BPF_STRUCT_OPS_STATE_INIT,
+ BPF_STRUCT_OPS_STATE_INUSE,
+ BPF_STRUCT_OPS_STATE_TOBEFREE,
+ BPF_STRUCT_OPS_STATE_READY,
+};
+
+struct bpf_struct_ops_common_value {
+ refcount_t refcnt;
+ enum bpf_struct_ops_state state;
+};
nit. Move these up closer to the existing 'struct bpf_struct_ops' and
related functions. Probably under 'struct bpf_struct_ops'.
Sure! I will move all following changes to the place closer to
struct bpf_struct_ops.