.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* net/sched/sch_ingress.c - Ingress and clsact qdisc |
---|
2 | | - * |
---|
3 | | - * This program is free software; you can redistribute it and/or |
---|
4 | | - * modify it under the terms of the GNU General Public License |
---|
5 | | - * as published by the Free Software Foundation; either version |
---|
6 | | - * 2 of the License, or (at your option) any later version. |
---|
7 | 3 | * |
---|
8 | 4 | * Authors: Jamal Hadi Salim 1999 |
---|
9 | 5 | */ |
---|
.. | .. |
---|
82 | 78 | { |
---|
83 | 79 | struct ingress_sched_data *q = qdisc_priv(sch); |
---|
84 | 80 | struct net_device *dev = qdisc_dev(sch); |
---|
| 81 | + int err; |
---|
85 | 82 | |
---|
86 | 83 | net_inc_ingress_queue(); |
---|
87 | 84 | |
---|
88 | 85 | mini_qdisc_pair_init(&q->miniqp, sch, &dev->miniq_ingress); |
---|
89 | 86 | |
---|
90 | | - q->block_info.binder_type = TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS; |
---|
| 87 | + q->block_info.binder_type = FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS; |
---|
91 | 88 | q->block_info.chain_head_change = clsact_chain_head_change; |
---|
92 | 89 | q->block_info.chain_head_change_priv = &q->miniqp; |
---|
93 | 90 | |
---|
94 | | - return tcf_block_get_ext(&q->block, sch, &q->block_info, extack); |
---|
| 91 | + err = tcf_block_get_ext(&q->block, sch, &q->block_info, extack); |
---|
| 92 | + if (err) |
---|
| 93 | + return err; |
---|
| 94 | + |
---|
| 95 | + mini_qdisc_pair_block_init(&q->miniqp, q->block); |
---|
| 96 | + |
---|
| 97 | + return 0; |
---|
95 | 98 | } |
---|
96 | 99 | |
---|
97 | 100 | static void ingress_destroy(struct Qdisc *sch) |
---|
.. | .. |
---|
106 | 109 | { |
---|
107 | 110 | struct nlattr *nest; |
---|
108 | 111 | |
---|
109 | | - nest = nla_nest_start(skb, TCA_OPTIONS); |
---|
| 112 | + nest = nla_nest_start_noflag(skb, TCA_OPTIONS); |
---|
110 | 113 | if (nest == NULL) |
---|
111 | 114 | goto nla_put_failure; |
---|
112 | 115 | |
---|
.. | .. |
---|
118 | 121 | } |
---|
119 | 122 | |
---|
120 | 123 | static const struct Qdisc_class_ops ingress_class_ops = { |
---|
| 124 | + .flags = QDISC_CLASS_OPS_DOIT_UNLOCKED, |
---|
121 | 125 | .leaf = ingress_leaf, |
---|
122 | 126 | .find = ingress_find, |
---|
123 | 127 | .walk = ingress_walk, |
---|
.. | .. |
---|
220 | 224 | |
---|
221 | 225 | mini_qdisc_pair_init(&q->miniqp_ingress, sch, &dev->miniq_ingress); |
---|
222 | 226 | |
---|
223 | | - q->ingress_block_info.binder_type = TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS; |
---|
| 227 | + q->ingress_block_info.binder_type = FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS; |
---|
224 | 228 | q->ingress_block_info.chain_head_change = clsact_chain_head_change; |
---|
225 | 229 | q->ingress_block_info.chain_head_change_priv = &q->miniqp_ingress; |
---|
226 | 230 | |
---|
.. | .. |
---|
229 | 233 | if (err) |
---|
230 | 234 | return err; |
---|
231 | 235 | |
---|
| 236 | + mini_qdisc_pair_block_init(&q->miniqp_ingress, q->ingress_block); |
---|
| 237 | + |
---|
232 | 238 | mini_qdisc_pair_init(&q->miniqp_egress, sch, &dev->miniq_egress); |
---|
233 | 239 | |
---|
234 | | - q->egress_block_info.binder_type = TCF_BLOCK_BINDER_TYPE_CLSACT_EGRESS; |
---|
| 240 | + q->egress_block_info.binder_type = FLOW_BLOCK_BINDER_TYPE_CLSACT_EGRESS; |
---|
235 | 241 | q->egress_block_info.chain_head_change = clsact_chain_head_change; |
---|
236 | 242 | q->egress_block_info.chain_head_change_priv = &q->miniqp_egress; |
---|
237 | 243 | |
---|
.. | .. |
---|
250 | 256 | } |
---|
251 | 257 | |
---|
252 | 258 | static const struct Qdisc_class_ops clsact_class_ops = { |
---|
| 259 | + .flags = QDISC_CLASS_OPS_DOIT_UNLOCKED, |
---|
253 | 260 | .leaf = ingress_leaf, |
---|
254 | 261 | .find = clsact_find, |
---|
255 | 262 | .walk = ingress_walk, |
---|