Hi Guangbin,
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/Guangbin-Huang/ethtool-add-suppo...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
177c92353be935db555d0d08729e871145ec698c
config: s390-debug_defconfig (attached as .config)
compiler: s390-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/e5381d894cbf31bc070529a4db63c22d1...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Guangbin-Huang/ethtool-add-support-to-set-get-tx-copybreak-buf-size-and-rx-buf-len/20211012-220537
git checkout e5381d894cbf31bc070529a4db63c22d1b1dbcfa
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir
ARCH=s390 SHELL=/bin/bash drivers/s390/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/s390/net/qeth_ethtool.c: In function 'qeth_get_ringparam':
> drivers/s390/net/qeth_ethtool.c:149:63: error: expected
declaration specifiers before ')' token
149 |
struct netlink_ext_ack *extack))
| ^
> drivers/s390/net/qeth_ethtool.c:165:1: error: expected
'=', ',', ';', 'asm' or '__attribute__' before
'{' token
165 | {
| ^
drivers/s390/net/qeth_ethtool.c:188:1: error: expected '=', ',',
';', 'asm' or '__attribute__' before '{' token
188 | {
| ^
drivers/s390/net/qeth_ethtool.c:201:1: error: expected '=', ',',
';', 'asm' or '__attribute__' before '{' token
201 | {
| ^
drivers/s390/net/qeth_ethtool.c:216:1: error: expected '=', ',',
';', 'asm' or '__attribute__' before '{' token
216 | {
| ^
drivers/s390/net/qeth_ethtool.c:251:1: error: expected '=', ',',
';', 'asm' or '__attribute__' before '{' token
251 | {
| ^
drivers/s390/net/qeth_ethtool.c:262:1: error: expected '=', ',',
';', 'asm' or '__attribute__' before '{' token
262 | {
| ^
drivers/s390/net/qeth_ethtool.c:277:1: error: expected '=', ',',
';', 'asm' or '__attribute__' before '{' token
277 | {
| ^
drivers/s390/net/qeth_ethtool.c:291:1: error: expected '=', ',',
';', 'asm' or '__attribute__' before '{' token
291 | {
| ^
drivers/s390/net/qeth_ethtool.c:310:1: error: expected '=', ',',
';', 'asm' or '__attribute__' before '{' token
310 | {
| ^
drivers/s390/net/qeth_ethtool.c:332:1: error: expected '=', ',',
';', 'asm' or '__attribute__' before '{' token
332 | {
| ^
drivers/s390/net/qeth_ethtool.c:429:1: error: expected '=', ',',
';', 'asm' or '__attribute__' before '{' token
429 | {
| ^
> drivers/s390/net/qeth_ethtool.c:457:14: error: parameter
'qeth_ethtool_ops' is initialized
457 | const struct ethtool_ops
qeth_ethtool_ops = {
| ^~~~~~~~~~~
> drivers/s390/net/qeth_ethtool.c:463:24: error:
'qeth_get_strings' undeclared (first use in this function); did you mean
'qeth_get_stats64'?
463 | .get_strings = qeth_get_strings,
| ^~~~~~~~~~~~~~~~
| qeth_get_stats64
drivers/s390/net/qeth_ethtool.c:463:24: note: each undeclared identifier is reported
only once for each function it appears in
> drivers/s390/net/qeth_ethtool.c:466:24: error:
'qeth_get_drvinfo' undeclared (first use in this function); did you mean
'ethtool_drvinfo'?
466 | .get_drvinfo = qeth_get_drvinfo,
| ^~~~~~~~~~~~~~~~
| ethtool_drvinfo
> drivers/s390/net/qeth_ethtool.c:467:25: error:
'qeth_get_channels' undeclared (first use in this function); did you mean
'qeth_channel'?
467 | .get_channels = qeth_get_channels,
| ^~~~~~~~~~~~~~~~~
| qeth_channel
> drivers/s390/net/qeth_ethtool.c:468:25: error:
'qeth_set_channels' undeclared (first use in this function); did you mean
'qeth_channel'?
468 | .set_channels = qeth_set_channels,
| ^~~~~~~~~~~~~~~~~
| qeth_channel
> drivers/s390/net/qeth_ethtool.c:469:24: error:
'qeth_get_ts_info' undeclared (first use in this function); did you mean
'ethtool_ts_info'?
469 | .get_ts_info = qeth_get_ts_info,
| ^~~~~~~~~~~~~~~~
| ethtool_ts_info
> drivers/s390/net/qeth_ethtool.c:470:24: error:
'qeth_get_tunable' undeclared (first use in this function); did you mean
'frh_get_table'?
470 | .get_tunable = qeth_get_tunable,
| ^~~~~~~~~~~~~~~~
| frh_get_table
> drivers/s390/net/qeth_ethtool.c:471:24: error:
'qeth_set_tunable' undeclared (first use in this function); did you mean
'ethtool_tunable'?
471 | .set_tunable = qeth_set_tunable,
| ^~~~~~~~~~~~~~~~
| ethtool_tunable
> drivers/s390/net/qeth_ethtool.c:472:35: error:
'qeth_get_per_queue_coalesce' undeclared (first use in this function)
472 | .get_per_queue_coalesce = qeth_get_per_queue_coalesce,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/s390/net/qeth_ethtool.c:473:35: error:
'qeth_set_per_queue_coalesce' undeclared (first use in this function)
473 | .set_per_queue_coalesce = qeth_set_per_queue_coalesce,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/s390/net/qeth_ethtool.c:474:31: error:
'qeth_get_link_ksettings' undeclared (first use in this function); did you mean
'ethtool_link_ksettings'?
474 | .get_link_ksettings =
qeth_get_link_ksettings,
| ^~~~~~~~~~~~~~~~~~~~~~~
| ethtool_link_ksettings
> drivers/s390/net/qeth_ethtool.c:146:13: error: old-style
parameter declarations in prototyped function definition
146 | static void
qeth_get_ringparam(struct net_device *dev,
| ^~~~~~~~~~~~~~~~~~
> drivers/s390/net/qeth_ethtool.c:476: error: expected '{'
at end of input
At top level:
drivers/s390/net/qeth_ethtool.c:146:13: warning: 'qeth_get_ringparam' defined
but not used [-Wunused-function]
146 | static void qeth_get_ringparam(struct net_device *dev,
| ^~~~~~~~~~~~~~~~~~
drivers/s390/net/qeth_ethtool.c:77:13: warning: 'qeth_add_stat_strings' defined
but not used [-Wunused-function]
77 | static void qeth_add_stat_strings(u8 **data, const char *prefix,
| ^~~~~~~~~~~~~~~~~~~~~
vim +149 drivers/s390/net/qeth_ethtool.c
145
146 static void qeth_get_ringparam(struct net_device *dev,
147 struct ethtool_ringparam *param,
148 struct ethtool_ringparam_ext *param_ext,
149 struct netlink_ext_ack *extack))
150 {
151 struct qeth_card *card = dev->ml_priv;
152
153 param->rx_max_pending = QDIO_MAX_BUFFERS_PER_Q;
154 param->rx_mini_max_pending = 0;
155 param->rx_jumbo_max_pending = 0;
156 param->tx_max_pending = QDIO_MAX_BUFFERS_PER_Q;
157
158 param->rx_pending = card->qdio.in_buf_pool.buf_count;
159 param->rx_mini_pending = 0;
160 param->rx_jumbo_pending = 0;
161 param->tx_pending = QDIO_MAX_BUFFERS_PER_Q;
162 }
163
164 static void qeth_get_strings(struct net_device *dev, u32 stringset, u8 *data)
165 {
166 struct qeth_card *card = dev->ml_priv;
167 char prefix[ETH_GSTRING_LEN] = "";
168 unsigned int i;
169
170 switch (stringset) {
171 case ETH_SS_STATS:
172 qeth_add_stat_strings(&data, prefix, card_stats,
173 CARD_STATS_LEN);
174 for (i = 0; i < card->qdio.no_out_queues; i++) {
175 snprintf(prefix, ETH_GSTRING_LEN, "tx%u ", i);
176 qeth_add_stat_strings(&data, prefix, txq_stats,
177 TXQ_STATS_LEN);
178 }
179 break;
180 default:
181 WARN_ON(1);
182 break;
183 }
184 }
185
186 static void qeth_get_drvinfo(struct net_device *dev,
187 struct ethtool_drvinfo *info)
188 {
189 struct qeth_card *card = dev->ml_priv;
190
191 strlcpy(info->driver, IS_LAYER2(card) ? "qeth_l2" :
"qeth_l3",
192 sizeof(info->driver));
193 strlcpy(info->fw_version, card->info.mcl_level,
194 sizeof(info->fw_version));
195 snprintf(info->bus_info, sizeof(info->bus_info), "%s/%s/%s",
196 CARD_RDEV_ID(card), CARD_WDEV_ID(card), CARD_DDEV_ID(card));
197 }
198
199 static void qeth_get_channels(struct net_device *dev,
200 struct ethtool_channels *channels)
201 {
202 struct qeth_card *card = dev->ml_priv;
203
204 channels->max_rx = dev->num_rx_queues;
205 channels->max_tx = card->qdio.no_out_queues;
206 channels->max_other = 0;
207 channels->max_combined = 0;
208 channels->rx_count = dev->real_num_rx_queues;
209 channels->tx_count = dev->real_num_tx_queues;
210 channels->other_count = 0;
211 channels->combined_count = 0;
212 }
213
214 static int qeth_set_channels(struct net_device *dev,
215 struct ethtool_channels *channels)
216 {
217 struct qeth_priv *priv = netdev_priv(dev);
218 struct qeth_card *card = dev->ml_priv;
219 int rc;
220
221 if (channels->rx_count == 0 || channels->tx_count == 0)
222 return -EINVAL;
223 if (channels->tx_count > card->qdio.no_out_queues)
224 return -EINVAL;
225
226 /* Prio-queueing needs all TX queues: */
227 if (qeth_uses_tx_prio_queueing(card))
228 return -EPERM;
229
230 if (IS_IQD(card)) {
231 if (channels->tx_count < QETH_IQD_MIN_TXQ)
232 return -EINVAL;
233
234 /* Reject downgrade while running. It could push displaced
235 * ucast flows onto txq0, which is reserved for mcast.
236 */
237 if (netif_running(dev) &&
238 channels->tx_count < dev->real_num_tx_queues)
239 return -EPERM;
240 }
241
242 rc = qeth_set_real_num_tx_queues(card, channels->tx_count);
243 if (!rc)
244 priv->tx_wanted_queues = channels->tx_count;
245
246 return rc;
247 }
248
249 static int qeth_get_ts_info(struct net_device *dev,
250 struct ethtool_ts_info *info)
251 {
252 struct qeth_card *card = dev->ml_priv;
253
254 if (!IS_IQD(card))
255 return -EOPNOTSUPP;
256
257 return ethtool_op_get_ts_info(dev, info);
258 }
259
260 static int qeth_get_tunable(struct net_device *dev,
261 const struct ethtool_tunable *tuna, void *data)
262 {
263 struct qeth_priv *priv = netdev_priv(dev);
264
265 switch (tuna->id) {
266 case ETHTOOL_RX_COPYBREAK:
267 *(u32 *)data = priv->rx_copybreak;
268 return 0;
269 default:
270 return -EOPNOTSUPP;
271 }
272 }
273
274 static int qeth_set_tunable(struct net_device *dev,
275 const struct ethtool_tunable *tuna,
276 const void *data)
277 {
278 struct qeth_priv *priv = netdev_priv(dev);
279
280 switch (tuna->id) {
281 case ETHTOOL_RX_COPYBREAK:
282 WRITE_ONCE(priv->rx_copybreak, *(u32 *)data);
283 return 0;
284 default:
285 return -EOPNOTSUPP;
286 }
287 }
288
289 static int qeth_get_per_queue_coalesce(struct net_device *dev, u32 __queue,
290 struct ethtool_coalesce *coal)
291 {
292 struct qeth_card *card = dev->ml_priv;
293 struct qeth_qdio_out_q *queue;
294
295 if (!IS_IQD(card))
296 return -EOPNOTSUPP;
297
298 if (__queue >= card->qdio.no_out_queues)
299 return -EINVAL;
300
301 queue = card->qdio.out_qs[__queue];
302
303 coal->tx_coalesce_usecs = queue->coalesce_usecs;
304 coal->tx_max_coalesced_frames = queue->max_coalesced_frames;
305 return 0;
306 }
307
308 static int qeth_set_per_queue_coalesce(struct net_device *dev, u32 queue,
309 struct ethtool_coalesce *coal)
310 {
311 struct qeth_card *card = dev->ml_priv;
312
313 if (!IS_IQD(card))
314 return -EOPNOTSUPP;
315
316 if (queue >= card->qdio.no_out_queues)
317 return -EINVAL;
318
319 if (!coal->tx_coalesce_usecs && !coal->tx_max_coalesced_frames)
320 return -EINVAL;
321
322 __qeth_set_coalesce(dev, card->qdio.out_qs[queue], coal);
323 return 0;
324 }
325
326 /* Helper function to fill 'advertising' and 'supported' which are
the same. */
327 /* Autoneg and full-duplex are supported and advertised unconditionally. */
328 /* Always advertise and support all speeds up to specified, and only one */
329 /* specified port type. */
330 static void qeth_set_ethtool_link_modes(struct ethtool_link_ksettings *cmd,
331 enum qeth_link_mode link_mode)
332 {
333 ethtool_link_ksettings_zero_link_mode(cmd,
supported);
334 ethtool_link_ksettings_zero_link_mode(cmd, advertising);
335 ethtool_link_ksettings_zero_link_mode(cmd, lp_advertising);
336
337 ethtool_link_ksettings_add_link_mode(cmd, supported, Autoneg);
338 ethtool_link_ksettings_add_link_mode(cmd, advertising, Autoneg);
339
340 switch (cmd->base.port) {
341 case PORT_TP:
342 ethtool_link_ksettings_add_link_mode(cmd, supported, TP);
343 ethtool_link_ksettings_add_link_mode(cmd, advertising, TP);
344
345 switch (cmd->base.speed) {
346 case SPEED_10000:
347 ethtool_link_ksettings_add_link_mode(cmd, supported,
348 10000baseT_Full);
349 ethtool_link_ksettings_add_link_mode(cmd, advertising,
350 10000baseT_Full);
351 fallthrough;
352 case SPEED_1000:
353 ethtool_link_ksettings_add_link_mode(cmd, supported,
354 1000baseT_Full);
355 ethtool_link_ksettings_add_link_mode(cmd, advertising,
356 1000baseT_Full);
357 ethtool_link_ksettings_add_link_mode(cmd, supported,
358 1000baseT_Half);
359 ethtool_link_ksettings_add_link_mode(cmd, advertising,
360 1000baseT_Half);
361 fallthrough;
362 case SPEED_100:
363 ethtool_link_ksettings_add_link_mode(cmd, supported,
364 100baseT_Full);
365 ethtool_link_ksettings_add_link_mode(cmd, advertising,
366 100baseT_Full);
367 ethtool_link_ksettings_add_link_mode(cmd, supported,
368 100baseT_Half);
369 ethtool_link_ksettings_add_link_mode(cmd, advertising,
370 100baseT_Half);
371 fallthrough;
372 case SPEED_10:
373 ethtool_link_ksettings_add_link_mode(cmd, supported,
374 10baseT_Full);
375 ethtool_link_ksettings_add_link_mode(cmd, advertising,
376 10baseT_Full);
377 ethtool_link_ksettings_add_link_mode(cmd, supported,
378 10baseT_Half);
379 ethtool_link_ksettings_add_link_mode(cmd, advertising,
380 10baseT_Half);
381 break;
382 default:
383 break;
384 }
385
386 break;
387 case PORT_FIBRE:
388 ethtool_link_ksettings_add_link_mode(cmd, supported, FIBRE);
389 ethtool_link_ksettings_add_link_mode(cmd, advertising, FIBRE);
390
391 switch (cmd->base.speed) {
392 case SPEED_25000:
393 ethtool_link_ksettings_add_link_mode(cmd, supported,
394 25000baseSR_Full);
395 ethtool_link_ksettings_add_link_mode(cmd, advertising,
396 25000baseSR_Full);
397 break;
398 case SPEED_10000:
399 if (link_mode == QETH_LINK_MODE_FIBRE_LONG) {
400 ethtool_link_ksettings_add_link_mode(cmd, supported,
401 10000baseLR_Full);
402 ethtool_link_ksettings_add_link_mode(cmd, advertising,
403 10000baseLR_Full);
404 } else if (link_mode == QETH_LINK_MODE_FIBRE_SHORT) {
405 ethtool_link_ksettings_add_link_mode(cmd, supported,
406 10000baseSR_Full);
407 ethtool_link_ksettings_add_link_mode(cmd, advertising,
408 10000baseSR_Full);
409 }
410 break;
411 case SPEED_1000:
412 ethtool_link_ksettings_add_link_mode(cmd, supported,
413 1000baseX_Full);
414 ethtool_link_ksettings_add_link_mode(cmd, advertising,
415 1000baseX_Full);
416 break;
417 default:
418 break;
419 }
420
421 break;
422 default:
423 break;
424 }
425 }
426
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org