Re: [PATCH 3/3] net: stmmac: use pcpu statistics where necessary

From: kernel test robot
Date: Wed Jun 14 2023 - 14:39:10 EST


Hi Jisheng,

kernel test robot noticed the following build warnings:

[auto build test WARNING on sunxi/sunxi/for-next]
[also build test WARNING on linus/master v6.4-rc6]
[cannot apply to next-20230614]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Jisheng-Zhang/net-stmmac-don-t-clear-network-statistics-in-ndo_open/20230615-003137
base: https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi/for-next
patch link: https://lore.kernel.org/r/20230614161847.4071-4-jszhang%40kernel.org
patch subject: [PATCH 3/3] net: stmmac: use pcpu statistics where necessary
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230615/202306150255.k4BaJTXY-lkp@xxxxxxxxx/config)
compiler: m68k-linux-gcc (GCC) 12.3.0
reproduce (this is a W=1 build):
mkdir -p ~/bin
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add sunxi https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git
git fetch sunxi sunxi/for-next
git checkout sunxi/sunxi/for-next
b4 shazam https://lore.kernel.org/r/20230614161847.4071-4-jszhang@xxxxxxxxxx
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=m68k olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/net/

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306150255.k4BaJTXY-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c: In function 'stmmac_get_per_qstats':
>> drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:564:26: warning: 'start' is used uninitialized [-Wuninitialized]
564 | } while (u64_stats_fetch_retry(&stats->syncp, start));
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:551:22: note: 'start' was declared here
551 | unsigned int start;
| ^~~~~


vim +/start +564 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

546
547 static void stmmac_get_per_qstats(struct stmmac_priv *priv, u64 *data)
548 {
549 u32 tx_cnt = priv->plat->tx_queues_to_use;
550 u32 rx_cnt = priv->plat->rx_queues_to_use;
551 unsigned int start;
552 int q, stat, cpu;
553 char *p;
554 u64 *pos;
555
556 pos = data;
557 for_each_possible_cpu(cpu) {
558 struct stmmac_pcpu_stats *stats, snapshot;
559
560 data = pos;
561 stats = per_cpu_ptr(priv->xstats.pstats, cpu);
562 do {
563 snapshot = *stats;
> 564 } while (u64_stats_fetch_retry(&stats->syncp, start));
565
566 for (q = 0; q < tx_cnt; q++) {
567 p = (char *)&snapshot + offsetof(struct stmmac_pcpu_stats,
568 txq_stats[q].tx_pkt_n);
569 for (stat = 0; stat < STMMAC_TXQ_STATS; stat++) {
570 *data++ = (*(u64 *)p);
571 p += sizeof(u64);
572 }
573 }
574 for (q = 0; q < rx_cnt; q++) {
575 p = (char *)&snapshot + offsetof(struct stmmac_pcpu_stats,
576 rxq_stats[q].rx_pkt_n);
577 for (stat = 0; stat < STMMAC_RXQ_STATS; stat++) {
578 *data++ = (*(u64 *)p);
579 p += sizeof(u64);
580 }
581 }
582 }
583 }
584

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki