net: update netdev_rx_csum_fault() print dump only once
Subsystems (6)
cover net: update netdev_rx_csum_fault() print dump only once
From: Tanner Love <[email protected]>
First two patches implement DO_ONCE_LITE for non-fast-path "do once" functionality. Third patch uses the feature in netdev_rx_csum_fault to print dump only once.
Tanner Love (3):
once: implement DO_ONCE_LITE for non-fast-path "do once" functionality
once: replace uses of __section(".data.once") with DO_ONCE_LITE(_IF)?
net: update netdev_rx_csum_fault() print dump only once
fs/xfs/xfs_message.h | 13 +++---------- include/asm-generic/bug.h | 37 +++++++------------------------------ include/linux/once.h | 16 ++++++++++++++++ include/linux/printk.h | 23 +++-------------------- kernel/trace/trace.h | 13 +++---------- net/core/dev.c | 10 +++++++--- 6 files changed, 39 insertions(+), 73 deletions(-)
Signature · 1 line
2.31.1.498.g6c1eba8ee3d-goog
PATCH 1/3 once: implement DO_ONCE_LITE for non-fast-path "do once" functionality
From: Tanner Love <[email protected]>
Certain uses of "do once" functionality (such as many occurrences of static bool __section(".data.once")) reside outside of fast path, and thus do not require jump label patching via static keys.
Implement DO_ONCE_LITE, which offers this "do once" functionality without using static keys.
Implement DO_ONCE_LITE_IF, which offers the same functionality but gated by a condition test. This is common in current uses of static bool __section(".data.once").
--- include/linux/once.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
include/linux/once.h +16 -0
@@ -52,6 +52,22 @@ void __do_once_done(bool *done, struct static_key_true *once_key, ___ret; \ }) +/* Call a function once. Similar to DO_ONCE(), but does not use jump label +* patching via static keys. +*/ +#define DO_ONCE_LITE (func, ...) \ + DO_ONCE_LITE_IF(true, func, ##__VA_ARGS__) +#define DO_ONCE_LITE_IF (condition, func, ...) \ + ({ \ + static bool __section(".data.once") __already_done; \ + bool __ret_do_once = !!(condition); \ + \ + if (unlikely(__ret_do_once && !__already_done)) { \ + __already_done = true; \ + func(__VA_ARGS__); \ + } \ + unlikely(__ret_do_once); \ + })#define get_random_once (buf, nbytes) \ DO_ONCE(get_random_bytes, (buf), (nbytes))#define get_random_once_wait (buf, nbytes) \
Signature · 1 line
2.31.1.498.g6c1eba8ee3d-goog
PATCH 2/3 once: replace uses of __section(".data.once") with DO_ONCE_LITE(_IF)?
In reply to Tanner LoveFrom: Tanner Love <[email protected]>
DO_ONCE_LITE(_IF)? abstracts this "do once" functionality, presenting an opportunity for code reuse.
This commit changes the behavior of xfs_printk_once, printk_once and printk_deferred_once. Before, these macros resulted in code ultimately evaluating to __print_once. Now, they ultimately evaluate to true. This is acceptable because none of the clients of these macros relies on the value.
--- fs/xfs/xfs_message.h | 13 +++---------- include/asm-generic/bug.h | 37 +++++++------------------------------ include/linux/printk.h | 23 +++-------------------- kernel/trace/trace.h | 13 +++---------- 4 files changed, 16 insertions(+), 70 deletions(-)
fs/xfs/xfs_message.h +3 -10
@@ -2,6 +2,8 @@#ifndef __XFS_MESSAGE_H#define __XFS_MESSAGE_H 1 +#include <linux/once.h> +struct xfs_mount ; extern __printf(2, 3)
@@ -41,16 +43,7 @@ do { \ } while (0)#define xfs_printk_once (func, dev, fmt, ...) \ -({ \ - static bool __section(".data.once") __print_once; \ - bool __ret_print_once = !__print_once; \ - \ - if (!__print_once) { \ - __print_once = true; \ - func(dev, fmt, ##__VA_ARGS__); \ - } \ - unlikely(__ret_print_once); \ -}) + DO_ONCE_LITE(func, dev, fmt, ##__VA_ARGS__)#define xfs_emerg_ratelimited (dev, fmt, ...) \ xfs_printk_ratelimited(xfs_emerg, dev, fmt, ##__VA_ARGS__)
include/asm-generic/bug.h +7 -30
@@ -4,6 +4,7 @@#include <linux/compiler.h> #include <linux/instrumentation.h> +#include <linux/once.h> #define CUT_HERE "------------[ cut here ]------------\n"
@@ -140,39 +141,15 @@ void __warn(const char *file, int line, void *caller, unsigned taint, })#ifndef WARN_ON_ONCE -#define WARN_ON_ONCE (condition) ({ \ - static bool __section(".data.once") __warned; \ - int __ret_warn_once = !!(condition); \ - \ - if (unlikely(__ret_warn_once && !__warned)) { \ - __warned = true; \ - WARN_ON(1); \ - } \ - unlikely(__ret_warn_once); \ -}) +#define WARN_ON_ONCE (condition) \ + DO_ONCE_LITE_IF(condition, WARN_ON, 1)#endif -#define WARN_ONCE(condition, format...) ({ \ - static bool __section(".data.once") __warned; \ - int __ret_warn_once = !!(condition); \ - \ - if (unlikely(__ret_warn_once && !__warned)) { \ - __warned = true; \ - WARN(1, format); \ - } \ - unlikely(__ret_warn_once); \ -}) +#define WARN_ONCE(condition, format...) \ + DO_ONCE_LITE_IF(condition, WARN, 1, format) -#define WARN_TAINT_ONCE(condition, taint, format...) ({ \ - static bool __section(".data.once") __warned; \ - int __ret_warn_once = !!(condition); \ - \ - if (unlikely(__ret_warn_once && !__warned)) { \ - __warned = true; \ - WARN_TAINT(1, taint, format); \ - } \ - unlikely(__ret_warn_once); \ -}) +#define WARN_TAINT_ONCE(condition, taint, format...) \ + DO_ONCE_LITE_IF(condition, WARN_TAINT, 1, taint, format)#else /* !CONFIG_BUG */ #ifndef HAVE_ARCH_BUG
include/linux/printk.h +3 -20
@@ -8,6 +8,7 @@#include <linux/linkage.h> #include <linux/cache.h> #include <linux/ratelimit_types.h> +#include <linux/once.h> extern const char linux_banner[];extern const char linux_proc_banner[];
@@ -436,27 +437,9 @@ extern int kptr_restrict;#ifdef CONFIG_PRINTK #define printk_once (fmt, ...) \ -({ \ - static bool __section(".data.once") __print_once; \ - bool __ret_print_once = !__print_once; \ - \ - if (!__print_once) { \ - __print_once = true; \ - printk(fmt, ##__VA_ARGS__); \ - } \ - unlikely(__ret_print_once); \ -}) + DO_ONCE_LITE(printk, fmt, ##__VA_ARGS__)#define printk_deferred_once (fmt, ...) \ -({ \ - static bool __section(".data.once") __print_once; \ - bool __ret_print_once = !__print_once; \ - \ - if (!__print_once) { \ - __print_once = true; \ - printk_deferred(fmt, ##__VA_ARGS__); \ - } \ - unlikely(__ret_print_once); \ -}) + DO_ONCE_LITE(printk_deferred, fmt, ##__VA_ARGS__)#else #define printk_once (fmt, ...) \ no_printk(fmt, ##__VA_ARGS__)
kernel/trace/trace.h +3 -10
@@ -20,6 +20,7 @@#include <linux/irq_work.h> #include <linux/workqueue.h> #include <linux/ctype.h> +#include <linux/once.h> #ifdef CONFIG_FTRACE_SYSCALLS #include <asm/unistd.h> /* For NR_SYSCALLS */
@@ -98,16 +99,8 @@ enum trace_type {#include "trace_entries.h" /* Use this for memory failure errors */ -#define MEM_FAIL (condition, fmt, ...) ({ \ - static bool __section(".data.once") __warned; \ - int __ret_warn_once = !!(condition); \ - \ - if (unlikely(__ret_warn_once && !__warned)) { \ - __warned = true; \ - pr_err("ERROR: " fmt, ##__VA_ARGS__); \ - } \ - unlikely(__ret_warn_once); \ -}) +#define MEM_FAIL (condition, fmt, ...) \ + DO_ONCE_LITE_IF(condition, pr_err, "ERROR: " fmt, ##__VA_ARGS__)/* * syscalls are special, and need special handling, this is why
Signature · 1 line
2.31.1.498.g6c1eba8ee3d-goog
kernel test robot
build botRe: [PATCH net-next 2/3] once: replace uses of __section(".data.once") with DO_ONCE_LITE(_IF)?
Thank you for the patch! Yet something to improve:
Hi Tanner,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Tanner-Love/net-update-netdev_rx_csum_fault-print-dump-only-once/20210423-034958 base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 5d869070569a23aa909c6e7e9d010fc438a492ef config: i386-tinyconfig (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=1 build): # https://github.com/0day-ci/linux/commit/eaeb33f0f85f70fc4e5fbae1e2344e9c6867c840 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Tanner-Love/net-update-netdev_rx_csum_fault-print-dump-only-once/20210423-034958 git checkout eaeb33f0f85f70fc4e5fbae1e2344e9c6867c840 # save the attached .config to linux build tree make W=1 W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
In file included from include/linux/once.h:6,
from include/asm-generic/bug.h:7,
from arch/x86/include/asm/bug.h:93,
from include/linux/bug.h:5,
from include/linux/page-flags.h:10,
from kernel/bounds.c:10:
include/linux/jump_label.h: In function 'static_key_slow_inc':
>> include/linux/jump_label.h:81:35: error: implicit declaration of function 'WARN' [-Werror=implicit-function-declaration]
81 | #define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized, \
| ^~~~
include/linux/jump_label.h:278:2: note: in expansion of macro 'STATIC_KEY_CHECK_USE'
278 | STATIC_KEY_CHECK_USE(key);
| ^~~~~~~~~~~~~~~~~~~~
In file included from include/linux/once.h:6,
from include/asm-generic/bug.h:7,
from arch/x86/include/asm/bug.h:93,
from include/linux/bug.h:5,
from include/linux/page-flags.h:10,
from kernel/bounds.c:10:
include/linux/jump_label.h: In function 'static_key_enable':
>> include/linux/jump_label.h:309:3: error: implicit declaration of function 'WARN_ON_ONCE' [-Werror=implicit-function-declaration]
309 | WARN_ON_ONCE(atomic_read(&key->enabled) != 1);
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from include/linux/once.h:6,
from include/asm-generic/bug.h:7,
from arch/x86/include/asm/bug.h:93,
from include/linux/bug.h:5,
from include/linux/page-flags.h:10,
from kernel/bounds.c:10:
include/linux/jump_label.h: In function 'static_key_slow_inc':
>> include/linux/jump_label.h:81:35: error: implicit declaration of function 'WARN' [-Werror=implicit-function-declaration]
81 | #define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized, \
| ^~~~
include/linux/jump_label.h:278:2: note: in expansion of macro 'STATIC_KEY_CHECK_USE'
278 | STATIC_KEY_CHECK_USE(key);
| ^~~~~~~~~~~~~~~~~~~~
In file included from include/linux/once.h:6,
from include/asm-generic/bug.h:7,
from arch/x86/include/asm/bug.h:93,
from include/linux/bug.h:5,
from include/linux/page-flags.h:10,
from kernel/bounds.c:10:
include/linux/jump_label.h: In function 'static_key_enable':
>> include/linux/jump_label.h:309:3: error: implicit declaration of function 'WARN_ON_ONCE' [-Werror=implicit-function-declaration]
309 | WARN_ON_ONCE(atomic_read(&key->enabled) != 1);
| ^~~~~~~~~~~~ cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:116: kernel/bounds.s] Error 1 make[2]: Target '__build' not remade because of errors. make[1]: *** [Makefile:1235: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:215: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +/WARN_ON_ONCE +309 include/linux/jump_label.h
b202952075f626 Gleb Natapov 2011-11-27 303
e33886b38cc82a Peter Zijlstra 2015-07-24 304 static inline void static_key_enable(struct static_key *key)
e33886b38cc82a Peter Zijlstra 2015-07-24 305 {
5cdda5117e125e Borislav Petkov 2017-10-18 306 STATIC_KEY_CHECK_USE(key);
e33886b38cc82a Peter Zijlstra 2015-07-24 307
1dbb6704de91b1 Paolo Bonzini 2017-08-01 308 if (atomic_read(&key->enabled) != 0) {
1dbb6704de91b1 Paolo Bonzini 2017-08-01 @309 WARN_ON_ONCE(atomic_read(&key->enabled) != 1);
1dbb6704de91b1 Paolo Bonzini 2017-08-01 310 return;
1dbb6704de91b1 Paolo Bonzini 2017-08-01 311 }
1dbb6704de91b1 Paolo Bonzini 2017-08-01 312 atomic_set(&key->enabled, 1);
e33886b38cc82a Peter Zijlstra 2015-07-24 313 }
e33886b38cc82a Peter Zijlstra 2015-07-24 314 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botRe: [PATCH net-next 2/3] once: replace uses of __section(".data.once") with DO_ONCE_LITE(_IF)?
In reply to Tanner LoveThank you for the patch! Yet something to improve:
Hi Tanner,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Tanner-Love/net-update-netdev_rx_csum_fault-print-dump-only-once/20210423-034958 base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 5d869070569a23aa909c6e7e9d010fc438a492ef config: powerpc-randconfig-r011-20210421 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project f5446b769a7929806f72256fccd4826d66502e59)
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
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://github.com/0day-ci/linux/commit/eaeb33f0f85f70fc4e5fbae1e2344e9c6867c840
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Tanner-Love/net-update-netdev_rx_csum_fault-print-dump-only-once/20210423-034958 git checkout eaeb33f0f85f70fc4e5fbae1e2344e9c6867c840
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
In file included from kernel/bounds.c:10:
In file included from include/linux/page-flags.h:10:
In file included from include/linux/bug.h:5:
In file included from arch/powerpc/include/asm/bug.h:109:
In file included from include/asm-generic/bug.h:7:
In file included from include/linux/once.h:6:
In file included from include/linux/jump_label.h:249:
In file included from include/linux/atomic.h:7:
In file included from arch/powerpc/include/asm/atomic.h:11:
>> arch/powerpc/include/asm/cmpxchg.h:80:1: error: use of undeclared identifier 'BITS_PER_BYTE'
XCHG_GEN(u8, _local, "memory");
^
arch/powerpc/include/asm/cmpxchg.h:22:11: note: expanded from macro 'XCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:81:1: error: use of undeclared identifier 'BITS_PER_BYTE'
XCHG_GEN(u8, _relaxed, "cc");
^
arch/powerpc/include/asm/cmpxchg.h:22:11: note: expanded from macro 'XCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:82:1: error: use of undeclared identifier 'BITS_PER_BYTE'
XCHG_GEN(u16, _local, "memory");
^
arch/powerpc/include/asm/cmpxchg.h:22:11: note: expanded from macro 'XCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:83:1: error: use of undeclared identifier 'BITS_PER_BYTE'
XCHG_GEN(u16, _relaxed, "cc");
^
arch/powerpc/include/asm/cmpxchg.h:22:11: note: expanded from macro 'XCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
>> arch/powerpc/include/asm/cmpxchg.h:166:2: error: implicit declaration of function 'BUILD_BUG_ON_MSG' [-Werror,-Wimplicit-function-declaration]
BUILD_BUG_ON_MSG(1, "Unsupported size for __xchg");
^
arch/powerpc/include/asm/cmpxchg.h:185:2: error: implicit declaration of function 'BUILD_BUG_ON_MSG' [-Werror,-Wimplicit-function-declaration]
BUILD_BUG_ON_MSG(1, "Unsupported size for __xchg_local");
^
arch/powerpc/include/asm/cmpxchg.h:206:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u8, , PPC_ATOMIC_ENTRY_BARRIER, PPC_ATOMIC_EXIT_BARRIER, "memory");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:207:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u8, _local, , , "memory");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:208:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u8, _acquire, , PPC_ACQUIRE_BARRIER, "memory");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:209:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u8, _relaxed, , , "cc");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:210:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u16, , PPC_ATOMIC_ENTRY_BARRIER, PPC_ATOMIC_EXIT_BARRIER, "memory");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:211:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u16, _local, , , "memory");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:212:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u16, _acquire, , PPC_ACQUIRE_BARRIER, "memory");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:213:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u16, _relaxed, , , "cc");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:407:2: error: implicit declaration of function 'BUILD_BUG_ON_MSG' [-Werror,-Wimplicit-function-declaration]
BUILD_BUG_ON_MSG(1, "Unsupported size for __cmpxchg");
^
arch/powerpc/include/asm/cmpxchg.h:427:2: error: implicit declaration of function 'BUILD_BUG_ON_MSG' [-Werror,-Wimplicit-function-declaration]
BUILD_BUG_ON_MSG(1, "Unsupported size for __cmpxchg_local");
^
arch/powerpc/include/asm/cmpxchg.h:447:2: error: implicit declaration of function 'BUILD_BUG_ON_MSG' [-Werror,-Wimplicit-function-declaration]
BUILD_BUG_ON_MSG(1, "Unsupported size for __cmpxchg_relaxed");
^
arch/powerpc/include/asm/cmpxchg.h:467:2: error: implicit declaration of function 'BUILD_BUG_ON_MSG' [-Werror,-Wimplicit-function-declaration]
BUILD_BUG_ON_MSG(1, "Unsupported size for __cmpxchg_acquire");
^
In file included from kernel/bounds.c:10:
In file included from include/linux/page-flags.h:10:
In file included from include/linux/bug.h:5:
In file included from arch/powerpc/include/asm/bug.h:109:
In file included from include/asm-generic/bug.h:7:
In file included from include/linux/once.h:6:
In file included from include/linux/jump_label.h:249:
In file included from include/linux/atomic.h:7:
In file included from arch/powerpc/include/asm/atomic.h:11:
In file included from arch/powerpc/include/asm/cmpxchg.h:526:
In file included from include/asm-generic/cmpxchg-local.h:6:
In file included from include/linux/irqflags.h:16:
In file included from arch/powerpc/include/asm/irqflags.h:12:
In file included from arch/powerpc/include/asm/hw_irq.h:12:
In file included from arch/powerpc/include/asm/ptrace.h:264:
In file included from include/linux/thread_info.h:59:
In file included from arch/powerpc/include/asm/thread_info.h:13:
In file included from arch/powerpc/include/asm/page.h:249:
>> arch/powerpc/include/asm/page_32.h:48:2: error: implicit declaration of function '__WARN' [-Werror,-Wimplicit-function-declaration]
WARN_ON((unsigned long)addr & (L1_CACHE_BYTES - 1));
^
arch/powerpc/include/asm/bug.h:87:4: note: expanded from macro 'WARN_ON'
__WARN(); \
^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated.
--
In file included from kernel/bounds.c:10:
In file included from include/linux/page-flags.h:10:
In file included from include/linux/bug.h:5:
In file included from arch/powerpc/include/asm/bug.h:109:
In file included from include/asm-generic/bug.h:7:
In file included from include/linux/once.h:6:
In file included from include/linux/jump_label.h:249:
In file included from include/linux/atomic.h:7:
In file included from arch/powerpc/include/asm/atomic.h:11:
>> arch/powerpc/include/asm/cmpxchg.h:80:1: error: use of undeclared identifier 'BITS_PER_BYTE'
XCHG_GEN(u8, _local, "memory");
^
arch/powerpc/include/asm/cmpxchg.h:22:11: note: expanded from macro 'XCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:81:1: error: use of undeclared identifier 'BITS_PER_BYTE'
XCHG_GEN(u8, _relaxed, "cc");
^
arch/powerpc/include/asm/cmpxchg.h:22:11: note: expanded from macro 'XCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:82:1: error: use of undeclared identifier 'BITS_PER_BYTE'
XCHG_GEN(u16, _local, "memory");
^
arch/powerpc/include/asm/cmpxchg.h:22:11: note: expanded from macro 'XCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:83:1: error: use of undeclared identifier 'BITS_PER_BYTE'
XCHG_GEN(u16, _relaxed, "cc");
^
arch/powerpc/include/asm/cmpxchg.h:22:11: note: expanded from macro 'XCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
>> arch/powerpc/include/asm/cmpxchg.h:166:2: error: implicit declaration of function 'BUILD_BUG_ON_MSG' [-Werror,-Wimplicit-function-declaration]
BUILD_BUG_ON_MSG(1, "Unsupported size for __xchg");
^
arch/powerpc/include/asm/cmpxchg.h:185:2: error: implicit declaration of function 'BUILD_BUG_ON_MSG' [-Werror,-Wimplicit-function-declaration]
BUILD_BUG_ON_MSG(1, "Unsupported size for __xchg_local");
^
arch/powerpc/include/asm/cmpxchg.h:206:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u8, , PPC_ATOMIC_ENTRY_BARRIER, PPC_ATOMIC_EXIT_BARRIER, "memory");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:207:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u8, _local, , , "memory");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:208:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u8, _acquire, , PPC_ACQUIRE_BARRIER, "memory");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:209:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u8, _relaxed, , , "cc");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:210:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u16, , PPC_ATOMIC_ENTRY_BARRIER, PPC_ATOMIC_EXIT_BARRIER, "memory");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:211:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u16, _local, , , "memory");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:212:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u16, _acquire, , PPC_ACQUIRE_BARRIER, "memory");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:213:1: error: use of undeclared identifier 'BITS_PER_BYTE'
CMPXCHG_GEN(u16, _relaxed, , , "cc");
^
arch/powerpc/include/asm/cmpxchg.h:47:11: note: expanded from macro 'CMPXCHG_GEN'
bitoff = BITOFF_CAL(sizeof(type), off); \
^
arch/powerpc/include/asm/cmpxchg.h:11:61: note: expanded from macro 'BITOFF_CAL'
#define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE)
^
arch/powerpc/include/asm/cmpxchg.h:407:2: error: implicit declaration of function 'BUILD_BUG_ON_MSG' [-Werror,-Wimplicit-function-declaration]
BUILD_BUG_ON_MSG(1, "Unsupported size for __cmpxchg");
^
arch/powerpc/include/asm/cmpxchg.h:427:2: error: implicit declaration of function 'BUILD_BUG_ON_MSG' [-Werror,-Wimplicit-function-declaration]
BUILD_BUG_ON_MSG(1, "Unsupported size for __cmpxchg_local");
^
arch/powerpc/include/asm/cmpxchg.h:447:2: error: implicit declaration of function 'BUILD_BUG_ON_MSG' [-Werror,-Wimplicit-function-declaration]
BUILD_BUG_ON_MSG(1, "Unsupported size for __cmpxchg_relaxed");
^
arch/powerpc/include/asm/cmpxchg.h:467:2: error: implicit declaration of function 'BUILD_BUG_ON_MSG' [-Werror,-Wimplicit-function-declaration]
BUILD_BUG_ON_MSG(1, "Unsupported size for __cmpxchg_acquire");
^
In file included from kernel/bounds.c:10:
In file included from include/linux/page-flags.h:10:
In file included from include/linux/bug.h:5:
In file included from arch/powerpc/include/asm/bug.h:109:
In file included from include/asm-generic/bug.h:7:
In file included from include/linux/once.h:6:
In file included from include/linux/jump_label.h:249:
In file included from include/linux/atomic.h:7:
In file included from arch/powerpc/include/asm/atomic.h:11:
In file included from arch/powerpc/include/asm/cmpxchg.h:526:
In file included from include/asm-generic/cmpxchg-local.h:6:
In file included from include/linux/irqflags.h:16:
In file included from arch/powerpc/include/asm/irqflags.h:12:
In file included from arch/powerpc/include/asm/hw_irq.h:12:
In file included from arch/powerpc/include/asm/ptrace.h:264:
In file included from include/linux/thread_info.h:59:
In file included from arch/powerpc/include/asm/thread_info.h:13:
In file included from arch/powerpc/include/asm/page.h:249:
>> arch/powerpc/include/asm/page_32.h:48:2: error: implicit declaration of function '__WARN' [-Werror,-Wimplicit-function-declaration]
WARN_ON((unsigned long)addr & (L1_CACHE_BYTES - 1));
^
arch/powerpc/include/asm/bug.h:87:4: note: expanded from macro 'WARN_ON'
__WARN(); \
^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated.
make[2]: *** [scripts/Makefile.build:116: kernel/bounds.s] Error 1 make[2]: Target '__build' not remade because of errors. make[1]: *** [Makefile:1235: prepare0] Error 2
make[1]: Target 'modules_prepare' not remade because of errors.
make: *** [Makefile:215: __sub-make] Error 2
make: Target 'modules_prepare' not remade because of errors.
..
vim +/BITS_PER_BYTE +80 arch/powerpc/include/asm/cmpxchg.h
d0563a1297e234 Pan Xinhui 2016-04-27 72
ae3a197e3d0bfe David Howells 2012-03-28 73 /*
ae3a197e3d0bfe David Howells 2012-03-28 74 * Atomic exchange
ae3a197e3d0bfe David Howells 2012-03-28 75 *
26760fc19a7e66 Boqun Feng 2015-12-15 76 * Changes the memory location '*p' to be val and returns
ae3a197e3d0bfe David Howells 2012-03-28 77 * the previous value stored there.
ae3a197e3d0bfe David Howells 2012-03-28 78 */
26760fc19a7e66 Boqun Feng 2015-12-15 79
d0563a1297e234 Pan Xinhui 2016-04-27 @80 XCHG_GEN(u8, _local, "memory");
d0563a1297e234 Pan Xinhui 2016-04-27 81 XCHG_GEN(u8, _relaxed, "cc");
d0563a1297e234 Pan Xinhui 2016-04-27 82 XCHG_GEN(u16, _local, "memory");
d0563a1297e234 Pan Xinhui 2016-04-27 83 XCHG_GEN(u16, _relaxed, "cc");
d0563a1297e234 Pan Xinhui 2016-04-27 84
ae3a197e3d0bfe David Howells 2012-03-28 85 static __always_inline unsigned long
26760fc19a7e66 Boqun Feng 2015-12-15 86 __xchg_u32_local(volatile void *p, unsigned long val)
ae3a197e3d0bfe David Howells 2012-03-28 87 {
ae3a197e3d0bfe David Howells 2012-03-28 88 unsigned long prev;
ae3a197e3d0bfe David Howells 2012-03-28 89
ae3a197e3d0bfe David Howells 2012-03-28 90 __asm__ __volatile__(
ae3a197e3d0bfe David Howells 2012-03-28 91 "1: lwarx %0,0,%2 \n"
ae3a197e3d0bfe David Howells 2012-03-28 92 " stwcx. %3,0,%2 \n\
ae3a197e3d0bfe David Howells 2012-03-28 93 bne- 1b"
ae3a197e3d0bfe David Howells 2012-03-28 94 : "=&r" (prev), "+m" (*(volatile unsigned int *)p)
ae3a197e3d0bfe David Howells 2012-03-28 95 : "r" (p), "r" (val)
ae3a197e3d0bfe David Howells 2012-03-28 96 : "cc", "memory");
ae3a197e3d0bfe David Howells 2012-03-28 97
ae3a197e3d0bfe David Howells 2012-03-28 98 return prev;
ae3a197e3d0bfe David Howells 2012-03-28 99 }
ae3a197e3d0bfe David Howells 2012-03-28 100
ae3a197e3d0bfe David Howells 2012-03-28 101 static __always_inline unsigned long
26760fc19a7e66 Boqun Feng 2015-12-15 102 __xchg_u32_relaxed(u32 *p, unsigned long val)
ae3a197e3d0bfe David Howells 2012-03-28 103 {
ae3a197e3d0bfe David Howells 2012-03-28 104 unsigned long prev;
ae3a197e3d0bfe David Howells 2012-03-28 105
ae3a197e3d0bfe David Howells 2012-03-28 106 __asm__ __volatile__(
ae3a197e3d0bfe David Howells 2012-03-28 107 "1: lwarx %0,0,%2\n"
26760fc19a7e66 Boqun Feng 2015-12-15 108 " stwcx. %3,0,%2\n"
26760fc19a7e66 Boqun Feng 2015-12-15 109 " bne- 1b"
26760fc19a7e66 Boqun Feng 2015-12-15 110 : "=&r" (prev), "+m" (*p)
ae3a197e3d0bfe David Howells 2012-03-28 111 : "r" (p), "r" (val)
26760fc19a7e66 Boqun Feng 2015-12-15 112 : "cc");
ae3a197e3d0bfe David Howells 2012-03-28 113
ae3a197e3d0bfe David Howells 2012-03-28 114 return prev;
ae3a197e3d0bfe David Howells 2012-03-28 115 }
ae3a197e3d0bfe David Howells 2012-03-28 116
ae3a197e3d0bfe David Howells 2012-03-28 117 #ifdef CONFIG_PPC64
ae3a197e3d0bfe David Howells 2012-03-28 118 static __always_inline unsigned long
26760fc19a7e66 Boqun Feng 2015-12-15 119 __xchg_u64_local(volatile void *p, unsigned long val)
ae3a197e3d0bfe David Howells 2012-03-28 120 {
ae3a197e3d0bfe David Howells 2012-03-28 121 unsigned long prev;
ae3a197e3d0bfe David Howells 2012-03-28 122
ae3a197e3d0bfe David Howells 2012-03-28 123 __asm__ __volatile__(
ae3a197e3d0bfe David Howells 2012-03-28 124 "1: ldarx %0,0,%2 \n"
ae3a197e3d0bfe David Howells 2012-03-28 125 " stdcx. %3,0,%2 \n\
ae3a197e3d0bfe David Howells 2012-03-28 126 bne- 1b"
ae3a197e3d0bfe David Howells 2012-03-28 127 : "=&r" (prev), "+m" (*(volatile unsigned long *)p)
ae3a197e3d0bfe David Howells 2012-03-28 128 : "r" (p), "r" (val)
ae3a197e3d0bfe David Howells 2012-03-28 129 : "cc", "memory");
ae3a197e3d0bfe David Howells 2012-03-28 130
ae3a197e3d0bfe David Howells 2012-03-28 131 return prev;
ae3a197e3d0bfe David Howells 2012-03-28 132 }
ae3a197e3d0bfe David Howells 2012-03-28 133
ae3a197e3d0bfe David Howells 2012-03-28 134 static __always_inline unsigned long
26760fc19a7e66 Boqun Feng 2015-12-15 135 __xchg_u64_relaxed(u64 *p, unsigned long val)
ae3a197e3d0bfe David Howells 2012-03-28 136 {
ae3a197e3d0bfe David Howells 2012-03-28 137 unsigned long prev;
ae3a197e3d0bfe David Howells 2012-03-28 138
ae3a197e3d0bfe David Howells 2012-03-28 139 __asm__ __volatile__(
ae3a197e3d0bfe David Howells 2012-03-28 140 "1: ldarx %0,0,%2\n"
26760fc19a7e66 Boqun Feng 2015-12-15 141 " stdcx. %3,0,%2\n"
26760fc19a7e66 Boqun Feng 2015-12-15 142 " bne- 1b"
26760fc19a7e66 Boqun Feng 2015-12-15 143 : "=&r" (prev), "+m" (*p)
ae3a197e3d0bfe David Howells 2012-03-28 144 : "r" (p), "r" (val)
26760fc19a7e66 Boqun Feng 2015-12-15 145 : "cc");
ae3a197e3d0bfe David Howells 2012-03-28 146
ae3a197e3d0bfe David Howells 2012-03-28 147 return prev;
ae3a197e3d0bfe David Howells 2012-03-28 148 }
ae3a197e3d0bfe David Howells 2012-03-28 149 #endif
ae3a197e3d0bfe David Howells 2012-03-28 150
ae3a197e3d0bfe David Howells 2012-03-28 151 static __always_inline unsigned long
d0563a1297e234 Pan Xinhui 2016-04-27 152 __xchg_local(void *ptr, unsigned long x, unsigned int size)
ae3a197e3d0bfe David Howells 2012-03-28 153 {
ae3a197e3d0bfe David Howells 2012-03-28 154 switch (size) {
d0563a1297e234 Pan Xinhui 2016-04-27 155 case 1:
d0563a1297e234 Pan Xinhui 2016-04-27 156 return __xchg_u8_local(ptr, x);
d0563a1297e234 Pan Xinhui 2016-04-27 157 case 2:
d0563a1297e234 Pan Xinhui 2016-04-27 158 return __xchg_u16_local(ptr, x);
ae3a197e3d0bfe David Howells 2012-03-28 159 case 4:
26760fc19a7e66 Boqun Feng 2015-12-15 160 return __xchg_u32_local(ptr, x);
ae3a197e3d0bfe David Howells 2012-03-28 161 #ifdef CONFIG_PPC64
ae3a197e3d0bfe David Howells 2012-03-28 162 case 8:
26760fc19a7e66 Boqun Feng 2015-12-15 163 return __xchg_u64_local(ptr, x);
ae3a197e3d0bfe David Howells 2012-03-28 164 #endif
ae3a197e3d0bfe David Howells 2012-03-28 165 }
10d8b1480e6966 pan xinhui 2016-02-23 @166 BUILD_BUG_ON_MSG(1, "Unsupported size for __xchg");
ae3a197e3d0bfe David Howells 2012-03-28 167 return x;
ae3a197e3d0bfe David Howells 2012-03-28 168 }ae3a197e3d0bfe David Howells 2012-03-28 169
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botRe: [PATCH net-next 2/3] once: replace uses of __section(".data.once") with DO_ONCE_LITE(_IF)?
In reply to Tanner LoveThank you for the patch! Yet something to improve:
Hi Tanner,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Tanner-Love/net-update-netdev_rx_csum_fault-print-dump-only-once/20210423-034958 base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 5d869070569a23aa909c6e7e9d010fc438a492ef config: s390-randconfig-r014-20210421 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project f5446b769a7929806f72256fccd4826d66502e59)
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
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://github.com/0day-ci/linux/commit/eaeb33f0f85f70fc4e5fbae1e2344e9c6867c840
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Tanner-Love/net-update-netdev_rx_csum_fault-print-dump-only-once/20210423-034958 git checkout eaeb33f0f85f70fc4e5fbae1e2344e9c6867c840
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=s390
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
In file included from kernel/bounds.c:10:
In file included from include/linux/page-flags.h:10:
In file included from include/linux/bug.h:5:
In file included from arch/s390/include/asm/bug.h:68:
In file included from include/asm-generic/bug.h:7:
In file included from include/linux/once.h:6:
include/linux/jump_label.h:278:2: error: implicit declaration of function 'WARN' [-Werror,-Wimplicit-function-declaration]
STATIC_KEY_CHECK_USE(key);
^
include/linux/jump_label.h:81:35: note: expanded from macro 'STATIC_KEY_CHECK_USE'
#define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized, \
^
include/linux/jump_label.h:284:2: error: implicit declaration of function 'WARN' [-Werror,-Wimplicit-function-declaration]
STATIC_KEY_CHECK_USE(key);
^
include/linux/jump_label.h:81:35: note: expanded from macro 'STATIC_KEY_CHECK_USE'
#define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized, \
^
include/linux/jump_label.h:306:2: error: implicit declaration of function 'WARN' [-Werror,-Wimplicit-function-declaration]
STATIC_KEY_CHECK_USE(key);
^
include/linux/jump_label.h:81:35: note: expanded from macro 'STATIC_KEY_CHECK_USE'
#define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized, \
^
>> include/linux/jump_label.h:309:3: error: implicit declaration of function 'WARN_ON_ONCE' [-Werror,-Wimplicit-function-declaration]
WARN_ON_ONCE(atomic_read(&key->enabled) != 1);
^
include/linux/jump_label.h:317:2: error: implicit declaration of function 'WARN' [-Werror,-Wimplicit-function-declaration]
STATIC_KEY_CHECK_USE(key);
^
include/linux/jump_label.h:81:35: note: expanded from macro 'STATIC_KEY_CHECK_USE'
#define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized, \
^
include/linux/jump_label.h:320:3: error: implicit declaration of function 'WARN_ON_ONCE' [-Werror,-Wimplicit-function-declaration]
WARN_ON_ONCE(atomic_read(&key->enabled) != 0);
^ 6 errors generated.
--
In file included from kernel/bounds.c:10:
In file included from include/linux/page-flags.h:10:
In file included from include/linux/bug.h:5:
In file included from arch/s390/include/asm/bug.h:68:
In file included from include/asm-generic/bug.h:7:
In file included from include/linux/once.h:6:
include/linux/jump_label.h:278:2: error: implicit declaration of function 'WARN' [-Werror,-Wimplicit-function-declaration]
STATIC_KEY_CHECK_USE(key);
^
include/linux/jump_label.h:81:35: note: expanded from macro 'STATIC_KEY_CHECK_USE'
#define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized, \
^
include/linux/jump_label.h:284:2: error: implicit declaration of function 'WARN' [-Werror,-Wimplicit-function-declaration]
STATIC_KEY_CHECK_USE(key);
^
include/linux/jump_label.h:81:35: note: expanded from macro 'STATIC_KEY_CHECK_USE'
#define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized, \
^
include/linux/jump_label.h:306:2: error: implicit declaration of function 'WARN' [-Werror,-Wimplicit-function-declaration]
STATIC_KEY_CHECK_USE(key);
^
include/linux/jump_label.h:81:35: note: expanded from macro 'STATIC_KEY_CHECK_USE'
#define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized, \
^
>> include/linux/jump_label.h:309:3: error: implicit declaration of function 'WARN_ON_ONCE' [-Werror,-Wimplicit-function-declaration]
WARN_ON_ONCE(atomic_read(&key->enabled) != 1);
^
include/linux/jump_label.h:317:2: error: implicit declaration of function 'WARN' [-Werror,-Wimplicit-function-declaration]
STATIC_KEY_CHECK_USE(key);
^
include/linux/jump_label.h:81:35: note: expanded from macro 'STATIC_KEY_CHECK_USE'
#define STATIC_KEY_CHECK_USE(key) WARN(!static_key_initialized, \
^
include/linux/jump_label.h:320:3: error: implicit declaration of function 'WARN_ON_ONCE' [-Werror,-Wimplicit-function-declaration]
WARN_ON_ONCE(atomic_read(&key->enabled) != 0);
^ 6 errors generated.
make[2]: *** [scripts/Makefile.build:116: kernel/bounds.s] Error 1 make[2]: Target '__build' not remade because of errors. make[1]: *** [Makefile:1235: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:215: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +/WARN_ON_ONCE +309 include/linux/jump_label.h
b202952075f626 Gleb Natapov 2011-11-27 303
e33886b38cc82a Peter Zijlstra 2015-07-24 304 static inline void static_key_enable(struct static_key *key)
e33886b38cc82a Peter Zijlstra 2015-07-24 305 {
5cdda5117e125e Borislav Petkov 2017-10-18 306 STATIC_KEY_CHECK_USE(key);
e33886b38cc82a Peter Zijlstra 2015-07-24 307
1dbb6704de91b1 Paolo Bonzini 2017-08-01 308 if (atomic_read(&key->enabled) != 0) {
1dbb6704de91b1 Paolo Bonzini 2017-08-01 @309 WARN_ON_ONCE(atomic_read(&key->enabled) != 1);
1dbb6704de91b1 Paolo Bonzini 2017-08-01 310 return;
1dbb6704de91b1 Paolo Bonzini 2017-08-01 311 }
1dbb6704de91b1 Paolo Bonzini 2017-08-01 312 atomic_set(&key->enabled, 1);
e33886b38cc82a Peter Zijlstra 2015-07-24 313 }
e33886b38cc82a Peter Zijlstra 2015-07-24 314 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
PATCH 3/3 net: update netdev_rx_csum_fault() print dump only once
In reply to Tanner LoveFrom: Tanner Love <[email protected]>
Printing this stack dump multiple times does not provide additional useful information, and consumes time in the data path. Printing once is sufficient.
--- net/core/dev.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
net/core/dev.c +7 -3
@@ -148,6 +148,7 @@#include <net/devlink.h> #include <linux/pm_runtime.h> #include <linux/prandom.h> +#include <linux/once.h> #include "net-sysfs.h"
@@ -3487,13 +3488,16 @@ EXPORT_SYMBOL(__skb_gso_segment);/* Take action when hardware reception checksum errors are detected. */ #ifdef CONFIG_BUG -void netdev_rx_csum_fault (struct net_device *dev,struct sk_buff *skb) +static void do_netdev_rx_csum_fault (struct net_device *dev,struct sk_buff *skb) { -if (net_ratelimit ()) {pr_err ("%s: hw csum failure\n" , dev ? dev->name :"<unknown>" );skb_dump (KERN_ERR , skb, true);dump_stack (); - } +} + +void netdev_rx_csum_fault (struct net_device *dev,struct sk_buff *skb) +{ +DO_ONCE_LITE (do_netdev_rx_csum_fault, dev, skb); }EXPORT_SYMBOL (netdev_rx_csum_fault);#endif
Signature · 1 line
2.31.1.498.g6c1eba8ee3d-goog
Quoted 26 lines · Tanner Love
From: Tanner Love <[email protected]>
Printing this stack dump multiple times does not provide additional useful information, and consumes time in the data path. Printing once is sufficient.
Signed-off-by Tanner Love <[email protected]>Acked-by Eric Dumazet <[email protected]>Acked-by Mahesh Bandewar <[email protected]>--- net/core/dev.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)net/core/dev.c +1
-0@@ -148,6 +148,7 @@#include <net/devlink.h> #include <linux/pm_runtime.h> #include <linux/prandom.h> +#include <linux/once.h> #include "net-sysfs.h"
net/core/dev.c EXPORT_SYMBOL(__skb_gso_segment); · line 3495
Quoted 10 lines
net/core/dev.c +1
-2@@ -3487,13 +3488,16 @@ EXPORT_SYMBOL(__skb_gso_segment);/* Take action when hardware reception checksum errors are detected. */ #ifdef CONFIG_BUG -void netdev_rx_csum_fault (struct net_device *dev,struct sk_buff *skb) +static void do_netdev_rx_csum_fault (struct net_device *dev,struct sk_buff *skb) { -if (net_ratelimit ()) {pr_err ("%s: hw csum failure\n" , dev ? dev->name :"<unknown>" );skb_dump (KERN_ERR , skb, true);dump_stack ();
Once the "if ()" is removed, one level of indent seems enough?
Quoted 10 lines
net/core/dev.c +5
-1- } +} + +void netdev_rx_csum_fault (struct net_device *dev,struct sk_buff *skb) +{ +DO_ONCE_LITE (do_netdev_rx_csum_fault, dev, skb); }EXPORT_SYMBOL (netdev_rx_csum_fault);#endif