[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200706113738.5a5fdf7d@hermes.lan>
Date: Mon, 6 Jul 2020 11:37:38 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: "YU, Xiangning" <xiangning.yu@...baba-inc.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/2] net: sched: Lockless Token Bucket (LTB)
Qdisc
On Tue, 07 Jul 2020 02:08:13 +0800
"YU, Xiangning" <xiangning.yu@...baba-inc.com> wrote:
> +static inline int ltb_drain(struct ltb_class *cl)
> +{
> + typeof(&cl->drain_queue) queue;
> + struct sk_buff *skb;
> + int npkts, bytes;
> + unsigned long now = NOW();
> + int cpu;
> + struct ltb_sched *ltb = qdisc_priv(cl->root_qdisc);
> + struct ltb_pcpu_sched *pcpu_q;
> + s64 timestamp;
> + bool need_watchdog = false;
> + struct cpumask cpumask;
> +
> + npkts = 0;
> + bytes = 0;
It would be safer to use unsigned int for npkts and bytes.
These should never be negative.
Powered by blists - more mailing lists