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>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 17 Sep 2022 22:59:54 +0800
From:   kernel test robot <lkp@...el.com>
To:     Ioana Ciornei <ioana.ciornei@....com>, davem@...emloft.net,
        edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
        netdev@...r.kernel.org
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org, ast@...nel.org,
        daniel@...earbox.net, hawk@...nel.org, john.fastabend@...il.com,
        Ioana Ciornei <ioana.ciornei@....com>
Subject: Re: [PATCH net-next 12/12] net: dpaa2-eth: add trace points on XSK
 events

Hi Ioana,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Ioana-Ciornei/net-dpaa2-eth-AF_XDP-zero-copy-support/20220913-023809
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 169ccf0e40825d9e465863e4707d8e8546d3c3cb
config: arm64-allmodconfig
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
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
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/aac3b456e9cc4c9b94b716c208d9ce955b37eeb8
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Ioana-Ciornei/net-dpaa2-eth-AF_XDP-zero-copy-support/20220913-023809
        git checkout aac3b456e9cc4c9b94b716c208d9ce955b37eeb8
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash

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/ethernet/freescale/dpaa2/dpaa2-eth.c:1734:8: warning: variable 'page' is uninitialized when used here [-Wuninitialized]
                                                    page, DPAA2_ETH_RX_BUF_RAW_SIZE,
                                                    ^~~~
   drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c:1681:19: note: initialize the variable 'page' to silence this warning
           struct page *page;
                            ^
                             = NULL
   1 warning generated.


vim +/page +1734 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

  1670	
  1671	/* Perform a single release command to add buffers
  1672	 * to the specified buffer pool
  1673	 */
  1674	static int dpaa2_eth_add_bufs(struct dpaa2_eth_priv *priv,
  1675				      struct dpaa2_eth_channel *ch)
  1676	{
  1677		struct xdp_buff *xdp_buffs[DPAA2_ETH_BUFS_PER_CMD];
  1678		struct device *dev = priv->net_dev->dev.parent;
  1679		u64 buf_array[DPAA2_ETH_BUFS_PER_CMD];
  1680		struct dpaa2_eth_swa *swa;
  1681		struct page *page;
  1682		dma_addr_t addr;
  1683		int retries = 0;
  1684		int i = 0, err;
  1685		u32 batch;
  1686	
  1687		/* Allocate buffers visible to WRIOP */
  1688		if (!ch->xsk_zc) {
  1689			for (i = 0; i < DPAA2_ETH_BUFS_PER_CMD; i++) {
  1690				/* Also allocate skb shared info and alignment padding */
  1691				/* There is one page for each Rx buffer. WRIOP sees
  1692				 * the entire page except for a tailroom reserved for
  1693				 * skb shared info
  1694				 */
  1695				page = dev_alloc_pages(0);
  1696				if (!page)
  1697					goto err_alloc;
  1698	
  1699				addr = dma_map_page(dev, page, 0, priv->rx_buf_size,
  1700						    DMA_BIDIRECTIONAL);
  1701				if (unlikely(dma_mapping_error(dev, addr)))
  1702					goto err_map;
  1703	
  1704				buf_array[i] = addr;
  1705	
  1706				/* tracing point */
  1707				trace_dpaa2_eth_buf_seed(priv->net_dev, page_address(page),
  1708							 DPAA2_ETH_RX_BUF_RAW_SIZE,
  1709							 addr, priv->rx_buf_size,
  1710							 ch->bp->bpid);
  1711			}
  1712		} else if (xsk_buff_can_alloc(ch->xsk_pool, DPAA2_ETH_BUFS_PER_CMD)) {
  1713			/* Allocate XSK buffers for AF_XDP fast path in batches
  1714			 * of DPAA2_ETH_BUFS_PER_CMD. Bail out if the UMEM cannot
  1715			 * provide enough buffers at the moment
  1716			 */
  1717			batch = xsk_buff_alloc_batch(ch->xsk_pool, xdp_buffs,
  1718						     DPAA2_ETH_BUFS_PER_CMD);
  1719			if (!batch)
  1720				goto err_alloc;
  1721	
  1722			for (i = 0; i < batch; i++) {
  1723				swa = (struct dpaa2_eth_swa *)(xdp_buffs[i]->data_hard_start +
  1724							       DPAA2_ETH_RX_HWA_SIZE);
  1725				swa->xsk.xdp_buff = xdp_buffs[i];
  1726	
  1727				addr = xsk_buff_xdp_get_frame_dma(xdp_buffs[i]);
  1728				if (unlikely(dma_mapping_error(dev, addr)))
  1729					goto err_map;
  1730	
  1731				buf_array[i] = addr;
  1732	
  1733				trace_dpaa2_xsk_buf_seed(priv->net_dev,
> 1734							 page, DPAA2_ETH_RX_BUF_RAW_SIZE,
  1735							 addr, priv->rx_buf_size,
  1736							 ch->bp->bpid);
  1737			}
  1738		}
  1739	
  1740	release_bufs:
  1741		/* In case the portal is busy, retry until successful */
  1742		while ((err = dpaa2_io_service_release(ch->dpio, ch->bp->bpid,
  1743						       buf_array, i)) == -EBUSY) {
  1744			if (retries++ >= DPAA2_ETH_SWP_BUSY_RETRIES)
  1745				break;
  1746			cpu_relax();
  1747		}
  1748	
  1749		/* If release command failed, clean up and bail out;
  1750		 * not much else we can do about it
  1751		 */
  1752		if (err) {
  1753			dpaa2_eth_free_bufs(priv, buf_array, i, ch->xsk_zc);
  1754			return 0;
  1755		}
  1756	
  1757		return i;
  1758	
  1759	err_map:
  1760		if (!ch->xsk_zc) {
  1761			__free_pages(page, 0);
  1762		} else {
  1763			for (; i < batch; i++)
  1764				xsk_buff_free(xdp_buffs[i]);
  1765		}
  1766	err_alloc:
  1767		/* If we managed to allocate at least some buffers,
  1768		 * release them to hardware
  1769		 */
  1770		if (i)
  1771			goto release_bufs;
  1772	
  1773		return 0;
  1774	}
  1775	

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

View attachment "config" of type "text/plain" (350208 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ