netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "YU, Xiangning" <xiangning.yu@alibaba-inc.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/2] net: sched: Lockless Token Bucket (LTB) Qdisc
Date: Mon, 6 Jul 2020 11:37:38 -0700	[thread overview]
Message-ID: <20200706113738.5a5fdf7d@hermes.lan> (raw)
In-Reply-To: <28bff9d7-fa2d-5284-f6d5-e08cd792c9c6@alibaba-inc.com>

On Tue, 07 Jul 2020 02:08:13 +0800
"YU, Xiangning" <xiangning.yu@alibaba-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.

  parent reply	other threads:[~2020-07-06 18:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06 18:08 [PATCH net-next 2/2] net: sched: Lockless Token Bucket (LTB) Qdisc YU, Xiangning
2020-07-06 18:32 ` Stephen Hemminger
2020-07-06 18:37 ` Stephen Hemminger [this message]
2020-07-06 19:56   ` YU, Xiangning
2020-07-06 20:10 ` Cong Wang
2020-07-06 20:34   ` YU, Xiangning
2020-07-07 20:06     ` Cong Wang
2020-07-07 21:24       ` YU, Xiangning
2020-07-08 20:24         ` Cong Wang
2020-07-08 21:07           ` YU, Xiangning
2020-07-10  5:04             ` Cong Wang
2020-07-10  5:20               ` Cong Wang
2020-07-10  6:06                 ` YU, Xiangning
2020-07-10  6:21                   ` Cong Wang
2020-07-10 18:01                     ` YU, Xiangning
2020-07-10  5:48               ` YU, Xiangning
2020-07-10  6:09                 ` Cong Wang
2020-07-10 17:03                   ` YU, Xiangning
2020-07-06 20:29 ` David Miller
2020-07-06 22:08   ` YU, Xiangning
2020-07-07 15:42 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200706113738.5a5fdf7d@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    --cc=xiangning.yu@alibaba-inc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).