| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* net/sched/sch_dsmark.c - Differentiated Services field marker */ |
|---|
| 2 | 3 | |
|---|
| 3 | 4 | /* Written 1998-2000 by Werner Almesberger, EPFL ICA */ |
|---|
| .. | .. |
|---|
| 132 | 133 | if (!opt) |
|---|
| 133 | 134 | goto errout; |
|---|
| 134 | 135 | |
|---|
| 135 | | - err = nla_parse_nested(tb, TCA_DSMARK_MAX, opt, dsmark_policy, NULL); |
|---|
| 136 | + err = nla_parse_nested_deprecated(tb, TCA_DSMARK_MAX, opt, |
|---|
| 137 | + dsmark_policy, NULL); |
|---|
| 136 | 138 | if (err < 0) |
|---|
| 137 | 139 | goto errout; |
|---|
| 138 | 140 | |
|---|
| .. | .. |
|---|
| 199 | 201 | static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch, |
|---|
| 200 | 202 | struct sk_buff **to_free) |
|---|
| 201 | 203 | { |
|---|
| 204 | + unsigned int len = qdisc_pkt_len(skb); |
|---|
| 202 | 205 | struct dsmark_qdisc_data *p = qdisc_priv(sch); |
|---|
| 203 | 206 | int err; |
|---|
| 204 | 207 | |
|---|
| .. | .. |
|---|
| 271 | 274 | return err; |
|---|
| 272 | 275 | } |
|---|
| 273 | 276 | |
|---|
| 274 | | - qdisc_qstats_backlog_inc(sch, skb); |
|---|
| 277 | + sch->qstats.backlog += len; |
|---|
| 275 | 278 | sch->q.qlen++; |
|---|
| 276 | 279 | |
|---|
| 277 | 280 | return NET_XMIT_SUCCESS; |
|---|
| .. | .. |
|---|
| 352 | 355 | if (err) |
|---|
| 353 | 356 | return err; |
|---|
| 354 | 357 | |
|---|
| 355 | | - err = nla_parse_nested(tb, TCA_DSMARK_MAX, opt, dsmark_policy, NULL); |
|---|
| 358 | + err = nla_parse_nested_deprecated(tb, TCA_DSMARK_MAX, opt, |
|---|
| 359 | + dsmark_policy, NULL); |
|---|
| 356 | 360 | if (err < 0) |
|---|
| 357 | 361 | goto errout; |
|---|
| 358 | 362 | |
|---|
| .. | .. |
|---|
| 404 | 408 | pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p); |
|---|
| 405 | 409 | if (p->q) |
|---|
| 406 | 410 | qdisc_reset(p->q); |
|---|
| 407 | | - sch->qstats.backlog = 0; |
|---|
| 408 | | - sch->q.qlen = 0; |
|---|
| 409 | 411 | } |
|---|
| 410 | 412 | |
|---|
| 411 | 413 | static void dsmark_destroy(struct Qdisc *sch) |
|---|
| .. | .. |
|---|
| 434 | 436 | tcm->tcm_handle = TC_H_MAKE(TC_H_MAJ(sch->handle), cl - 1); |
|---|
| 435 | 437 | tcm->tcm_info = p->q->handle; |
|---|
| 436 | 438 | |
|---|
| 437 | | - opts = nla_nest_start(skb, TCA_OPTIONS); |
|---|
| 439 | + opts = nla_nest_start_noflag(skb, TCA_OPTIONS); |
|---|
| 438 | 440 | if (opts == NULL) |
|---|
| 439 | 441 | goto nla_put_failure; |
|---|
| 440 | 442 | if (nla_put_u8(skb, TCA_DSMARK_MASK, p->mv[cl - 1].mask) || |
|---|
| .. | .. |
|---|
| 453 | 455 | struct dsmark_qdisc_data *p = qdisc_priv(sch); |
|---|
| 454 | 456 | struct nlattr *opts = NULL; |
|---|
| 455 | 457 | |
|---|
| 456 | | - opts = nla_nest_start(skb, TCA_OPTIONS); |
|---|
| 458 | + opts = nla_nest_start_noflag(skb, TCA_OPTIONS); |
|---|
| 457 | 459 | if (opts == NULL) |
|---|
| 458 | 460 | goto nla_put_failure; |
|---|
| 459 | 461 | if (nla_put_u16(skb, TCA_DSMARK_INDICES, p->indices)) |
|---|