* Re: [PATCH net-next 10/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()
@ 2022-05-13 21:30 kernel test robot
0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2022-05-13 21:30 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 15970 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220511233757.2001218-11-eric.dumazet@gmail.com>
References: <20220511233757.2001218-11-eric.dumazet@gmail.com>
TO: Eric Dumazet <eric.dumazet@gmail.com>
Hi Eric,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git b57c7e8b76c646cf77ce4353a779a8b781592209
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: i386-randconfig-m021 (https://download.01.org/0day-ci/archive/20220514/202205140547.cDVaemuQ-lkp(a)intel.com/config)
compiler: gcc-11 (Debian 11.2.0-20) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
net/ipv4/inet_hashtables.c:413 __inet_lookup_established() error: uninitialized symbol 'acookie'.
net/ipv4/inet_hashtables.c:468 __inet_check_established() error: uninitialized symbol 'acookie'.
net/ipv4/inet_hashtables.c:535 inet_ehash_lookup_by_sk() error: uninitialized symbol 'acookie'.
net/ipv4/udp.c:2566 __udp4_lib_demux_lookup() error: uninitialized symbol 'acookie'.
Old smatch warnings:
net/ipv4/udp.c:496 __udp4_lib_lookup() warn: potential spectre issue 'udptable->hash2' [r]
net/ipv4/udp.c:2297 __udp4_lib_mcast_deliver() warn: potential spectre issue 'udptable->hash2' [r]
net/ipv4/udp.c:2529 __udp4_lib_mcast_demux_lookup() warn: potential spectre issue 'udp_table.hash' [r]
net/ipv4/udp.c:2560 __udp4_lib_demux_lookup() warn: potential spectre issue 'udp_table.hash2' [r]
vim +/acookie +413 net/ipv4/inet_hashtables.c
2c13270b441054 Eric Dumazet 2015-03-15 391
c67499c0e77206 Pavel Emelyanov 2008-01-31 392 struct sock *__inet_lookup_established(struct net *net,
c67499c0e77206 Pavel Emelyanov 2008-01-31 393 struct inet_hashinfo *hashinfo,
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 394 const __be32 saddr, const __be16 sport,
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 395 const __be32 daddr, const u16 hnum,
3fa6f616a7a4d0 David Ahern 2017-08-07 396 const int dif, const int sdif)
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 397 {
c7228317441f4d Joe Perches 2014-05-13 398 INET_ADDR_COOKIE(acookie, saddr, daddr);
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 399 const __portpair ports = INET_COMBINED_PORTS(sport, hnum);
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 400 struct sock *sk;
3ab5aee7fe840b Eric Dumazet 2008-11-16 401 const struct hlist_nulls_node *node;
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 402 /* Optimize here for direct hit, only listening connections can
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 403 * have wildcards anyways.
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 404 */
9f26b3add3783c Pavel Emelyanov 2008-06-16 405 unsigned int hash = inet_ehashfn(net, daddr, hnum, saddr, sport);
f373b53b5fe67a Eric Dumazet 2009-10-09 406 unsigned int slot = hash & hashinfo->ehash_mask;
3ab5aee7fe840b Eric Dumazet 2008-11-16 407 struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 408
3ab5aee7fe840b Eric Dumazet 2008-11-16 409 begin:
3ab5aee7fe840b Eric Dumazet 2008-11-16 410 sk_nulls_for_each_rcu(sk, node, &head->chain) {
ce43b03e888947 Eric Dumazet 2012-11-30 411 if (sk->sk_hash != hash)
ce43b03e888947 Eric Dumazet 2012-11-30 412 continue;
ce43b03e888947 Eric Dumazet 2012-11-30 @413 if (likely(INET_MATCH(sk, net, acookie,
3fa6f616a7a4d0 David Ahern 2017-08-07 414 saddr, daddr, ports, dif, sdif))) {
41c6d650f6537e Reshetova, Elena 2017-06-30 415 if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
05dbc7b59481ca Eric Dumazet 2013-10-03 416 goto out;
ce43b03e888947 Eric Dumazet 2012-11-30 417 if (unlikely(!INET_MATCH(sk, net, acookie,
3fa6f616a7a4d0 David Ahern 2017-08-07 418 saddr, daddr, ports,
3fa6f616a7a4d0 David Ahern 2017-08-07 419 dif, sdif))) {
05dbc7b59481ca Eric Dumazet 2013-10-03 420 sock_gen_put(sk);
3ab5aee7fe840b Eric Dumazet 2008-11-16 421 goto begin;
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 422 }
05dbc7b59481ca Eric Dumazet 2013-10-03 423 goto found;
3ab5aee7fe840b Eric Dumazet 2008-11-16 424 }
3ab5aee7fe840b Eric Dumazet 2008-11-16 425 }
3ab5aee7fe840b Eric Dumazet 2008-11-16 426 /*
3ab5aee7fe840b Eric Dumazet 2008-11-16 427 * if the nulls value we got at the end of this lookup is
3ab5aee7fe840b Eric Dumazet 2008-11-16 428 * not the expected one, we must restart lookup.
3ab5aee7fe840b Eric Dumazet 2008-11-16 429 * We probably met an item that was moved to another chain.
3ab5aee7fe840b Eric Dumazet 2008-11-16 430 */
3ab5aee7fe840b Eric Dumazet 2008-11-16 431 if (get_nulls_value(node) != slot)
3ab5aee7fe840b Eric Dumazet 2008-11-16 432 goto begin;
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 433 out:
05dbc7b59481ca Eric Dumazet 2013-10-03 434 sk = NULL;
05dbc7b59481ca Eric Dumazet 2013-10-03 435 found:
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 436 return sk;
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 437 }
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 438 EXPORT_SYMBOL_GPL(__inet_lookup_established);
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 439
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 440 /* called with local bh disabled */
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 441 static int __inet_check_established(struct inet_timewait_death_row *death_row,
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 442 struct sock *sk, __u16 lport,
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 443 struct inet_timewait_sock **twp)
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 444 {
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 445 struct inet_hashinfo *hinfo = death_row->hashinfo;
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 446 struct inet_sock *inet = inet_sk(sk);
c720c7e8383aff Eric Dumazet 2009-10-15 447 __be32 daddr = inet->inet_rcv_saddr;
c720c7e8383aff Eric Dumazet 2009-10-15 448 __be32 saddr = inet->inet_daddr;
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 449 int dif = sk->sk_bound_dev_if;
3fa6f616a7a4d0 David Ahern 2017-08-07 450 struct net *net = sock_net(sk);
3fa6f616a7a4d0 David Ahern 2017-08-07 451 int sdif = l3mdev_master_ifindex_by_index(net, dif);
c7228317441f4d Joe Perches 2014-05-13 452 INET_ADDR_COOKIE(acookie, saddr, daddr);
c720c7e8383aff Eric Dumazet 2009-10-15 453 const __portpair ports = INET_COMBINED_PORTS(inet->inet_dport, lport);
c720c7e8383aff Eric Dumazet 2009-10-15 454 unsigned int hash = inet_ehashfn(net, daddr, lport,
c720c7e8383aff Eric Dumazet 2009-10-15 455 saddr, inet->inet_dport);
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 456 struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash);
9db66bdcc83749 Eric Dumazet 2008-11-20 457 spinlock_t *lock = inet_ehash_lockp(hinfo, hash);
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 458 struct sock *sk2;
3ab5aee7fe840b Eric Dumazet 2008-11-16 459 const struct hlist_nulls_node *node;
05dbc7b59481ca Eric Dumazet 2013-10-03 460 struct inet_timewait_sock *tw = NULL;
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 461
9db66bdcc83749 Eric Dumazet 2008-11-20 462 spin_lock(lock);
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 463
05dbc7b59481ca Eric Dumazet 2013-10-03 464 sk_nulls_for_each(sk2, node, &head->chain) {
ce43b03e888947 Eric Dumazet 2012-11-30 465 if (sk2->sk_hash != hash)
ce43b03e888947 Eric Dumazet 2012-11-30 466 continue;
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 467
05dbc7b59481ca Eric Dumazet 2013-10-03 @468 if (likely(INET_MATCH(sk2, net, acookie,
3fa6f616a7a4d0 David Ahern 2017-08-07 469 saddr, daddr, ports, dif, sdif))) {
05dbc7b59481ca Eric Dumazet 2013-10-03 470 if (sk2->sk_state == TCP_TIME_WAIT) {
ce43b03e888947 Eric Dumazet 2012-11-30 471 tw = inet_twsk(sk2);
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 472 if (twsk_unique(sk, sk2, twp))
05dbc7b59481ca Eric Dumazet 2013-10-03 473 break;
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 474 }
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 475 goto not_unique;
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 476 }
05dbc7b59481ca Eric Dumazet 2013-10-03 477 }
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 478
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 479 /* Must record num and sport now. Otherwise we will see
05dbc7b59481ca Eric Dumazet 2013-10-03 480 * in hash table socket with a funny identity.
05dbc7b59481ca Eric Dumazet 2013-10-03 481 */
c720c7e8383aff Eric Dumazet 2009-10-15 482 inet->inet_num = lport;
c720c7e8383aff Eric Dumazet 2009-10-15 483 inet->inet_sport = htons(lport);
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 484 sk->sk_hash = hash;
547b792cac0a03 Ilpo Järvinen 2008-07-25 485 WARN_ON(!sk_unhashed(sk));
3ab5aee7fe840b Eric Dumazet 2008-11-16 486 __sk_nulls_add_node_rcu(sk, &head->chain);
13475a30b66cdb Eric Dumazet 2009-12-02 487 if (tw) {
fc01538f9fb755 Eric Dumazet 2015-07-08 488 sk_nulls_del_node_init_rcu((struct sock *)tw);
02a1d6e7a6bb02 Eric Dumazet 2016-04-27 489 __NET_INC_STATS(net, LINUX_MIB_TIMEWAITRECYCLED);
13475a30b66cdb Eric Dumazet 2009-12-02 490 }
9db66bdcc83749 Eric Dumazet 2008-11-20 491 spin_unlock(lock);
c29a0bc4dfc4d8 Pavel Emelyanov 2008-03-31 492 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 493
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 494 if (twp) {
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 495 *twp = tw;
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 496 } else if (tw) {
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 497 /* Silly. Should hash-dance instead... */
dbe7faa4045ea8 Eric Dumazet 2015-07-08 498 inet_twsk_deschedule_put(tw);
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 499 }
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 500 return 0;
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 501
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 502 not_unique:
9db66bdcc83749 Eric Dumazet 2008-11-20 503 spin_unlock(lock);
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 504 return -EADDRNOTAVAIL;
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 505 }
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 506
b2d057560b8107 Willy Tarreau 2022-05-02 507 static u64 inet_sk_port_offset(const struct sock *sk)
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 508 {
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 509 const struct inet_sock *inet = inet_sk(sk);
e2baad9e4b153c Eric Dumazet 2015-05-27 510
c720c7e8383aff Eric Dumazet 2009-10-15 511 return secure_ipv4_port_ephemeral(inet->inet_rcv_saddr,
c720c7e8383aff Eric Dumazet 2009-10-15 512 inet->inet_daddr,
c720c7e8383aff Eric Dumazet 2009-10-15 513 inet->inet_dport);
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 514 }
a7f5e7f164788a Arnaldo Carvalho de Melo 2005-12-13 515
01770a16616573 Ricardo Dias 2020-11-20 516 /* Searches for an exsiting socket in the ehash bucket list.
01770a16616573 Ricardo Dias 2020-11-20 517 * Returns true if found, false otherwise.
01770a16616573 Ricardo Dias 2020-11-20 518 */
01770a16616573 Ricardo Dias 2020-11-20 519 static bool inet_ehash_lookup_by_sk(struct sock *sk,
01770a16616573 Ricardo Dias 2020-11-20 520 struct hlist_nulls_head *list)
01770a16616573 Ricardo Dias 2020-11-20 521 {
01770a16616573 Ricardo Dias 2020-11-20 522 const __portpair ports = INET_COMBINED_PORTS(sk->sk_dport, sk->sk_num);
01770a16616573 Ricardo Dias 2020-11-20 523 const int sdif = sk->sk_bound_dev_if;
01770a16616573 Ricardo Dias 2020-11-20 524 const int dif = sk->sk_bound_dev_if;
01770a16616573 Ricardo Dias 2020-11-20 525 const struct hlist_nulls_node *node;
01770a16616573 Ricardo Dias 2020-11-20 526 struct net *net = sock_net(sk);
01770a16616573 Ricardo Dias 2020-11-20 527 struct sock *esk;
01770a16616573 Ricardo Dias 2020-11-20 528
01770a16616573 Ricardo Dias 2020-11-20 529 INET_ADDR_COOKIE(acookie, sk->sk_daddr, sk->sk_rcv_saddr);
01770a16616573 Ricardo Dias 2020-11-20 530
01770a16616573 Ricardo Dias 2020-11-20 531 sk_nulls_for_each_rcu(esk, node, list) {
01770a16616573 Ricardo Dias 2020-11-20 532 if (esk->sk_hash != sk->sk_hash)
01770a16616573 Ricardo Dias 2020-11-20 533 continue;
01770a16616573 Ricardo Dias 2020-11-20 534 if (sk->sk_family == AF_INET) {
01770a16616573 Ricardo Dias 2020-11-20 @535 if (unlikely(INET_MATCH(esk, net, acookie,
01770a16616573 Ricardo Dias 2020-11-20 536 sk->sk_daddr,
01770a16616573 Ricardo Dias 2020-11-20 537 sk->sk_rcv_saddr,
01770a16616573 Ricardo Dias 2020-11-20 538 ports, dif, sdif))) {
01770a16616573 Ricardo Dias 2020-11-20 539 return true;
01770a16616573 Ricardo Dias 2020-11-20 540 }
01770a16616573 Ricardo Dias 2020-11-20 541 }
01770a16616573 Ricardo Dias 2020-11-20 542 #if IS_ENABLED(CONFIG_IPV6)
01770a16616573 Ricardo Dias 2020-11-20 543 else if (sk->sk_family == AF_INET6) {
01770a16616573 Ricardo Dias 2020-11-20 544 if (unlikely(INET6_MATCH(esk, net,
01770a16616573 Ricardo Dias 2020-11-20 545 &sk->sk_v6_daddr,
01770a16616573 Ricardo Dias 2020-11-20 546 &sk->sk_v6_rcv_saddr,
01770a16616573 Ricardo Dias 2020-11-20 547 ports, dif, sdif))) {
01770a16616573 Ricardo Dias 2020-11-20 548 return true;
01770a16616573 Ricardo Dias 2020-11-20 549 }
01770a16616573 Ricardo Dias 2020-11-20 550 }
01770a16616573 Ricardo Dias 2020-11-20 551 #endif
01770a16616573 Ricardo Dias 2020-11-20 552 }
01770a16616573 Ricardo Dias 2020-11-20 553 return false;
01770a16616573 Ricardo Dias 2020-11-20 554 }
01770a16616573 Ricardo Dias 2020-11-20 555
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next 00/10] net: add annotations for sk->sk_bound_dev_if
@ 2022-05-11 23:37 Eric Dumazet
2022-05-11 23:37 ` [PATCH net-next 10/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH() Eric Dumazet
0 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2022-05-11 23:37 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: netdev, Eric Dumazet, Eric Dumazet
From: Eric Dumazet <edumazet@google.com>
While writes on sk->sk_bound_dev_if are protected by socket lock,
we have many lockless reads all over the places.
This is based on syzbot report found in the first patch changelog.
Eric Dumazet (10):
net: annotate races around sk->sk_bound_dev_if
sctp: read sk->sk_bound_dev_if once in sctp_rcv()
tcp: sk->sk_bound_dev_if once in inet_request_bound_dev_if()
net: core: add READ_ONCE/WRITE_ONCE annotations for
sk->sk_bound_dev_if
dccp: use READ_ONCE() to read sk->sk_bound_dev_if
inet: add READ_ONCE(sk->sk_bound_dev_if) in inet_csk_bind_conflict()
net_sched: em_meta: add READ_ONCE() in var_sk_bound_if()
l2tp: use add READ_ONCE() to fetch sk->sk_bound_dev_if
ipv6: add READ_ONCE(sk->sk_bound_dev_if) in INET6_MATCH()
inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()
include/net/inet6_hashtables.h | 25 +++++++++++-----
include/net/inet_hashtables.h | 52 ++++++++++++++++++++++++---------
include/net/inet_sock.h | 5 ++--
include/net/ip.h | 2 +-
include/net/sock.h | 5 ++--
net/core/sock.c | 11 ++++---
net/dccp/ipv4.c | 2 +-
net/dccp/ipv6.c | 4 +--
net/ipv4/inet_connection_sock.c | 12 +++++---
net/ipv6/datagram.c | 6 ++--
net/ipv6/udp.c | 11 +++----
net/l2tp/l2tp_ip.c | 4 ++-
net/l2tp/l2tp_ip6.c | 8 +++--
net/sched/em_meta.c | 7 +++--
net/sctp/input.c | 4 ++-
15 files changed, 105 insertions(+), 53 deletions(-)
--
2.36.0.512.ge40c2bad7a-goog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next 10/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()
2022-05-11 23:37 [PATCH net-next 00/10] net: add annotations for sk->sk_bound_dev_if Eric Dumazet
@ 2022-05-11 23:37 ` Eric Dumazet
2022-05-12 13:15 ` kernel test robot
0 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2022-05-11 23:37 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: netdev, Eric Dumazet, Eric Dumazet
From: Eric Dumazet <edumazet@google.com>
INET_MATCH() runs without holding a lock on the socket.
We probably need to annotate most reads.
This patch makes INET_MATCH() an inline function
to ease our changes. This also allows us
to add some __always_unused qualifiers.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/net/inet_hashtables.h | 52 +++++++++++++++++++++++++----------
1 file changed, 38 insertions(+), 14 deletions(-)
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 98e1ec1a14f0382d1f4f8e85fe5ac2a056d2d6bc..5d3fa071d754601149c9ad0dd559f074ac58deaa 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -307,23 +307,47 @@ static inline struct sock *inet_lookup_listener(struct net *net,
(((__force __u64)(__be32)(__daddr)) << 32) | \
((__force __u64)(__be32)(__saddr)))
#endif /* __BIG_ENDIAN */
-#define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif, __sdif) \
- (((__sk)->sk_portpair == (__ports)) && \
- ((__sk)->sk_addrpair == (__cookie)) && \
- (((__sk)->sk_bound_dev_if == (__dif)) || \
- ((__sk)->sk_bound_dev_if == (__sdif))) && \
- net_eq(sock_net(__sk), (__net)))
+static inline bool INET_MATCH(const struct sock *sk, struct net *net,
+ const __addrpair cookie,
+ const __be32 __always_unused saddr,
+ const __be32 __always_unused daddr,
+ const __portpair ports,
+ const int dif,
+ const int sdif)
+{
+ int bound_dev_if;
+
+ if (!net_eq(sock_net(sk), net) ||
+ sk->sk_portpair != ports ||
+ sk->sk_addrpair != cookie)
+ return false;
+
+ bound_dev_if = READ_ONCE(sk->sk_bound_dev_if);
+ return bound_dev_if == dif || bound_dev_if == sdif;
+}
#else /* 32-bit arch */
#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
- const int __name __deprecated __attribute__((unused))
+ const int __name __deprecated __always_unused
-#define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif, __sdif) \
- (((__sk)->sk_portpair == (__ports)) && \
- ((__sk)->sk_daddr == (__saddr)) && \
- ((__sk)->sk_rcv_saddr == (__daddr)) && \
- (((__sk)->sk_bound_dev_if == (__dif)) || \
- ((__sk)->sk_bound_dev_if == (__sdif))) && \
- net_eq(sock_net(__sk), (__net)))
+static inline bool INET_MATCH(const struct sock *sk, struct net *net,
+ const __addrpair __always_unused cookie,
+ const __be32 saddr,
+ const __be32 daddr,
+ const __portpair ports,
+ const int dif,
+ const int sdif)
+{
+ int bound_dev_if;
+
+ if (!net_eq(sock_net(sk), net) ||
+ sk->sk_portpair != ports ||
+ sk->sk_daddr != saddr ||
+ sk->sk_rcv_saddr != daddr)
+ return false;
+
+ bound_dev_if = READ_ONCE(sk->sk_bound_dev_if);
+ return bound_dev_if == dif || bound_dev_if == sdif;
+}
#endif /* 64-bit arch */
/* Sockets in TCP_CLOSE state are _always_ taken out of the hash, so we need
--
2.36.0.512.ge40c2bad7a-goog
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 10/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()
2022-05-11 23:37 ` [PATCH net-next 10/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH() Eric Dumazet
@ 2022-05-12 13:15 ` kernel test robot
2022-05-12 16:13 ` Eric Dumazet
0 siblings, 1 reply; 8+ messages in thread
From: kernel test robot @ 2022-05-12 13:15 UTC (permalink / raw)
To: Eric Dumazet, David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: llvm, kbuild-all, netdev, Eric Dumazet
Hi Eric,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git b57c7e8b76c646cf77ce4353a779a8b781592209
config: hexagon-randconfig-r035-20220512 (https://download.01.org/0day-ci/archive/20220512/202205122132.HUrst9JA-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 18dd123c56754edf62c7042dcf23185c3727610f)
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
# https://github.com/intel-lab-lkp/linux/commit/c92cfd9f3ecb483ff055edb02f7498494b96ba68
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
git checkout c92cfd9f3ecb483ff055edb02f7498494b96ba68
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash net/ipv4/
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/ipv4/inet_hashtables.c:413:34: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
if (likely(INET_MATCH(sk, net, acookie,
^~~~~~~
include/linux/compiler.h:77:40: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
net/ipv4/inet_hashtables.c:398:2: note: variable 'acookie' is declared here
INET_ADDR_COOKIE(acookie, saddr, daddr);
^
include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
const int __name __deprecated __always_unused
^
net/ipv4/inet_hashtables.c:468:35: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
if (likely(INET_MATCH(sk2, net, acookie,
^~~~~~~
include/linux/compiler.h:77:40: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
net/ipv4/inet_hashtables.c:452:2: note: variable 'acookie' is declared here
INET_ADDR_COOKIE(acookie, saddr, daddr);
^
include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
const int __name __deprecated __always_unused
^
net/ipv4/inet_hashtables.c:535:38: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
if (unlikely(INET_MATCH(esk, net, acookie,
^~~~~~~
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
net/ipv4/inet_hashtables.c:529:2: note: variable 'acookie' is declared here
INET_ADDR_COOKIE(acookie, sk->sk_daddr, sk->sk_rcv_saddr);
^
include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
const int __name __deprecated __always_unused
^
3 warnings generated.
--
>> net/ipv4/udp.c:2566:27: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
if (INET_MATCH(sk, net, acookie, rmt_addr,
^~~~~~~
net/ipv4/udp.c:2561:2: note: variable 'acookie' is declared here
INET_ADDR_COOKIE(acookie, rmt_addr, loc_addr);
^
include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
const int __name __deprecated __always_unused
^
1 warning generated.
vim +/acookie +413 net/ipv4/inet_hashtables.c
2c13270b441054 Eric Dumazet 2015-03-15 391
c67499c0e77206 Pavel Emelyanov 2008-01-31 392 struct sock *__inet_lookup_established(struct net *net,
c67499c0e77206 Pavel Emelyanov 2008-01-31 393 struct inet_hashinfo *hashinfo,
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 394 const __be32 saddr, const __be16 sport,
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 395 const __be32 daddr, const u16 hnum,
3fa6f616a7a4d0 David Ahern 2017-08-07 396 const int dif, const int sdif)
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 397 {
c7228317441f4d Joe Perches 2014-05-13 398 INET_ADDR_COOKIE(acookie, saddr, daddr);
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 399 const __portpair ports = INET_COMBINED_PORTS(sport, hnum);
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 400 struct sock *sk;
3ab5aee7fe840b Eric Dumazet 2008-11-16 401 const struct hlist_nulls_node *node;
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 402 /* Optimize here for direct hit, only listening connections can
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 403 * have wildcards anyways.
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 404 */
9f26b3add3783c Pavel Emelyanov 2008-06-16 405 unsigned int hash = inet_ehashfn(net, daddr, hnum, saddr, sport);
f373b53b5fe67a Eric Dumazet 2009-10-09 406 unsigned int slot = hash & hashinfo->ehash_mask;
3ab5aee7fe840b Eric Dumazet 2008-11-16 407 struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 408
3ab5aee7fe840b Eric Dumazet 2008-11-16 409 begin:
3ab5aee7fe840b Eric Dumazet 2008-11-16 410 sk_nulls_for_each_rcu(sk, node, &head->chain) {
ce43b03e888947 Eric Dumazet 2012-11-30 411 if (sk->sk_hash != hash)
ce43b03e888947 Eric Dumazet 2012-11-30 412 continue;
ce43b03e888947 Eric Dumazet 2012-11-30 @413 if (likely(INET_MATCH(sk, net, acookie,
3fa6f616a7a4d0 David Ahern 2017-08-07 414 saddr, daddr, ports, dif, sdif))) {
41c6d650f6537e Reshetova, Elena 2017-06-30 415 if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
05dbc7b59481ca Eric Dumazet 2013-10-03 416 goto out;
ce43b03e888947 Eric Dumazet 2012-11-30 417 if (unlikely(!INET_MATCH(sk, net, acookie,
3fa6f616a7a4d0 David Ahern 2017-08-07 418 saddr, daddr, ports,
3fa6f616a7a4d0 David Ahern 2017-08-07 419 dif, sdif))) {
05dbc7b59481ca Eric Dumazet 2013-10-03 420 sock_gen_put(sk);
3ab5aee7fe840b Eric Dumazet 2008-11-16 421 goto begin;
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 422 }
05dbc7b59481ca Eric Dumazet 2013-10-03 423 goto found;
3ab5aee7fe840b Eric Dumazet 2008-11-16 424 }
3ab5aee7fe840b Eric Dumazet 2008-11-16 425 }
3ab5aee7fe840b Eric Dumazet 2008-11-16 426 /*
3ab5aee7fe840b Eric Dumazet 2008-11-16 427 * if the nulls value we got at the end of this lookup is
3ab5aee7fe840b Eric Dumazet 2008-11-16 428 * not the expected one, we must restart lookup.
3ab5aee7fe840b Eric Dumazet 2008-11-16 429 * We probably met an item that was moved to another chain.
3ab5aee7fe840b Eric Dumazet 2008-11-16 430 */
3ab5aee7fe840b Eric Dumazet 2008-11-16 431 if (get_nulls_value(node) != slot)
3ab5aee7fe840b Eric Dumazet 2008-11-16 432 goto begin;
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 433 out:
05dbc7b59481ca Eric Dumazet 2013-10-03 434 sk = NULL;
05dbc7b59481ca Eric Dumazet 2013-10-03 435 found:
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 436 return sk;
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 437 }
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 438 EXPORT_SYMBOL_GPL(__inet_lookup_established);
77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 439
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 10/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()
2022-05-12 13:15 ` kernel test robot
@ 2022-05-12 16:13 ` Eric Dumazet
0 siblings, 0 replies; 8+ messages in thread
From: Eric Dumazet @ 2022-05-12 16:13 UTC (permalink / raw)
To: kernel test robot
Cc: Eric Dumazet, David S . Miller, Jakub Kicinski, Paolo Abeni,
llvm, kbuild-all, netdev
On Thu, May 12, 2022 at 6:16 AM kernel test robot <lkp@intel.com> wrote:
>
> Hi Eric,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on net-next/master]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
> base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git b57c7e8b76c646cf77ce4353a779a8b781592209
> config: hexagon-randconfig-r035-20220512 (https://download.01.org/0day-ci/archive/20220512/202205122132.HUrst9JA-lkp@intel.com/config)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 18dd123c56754edf62c7042dcf23185c3727610f)
> 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
> # https://github.com/intel-lab-lkp/linux/commit/c92cfd9f3ecb483ff055edb02f7498494b96ba68
> git remote add linux-review https://github.com/intel-lab-lkp/linux
> git fetch --no-tags linux-review Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
> git checkout c92cfd9f3ecb483ff055edb02f7498494b96ba68
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash net/ipv4/
Thank you for the instructions.
Unfortunately this is failing for me.
I have tested ARCH=i386 before sending the series, I am not sure what
the issue is for ARCH=hexagon and the cross compiler.
Maybe __always_unused is not yet understood for this combination.
It might be the time to just use __addrpair even on 32bit arches...
Then we can remove saddr,daddr args from INET_MATCH()
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 5d3fa071d754601149c9ad0dd559f074ac58deaa..34ddb54506dd02e702dd20cbe8b7dba006130c5a
100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -295,7 +295,6 @@ static inline struct sock
*inet_lookup_listener(struct net *net,
((__force __portpair)(((__u32)(__dport) << 16) | (__force
__u32)(__be16)(__sport)))
#endif
-#if (BITS_PER_LONG == 64)
#ifdef __BIG_ENDIAN
#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
const __addrpair __name = (__force __addrpair) ( \
@@ -325,30 +324,6 @@ static inline bool INET_MATCH(const struct sock
*sk, struct net *net,
bound_dev_if = READ_ONCE(sk->sk_bound_dev_if);
return bound_dev_if == dif || bound_dev_if == sdif;
}
-#else /* 32-bit arch */
-#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
- const int __name __deprecated __always_unused
-
-static inline bool INET_MATCH(const struct sock *sk, struct net *net,
- const __addrpair __always_unused cookie,
- const __be32 saddr,
- const __be32 daddr,
- const __portpair ports,
- const int dif,
- const int sdif)
-{
- int bound_dev_if;
-
- if (!net_eq(sock_net(sk), net) ||
- sk->sk_portpair != ports ||
- sk->sk_daddr != saddr ||
- sk->sk_rcv_saddr != daddr)
- return false;
-
- bound_dev_if = READ_ONCE(sk->sk_bound_dev_if);
- return bound_dev_if == dif || bound_dev_if == sdif;
-}
-#endif /* 64-bit arch */
I will cook a small patch to simplify INET_MATCH(), then if/when
merged, I will resend the pach series about sk_bound_dev_if.
Thanks.
>
> 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/ipv4/inet_hashtables.c:413:34: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
> if (likely(INET_MATCH(sk, net, acookie,
> ^~~~~~~
> include/linux/compiler.h:77:40: note: expanded from macro 'likely'
> # define likely(x) __builtin_expect(!!(x), 1)
> ^
> net/ipv4/inet_hashtables.c:398:2: note: variable 'acookie' is declared here
> INET_ADDR_COOKIE(acookie, saddr, daddr);
> ^
> include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
> const int __name __deprecated __always_unused
> ^
> net/ipv4/inet_hashtables.c:468:35: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
> if (likely(INET_MATCH(sk2, net, acookie,
> ^~~~~~~
> include/linux/compiler.h:77:40: note: expanded from macro 'likely'
> # define likely(x) __builtin_expect(!!(x), 1)
> ^
> net/ipv4/inet_hashtables.c:452:2: note: variable 'acookie' is declared here
> INET_ADDR_COOKIE(acookie, saddr, daddr);
> ^
> include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
> const int __name __deprecated __always_unused
> ^
> net/ipv4/inet_hashtables.c:535:38: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
> if (unlikely(INET_MATCH(esk, net, acookie,
> ^~~~~~~
> include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
> # define unlikely(x) __builtin_expect(!!(x), 0)
> ^
> net/ipv4/inet_hashtables.c:529:2: note: variable 'acookie' is declared here
> INET_ADDR_COOKIE(acookie, sk->sk_daddr, sk->sk_rcv_saddr);
> ^
> include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
> const int __name __deprecated __always_unused
> ^
> 3 warnings generated.
> --
> >> net/ipv4/udp.c:2566:27: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
> if (INET_MATCH(sk, net, acookie, rmt_addr,
> ^~~~~~~
> net/ipv4/udp.c:2561:2: note: variable 'acookie' is declared here
> INET_ADDR_COOKIE(acookie, rmt_addr, loc_addr);
> ^
> include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
> const int __name __deprecated __always_unused
> ^
> 1 warning generated.
>
>
> vim +/acookie +413 net/ipv4/inet_hashtables.c
>
> 2c13270b441054 Eric Dumazet 2015-03-15 391
> c67499c0e77206 Pavel Emelyanov 2008-01-31 392 struct sock *__inet_lookup_established(struct net *net,
> c67499c0e77206 Pavel Emelyanov 2008-01-31 393 struct inet_hashinfo *hashinfo,
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 394 const __be32 saddr, const __be16 sport,
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 395 const __be32 daddr, const u16 hnum,
> 3fa6f616a7a4d0 David Ahern 2017-08-07 396 const int dif, const int sdif)
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 397 {
> c7228317441f4d Joe Perches 2014-05-13 398 INET_ADDR_COOKIE(acookie, saddr, daddr);
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 399 const __portpair ports = INET_COMBINED_PORTS(sport, hnum);
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 400 struct sock *sk;
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 401 const struct hlist_nulls_node *node;
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 402 /* Optimize here for direct hit, only listening connections can
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 403 * have wildcards anyways.
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 404 */
> 9f26b3add3783c Pavel Emelyanov 2008-06-16 405 unsigned int hash = inet_ehashfn(net, daddr, hnum, saddr, sport);
> f373b53b5fe67a Eric Dumazet 2009-10-09 406 unsigned int slot = hash & hashinfo->ehash_mask;
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 407 struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 408
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 409 begin:
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 410 sk_nulls_for_each_rcu(sk, node, &head->chain) {
> ce43b03e888947 Eric Dumazet 2012-11-30 411 if (sk->sk_hash != hash)
> ce43b03e888947 Eric Dumazet 2012-11-30 412 continue;
> ce43b03e888947 Eric Dumazet 2012-11-30 @413 if (likely(INET_MATCH(sk, net, acookie,
> 3fa6f616a7a4d0 David Ahern 2017-08-07 414 saddr, daddr, ports, dif, sdif))) {
> 41c6d650f6537e Reshetova, Elena 2017-06-30 415 if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
> 05dbc7b59481ca Eric Dumazet 2013-10-03 416 goto out;
> ce43b03e888947 Eric Dumazet 2012-11-30 417 if (unlikely(!INET_MATCH(sk, net, acookie,
> 3fa6f616a7a4d0 David Ahern 2017-08-07 418 saddr, daddr, ports,
> 3fa6f616a7a4d0 David Ahern 2017-08-07 419 dif, sdif))) {
> 05dbc7b59481ca Eric Dumazet 2013-10-03 420 sock_gen_put(sk);
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 421 goto begin;
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 422 }
> 05dbc7b59481ca Eric Dumazet 2013-10-03 423 goto found;
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 424 }
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 425 }
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 426 /*
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 427 * if the nulls value we got at the end of this lookup is
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 428 * not the expected one, we must restart lookup.
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 429 * We probably met an item that was moved to another chain.
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 430 */
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 431 if (get_nulls_value(node) != slot)
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 432 goto begin;
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 433 out:
> 05dbc7b59481ca Eric Dumazet 2013-10-03 434 sk = NULL;
> 05dbc7b59481ca Eric Dumazet 2013-10-03 435 found:
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 436 return sk;
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 437 }
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 438 EXPORT_SYMBOL_GPL(__inet_lookup_established);
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 439
>
> --
> 0-DAY CI Kernel Test Service
> https://01.org/lkp
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 10/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()
@ 2022-05-12 16:13 ` Eric Dumazet
0 siblings, 0 replies; 8+ messages in thread
From: Eric Dumazet @ 2022-05-12 16:13 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 11390 bytes --]
On Thu, May 12, 2022 at 6:16 AM kernel test robot <lkp@intel.com> wrote:
>
> Hi Eric,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on net-next/master]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
> base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git b57c7e8b76c646cf77ce4353a779a8b781592209
> config: hexagon-randconfig-r035-20220512 (https://download.01.org/0day-ci/archive/20220512/202205122132.HUrst9JA-lkp(a)intel.com/config)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 18dd123c56754edf62c7042dcf23185c3727610f)
> 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
> # https://github.com/intel-lab-lkp/linux/commit/c92cfd9f3ecb483ff055edb02f7498494b96ba68
> git remote add linux-review https://github.com/intel-lab-lkp/linux
> git fetch --no-tags linux-review Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
> git checkout c92cfd9f3ecb483ff055edb02f7498494b96ba68
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash net/ipv4/
Thank you for the instructions.
Unfortunately this is failing for me.
I have tested ARCH=i386 before sending the series, I am not sure what
the issue is for ARCH=hexagon and the cross compiler.
Maybe __always_unused is not yet understood for this combination.
It might be the time to just use __addrpair even on 32bit arches...
Then we can remove saddr,daddr args from INET_MATCH()
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 5d3fa071d754601149c9ad0dd559f074ac58deaa..34ddb54506dd02e702dd20cbe8b7dba006130c5a
100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -295,7 +295,6 @@ static inline struct sock
*inet_lookup_listener(struct net *net,
((__force __portpair)(((__u32)(__dport) << 16) | (__force
__u32)(__be16)(__sport)))
#endif
-#if (BITS_PER_LONG == 64)
#ifdef __BIG_ENDIAN
#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
const __addrpair __name = (__force __addrpair) ( \
@@ -325,30 +324,6 @@ static inline bool INET_MATCH(const struct sock
*sk, struct net *net,
bound_dev_if = READ_ONCE(sk->sk_bound_dev_if);
return bound_dev_if == dif || bound_dev_if == sdif;
}
-#else /* 32-bit arch */
-#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
- const int __name __deprecated __always_unused
-
-static inline bool INET_MATCH(const struct sock *sk, struct net *net,
- const __addrpair __always_unused cookie,
- const __be32 saddr,
- const __be32 daddr,
- const __portpair ports,
- const int dif,
- const int sdif)
-{
- int bound_dev_if;
-
- if (!net_eq(sock_net(sk), net) ||
- sk->sk_portpair != ports ||
- sk->sk_daddr != saddr ||
- sk->sk_rcv_saddr != daddr)
- return false;
-
- bound_dev_if = READ_ONCE(sk->sk_bound_dev_if);
- return bound_dev_if == dif || bound_dev_if == sdif;
-}
-#endif /* 64-bit arch */
I will cook a small patch to simplify INET_MATCH(), then if/when
merged, I will resend the pach series about sk_bound_dev_if.
Thanks.
>
> 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/ipv4/inet_hashtables.c:413:34: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
> if (likely(INET_MATCH(sk, net, acookie,
> ^~~~~~~
> include/linux/compiler.h:77:40: note: expanded from macro 'likely'
> # define likely(x) __builtin_expect(!!(x), 1)
> ^
> net/ipv4/inet_hashtables.c:398:2: note: variable 'acookie' is declared here
> INET_ADDR_COOKIE(acookie, saddr, daddr);
> ^
> include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
> const int __name __deprecated __always_unused
> ^
> net/ipv4/inet_hashtables.c:468:35: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
> if (likely(INET_MATCH(sk2, net, acookie,
> ^~~~~~~
> include/linux/compiler.h:77:40: note: expanded from macro 'likely'
> # define likely(x) __builtin_expect(!!(x), 1)
> ^
> net/ipv4/inet_hashtables.c:452:2: note: variable 'acookie' is declared here
> INET_ADDR_COOKIE(acookie, saddr, daddr);
> ^
> include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
> const int __name __deprecated __always_unused
> ^
> net/ipv4/inet_hashtables.c:535:38: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
> if (unlikely(INET_MATCH(esk, net, acookie,
> ^~~~~~~
> include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
> # define unlikely(x) __builtin_expect(!!(x), 0)
> ^
> net/ipv4/inet_hashtables.c:529:2: note: variable 'acookie' is declared here
> INET_ADDR_COOKIE(acookie, sk->sk_daddr, sk->sk_rcv_saddr);
> ^
> include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
> const int __name __deprecated __always_unused
> ^
> 3 warnings generated.
> --
> >> net/ipv4/udp.c:2566:27: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
> if (INET_MATCH(sk, net, acookie, rmt_addr,
> ^~~~~~~
> net/ipv4/udp.c:2561:2: note: variable 'acookie' is declared here
> INET_ADDR_COOKIE(acookie, rmt_addr, loc_addr);
> ^
> include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
> const int __name __deprecated __always_unused
> ^
> 1 warning generated.
>
>
> vim +/acookie +413 net/ipv4/inet_hashtables.c
>
> 2c13270b441054 Eric Dumazet 2015-03-15 391
> c67499c0e77206 Pavel Emelyanov 2008-01-31 392 struct sock *__inet_lookup_established(struct net *net,
> c67499c0e77206 Pavel Emelyanov 2008-01-31 393 struct inet_hashinfo *hashinfo,
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 394 const __be32 saddr, const __be16 sport,
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 395 const __be32 daddr, const u16 hnum,
> 3fa6f616a7a4d0 David Ahern 2017-08-07 396 const int dif, const int sdif)
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 397 {
> c7228317441f4d Joe Perches 2014-05-13 398 INET_ADDR_COOKIE(acookie, saddr, daddr);
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 399 const __portpair ports = INET_COMBINED_PORTS(sport, hnum);
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 400 struct sock *sk;
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 401 const struct hlist_nulls_node *node;
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 402 /* Optimize here for direct hit, only listening connections can
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 403 * have wildcards anyways.
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 404 */
> 9f26b3add3783c Pavel Emelyanov 2008-06-16 405 unsigned int hash = inet_ehashfn(net, daddr, hnum, saddr, sport);
> f373b53b5fe67a Eric Dumazet 2009-10-09 406 unsigned int slot = hash & hashinfo->ehash_mask;
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 407 struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 408
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 409 begin:
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 410 sk_nulls_for_each_rcu(sk, node, &head->chain) {
> ce43b03e888947 Eric Dumazet 2012-11-30 411 if (sk->sk_hash != hash)
> ce43b03e888947 Eric Dumazet 2012-11-30 412 continue;
> ce43b03e888947 Eric Dumazet 2012-11-30 @413 if (likely(INET_MATCH(sk, net, acookie,
> 3fa6f616a7a4d0 David Ahern 2017-08-07 414 saddr, daddr, ports, dif, sdif))) {
> 41c6d650f6537e Reshetova, Elena 2017-06-30 415 if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
> 05dbc7b59481ca Eric Dumazet 2013-10-03 416 goto out;
> ce43b03e888947 Eric Dumazet 2012-11-30 417 if (unlikely(!INET_MATCH(sk, net, acookie,
> 3fa6f616a7a4d0 David Ahern 2017-08-07 418 saddr, daddr, ports,
> 3fa6f616a7a4d0 David Ahern 2017-08-07 419 dif, sdif))) {
> 05dbc7b59481ca Eric Dumazet 2013-10-03 420 sock_gen_put(sk);
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 421 goto begin;
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 422 }
> 05dbc7b59481ca Eric Dumazet 2013-10-03 423 goto found;
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 424 }
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 425 }
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 426 /*
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 427 * if the nulls value we got at the end of this lookup is
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 428 * not the expected one, we must restart lookup.
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 429 * We probably met an item that was moved to another chain.
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 430 */
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 431 if (get_nulls_value(node) != slot)
> 3ab5aee7fe840b Eric Dumazet 2008-11-16 432 goto begin;
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 433 out:
> 05dbc7b59481ca Eric Dumazet 2013-10-03 434 sk = NULL;
> 05dbc7b59481ca Eric Dumazet 2013-10-03 435 found:
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 436 return sk;
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 437 }
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 438 EXPORT_SYMBOL_GPL(__inet_lookup_established);
> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 439
>
> --
> 0-DAY CI Kernel Test Service
> https://01.org/lkp
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 10/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()
2022-05-12 16:13 ` Eric Dumazet
(?)
@ 2022-05-20 8:40 ` Chen, Rong A
2022-05-20 13:17 ` Eric Dumazet
-1 siblings, 1 reply; 8+ messages in thread
From: Chen, Rong A @ 2022-05-20 8:40 UTC (permalink / raw)
To: Eric Dumazet, kernel test robot
Cc: Eric Dumazet, David S . Miller, Jakub Kicinski, Paolo Abeni,
llvm, kbuild-all, netdev
On 5/13/2022 12:13 AM, Eric Dumazet wrote:
> On Thu, May 12, 2022 at 6:16 AM kernel test robot <lkp@intel.com> wrote:
>>
>> Hi Eric,
>>
>> I love your patch! Perhaps something to improve:
>>
>> [auto build test WARNING on net-next/master]
>>
>> url: https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
>> base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git b57c7e8b76c646cf77ce4353a779a8b781592209
>> config: hexagon-randconfig-r035-20220512 (https://download.01.org/0day-ci/archive/20220512/202205122132.HUrst9JA-lkp@intel.com/config)
>> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 18dd123c56754edf62c7042dcf23185c3727610f)
>> 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
>> # https://github.com/intel-lab-lkp/linux/commit/c92cfd9f3ecb483ff055edb02f7498494b96ba68
>> git remote add linux-review https://github.com/intel-lab-lkp/linux
>> git fetch --no-tags linux-review Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
>> git checkout c92cfd9f3ecb483ff055edb02f7498494b96ba68
>> # save the config file
>> mkdir build_dir && cp config build_dir/.config
>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash net/ipv4/
>
> Thank you for the instructions.
> Unfortunately this is failing for me.
Hi Eric,
Can you share the problem you met?
Best Regards,
Rong Chen
>
> I have tested ARCH=i386 before sending the series, I am not sure what
> the issue is for ARCH=hexagon and the cross compiler.
>
> Maybe __always_unused is not yet understood for this combination.
>
> It might be the time to just use __addrpair even on 32bit arches...
>
> Then we can remove saddr,daddr args from INET_MATCH()
>
> diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
> index 5d3fa071d754601149c9ad0dd559f074ac58deaa..34ddb54506dd02e702dd20cbe8b7dba006130c5a
> 100644
> --- a/include/net/inet_hashtables.h
> +++ b/include/net/inet_hashtables.h
> @@ -295,7 +295,6 @@ static inline struct sock
> *inet_lookup_listener(struct net *net,
> ((__force __portpair)(((__u32)(__dport) << 16) | (__force
> __u32)(__be16)(__sport)))
> #endif
>
> -#if (BITS_PER_LONG == 64)
> #ifdef __BIG_ENDIAN
> #define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
> const __addrpair __name = (__force __addrpair) ( \
> @@ -325,30 +324,6 @@ static inline bool INET_MATCH(const struct sock
> *sk, struct net *net,
> bound_dev_if = READ_ONCE(sk->sk_bound_dev_if);
> return bound_dev_if == dif || bound_dev_if == sdif;
> }
> -#else /* 32-bit arch */
> -#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
> - const int __name __deprecated __always_unused
> -
> -static inline bool INET_MATCH(const struct sock *sk, struct net *net,
> - const __addrpair __always_unused cookie,
> - const __be32 saddr,
> - const __be32 daddr,
> - const __portpair ports,
> - const int dif,
> - const int sdif)
> -{
> - int bound_dev_if;
> -
> - if (!net_eq(sock_net(sk), net) ||
> - sk->sk_portpair != ports ||
> - sk->sk_daddr != saddr ||
> - sk->sk_rcv_saddr != daddr)
> - return false;
> -
> - bound_dev_if = READ_ONCE(sk->sk_bound_dev_if);
> - return bound_dev_if == dif || bound_dev_if == sdif;
> -}
> -#endif /* 64-bit arch */
>
>
> I will cook a small patch to simplify INET_MATCH(), then if/when
> merged, I will resend the pach series about sk_bound_dev_if.
>
> Thanks.
>
>
>
>
>>
>> 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/ipv4/inet_hashtables.c:413:34: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
>> if (likely(INET_MATCH(sk, net, acookie,
>> ^~~~~~~
>> include/linux/compiler.h:77:40: note: expanded from macro 'likely'
>> # define likely(x) __builtin_expect(!!(x), 1)
>> ^
>> net/ipv4/inet_hashtables.c:398:2: note: variable 'acookie' is declared here
>> INET_ADDR_COOKIE(acookie, saddr, daddr);
>> ^
>> include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
>> const int __name __deprecated __always_unused
>> ^
>> net/ipv4/inet_hashtables.c:468:35: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
>> if (likely(INET_MATCH(sk2, net, acookie,
>> ^~~~~~~
>> include/linux/compiler.h:77:40: note: expanded from macro 'likely'
>> # define likely(x) __builtin_expect(!!(x), 1)
>> ^
>> net/ipv4/inet_hashtables.c:452:2: note: variable 'acookie' is declared here
>> INET_ADDR_COOKIE(acookie, saddr, daddr);
>> ^
>> include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
>> const int __name __deprecated __always_unused
>> ^
>> net/ipv4/inet_hashtables.c:535:38: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
>> if (unlikely(INET_MATCH(esk, net, acookie,
>> ^~~~~~~
>> include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
>> # define unlikely(x) __builtin_expect(!!(x), 0)
>> ^
>> net/ipv4/inet_hashtables.c:529:2: note: variable 'acookie' is declared here
>> INET_ADDR_COOKIE(acookie, sk->sk_daddr, sk->sk_rcv_saddr);
>> ^
>> include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
>> const int __name __deprecated __always_unused
>> ^
>> 3 warnings generated.
>> --
>>>> net/ipv4/udp.c:2566:27: warning: variable 'acookie' is uninitialized when used here [-Wuninitialized]
>> if (INET_MATCH(sk, net, acookie, rmt_addr,
>> ^~~~~~~
>> net/ipv4/udp.c:2561:2: note: variable 'acookie' is declared here
>> INET_ADDR_COOKIE(acookie, rmt_addr, loc_addr);
>> ^
>> include/net/inet_hashtables.h:330:2: note: expanded from macro 'INET_ADDR_COOKIE'
>> const int __name __deprecated __always_unused
>> ^
>> 1 warning generated.
>>
>>
>> vim +/acookie +413 net/ipv4/inet_hashtables.c
>>
>> 2c13270b441054 Eric Dumazet 2015-03-15 391
>> c67499c0e77206 Pavel Emelyanov 2008-01-31 392 struct sock *__inet_lookup_established(struct net *net,
>> c67499c0e77206 Pavel Emelyanov 2008-01-31 393 struct inet_hashinfo *hashinfo,
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 394 const __be32 saddr, const __be16 sport,
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 395 const __be32 daddr, const u16 hnum,
>> 3fa6f616a7a4d0 David Ahern 2017-08-07 396 const int dif, const int sdif)
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 397 {
>> c7228317441f4d Joe Perches 2014-05-13 398 INET_ADDR_COOKIE(acookie, saddr, daddr);
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 399 const __portpair ports = INET_COMBINED_PORTS(sport, hnum);
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 400 struct sock *sk;
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 401 const struct hlist_nulls_node *node;
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 402 /* Optimize here for direct hit, only listening connections can
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 403 * have wildcards anyways.
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 404 */
>> 9f26b3add3783c Pavel Emelyanov 2008-06-16 405 unsigned int hash = inet_ehashfn(net, daddr, hnum, saddr, sport);
>> f373b53b5fe67a Eric Dumazet 2009-10-09 406 unsigned int slot = hash & hashinfo->ehash_mask;
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 407 struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 408
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 409 begin:
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 410 sk_nulls_for_each_rcu(sk, node, &head->chain) {
>> ce43b03e888947 Eric Dumazet 2012-11-30 411 if (sk->sk_hash != hash)
>> ce43b03e888947 Eric Dumazet 2012-11-30 412 continue;
>> ce43b03e888947 Eric Dumazet 2012-11-30 @413 if (likely(INET_MATCH(sk, net, acookie,
>> 3fa6f616a7a4d0 David Ahern 2017-08-07 414 saddr, daddr, ports, dif, sdif))) {
>> 41c6d650f6537e Reshetova, Elena 2017-06-30 415 if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
>> 05dbc7b59481ca Eric Dumazet 2013-10-03 416 goto out;
>> ce43b03e888947 Eric Dumazet 2012-11-30 417 if (unlikely(!INET_MATCH(sk, net, acookie,
>> 3fa6f616a7a4d0 David Ahern 2017-08-07 418 saddr, daddr, ports,
>> 3fa6f616a7a4d0 David Ahern 2017-08-07 419 dif, sdif))) {
>> 05dbc7b59481ca Eric Dumazet 2013-10-03 420 sock_gen_put(sk);
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 421 goto begin;
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 422 }
>> 05dbc7b59481ca Eric Dumazet 2013-10-03 423 goto found;
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 424 }
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 425 }
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 426 /*
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 427 * if the nulls value we got at the end of this lookup is
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 428 * not the expected one, we must restart lookup.
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 429 * We probably met an item that was moved to another chain.
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 430 */
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 431 if (get_nulls_value(node) != slot)
>> 3ab5aee7fe840b Eric Dumazet 2008-11-16 432 goto begin;
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 433 out:
>> 05dbc7b59481ca Eric Dumazet 2013-10-03 434 sk = NULL;
>> 05dbc7b59481ca Eric Dumazet 2013-10-03 435 found:
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 436 return sk;
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 437 }
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 438 EXPORT_SYMBOL_GPL(__inet_lookup_established);
>> 77a5ba55dab7b4 Pavel Emelyanov 2007-12-20 439
>>
>> --
>> 0-DAY CI Kernel Test Service
>> https://01.org/lkp
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 10/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()
2022-05-20 8:40 ` Chen, Rong A
@ 2022-05-20 13:17 ` Eric Dumazet
0 siblings, 0 replies; 8+ messages in thread
From: Eric Dumazet @ 2022-05-20 13:17 UTC (permalink / raw)
To: Chen, Rong A
Cc: kernel test robot, Eric Dumazet, David S . Miller,
Jakub Kicinski, Paolo Abeni, llvm, kbuild-all, netdev
On Fri, May 20, 2022 at 1:40 AM Chen, Rong A <rong.a.chen@intel.com> wrote:
>
>
>
> On 5/13/2022 12:13 AM, Eric Dumazet wrote:
> > On Thu, May 12, 2022 at 6:16 AM kernel test robot <lkp@intel.com> wrote:
> >>
> >> Hi Eric,
> >>
> >> I love your patch! Perhaps something to improve:
> >>
> >> [auto build test WARNING on net-next/master]
> >>
> >> url: https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
> >> base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git b57c7e8b76c646cf77ce4353a779a8b781592209
> >> config: hexagon-randconfig-r035-20220512 (https://download.01.org/0day-ci/archive/20220512/202205122132.HUrst9JA-lkp@intel.com/config)
> >> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 18dd123c56754edf62c7042dcf23185c3727610f)
> >> 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
> >> # https://github.com/intel-lab-lkp/linux/commit/c92cfd9f3ecb483ff055edb02f7498494b96ba68
> >> git remote add linux-review https://github.com/intel-lab-lkp/linux
> >> git fetch --no-tags linux-review Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
> >> git checkout c92cfd9f3ecb483ff055edb02f7498494b96ba68
> >> # save the config file
> >> mkdir build_dir && cp config build_dir/.config
> >> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash net/ipv4/
> >
> > Thank you for the instructions.
> > Unfortunately this is failing for me.
>
> Hi Eric,
>
> Can you share the problem you met?
It seems the problem has disappeared on the host where I retried the
recipe this morning.
It is very possible that this was because I started from a fresh
directory, instead of reusing a prior git tree,
hoping to not pull 4 GB of data from the Internet :/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 10/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()
@ 2022-05-20 13:17 ` Eric Dumazet
0 siblings, 0 replies; 8+ messages in thread
From: Eric Dumazet @ 2022-05-20 13:17 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2073 bytes --]
On Fri, May 20, 2022 at 1:40 AM Chen, Rong A <rong.a.chen@intel.com> wrote:
>
>
>
> On 5/13/2022 12:13 AM, Eric Dumazet wrote:
> > On Thu, May 12, 2022 at 6:16 AM kernel test robot <lkp@intel.com> wrote:
> >>
> >> Hi Eric,
> >>
> >> I love your patch! Perhaps something to improve:
> >>
> >> [auto build test WARNING on net-next/master]
> >>
> >> url: https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
> >> base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git b57c7e8b76c646cf77ce4353a779a8b781592209
> >> config: hexagon-randconfig-r035-20220512 (https://download.01.org/0day-ci/archive/20220512/202205122132.HUrst9JA-lkp(a)intel.com/config)
> >> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 18dd123c56754edf62c7042dcf23185c3727610f)
> >> 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
> >> # https://github.com/intel-lab-lkp/linux/commit/c92cfd9f3ecb483ff055edb02f7498494b96ba68
> >> git remote add linux-review https://github.com/intel-lab-lkp/linux
> >> git fetch --no-tags linux-review Eric-Dumazet/net-add-annotations-for-sk-sk_bound_dev_if/20220512-073914
> >> git checkout c92cfd9f3ecb483ff055edb02f7498494b96ba68
> >> # save the config file
> >> mkdir build_dir && cp config build_dir/.config
> >> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash net/ipv4/
> >
> > Thank you for the instructions.
> > Unfortunately this is failing for me.
>
> Hi Eric,
>
> Can you share the problem you met?
It seems the problem has disappeared on the host where I retried the
recipe this morning.
It is very possible that this was because I started from a fresh
directory, instead of reusing a prior git tree,
hoping to not pull 4 GB of data from the Internet :/
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-05-20 13:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 21:30 [PATCH net-next 10/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH() kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2022-05-11 23:37 [PATCH net-next 00/10] net: add annotations for sk->sk_bound_dev_if Eric Dumazet
2022-05-11 23:37 ` [PATCH net-next 10/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH() Eric Dumazet
2022-05-12 13:15 ` kernel test robot
2022-05-12 16:13 ` Eric Dumazet
2022-05-12 16:13 ` Eric Dumazet
2022-05-20 8:40 ` Chen, Rong A
2022-05-20 13:17 ` Eric Dumazet
2022-05-20 13:17 ` Eric Dumazet
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.