Re: [PATCH net-next] tcp: show number of network segments in some SNMP counters

From: kbuild test robot
Date: Mon Sep 10 2018 - 11:08:16 EST


Hi Yafang,

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/Yafang-Shao/tcp-show-number-of-network-segments-in-some-SNMP-counters/20180910-225108
config: x86_64-randconfig-x019-201836 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

In file included from net/ipv4/tcp_ipv4.c:69:0:
net/ipv4/tcp_ipv4.c: In function 'tcp_v4_err':
>> include/net/tcp.h:917:24: warning: 'skb' may be used uninitialized in this function [-Wmaybe-uninitialized]
return TCP_SKB_CB(skb)->tcp_gso_segs;
^
net/ipv4/tcp_ipv4.c:436:18: note: 'skb' was declared here
struct sk_buff *skb;
^~~
--
In file included from net//ipv4/tcp_ipv4.c:69:0:
net//ipv4/tcp_ipv4.c: In function 'tcp_v4_err':
>> include/net/tcp.h:917:24: warning: 'skb' may be used uninitialized in this function [-Wmaybe-uninitialized]
return TCP_SKB_CB(skb)->tcp_gso_segs;
^
net//ipv4/tcp_ipv4.c:436:18: note: 'skb' was declared here
struct sk_buff *skb;
^~~

vim +/skb +917 include/net/tcp.h

3fa6f616 David Ahern 2017-08-07 911
^1da177e Linus Torvalds 2005-04-16 912 /* Due to TSO, an SKB can be composed of multiple actual
^1da177e Linus Torvalds 2005-04-16 913 * packets. To keep these tracked properly, we use this.
bd14b1b2 Eric Dumazet 2012-05-04 914 */
^1da177e Linus Torvalds 2005-04-16 915 static inline int tcp_skb_pcount(const struct sk_buff *skb)
bd14b1b2 Eric Dumazet 2012-05-04 916 {
cd7d8498 Eric Dumazet 2014-09-24 @917 return TCP_SKB_CB(skb)->tcp_gso_segs;
cd7d8498 Eric Dumazet 2014-09-24 918 }
bd14b1b2 Eric Dumazet 2012-05-04 919

:::::: The code at line 917 was first introduced by commit
:::::: cd7d8498c9a5d510c64db38d9f4f4fbc41790f09 tcp: change tcp_skb_pcount() location

:::::: TO: Eric Dumazet <edumazet@xxxxxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip