Re: [PATCH] wireguard: convert selftest/{counter,ratelimiter}.c to KUnit
From: kernel test robot
Date: Tue Oct 20 2020 - 00:44:02 EST
Hi Daniel,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on 7cf726a59435301046250c42131554d9ccc566b8]
url: https://github.com/0day-ci/linux/commits/Daniel-Latypov/wireguard-convert-selftest-counter-ratelimiter-c-to-KUnit/20201020-042650
base: 7cf726a59435301046250c42131554d9ccc566b8
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.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/7a0f82af0af9735a7f20ef9e291e704aff218e8f
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Daniel-Latypov/wireguard-convert-selftest-counter-ratelimiter-c-to-KUnit/20201020-042650
git checkout 7a0f82af0af9735a7f20ef9e291e704aff218e8f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
drivers/net/wireguard/counter_test.c:84:2: note: in expansion of macro 'T'
84 | T(COUNTER_WINDOW_SIZE + 1, true);
| ^
include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast
18 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^~
include/kunit/test.h:748:9: note: in expansion of macro '__typecheck'
748 | ((void)__typecheck(__left, __right)); \
| ^~~~~~~~~~~
include/kunit/test.h:772:2: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
772 | KUNIT_BASE_BINARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:861:2: note: in expansion of macro 'KUNIT_BASE_EQ_MSG_ASSERTION'
861 | KUNIT_BASE_EQ_MSG_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:871:2: note: in expansion of macro 'KUNIT_BINARY_EQ_MSG_ASSERTION'
871 | KUNIT_BINARY_EQ_MSG_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1234:2: note: in expansion of macro 'KUNIT_BINARY_EQ_ASSERTION'
1234 | KUNIT_BINARY_EQ_ASSERTION(test, KUNIT_EXPECTATION, left, right)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireguard/counter_test.c:22:3: note: in expansion of macro 'KUNIT_EXPECT_EQ'
22 | KUNIT_EXPECT_EQ(test, counter_validate(counter, n), v)
| ^~~~~~~~~~~~~~~
drivers/net/wireguard/counter_test.c:85:2: note: in expansion of macro 'T'
85 | T(0, false);
| ^
include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast
18 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^~
include/kunit/test.h:748:9: note: in expansion of macro '__typecheck'
748 | ((void)__typecheck(__left, __right)); \
| ^~~~~~~~~~~
include/kunit/test.h:772:2: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
772 | KUNIT_BASE_BINARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:861:2: note: in expansion of macro 'KUNIT_BASE_EQ_MSG_ASSERTION'
861 | KUNIT_BASE_EQ_MSG_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:871:2: note: in expansion of macro 'KUNIT_BINARY_EQ_MSG_ASSERTION'
871 | KUNIT_BINARY_EQ_MSG_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1234:2: note: in expansion of macro 'KUNIT_BINARY_EQ_ASSERTION'
1234 | KUNIT_BINARY_EQ_ASSERTION(test, KUNIT_EXPECTATION, left, right)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireguard/counter_test.c:22:3: note: in expansion of macro 'KUNIT_EXPECT_EQ'
22 | KUNIT_EXPECT_EQ(test, counter_validate(counter, n), v)
| ^~~~~~~~~~~~~~~
drivers/net/wireguard/counter_test.c:89:3: note: in expansion of macro 'T'
89 | T(i, true);
| ^
include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast
18 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^~
include/kunit/test.h:748:9: note: in expansion of macro '__typecheck'
748 | ((void)__typecheck(__left, __right)); \
| ^~~~~~~~~~~
include/kunit/test.h:772:2: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
772 | KUNIT_BASE_BINARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:861:2: note: in expansion of macro 'KUNIT_BASE_EQ_MSG_ASSERTION'
861 | KUNIT_BASE_EQ_MSG_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:871:2: note: in expansion of macro 'KUNIT_BINARY_EQ_MSG_ASSERTION'
871 | KUNIT_BINARY_EQ_MSG_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1234:2: note: in expansion of macro 'KUNIT_BINARY_EQ_ASSERTION'
1234 | KUNIT_BINARY_EQ_ASSERTION(test, KUNIT_EXPECTATION, left, right)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireguard/counter_test.c:22:3: note: in expansion of macro 'KUNIT_EXPECT_EQ'
22 | KUNIT_EXPECT_EQ(test, counter_validate(counter, n), v)
| ^~~~~~~~~~~~~~~
drivers/net/wireguard/counter_test.c:90:2: note: in expansion of macro 'T'
90 | T(0, true);
| ^
include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast
18 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^~
include/kunit/test.h:748:9: note: in expansion of macro '__typecheck'
748 | ((void)__typecheck(__left, __right)); \
| ^~~~~~~~~~~
include/kunit/test.h:772:2: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
772 | KUNIT_BASE_BINARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:861:2: note: in expansion of macro 'KUNIT_BASE_EQ_MSG_ASSERTION'
861 | KUNIT_BASE_EQ_MSG_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:871:2: note: in expansion of macro 'KUNIT_BINARY_EQ_MSG_ASSERTION'
871 | KUNIT_BINARY_EQ_MSG_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1234:2: note: in expansion of macro 'KUNIT_BINARY_EQ_ASSERTION'
1234 | KUNIT_BINARY_EQ_ASSERTION(test, KUNIT_EXPECTATION, left, right)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireguard/counter_test.c:22:3: note: in expansion of macro 'KUNIT_EXPECT_EQ'
22 | KUNIT_EXPECT_EQ(test, counter_validate(counter, n), v)
| ^~~~~~~~~~~~~~~
drivers/net/wireguard/counter_test.c:91:2: note: in expansion of macro 'T'
91 | T(COUNTER_WINDOW_SIZE + 1, true);
| ^
In file included from drivers/net/wireguard/receive.c:591:
>> drivers/net/wireguard/counter_test.c:96:1: warning: the frame size of 3224 bytes is larger than 2048 bytes [-Wframe-larger-than=]
96 | }
| ^
vim +96 drivers/net/wireguard/counter_test.c
7a0f82af0af973 drivers/net/wireguard/counter_test.c Daniel Latypov 2020-10-19 7
7a0f82af0af973 drivers/net/wireguard/counter_test.c Daniel Latypov 2020-10-19 8 static void wg_packet_counter_test(struct kunit *test)
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 9 {
a9e90d9931f3a4 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2020-05-19 10 struct noise_replay_counter *counter;
7a0f82af0af973 drivers/net/wireguard/counter_test.c Daniel Latypov 2020-10-19 11 unsigned int i;
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 12
7a0f82af0af973 drivers/net/wireguard/counter_test.c Daniel Latypov 2020-10-19 13 counter = kunit_kmalloc(test, sizeof(*counter), GFP_KERNEL);
7a0f82af0af973 drivers/net/wireguard/counter_test.c Daniel Latypov 2020-10-19 14 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, counter);
a9e90d9931f3a4 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2020-05-19 15
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 16 #define T_INIT do { \
a9e90d9931f3a4 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2020-05-19 17 memset(counter, 0, sizeof(*counter)); \
a9e90d9931f3a4 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2020-05-19 18 spin_lock_init(&counter->lock); \
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 19 } while (0)
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 20 #define T_LIM (COUNTER_WINDOW_SIZE + 1)
7a0f82af0af973 drivers/net/wireguard/counter_test.c Daniel Latypov 2020-10-19 21 #define T(n, v) \
7a0f82af0af973 drivers/net/wireguard/counter_test.c Daniel Latypov 2020-10-19 @22 KUNIT_EXPECT_EQ(test, counter_validate(counter, n), v)
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 23
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 24 T_INIT;
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 25 /* 1 */ T(0, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 26 /* 2 */ T(1, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 27 /* 3 */ T(1, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 28 /* 4 */ T(9, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 29 /* 5 */ T(8, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 30 /* 6 */ T(7, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 31 /* 7 */ T(7, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 32 /* 8 */ T(T_LIM, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 33 /* 9 */ T(T_LIM - 1, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 34 /* 10 */ T(T_LIM - 1, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 35 /* 11 */ T(T_LIM - 2, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 36 /* 12 */ T(2, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 37 /* 13 */ T(2, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 38 /* 14 */ T(T_LIM + 16, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 39 /* 15 */ T(3, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 40 /* 16 */ T(T_LIM + 16, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 41 /* 17 */ T(T_LIM * 4, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 42 /* 18 */ T(T_LIM * 4 - (T_LIM - 1), true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 43 /* 19 */ T(10, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 44 /* 20 */ T(T_LIM * 4 - T_LIM, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 45 /* 21 */ T(T_LIM * 4 - (T_LIM + 1), false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 46 /* 22 */ T(T_LIM * 4 - (T_LIM - 2), true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 47 /* 23 */ T(T_LIM * 4 + 1 - T_LIM, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 48 /* 24 */ T(0, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 49 /* 25 */ T(REJECT_AFTER_MESSAGES, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 50 /* 26 */ T(REJECT_AFTER_MESSAGES - 1, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 51 /* 27 */ T(REJECT_AFTER_MESSAGES, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 52 /* 28 */ T(REJECT_AFTER_MESSAGES - 1, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 53 /* 29 */ T(REJECT_AFTER_MESSAGES - 2, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 54 /* 30 */ T(REJECT_AFTER_MESSAGES + 1, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 55 /* 31 */ T(REJECT_AFTER_MESSAGES + 2, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 56 /* 32 */ T(REJECT_AFTER_MESSAGES - 2, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 57 /* 33 */ T(REJECT_AFTER_MESSAGES - 3, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 58 /* 34 */ T(0, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 59
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 60 T_INIT;
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 61 for (i = 1; i <= COUNTER_WINDOW_SIZE; ++i)
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 62 T(i, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 63 T(0, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 64 T(0, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 65
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 66 T_INIT;
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 67 for (i = 2; i <= COUNTER_WINDOW_SIZE + 1; ++i)
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 68 T(i, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 69 T(1, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 70 T(0, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 71
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 72 T_INIT;
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 73 for (i = COUNTER_WINDOW_SIZE + 1; i-- > 0;)
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 74 T(i, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 75
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 76 T_INIT;
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 77 for (i = COUNTER_WINDOW_SIZE + 2; i-- > 1;)
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 78 T(i, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 79 T(0, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 80
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 81 T_INIT;
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 82 for (i = COUNTER_WINDOW_SIZE + 1; i-- > 1;)
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 83 T(i, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 84 T(COUNTER_WINDOW_SIZE + 1, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 85 T(0, false);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 86
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 87 T_INIT;
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 88 for (i = COUNTER_WINDOW_SIZE + 1; i-- > 1;)
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 89 T(i, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 90 T(0, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 91 T(COUNTER_WINDOW_SIZE + 1, true);
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 92
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 93 #undef T
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 94 #undef T_LIM
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 95 #undef T_INIT
e7096c131e5161 drivers/net/wireguard/selftest/counter.c Jason A. Donenfeld 2019-12-09 @96 }
7a0f82af0af973 drivers/net/wireguard/counter_test.c Daniel Latypov 2020-10-19 97
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip