[PATCH net-next] net: sched: using TCQ_MIN_PRIO_BANDS in prio_tune()

Zhengchao Shao posted 1 patch 3 years, 7 months ago
net/sched/sch_prio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH net-next] net: sched: using TCQ_MIN_PRIO_BANDS in prio_tune()
Posted by Zhengchao Shao 3 years, 7 months ago
Using TCQ_MIN_PRIO_BANDS instead of magic number in prio_tune().

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
 net/sched/sch_prio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index 3b8d7197c06b..fbbd4f7015be 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -187,7 +187,7 @@ static int prio_tune(struct Qdisc *sch, struct nlattr *opt,
 		return -EINVAL;
 	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;
 
 	for (i = 0; i <= TC_PRIO_MAX; i++) {
-- 
2.17.1
Re: [PATCH net-next] net: sched: using TCQ_MIN_PRIO_BANDS in prio_tune()
Posted by patchwork-bot+netdevbpf@kernel.org 3 years, 7 months ago
Hello:

This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Fri, 26 Aug 2022 12:10:35 +0800 you wrote:
> Using TCQ_MIN_PRIO_BANDS instead of magic number in prio_tune().
> 
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> ---
>  net/sched/sch_prio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] net: sched: using TCQ_MIN_PRIO_BANDS in prio_tune()
    https://git.kernel.org/netdev/net-next/c/4b7477f0921a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Re: [PATCH net-next] net: sched: using TCQ_MIN_PRIO_BANDS in prio_tune()
Posted by Cong Wang 3 years, 7 months ago
On Fri, Aug 26, 2022 at 12:10:35PM +0800, Zhengchao Shao wrote:
> Using TCQ_MIN_PRIO_BANDS instead of magic number in prio_tune().
> 
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>

Acked-by: Cong Wang <xiyou.wangcong@gmail.com>

Thanks.