[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202412142229.7lFHEOun-lkp@intel.com>
Date: Sat, 14 Dec 2024 22:34:40 +0800
From: kernel test robot <lkp@...el.com>
To: Eric Dumazet <edumazet@...gle.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
netdev@...r.kernel.org, Simon Horman <horms@...nel.org>,
David Ahern <dsahern@...nel.org>,
Kuniyuki Iwashima <kuniyu@...zon.com>, eric.dumazet@...il.com,
Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net-next 2/4] inetpeer: remove create argument of
inet_getpeer()
Hi Eric,
kernel test robot noticed the following build warnings:
[auto build test WARNING on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/inetpeer-remove-create-argument-of-inet_getpeer_v-46/20241213-210500
base: net-next/main
patch link: https://lore.kernel.org/r/20241213130212.1783302-3-edumazet%40google.com
patch subject: [PATCH net-next 2/4] inetpeer: remove create argument of inet_getpeer()
config: i386-buildonly-randconfig-003-20241214 (https://download.01.org/0day-ci/archive/20241214/202412142229.7lFHEOun-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241214/202412142229.7lFHEOun-lkp@intel.com/reproduce)
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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412142229.7lFHEOun-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from net/ipv4/inetpeer.c:19:
In file included from include/linux/mm.h:2223:
include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> net/ipv4/inetpeer.c:177:6: warning: variable 'invalidated' set but not used [-Wunused-but-set-variable]
177 | int invalidated;
| ^
2 warnings generated.
vim +/invalidated +177 net/ipv4/inetpeer.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 170
c0efc887dcadbd David S. Miller 2012-06-09 171 struct inet_peer *inet_getpeer(struct inet_peer_base *base,
4a6cb3d13bf1f8 Eric Dumazet 2024-12-13 172 const struct inetpeer_addr *daddr)
^1da177e4c3f41 Linus Torvalds 2005-04-16 173 {
b145425f269a17 Eric Dumazet 2017-07-17 174 struct inet_peer *p, *gc_stack[PEER_MAX_GC];
b145425f269a17 Eric Dumazet 2017-07-17 175 struct rb_node **pp, *parent;
b145425f269a17 Eric Dumazet 2017-07-17 176 unsigned int gc_cnt, seq;
b145425f269a17 Eric Dumazet 2017-07-17 @177 int invalidated;
^1da177e4c3f41 Linus Torvalds 2005-04-16 178
4b9d9be839fdb7 Eric Dumazet 2011-06-08 179 /* Attempt a lockless lookup first.
aa1039e73cc2cf Eric Dumazet 2010-06-15 180 * Because of a concurrent writer, we might not find an existing entry.
aa1039e73cc2cf Eric Dumazet 2010-06-15 181 */
7b46ac4e77f322 David S. Miller 2011-03-08 182 rcu_read_lock();
b145425f269a17 Eric Dumazet 2017-07-17 183 seq = read_seqbegin(&base->lock);
b145425f269a17 Eric Dumazet 2017-07-17 184 p = lookup(daddr, base, seq, NULL, &gc_cnt, &parent, &pp);
b145425f269a17 Eric Dumazet 2017-07-17 185 invalidated = read_seqretry(&base->lock, seq);
7b46ac4e77f322 David S. Miller 2011-03-08 186 rcu_read_unlock();
^1da177e4c3f41 Linus Torvalds 2005-04-16 187
4b9d9be839fdb7 Eric Dumazet 2011-06-08 188 if (p)
aa1039e73cc2cf Eric Dumazet 2010-06-15 189 return p;
aa1039e73cc2cf Eric Dumazet 2010-06-15 190
aa1039e73cc2cf Eric Dumazet 2010-06-15 191 /* retry an exact lookup, taking the lock before.
aa1039e73cc2cf Eric Dumazet 2010-06-15 192 * At least, nodes should be hot in our cache.
aa1039e73cc2cf Eric Dumazet 2010-06-15 193 */
b145425f269a17 Eric Dumazet 2017-07-17 194 parent = NULL;
65e8354ec13a45 Eric Dumazet 2011-03-04 195 write_seqlock_bh(&base->lock);
b145425f269a17 Eric Dumazet 2017-07-17 196
b145425f269a17 Eric Dumazet 2017-07-17 197 gc_cnt = 0;
b145425f269a17 Eric Dumazet 2017-07-17 198 p = lookup(daddr, base, seq, gc_stack, &gc_cnt, &parent, &pp);
4a6cb3d13bf1f8 Eric Dumazet 2024-12-13 199 if (!p) {
b145425f269a17 Eric Dumazet 2017-07-17 200 p = kmem_cache_alloc(peer_cachep, GFP_ATOMIC);
aa1039e73cc2cf Eric Dumazet 2010-06-15 201 if (p) {
b534ecf1cd26f0 David S. Miller 2010-11-30 202 p->daddr = *daddr;
b6a37e5e25414d Eric Dumazet 2018-04-09 203 p->dtime = (__u32)jiffies;
1cc9a98b59ba92 Reshetova, Elena 2017-06-30 204 refcount_set(&p->refcnt, 2);
aa1039e73cc2cf Eric Dumazet 2010-06-15 205 atomic_set(&p->rid, 0);
144001bddcb4db David S. Miller 2011-01-27 206 p->metrics[RTAX_LOCK-1] = INETPEER_METRICS_NEW;
92d8682926342d David S. Miller 2011-02-04 207 p->rate_tokens = 0;
c09551c6ff7fe1 Lorenzo Bianconi 2019-02-06 208 p->n_redirects = 0;
bc9259a8bae9e8 Nicolas Dichtel 2012-09-27 209 /* 60*HZ is arbitrary, but chosen enough high so that the first
bc9259a8bae9e8 Nicolas Dichtel 2012-09-27 210 * calculation of tokens is at its maximum.
bc9259a8bae9e8 Nicolas Dichtel 2012-09-27 211 */
bc9259a8bae9e8 Nicolas Dichtel 2012-09-27 212 p->rate_last = jiffies - 60*HZ;
^1da177e4c3f41 Linus Torvalds 2005-04-16 213
b145425f269a17 Eric Dumazet 2017-07-17 214 rb_link_node(&p->rb_node, parent, pp);
b145425f269a17 Eric Dumazet 2017-07-17 215 rb_insert_color(&p->rb_node, &base->rb_root);
98158f5a853caf David S. Miller 2010-11-30 216 base->total++;
aa1039e73cc2cf Eric Dumazet 2010-06-15 217 }
b145425f269a17 Eric Dumazet 2017-07-17 218 }
b145425f269a17 Eric Dumazet 2017-07-17 219 if (gc_cnt)
b145425f269a17 Eric Dumazet 2017-07-17 220 inet_peer_gc(base, gc_stack, gc_cnt);
65e8354ec13a45 Eric Dumazet 2011-03-04 221 write_sequnlock_bh(&base->lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 222
^1da177e4c3f41 Linus Torvalds 2005-04-16 223 return p;
^1da177e4c3f41 Linus Torvalds 2005-04-16 224 }
b3419363808f24 David S. Miller 2010-11-30 225 EXPORT_SYMBOL_GPL(inet_getpeer);
98158f5a853caf David S. Miller 2010-11-30 226
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists