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] [thread-next>] [day] [month] [year] [list]
Message-ID: <202209291002.4RASiVuy-lkp@intel.com>
Date:   Thu, 29 Sep 2022 10:43:16 +0800
From:   kernel test robot <lkp@...el.com>
To:     Shenwei Wang <shenwei.wang@....com>,
        Joakim Zhang <qiangqing.zhang@....com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>
Cc:     kbuild-all@...ts.01.org, netdev@...r.kernel.org,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        linux-kernel@...r.kernel.org, imx@...ts.linux.dev,
        Shenwei Wang <shenwei.wang@....com>
Subject: Re: [PATCH 1/1] net: fec: add initial XDP support

Hi Shenwei,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]
[also build test WARNING on next-20220928]
[cannot apply to net/master linus/master v6.0-rc7]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Shenwei-Wang/net-fec-add-initial-XDP-support/20220928-232917
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git b9a5cbf8ba24e88071a97a51a09ef5cdf0d1f6a1
config: parisc-randconfig-m031-20220925
compiler: hppa64-linux-gcc (GCC) 12.1.0

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

New smatch warnings:
drivers/net/ethernet/freescale/fec_main.c:3285 fec_enet_alloc_rxq_buffers() warn: unsigned 'err' is never less than zero.

Old smatch warnings:
drivers/net/ethernet/freescale/fec_main.c:3658 fec_enet_select_queue() warn: potential spectre issue 'fec_enet_vlan_pri_to_queue' [r]

vim +/err +3285 drivers/net/ethernet/freescale/fec_main.c

  3269	
  3270	static int
  3271	fec_enet_alloc_rxq_buffers(struct net_device *ndev, unsigned int queue)
  3272	{
  3273		struct fec_enet_private *fep = netdev_priv(ndev);
  3274		unsigned int i, err;
  3275		struct bufdesc	*bdp;
  3276		struct fec_enet_priv_rx_q *rxq;
  3277	
  3278		dma_addr_t phys_addr;
  3279		struct page *page;
  3280	
  3281		rxq = fep->rx_queue[queue];
  3282		bdp = rxq->bd.base;
  3283	
  3284		err = fec_enet_create_page_pool(fep, rxq, rxq->bd.ring_size);
> 3285		if (err < 0) {
  3286			netdev_err(ndev, "%s failed queue %d (%d)\n", __func__, queue, err);
  3287			return err;
  3288		}
  3289	
  3290		for (i = 0; i < rxq->bd.ring_size; i++) {
  3291			page = page_pool_dev_alloc_pages(rxq->page_pool);
  3292			if (!page)
  3293				goto err_alloc;
  3294	
  3295			phys_addr = page_pool_get_dma_addr(page) + FEC_ENET_XDP_HEADROOM;
  3296			bdp->cbd_bufaddr = cpu_to_fec32(phys_addr);
  3297	
  3298			rxq->rx_skb_info[i].page = page;
  3299			rxq->rx_skb_info[i].offset = FEC_ENET_XDP_HEADROOM;
  3300			bdp->cbd_sc = cpu_to_fec16(BD_ENET_RX_EMPTY);
  3301	
  3302			if (fep->bufdesc_ex) {
  3303				struct bufdesc_ex *ebdp = (struct bufdesc_ex *)bdp;
  3304				ebdp->cbd_esc = cpu_to_fec32(BD_ENET_RX_INT);
  3305			}
  3306	
  3307			bdp = fec_enet_get_nextdesc(bdp, &rxq->bd);
  3308		}
  3309	
  3310		/* Set the last buffer to wrap. */
  3311		bdp = fec_enet_get_prevdesc(bdp, &rxq->bd);
  3312		bdp->cbd_sc |= cpu_to_fec16(BD_SC_WRAP);
  3313		return 0;
  3314	
  3315	 err_alloc:
  3316		fec_enet_free_buffers(ndev);
  3317		return -ENOMEM;
  3318	}
  3319	

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ