Re: [PATCH] net/ena: Fix build warning in ena_xdp_set()
From: kbuild test robot
Date: Mon Apr 27 2020 - 12:28:07 EST
Hi Gavin,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on v5.7-rc2]
[also build test WARNING on next-20200423]
[cannot apply to ipvs/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Gavin-Shan/net-ena-Fix-build-warning-in-ena_xdp_set/20200427-011237
base: ae83d0b416db002fe95601e7f97f64b59514d936
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=xtensa
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
In file included from arch/xtensa/include/asm/atomic.h:19,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/atomic.h:5,
from arch/xtensa/include/asm/bitops.h:192,
from include/linux/bitops.h:29,
from include/linux/bitmap.h:8,
from include/linux/ethtool.h:16,
from drivers/net/ethernet/amazon/ena/ena_netdev.c:38:
drivers/net/ethernet/amazon/ena/ena_netdev.c: In function 'ena_xdp_exchange_program_rx_in_range':
arch/xtensa/include/asm/cmpxchg.h:173:3: warning: value computed is not used [-Wunused-value]
173 | ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/amazon/ena/ena_netdev.c:469:3: note: in expansion of macro 'xchg'
469 | xchg(&rx_ring->xdp_bpf_prog, prog);
| ^~~~
In file included from include/net/inet_sock.h:19,
from include/net/ip.h:27,
from drivers/net/ethernet/amazon/ena/ena_netdev.c:46:
drivers/net/ethernet/amazon/ena/ena_netdev.c: In function 'ena_xdp_set':
>> drivers/net/ethernet/amazon/ena/ena_netdev.c:557:6: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
557 | "Failed to set xdp program, the current MTU (%d) is larger than the maximum allowed MTU (%d) while xdp is on",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/netdevice.h:4923:23: note: in definition of macro 'netif_level'
4923 | netdev_##level(dev, fmt, ##args); \
| ^~~
>> drivers/net/ethernet/amazon/ena/ena_netdev.c:556:3: note: in expansion of macro 'netif_err'
556 | netif_err(adapter, drv, adapter->netdev,
| ^~~~~~~~~
drivers/net/ethernet/amazon/ena/ena_netdev.c:557:96: note: format string is defined here
557 | "Failed to set xdp program, the current MTU (%d) is larger than the maximum allowed MTU (%d) while xdp is on",
| ~^
| |
| int
| %ld
vim +557 drivers/net/ethernet/amazon/ena/ena_netdev.c
514
515 static int ena_xdp_set(struct net_device *netdev, struct netdev_bpf *bpf)
516 {
517 struct ena_adapter *adapter = netdev_priv(netdev);
518 struct bpf_prog *prog = bpf->prog;
519 struct bpf_prog *old_bpf_prog;
520 int rc, prev_mtu;
521 bool is_up;
522
523 is_up = test_bit(ENA_FLAG_DEV_UP, &adapter->flags);
524 rc = ena_xdp_allowed(adapter);
525 if (rc == ENA_XDP_ALLOWED) {
526 old_bpf_prog = adapter->xdp_bpf_prog;
527 if (prog) {
528 if (!is_up) {
529 ena_init_all_xdp_queues(adapter);
530 } else if (!old_bpf_prog) {
531 ena_down(adapter);
532 ena_init_all_xdp_queues(adapter);
533 }
534 ena_xdp_exchange_program(adapter, prog);
535
536 if (is_up && !old_bpf_prog) {
537 rc = ena_up(adapter);
538 if (rc)
539 return rc;
540 }
541 } else if (old_bpf_prog) {
542 rc = ena_destroy_and_free_all_xdp_queues(adapter);
543 if (rc)
544 return rc;
545 }
546
547 prev_mtu = netdev->max_mtu;
548 netdev->max_mtu = prog ? ENA_XDP_MAX_MTU : adapter->max_mtu;
549
550 if (!old_bpf_prog)
551 netif_info(adapter, drv, adapter->netdev,
552 "xdp program set, changing the max_mtu from %d to %d",
553 prev_mtu, netdev->max_mtu);
554
555 } else if (rc == ENA_XDP_CURRENT_MTU_TOO_LARGE) {
> 556 netif_err(adapter, drv, adapter->netdev,
> 557 "Failed to set xdp program, the current MTU (%d) is larger than the maximum allowed MTU (%d) while xdp is on",
558 netdev->mtu, ENA_XDP_MAX_MTU);
559 NL_SET_ERR_MSG_MOD(bpf->extack,
560 "Failed to set xdp program, the current MTU is larger than the maximum allowed MTU. Check the dmesg for more info");
561 return -EINVAL;
562 } else if (rc == ENA_XDP_NO_ENOUGH_QUEUES) {
563 netif_err(adapter, drv, adapter->netdev,
564 "Failed to set xdp program, the Rx/Tx channel count should be at most half of the maximum allowed channel count. The current queue count (%d), the maximal queue count (%d)\n",
565 adapter->num_io_queues, adapter->max_num_io_queues);
566 NL_SET_ERR_MSG_MOD(bpf->extack,
567 "Failed to set xdp program, there is no enough space for allocating XDP queues, Check the dmesg for more info");
568 return -EINVAL;
569 }
570
571 return 0;
572 }
573
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip