All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH net-next 2/2] net: sched: Lockless Token Bucket (LTB) Qdisc
Date: Tue, 07 Jul 2020 23:42:24 +0800	[thread overview]
Message-ID: <202007072333.I0LhbbAo%lkp@intel.com> (raw)
In-Reply-To: <28bff9d7-fa2d-5284-f6d5-e08cd792c9c6@alibaba-inc.com>

[-- Attachment #1: Type: text/plain, Size: 4083 bytes --]

Hi Xiangning",

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/YU-Xiangning/Lockless-Token-Bucket-LTB-Qdisc/20200707-020918
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 5bd6ff0c6fe6c138aebe8d3bf7163420386c7ca7
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 02946de3802d3bc65bc9f2eb9b8d4969b5a7add8)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> net/sched/sch_ltb.c:832:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!opt)
               ^~~~
   net/sched/sch_ltb.c:882:9: note: uninitialized use occurs here
           return err;
                  ^~~
   net/sched/sch_ltb.c:832:2: note: remove the 'if' if its condition is always false
           if (!opt)
           ^~~~~~~~~
   net/sched/sch_ltb.c:830:9: note: initialize the variable 'err' to silence this warning
           int err;
                  ^
                   = 0
   1 warning generated.

vim +832 net/sched/sch_ltb.c

   817	
   818	static int ltb_change_class(struct Qdisc *sch, u32 classid,
   819				    u32 parentid, struct nlattr **tca,
   820				    unsigned long *arg, struct netlink_ext_ack *extack)
   821	{
   822		struct ltb_sched *ltb  = qdisc_priv(sch);
   823		struct ltb_class *cl = (struct ltb_class *)*arg, *parent;
   824		struct nlattr *opt = tca[TCA_OPTIONS];
   825		struct nlattr *tb[TCA_LTB_MAX + 1];
   826		struct tc_ltb_opt *lopt;
   827		u64 rate64, ceil64;
   828		struct psched_ratecfg ratecfg, ceilcfg;
   829		u32 prio;
   830		int err;
   831	
 > 832		if (!opt)
   833			goto failure;
   834	
   835		err = nla_parse_nested_deprecated(tb, TCA_LTB_MAX, opt, ltb_policy,
   836						  NULL);
   837		if (err < 0)
   838			goto failure;
   839	
   840		err = -EINVAL;
   841		if (!tb[TCA_LTB_PARMS])
   842			goto failure;
   843	
   844		parent = parentid == TC_H_ROOT ? NULL : ltb_find_class(sch, parentid);
   845	
   846		lopt = nla_data(tb[TCA_LTB_PARMS]);
   847		if (!lopt->rate.rate || !lopt->ceil.rate)
   848			goto failure;
   849	
   850		rate64 = tb[TCA_LTB_RATE64] ? nla_get_u64(tb[TCA_LTB_RATE64]) : 0;
   851		ceil64 = tb[TCA_LTB_CEIL64] ? nla_get_u64(tb[TCA_LTB_CEIL64]) : 0;
   852		if (rate64 > ceil64)
   853			goto failure;
   854	
   855		psched_ratecfg_precompute(&ratecfg, &lopt->rate, rate64);
   856		psched_ratecfg_precompute(&ceilcfg, &lopt->ceil, ceil64);
   857		prio = lopt->prio;
   858		if (prio >= TC_LTB_NUMPRIO)
   859			prio = TC_LTB_NUMPRIO - 1;
   860	
   861		if (!cl) {
   862			if (!classid || TC_H_MAJ(classid ^ sch->handle) ||
   863			    ltb_find_class(sch, classid)) {
   864				err = -EINVAL;
   865				goto failure;
   866			}
   867			cl = ltb_alloc_class(sch, parent, classid, &ratecfg, &ceilcfg,
   868					     prio);
   869			if (!cl) {
   870				err = -ENOBUFS;
   871				goto failure;
   872			}
   873		} else {
   874			/* Modify existing class */
   875			ltb_modify_class(sch, cl, &ratecfg, &ceilcfg, prio);
   876		}
   877		qdisc_class_hash_grow(sch, &ltb->clhash);
   878		*arg = (unsigned long)cl;
   879		return 0;
   880	
   881	failure:
   882		return err;
   883	}
   884	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 75320 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: "YU, Xiangning" <xiangning.yu@alibaba-inc.com>, netdev@vger.kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com
Subject: Re: [PATCH net-next 2/2] net: sched: Lockless Token Bucket (LTB) Qdisc
Date: Tue, 7 Jul 2020 23:42:24 +0800	[thread overview]
Message-ID: <202007072333.I0LhbbAo%lkp@intel.com> (raw)
In-Reply-To: <28bff9d7-fa2d-5284-f6d5-e08cd792c9c6@alibaba-inc.com>

[-- Attachment #1: Type: text/plain, Size: 3969 bytes --]

Hi Xiangning",

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/YU-Xiangning/Lockless-Token-Bucket-LTB-Qdisc/20200707-020918
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 5bd6ff0c6fe6c138aebe8d3bf7163420386c7ca7
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 02946de3802d3bc65bc9f2eb9b8d4969b5a7add8)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> net/sched/sch_ltb.c:832:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!opt)
               ^~~~
   net/sched/sch_ltb.c:882:9: note: uninitialized use occurs here
           return err;
                  ^~~
   net/sched/sch_ltb.c:832:2: note: remove the 'if' if its condition is always false
           if (!opt)
           ^~~~~~~~~
   net/sched/sch_ltb.c:830:9: note: initialize the variable 'err' to silence this warning
           int err;
                  ^
                   = 0
   1 warning generated.

vim +832 net/sched/sch_ltb.c

   817	
   818	static int ltb_change_class(struct Qdisc *sch, u32 classid,
   819				    u32 parentid, struct nlattr **tca,
   820				    unsigned long *arg, struct netlink_ext_ack *extack)
   821	{
   822		struct ltb_sched *ltb  = qdisc_priv(sch);
   823		struct ltb_class *cl = (struct ltb_class *)*arg, *parent;
   824		struct nlattr *opt = tca[TCA_OPTIONS];
   825		struct nlattr *tb[TCA_LTB_MAX + 1];
   826		struct tc_ltb_opt *lopt;
   827		u64 rate64, ceil64;
   828		struct psched_ratecfg ratecfg, ceilcfg;
   829		u32 prio;
   830		int err;
   831	
 > 832		if (!opt)
   833			goto failure;
   834	
   835		err = nla_parse_nested_deprecated(tb, TCA_LTB_MAX, opt, ltb_policy,
   836						  NULL);
   837		if (err < 0)
   838			goto failure;
   839	
   840		err = -EINVAL;
   841		if (!tb[TCA_LTB_PARMS])
   842			goto failure;
   843	
   844		parent = parentid == TC_H_ROOT ? NULL : ltb_find_class(sch, parentid);
   845	
   846		lopt = nla_data(tb[TCA_LTB_PARMS]);
   847		if (!lopt->rate.rate || !lopt->ceil.rate)
   848			goto failure;
   849	
   850		rate64 = tb[TCA_LTB_RATE64] ? nla_get_u64(tb[TCA_LTB_RATE64]) : 0;
   851		ceil64 = tb[TCA_LTB_CEIL64] ? nla_get_u64(tb[TCA_LTB_CEIL64]) : 0;
   852		if (rate64 > ceil64)
   853			goto failure;
   854	
   855		psched_ratecfg_precompute(&ratecfg, &lopt->rate, rate64);
   856		psched_ratecfg_precompute(&ceilcfg, &lopt->ceil, ceil64);
   857		prio = lopt->prio;
   858		if (prio >= TC_LTB_NUMPRIO)
   859			prio = TC_LTB_NUMPRIO - 1;
   860	
   861		if (!cl) {
   862			if (!classid || TC_H_MAJ(classid ^ sch->handle) ||
   863			    ltb_find_class(sch, classid)) {
   864				err = -EINVAL;
   865				goto failure;
   866			}
   867			cl = ltb_alloc_class(sch, parent, classid, &ratecfg, &ceilcfg,
   868					     prio);
   869			if (!cl) {
   870				err = -ENOBUFS;
   871				goto failure;
   872			}
   873		} else {
   874			/* Modify existing class */
   875			ltb_modify_class(sch, cl, &ratecfg, &ceilcfg, prio);
   876		}
   877		qdisc_class_hash_grow(sch, &ltb->clhash);
   878		*arg = (unsigned long)cl;
   879		return 0;
   880	
   881	failure:
   882		return err;
   883	}
   884	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 75320 bytes --]

  parent reply	other threads:[~2020-07-07 15:42 UTC|newest]

Thread overview: 22+ 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
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 [this message]
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=202007072333.I0LhbbAo%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.