[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202106171059.fZKTNsGN-lkp@intel.com>
Date: Thu, 17 Jun 2021 10:48:57 +0800
From: kernel test robot <lkp@...el.com>
To: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>, netdev@...r.kernel.org
Cc: kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
Jakub Kicinski <kuba@...nel.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Björn Töpel <bjorn@...nel.org>,
Magnus Karlsson <magnus.karlsson@...el.com>,
Jonathan Lemon <jonathan.lemon@...il.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>
Subject: Re: [PATCH net-next v5 13/15] virtio-net: support AF_XDP zc rx
Hi Xuan,
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/Xuan-Zhuo/virtio-net-support-xdp-socket-zero-copy/20210617-033438
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git c7654495916e109f76a67fd3ae68f8fa70ab4faa
config: x86_64-randconfig-a015-20210617 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
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
# https://github.com/0day-ci/linux/commit/f5f1e60139e7c38fbb4ed58d503e89bbb26c1464
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Xuan-Zhuo/virtio-net-support-xdp-socket-zero-copy/20210617-033438
git checkout f5f1e60139e7c38fbb4ed58d503e89bbb26c1464
# 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@...el.com>
All warnings (new ones prefixed by >>):
>> drivers/net/virtio/virtio_net.c:1304:2: warning: variable 'oom' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (fill_recv_xsk(vi, rq, gfp))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:56:28: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:30: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/virtio/virtio_net.c:1329:10: note: uninitialized use occurs here
return !oom;
^~~
drivers/net/virtio/virtio_net.c:1304:2: note: remove the 'if' if its condition is always false
if (fill_recv_xsk(vi, rq, gfp))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:56:23: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^
drivers/net/virtio/virtio_net.c:1297:10: note: initialize the variable 'oom' to silence this warning
bool oom;
^
= 0
1 warning generated.
vim +1304 drivers/net/virtio/virtio_net.c
1285
1286 /*
1287 * Returns false if we couldn't fill entirely (OOM).
1288 *
1289 * Normally run in the receive path, but can also be run from ndo_open
1290 * before we're receiving packets, or from refill_work which is
1291 * careful to disable receiving (using napi_disable).
1292 */
1293 static bool try_fill_recv(struct virtnet_info *vi, struct receive_queue *rq,
1294 gfp_t gfp)
1295 {
1296 int err;
1297 bool oom;
1298
1299 /* Because virtio-net does not yet support flow direct, all rx
1300 * channels must also process other non-xsk packets. If there is
1301 * no buf available from xsk temporarily, we try to allocate
1302 * memory to the channel.
1303 */
> 1304 if (fill_recv_xsk(vi, rq, gfp))
1305 goto kick;
1306
1307 do {
1308 if (vi->mergeable_rx_bufs)
1309 err = add_recvbuf_mergeable(vi, rq, gfp);
1310 else if (vi->big_packets)
1311 err = add_recvbuf_big(vi, rq, gfp);
1312 else
1313 err = add_recvbuf_small(vi, rq, gfp);
1314
1315 oom = err == -ENOMEM;
1316 if (err)
1317 break;
1318 } while (rq->vq->num_free);
1319
1320 kick:
1321 if (virtqueue_kick_prepare(rq->vq) && virtqueue_notify(rq->vq)) {
1322 unsigned long flags;
1323
1324 flags = u64_stats_update_begin_irqsave(&rq->stats.syncp);
1325 rq->stats.kicks++;
1326 u64_stats_update_end_irqrestore(&rq->stats.syncp, flags);
1327 }
1328
1329 return !oom;
1330 }
1331
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (31921 bytes)
Powered by blists - more mailing lists