hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/sched/sch_ingress.c
....@@ -80,6 +80,9 @@
8080 struct net_device *dev = qdisc_dev(sch);
8181 int err;
8282
83
+ if (sch->parent != TC_H_INGRESS)
84
+ return -EOPNOTSUPP;
85
+
8386 net_inc_ingress_queue();
8487
8588 mini_qdisc_pair_init(&q->miniqp, sch, &dev->miniq_ingress);
....@@ -100,6 +103,9 @@
100103 static void ingress_destroy(struct Qdisc *sch)
101104 {
102105 struct ingress_sched_data *q = qdisc_priv(sch);
106
+
107
+ if (sch->parent != TC_H_INGRESS)
108
+ return;
103109
104110 tcf_block_put_ext(q->block, sch, &q->block_info);
105111 net_dec_ingress_queue();
....@@ -134,7 +140,7 @@
134140 .cl_ops = &ingress_class_ops,
135141 .id = "ingress",
136142 .priv_size = sizeof(struct ingress_sched_data),
137
- .static_flags = TCQ_F_CPUSTATS,
143
+ .static_flags = TCQ_F_INGRESS | TCQ_F_CPUSTATS,
138144 .init = ingress_init,
139145 .destroy = ingress_destroy,
140146 .dump = ingress_dump,
....@@ -219,6 +225,9 @@
219225 struct net_device *dev = qdisc_dev(sch);
220226 int err;
221227
228
+ if (sch->parent != TC_H_CLSACT)
229
+ return -EOPNOTSUPP;
230
+
222231 net_inc_ingress_queue();
223232 net_inc_egress_queue();
224233
....@@ -248,6 +257,9 @@
248257 {
249258 struct clsact_sched_data *q = qdisc_priv(sch);
250259
260
+ if (sch->parent != TC_H_CLSACT)
261
+ return;
262
+
251263 tcf_block_put_ext(q->egress_block, sch, &q->egress_block_info);
252264 tcf_block_put_ext(q->ingress_block, sch, &q->ingress_block_info);
253265
....@@ -269,7 +281,7 @@
269281 .cl_ops = &clsact_class_ops,
270282 .id = "clsact",
271283 .priv_size = sizeof(struct clsact_sched_data),
272
- .static_flags = TCQ_F_CPUSTATS,
284
+ .static_flags = TCQ_F_INGRESS | TCQ_F_CPUSTATS,
273285 .init = clsact_init,
274286 .destroy = clsact_destroy,
275287 .dump = ingress_dump,