net/core/skbuff.c:177:33: error: implicit declaration of function 'kmem_cache_alloc_cached'; did you mean 'kmem_cache_alloc_trace'?

From: kernel test robot
Date: Mon Sep 27 2021 - 16:01:43 EST


tree: https://github.com/0day-ci/linux/commits/Kangmin-Park/Introducing-lockless-cache-built-on-top-of-slab-allocator/20210922-153019
head: c40b46ce7950275afb58f344217952e6b29dd9fd
commit: c40b46ce7950275afb58f344217952e6b29dd9fd Introducing lockless cache built on top of slab allocator
date: 6 days ago
config: microblaze-buildonly-randconfig-r004-20210927 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 11.2.0
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/0day-ci/linux/commit/c40b46ce7950275afb58f344217952e6b29dd9fd
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Kangmin-Park/Introducing-lockless-cache-built-on-top-of-slab-allocator/20210922-153019
git checkout c40b46ce7950275afb58f344217952e6b29dd9fd
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

net/core/skbuff.c: In function 'napi_skb_cache_get':
>> net/core/skbuff.c:177:33: error: implicit declaration of function 'kmem_cache_alloc_cached'; did you mean 'kmem_cache_alloc_trace'? [-Werror=implicit-function-declaration]
177 | nc->skb_cache = kmem_cache_alloc_cached(skbuff_head_cache,
| ^~~~~~~~~~~~~~~~~~~~~~~
| kmem_cache_alloc_trace
>> net/core/skbuff.c:178:70: error: 'SLB_LOCKLESS_CACHE' undeclared (first use in this function)
178 | GFP_ATOMIC | SLB_LOCKLESS_CACHE);
| ^~~~~~~~~~~~~~~~~~
net/core/skbuff.c:178:70: note: each undeclared identifier is reported only once for each function it appears in
In file included from include/asm-generic/percpu.h:7,
from ./arch/microblaze/include/generated/asm/percpu.h:1,
from include/linux/irqflags.h:17,
from include/asm-generic/bitops.h:14,
from ./arch/microblaze/include/generated/asm/bitops.h:1,
from include/linux/bitops.h:33,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from net/core/skbuff.c:37:
>> include/linux/percpu-defs.h:219:59: error: invalid use of undefined type 'struct kmem_cache'
219 | const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
| ^
include/linux/percpu-defs.h:259:9: note: in expansion of macro '__verify_pcpu_ptr'
259 | __verify_pcpu_ptr(__p); \
| ^~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:263:49: note: in expansion of macro 'VERIFY_PERCPU_PTR'
263 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR(ptr); })
| ^~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:264:33: note: in expansion of macro 'per_cpu_ptr'
264 | #define raw_cpu_ptr(ptr) per_cpu_ptr(ptr, 0)
| ^~~~~~~~~~~
include/linux/percpu-defs.h:265:33: note: in expansion of macro 'raw_cpu_ptr'
265 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr)
| ^~~~~~~~~~~
net/core/skbuff.c:179:33: note: in expansion of macro 'this_cpu_ptr'
179 | nc->skb_count = this_cpu_ptr(skbuff_head_cache)->size;
| ^~~~~~~~~~~~
>> net/core/skbuff.c:179:64: error: invalid use of undefined type 'struct kmem_cache'
179 | nc->skb_count = this_cpu_ptr(skbuff_head_cache)->size;
| ^~
cc1: all warnings being treated as errors


vim +177 net/core/skbuff.c

167
168 static struct sk_buff *napi_skb_cache_get(void)
169 {
170 struct napi_alloc_cache *nc = this_cpu_ptr(&napi_alloc_cache);
171 struct sk_buff *skb;
172
173 if (unlikely(!nc->skb_count)) {
174 /* kmem_cache_alloc_cached should be changed to return the size of
175 * the allocated cache
176 */
> 177 nc->skb_cache = kmem_cache_alloc_cached(skbuff_head_cache,
> 178 GFP_ATOMIC | SLB_LOCKLESS_CACHE);
> 179 nc->skb_count = this_cpu_ptr(skbuff_head_cache)->size;
180 }
181
182 if (unlikely(!nc->skb_count))
183 return NULL;
184
185 skb = nc->skb_cache[--nc->skb_count];
186 kasan_unpoison_object_data(skbuff_head_cache, skb);
187
188 return skb;
189 }
190

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip