lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202207150027.C0HuxMn8-lkp@intel.com>
Date:   Fri, 15 Jul 2022 00:21:33 +0800
From:   kernel test robot <lkp@...el.com>
To:     William Tu <u9012063@...il.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        0day robot <lkp@...el.com>
Subject: drivers/net/vmxnet3/vmxnet3_drv.c:1557:13: warning: variable
 'delta_len' set but not used

tree:   https://github.com/intel-lab-lkp/linux/commits/UPDATE-20220714-210938/William-Tu/vmxnet3-Add-XDP-support/20220707-213553
head:   4340e33d0526f1a236e07f564ab630fe1df9a776
commit: 4340e33d0526f1a236e07f564ab630fe1df9a776 vmxnet3: Add XDP support.
date:   3 hours ago
config: x86_64-allmodconfig (https://download.01.org/0day-ci/archive/20220715/202207150027.C0HuxMn8-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/4340e33d0526f1a236e07f564ab630fe1df9a776
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review UPDATE-20220714-210938/William-Tu/vmxnet3-Add-XDP-support/20220707-213553
        git checkout 4340e33d0526f1a236e07f564ab630fe1df9a776
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/net/vmxnet3/vmxnet3_drv.c: In function '__vmxnet3_run_xdp':
>> drivers/net/vmxnet3/vmxnet3_drv.c:1557:13: warning: variable 'delta_len' set but not used [-Wunused-but-set-variable]
    1557 |         int delta_len;
         |             ^~~~~~~~~
>> drivers/net/vmxnet3/vmxnet3_drv.c:1556:18: warning: variable 'delta' set but not used [-Wunused-but-set-variable]
    1556 |         int err, delta;
         |                  ^~~~~


vim +/delta_len +1557 drivers/net/vmxnet3/vmxnet3_drv.c

  1546	
  1547	static int
  1548	__vmxnet3_run_xdp(struct vmxnet3_rx_queue *rq, void *data, int data_len,
  1549			  int headroom, int frame_sz, bool *need_xdp_flush)
  1550	{
  1551		struct xdp_frame *xdpf;
  1552		void *buf_hard_start;
  1553		struct xdp_buff xdp;
  1554		struct page *page;
  1555		void *orig_data;
> 1556		int err, delta;
> 1557		int delta_len;
  1558		u32 act;
  1559	
  1560		buf_hard_start = data;
  1561		xdp_init_buff(&xdp, frame_sz, &rq->xdp_rxq);
  1562		xdp_prepare_buff(&xdp, buf_hard_start, headroom, data_len, false);
  1563		orig_data = xdp.data;
  1564	
  1565		act = bpf_prog_run_xdp(rq->xdp_bpf_prog, &xdp);
  1566		rq->stats.xdp_packets++;
  1567	
  1568		switch (act) {
  1569		case XDP_DROP:
  1570			rq->stats.xdp_drops++;
  1571			break;
  1572		case XDP_PASS:
  1573			delta = xdp.data - orig_data;
  1574			delta_len = (xdp.data_end - xdp.data) - data_len;
  1575			/* FIXME */
  1576			break;
  1577		case XDP_TX:
  1578			xdpf = xdp_convert_buff_to_frame(&xdp);
  1579			if (!xdpf ||
  1580			    vmxnet3_xdp_xmit_back(rq->adapter, xdpf, NULL)) {
  1581				rq->stats.xdp_drops++;
  1582			} else {
  1583				rq->stats.xdp_tx++;
  1584			}
  1585			break;
  1586		case XDP_ABORTED:
  1587			trace_xdp_exception(rq->adapter->netdev, rq->xdp_bpf_prog,
  1588					    act);
  1589			rq->stats.xdp_aborted++;
  1590			break;
  1591		case XDP_REDIRECT:
  1592			page = alloc_page(GFP_ATOMIC);
  1593			if (!page) {
  1594				rq->stats.rx_buf_alloc_failure++;
  1595				return XDP_DROP;
  1596			}
  1597			xdp_init_buff(&xdp, PAGE_SIZE, &rq->xdp_rxq);
  1598			xdp_prepare_buff(&xdp, page_address(page),
  1599					 XDP_PACKET_HEADROOM,
  1600					 data_len, false);
  1601			memcpy(xdp.data, data, data_len);
  1602			err = xdp_do_redirect(rq->adapter->netdev, &xdp,
  1603					      rq->xdp_bpf_prog);
  1604			if (!err) {
  1605				rq->stats.xdp_redirects++;
  1606			} else {
  1607				__free_page(page);
  1608				rq->stats.xdp_drops++;
  1609			}
  1610			*need_xdp_flush = true;
  1611			break;
  1612		default:
  1613			bpf_warn_invalid_xdp_action(rq->adapter->netdev,
  1614						    rq->xdp_bpf_prog, act);
  1615			break;
  1616		}
  1617		return act;
  1618	}
  1619	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ