[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202207142124.OHu1H8Us-lkp@intel.com>
Date: Thu, 14 Jul 2022 22:05:45 +0800
From: kernel test robot <lkp@...el.com>
To: Joanne Koong <joannelkoong@...il.com>, netdev@...r.kernel.org
Cc: kbuild-all@...ts.01.org, edumazet@...gle.com, kafai@...com,
kuba@...nel.org, davem@...emloft.net, pabeni@...hat.com,
Joanne Koong <joannelkoong@...il.com>
Subject: Re: [PATCH net-next v2 1/3] net: Add a bhash2 table hashed by port +
address
Hi Joanne,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Joanne-Koong/Add-a-second-bind-table-hashed-by-port-address/20220713-075808
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 5022e221c98a609e0e5b0a73852c7e3d32f1c545
config: um-i386_defconfig (https://download.01.org/0day-ci/archive/20220714/202207142124.OHu1H8Us-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/2e20fc25bca52fbc786bbae312df56514c10798d
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Joanne-Koong/Add-a-second-bind-table-hashed-by-port-address/20220713-075808
git checkout 2e20fc25bca52fbc786bbae312df56514c10798d
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=um SUBARCH=i386 SHELL=/bin/bash net/ipv4/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
net/ipv4/inet_hashtables.c: In function 'inet_bhash2_update_saddr':
>> net/ipv4/inet_hashtables.c:853:38: warning: variable 'head' set but not used [-Wunused-but-set-variable]
853 | struct inet_bind_hashbucket *head, *head2;
| ^~~~
vim +/head +853 net/ipv4/inet_hashtables.c
849
850 int inet_bhash2_update_saddr(struct inet_bind_hashbucket *prev_saddr, struct sock *sk)
851 {
852 struct inet_hashinfo *hinfo = sk->sk_prot->h.hashinfo;
> 853 struct inet_bind_hashbucket *head, *head2;
854 struct inet_bind2_bucket *tb2, *new_tb2;
855 int l3mdev = inet_sk_bound_l3mdev(sk);
856 int port = inet_sk(sk)->inet_num;
857 struct net *net = sock_net(sk);
858
859 /* Allocate a bind2 bucket ahead of time to avoid permanently putting
860 * the bhash2 table in an inconsistent state if a new tb2 bucket
861 * allocation fails.
862 */
863 new_tb2 = kmem_cache_alloc(hinfo->bind2_bucket_cachep, GFP_ATOMIC);
864 if (!new_tb2)
865 return -ENOMEM;
866
867 head = &hinfo->bhash[inet_bhashfn(net, port,
868 hinfo->bhash_size)];
869 head2 = inet_bhashfn_portaddr(hinfo, sk, net, port);
870
871 spin_lock_bh(&prev_saddr->lock);
872 __sk_del_bind2_node(sk);
873 inet_bind2_bucket_destroy(hinfo->bind2_bucket_cachep,
874 inet_csk(sk)->icsk_bind2_hash);
875 spin_unlock_bh(&prev_saddr->lock);
876
877 spin_lock_bh(&head2->lock);
878 tb2 = inet_bind2_bucket_find(head2, net, port, l3mdev, sk);
879 if (!tb2) {
880 tb2 = new_tb2;
881 inet_bind2_bucket_init(tb2, net, head2, port, l3mdev, sk);
882 }
883 sk_add_bind2_node(sk, &tb2->owners);
884 inet_csk(sk)->icsk_bind2_hash = tb2;
885 spin_unlock_bh(&head2->lock);
886
887 if (tb2 != new_tb2)
888 kmem_cache_free(hinfo->bind2_bucket_cachep, new_tb2);
889
890 return 0;
891 }
892 EXPORT_SYMBOL_GPL(inet_bhash2_update_saddr);
893
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists