Commit 4b7477f0 authored by Zhengchao Shao's avatar Zhengchao Shao Committed by Paolo Abeni

net: sched: using TCQ_MIN_PRIO_BANDS in prio_tune()

Using TCQ_MIN_PRIO_BANDS instead of magic number in prio_tune().
Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
Acked-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Link: https://lore.kernel.org/r/20220826041035.80129-1-shaozhengchao@huawei.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent e79e40c8
...@@ -185,7 +185,7 @@ static int prio_tune(struct Qdisc *sch, struct nlattr *opt, ...@@ -185,7 +185,7 @@ static int prio_tune(struct Qdisc *sch, struct nlattr *opt,
return -EINVAL; return -EINVAL;
qopt = nla_data(opt); qopt = nla_data(opt);
if (qopt->bands > TCQ_PRIO_BANDS || qopt->bands < 2) if (qopt->bands > TCQ_PRIO_BANDS || qopt->bands < TCQ_MIN_PRIO_BANDS)
return -EINVAL; return -EINVAL;
for (i = 0; i <= TC_PRIO_MAX; i++) { for (i = 0; i <= TC_PRIO_MAX; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment