net/mctp/test/route-test.c:186:1: warning: the frame size of 1184 bytes is larger than 1024 bytes

From: kernel test robot
Date: Wed Nov 24 2021 - 08:01:33 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5d9f4cf36721aba199975a9be7863a3ff5cd4b59
commit: 161eba50e183ed4ca20f6d8dec19bdc526d2b2b9 mctp: Add initial test structure and fragmentation test
date: 7 weeks ago
config: powerpc64-randconfig-r023-20211124 (https://download.01.org/0day-ci/archive/20211124/202111242036.yDuA29vn-lkp@xxxxxxxxx/config)
compiler: powerpc64-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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=161eba50e183ed4ca20f6d8dec19bdc526d2b2b9
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 161eba50e183ed4ca20f6d8dec19bdc526d2b2b9
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=powerpc

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

All warnings (new ones prefixed by >>):

In file included from net/mctp/route.c:1234:
net/mctp/test/route-test.c: In function 'mctp_test_fragment':
>> net/mctp/test/route-test.c:186:1: warning: the frame size of 1184 bytes is larger than 1024 bytes [-Wframe-larger-than=]
186 | }
| ^


vim +186 net/mctp/test/route-test.c

101
102 static void mctp_test_fragment(struct kunit *test)
103 {
104 const struct mctp_frag_test *params;
105 int rc, i, n, mtu, msgsize;
106 struct mctp_test_route *rt;
107 struct sk_buff *skb;
108 struct mctp_hdr hdr;
109 u8 seq;
110
111 params = test->param_value;
112 mtu = params->mtu;
113 msgsize = params->msgsize;
114
115 hdr.ver = 1;
116 hdr.src = 8;
117 hdr.dest = 10;
118 hdr.flags_seq_tag = MCTP_HDR_FLAG_TO;
119
120 skb = mctp_test_create_skb(&hdr, msgsize);
121 KUNIT_ASSERT_TRUE(test, skb);
122
123 rt = mctp_test_create_route(&init_net, 10, mtu);
124 KUNIT_ASSERT_TRUE(test, rt);
125
126 /* The refcount would usually be incremented as part of a route lookup,
127 * but we're setting the route directly here.
128 */
129 refcount_inc(&rt->rt.refs);
130
131 rc = mctp_do_fragment_route(&rt->rt, skb, mtu, MCTP_TAG_OWNER);
132 KUNIT_EXPECT_FALSE(test, rc);
133
134 n = rt->pkts.qlen;
135
136 KUNIT_EXPECT_EQ(test, n, params->n_frags);
137
138 for (i = 0;; i++) {
139 struct mctp_hdr *hdr2;
140 struct sk_buff *skb2;
141 u8 tag_mask, seq2;
142 bool first, last;
143
144 first = i == 0;
145 last = i == (n - 1);
146
147 skb2 = skb_dequeue(&rt->pkts);
148
149 if (!skb2)
150 break;
151
152 hdr2 = mctp_hdr(skb2);
153
154 tag_mask = MCTP_HDR_TAG_MASK | MCTP_HDR_FLAG_TO;
155
156 KUNIT_EXPECT_EQ(test, hdr2->ver, hdr.ver);
157 KUNIT_EXPECT_EQ(test, hdr2->src, hdr.src);
158 KUNIT_EXPECT_EQ(test, hdr2->dest, hdr.dest);
159 KUNIT_EXPECT_EQ(test, hdr2->flags_seq_tag & tag_mask,
160 hdr.flags_seq_tag & tag_mask);
161
162 KUNIT_EXPECT_EQ(test,
163 !!(hdr2->flags_seq_tag & MCTP_HDR_FLAG_SOM), first);
164 KUNIT_EXPECT_EQ(test,
165 !!(hdr2->flags_seq_tag & MCTP_HDR_FLAG_EOM), last);
166
167 seq2 = (hdr2->flags_seq_tag >> MCTP_HDR_SEQ_SHIFT) &
168 MCTP_HDR_SEQ_MASK;
169
170 if (first) {
171 seq = seq2;
172 } else {
173 seq++;
174 KUNIT_EXPECT_EQ(test, seq2, seq & MCTP_HDR_SEQ_MASK);
175 }
176
177 if (!last)
178 KUNIT_EXPECT_EQ(test, skb2->len, mtu);
179 else
180 KUNIT_EXPECT_LE(test, skb2->len, mtu);
181
182 kfree_skb(skb2);
183 }
184
185 mctp_test_route_destroy(test, rt);
> 186 }
187

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