public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Florian Westphal <fw@strlen.de>, netdev@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	steffen.klassert@secunet.com, herbert@gondor.apana.org.au,
	Florian Westphal <fw@strlen.de>
Subject: Re: [PATCH ipsec-next] xfrm: remove hash table alloc/free helpers
Date: Wed, 26 Feb 2025 05:25:54 +0800	[thread overview]
Message-ID: <202502260536.BzRJ7jGr-lkp@intel.com> (raw)
In-Reply-To: <20250224171055.15951-1-fw@strlen.de>

Hi Florian,

kernel test robot noticed the following build warnings:

[auto build test WARNING on klassert-ipsec-next/master]
[also build test WARNING on klassert-ipsec/master net/main net-next/main linus/master v6.14-rc4 next-20250225]
[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/Florian-Westphal/xfrm-remove-hash-table-alloc-free-helpers/20250225-011758
base:   https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git master
patch link:    https://lore.kernel.org/r/20250224171055.15951-1-fw%40strlen.de
patch subject: [PATCH ipsec-next] xfrm: remove hash table alloc/free helpers
config: x86_64-buildonly-randconfig-004-20250226 (https://download.01.org/0day-ci/archive/20250226/202502260536.BzRJ7jGr-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250226/202502260536.BzRJ7jGr-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502260536.BzRJ7jGr-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> net/xfrm/xfrm_state.c:165:26: warning: variable 'ohashmask' set but not used [-Wunused-but-set-variable]
     165 |         unsigned int nhashmask, ohashmask;
         |                                 ^
   1 warning generated.


vim +/ohashmask +165 net/xfrm/xfrm_state.c

f034b5d4efdfe0 David S. Miller  2006-08-24  160  
63082733858502 Alexey Dobriyan  2008-11-25  161  static void xfrm_hash_resize(struct work_struct *work)
f034b5d4efdfe0 David S. Miller  2006-08-24  162  {
63082733858502 Alexey Dobriyan  2008-11-25  163  	struct net *net = container_of(work, struct net, xfrm.state_hash_work);
fe9f1d8779cb47 Sabrina Dubroca  2021-04-25  164  	struct hlist_head *ndst, *nsrc, *nspi, *nseq, *odst, *osrc, *ospi, *oseq;
f034b5d4efdfe0 David S. Miller  2006-08-24 @165  	unsigned int nhashmask, ohashmask;
ef6562fb0dcb1a Florian Westphal 2025-02-24  166  	unsigned long nsize;
f034b5d4efdfe0 David S. Miller  2006-08-24  167  	int i;
f034b5d4efdfe0 David S. Miller  2006-08-24  168  
63082733858502 Alexey Dobriyan  2008-11-25  169  	nsize = xfrm_hash_new_size(net->xfrm.state_hmask);
44e36b42a8378b David S. Miller  2006-08-24  170  	ndst = xfrm_hash_alloc(nsize);
f034b5d4efdfe0 David S. Miller  2006-08-24  171  	if (!ndst)
0244790c8ad240 Ying Xue         2014-08-29  172  		return;
44e36b42a8378b David S. Miller  2006-08-24  173  	nsrc = xfrm_hash_alloc(nsize);
f034b5d4efdfe0 David S. Miller  2006-08-24  174  	if (!nsrc) {
ef6562fb0dcb1a Florian Westphal 2025-02-24  175  		xfrm_hash_free(ndst);
0244790c8ad240 Ying Xue         2014-08-29  176  		return;
f034b5d4efdfe0 David S. Miller  2006-08-24  177  	}
44e36b42a8378b David S. Miller  2006-08-24  178  	nspi = xfrm_hash_alloc(nsize);
f034b5d4efdfe0 David S. Miller  2006-08-24  179  	if (!nspi) {
ef6562fb0dcb1a Florian Westphal 2025-02-24  180  		xfrm_hash_free(ndst);
ef6562fb0dcb1a Florian Westphal 2025-02-24  181  		xfrm_hash_free(nsrc);
0244790c8ad240 Ying Xue         2014-08-29  182  		return;
f034b5d4efdfe0 David S. Miller  2006-08-24  183  	}
fe9f1d8779cb47 Sabrina Dubroca  2021-04-25  184  	nseq = xfrm_hash_alloc(nsize);
fe9f1d8779cb47 Sabrina Dubroca  2021-04-25  185  	if (!nseq) {
ef6562fb0dcb1a Florian Westphal 2025-02-24  186  		xfrm_hash_free(ndst);
ef6562fb0dcb1a Florian Westphal 2025-02-24  187  		xfrm_hash_free(nsrc);
ef6562fb0dcb1a Florian Westphal 2025-02-24  188  		xfrm_hash_free(nspi);
fe9f1d8779cb47 Sabrina Dubroca  2021-04-25  189  		return;
fe9f1d8779cb47 Sabrina Dubroca  2021-04-25  190  	}
f034b5d4efdfe0 David S. Miller  2006-08-24  191  
283bc9f35bbbcb Fan Du           2013-11-07  192  	spin_lock_bh(&net->xfrm.xfrm_state_lock);
e88add19f68191 Ahmed S. Darwish 2021-03-16  193  	write_seqcount_begin(&net->xfrm.xfrm_state_hash_generation);
f034b5d4efdfe0 David S. Miller  2006-08-24  194  
f034b5d4efdfe0 David S. Miller  2006-08-24  195  	nhashmask = (nsize / sizeof(struct hlist_head)) - 1U;
c8406998b80183 Florian Westphal 2016-08-09  196  	odst = xfrm_state_deref_prot(net->xfrm.state_bydst, net);
63082733858502 Alexey Dobriyan  2008-11-25  197  	for (i = net->xfrm.state_hmask; i >= 0; i--)
fe9f1d8779cb47 Sabrina Dubroca  2021-04-25  198  		xfrm_hash_transfer(odst + i, ndst, nsrc, nspi, nseq, nhashmask);
f034b5d4efdfe0 David S. Miller  2006-08-24  199  
c8406998b80183 Florian Westphal 2016-08-09  200  	osrc = xfrm_state_deref_prot(net->xfrm.state_bysrc, net);
c8406998b80183 Florian Westphal 2016-08-09  201  	ospi = xfrm_state_deref_prot(net->xfrm.state_byspi, net);
fe9f1d8779cb47 Sabrina Dubroca  2021-04-25  202  	oseq = xfrm_state_deref_prot(net->xfrm.state_byseq, net);
63082733858502 Alexey Dobriyan  2008-11-25  203  	ohashmask = net->xfrm.state_hmask;
f034b5d4efdfe0 David S. Miller  2006-08-24  204  
c8406998b80183 Florian Westphal 2016-08-09  205  	rcu_assign_pointer(net->xfrm.state_bydst, ndst);
c8406998b80183 Florian Westphal 2016-08-09  206  	rcu_assign_pointer(net->xfrm.state_bysrc, nsrc);
c8406998b80183 Florian Westphal 2016-08-09  207  	rcu_assign_pointer(net->xfrm.state_byspi, nspi);
fe9f1d8779cb47 Sabrina Dubroca  2021-04-25  208  	rcu_assign_pointer(net->xfrm.state_byseq, nseq);
63082733858502 Alexey Dobriyan  2008-11-25  209  	net->xfrm.state_hmask = nhashmask;
f034b5d4efdfe0 David S. Miller  2006-08-24  210  
e88add19f68191 Ahmed S. Darwish 2021-03-16  211  	write_seqcount_end(&net->xfrm.xfrm_state_hash_generation);
283bc9f35bbbcb Fan Du           2013-11-07  212  	spin_unlock_bh(&net->xfrm.xfrm_state_lock);
f034b5d4efdfe0 David S. Miller  2006-08-24  213  
df7274eb70b7c8 Florian Westphal 2016-08-09  214  	synchronize_rcu();
df7274eb70b7c8 Florian Westphal 2016-08-09  215  
ef6562fb0dcb1a Florian Westphal 2025-02-24  216  	xfrm_hash_free(odst);
ef6562fb0dcb1a Florian Westphal 2025-02-24  217  	xfrm_hash_free(osrc);
ef6562fb0dcb1a Florian Westphal 2025-02-24  218  	xfrm_hash_free(ospi);
ef6562fb0dcb1a Florian Westphal 2025-02-24  219  	xfrm_hash_free(oseq);
f034b5d4efdfe0 David S. Miller  2006-08-24  220  }
f034b5d4efdfe0 David S. Miller  2006-08-24  221  

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

           reply	other threads:[~2025-02-25 21:27 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20250224171055.15951-1-fw@strlen.de>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202502260536.BzRJ7jGr-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=fw@strlen.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=llvm@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=steffen.klassert@secunet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox