File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,10 @@ struct cls_bpf_prog {
49
49
struct sock_filter * bpf_ops ;
50
50
const char * bpf_name ;
51
51
struct tcf_proto * tp ;
52
- struct rcu_head rcu ;
52
+ union {
53
+ struct work_struct work ;
54
+ struct rcu_head rcu ;
55
+ };
53
56
};
54
57
55
58
static const struct nla_policy bpf_policy [TCA_BPF_MAX + 1 ] = {
@@ -257,9 +260,21 @@ static void __cls_bpf_delete_prog(struct cls_bpf_prog *prog)
257
260
kfree (prog );
258
261
}
259
262
263
+ static void cls_bpf_delete_prog_work (struct work_struct * work )
264
+ {
265
+ struct cls_bpf_prog * prog = container_of (work , struct cls_bpf_prog , work );
266
+
267
+ rtnl_lock ();
268
+ __cls_bpf_delete_prog (prog );
269
+ rtnl_unlock ();
270
+ }
271
+
260
272
static void cls_bpf_delete_prog_rcu (struct rcu_head * rcu )
261
273
{
262
- __cls_bpf_delete_prog (container_of (rcu , struct cls_bpf_prog , rcu ));
274
+ struct cls_bpf_prog * prog = container_of (rcu , struct cls_bpf_prog , rcu );
275
+
276
+ INIT_WORK (& prog -> work , cls_bpf_delete_prog_work );
277
+ tcf_queue_work (& prog -> work );
263
278
}
264
279
265
280
static void __cls_bpf_delete (struct tcf_proto * tp , struct cls_bpf_prog * prog )
You can’t perform that action at this time.
0 commit comments