All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/net/ethernet/intel/i40e/i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring'.
Date: Sun, 27 Dec 2020 23:16:33 +0800	[thread overview]
Message-ID: <202012272316.HzgB8nzz-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 10091 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Ciara Loftus <ciara.loftus@intel.com>
CC: Tony Nguyen <anthony.l.nguyen@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f838f8d2b694cf9d524dc4423e9dd2db13892f3f
commit: 44ea803e2fa7e12adb5d6260da4e4956e784effb i40e: introduce new dump desc XDP command
date:   6 months ago
:::::: branch date: 22 hours ago
:::::: commit date: 6 months ago
config: i386-randconfig-m021-20201227 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/net/ethernet/intel/i40e/i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring'.

vim +/ring +582 drivers/net/ethernet/intel/i40e/i40e_debugfs.c

02e9c290814cc14 Jesse Brandeburg 2013-09-11  531  
02e9c290814cc14 Jesse Brandeburg 2013-09-11  532  /**
02e9c290814cc14 Jesse Brandeburg 2013-09-11  533   * i40e_dbg_dump_desc - handles dump desc write into command datum
02e9c290814cc14 Jesse Brandeburg 2013-09-11  534   * @cnt: number of arguments that the user supplied
02e9c290814cc14 Jesse Brandeburg 2013-09-11  535   * @vsi_seid: vsi id entered by user
02e9c290814cc14 Jesse Brandeburg 2013-09-11  536   * @ring_id: ring id entered by user
02e9c290814cc14 Jesse Brandeburg 2013-09-11  537   * @desc_n: descriptor number entered by user
02e9c290814cc14 Jesse Brandeburg 2013-09-11  538   * @pf: the i40e_pf created in command write
44ea803e2fa7e12 Ciara Loftus     2020-06-23  539   * @type: enum describing whether ring is RX, TX or XDP
02e9c290814cc14 Jesse Brandeburg 2013-09-11  540   **/
02e9c290814cc14 Jesse Brandeburg 2013-09-11  541  static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
44ea803e2fa7e12 Ciara Loftus     2020-06-23  542  			       struct i40e_pf *pf, enum ring_type type)
02e9c290814cc14 Jesse Brandeburg 2013-09-11  543  {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  544  	bool is_rx_ring = type == RING_TYPE_RX;
68bf94aae1873cb Shannon Nelson   2014-01-15  545  	struct i40e_tx_desc *txd;
68bf94aae1873cb Shannon Nelson   2014-01-15  546  	union i40e_rx_desc *rxd;
e6c97234d1b18d4 Joe Perches      2014-11-18  547  	struct i40e_ring *ring;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  548  	struct i40e_vsi *vsi;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  549  	int i;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  550  
02e9c290814cc14 Jesse Brandeburg 2013-09-11  551  	vsi = i40e_dbg_find_vsi(pf, vsi_seid);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  552  	if (!vsi) {
7792fe4fd2f1fac Shannon Nelson   2013-11-26  553  		dev_info(&pf->pdev->dev, "vsi %d not found\n", vsi_seid);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  554  		return;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  555  	}
44ea803e2fa7e12 Ciara Loftus     2020-06-23  556  	if (type == RING_TYPE_XDP && !i40e_enabled_xdp_vsi(vsi)) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  557  		dev_info(&pf->pdev->dev, "XDP not enabled on VSI %d\n", vsi_seid);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  558  		return;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  559  	}
02e9c290814cc14 Jesse Brandeburg 2013-09-11  560  	if (ring_id >= vsi->num_queue_pairs || ring_id < 0) {
02e9c290814cc14 Jesse Brandeburg 2013-09-11  561  		dev_info(&pf->pdev->dev, "ring %d not found\n", ring_id);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  562  		return;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  563  	}
68bf94aae1873cb Shannon Nelson   2014-01-15  564  	if (!vsi->tx_rings || !vsi->tx_rings[0]->desc) {
29d0790ef3acd86 Shannon Nelson   2013-11-26  565  		dev_info(&pf->pdev->dev,
29d0790ef3acd86 Shannon Nelson   2013-11-26  566  			 "descriptor rings have not been allocated for vsi %d\n",
29d0790ef3acd86 Shannon Nelson   2013-11-26  567  			 vsi_seid);
29d0790ef3acd86 Shannon Nelson   2013-11-26  568  		return;
29d0790ef3acd86 Shannon Nelson   2013-11-26  569  	}
e6c97234d1b18d4 Joe Perches      2014-11-18  570  
44ea803e2fa7e12 Ciara Loftus     2020-06-23  571  	switch (type) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  572  	case RING_TYPE_RX:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  573  		ring = kmemdup(vsi->rx_rings[ring_id], sizeof(*ring), GFP_KERNEL);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  574  		break;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  575  	case RING_TYPE_TX:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  576  		ring = kmemdup(vsi->tx_rings[ring_id], sizeof(*ring), GFP_KERNEL);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  577  		break;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  578  	case RING_TYPE_XDP:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  579  		ring = kmemdup(vsi->xdp_rings[ring_id], sizeof(*ring), GFP_KERNEL);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  580  		break;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  581  	}
e6c97234d1b18d4 Joe Perches      2014-11-18 @582  	if (!ring)
e6c97234d1b18d4 Joe Perches      2014-11-18  583  		return;
e6c97234d1b18d4 Joe Perches      2014-11-18  584  
02e9c290814cc14 Jesse Brandeburg 2013-09-11  585  	if (cnt == 2) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  586  		switch (type) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  587  		case RING_TYPE_RX:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  588  			dev_info(&pf->pdev->dev, "VSI = %02i Rx ring = %02i\n", vsi_seid, ring_id);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  589  			break;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  590  		case RING_TYPE_TX:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  591  			dev_info(&pf->pdev->dev, "VSI = %02i Tx ring = %02i\n", vsi_seid, ring_id);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  592  			break;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  593  		case RING_TYPE_XDP:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  594  			dev_info(&pf->pdev->dev, "VSI = %02i XDP ring = %02i\n", vsi_seid, ring_id);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  595  			break;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  596  		}
e6c97234d1b18d4 Joe Perches      2014-11-18  597  		for (i = 0; i < ring->count; i++) {
68bf94aae1873cb Shannon Nelson   2014-01-15  598  			if (!is_rx_ring) {
e6c97234d1b18d4 Joe Perches      2014-11-18  599  				txd = I40E_TX_DESC(ring, i);
68bf94aae1873cb Shannon Nelson   2014-01-15  600  				dev_info(&pf->pdev->dev,
13cb3e9d71d5823 Jesse Brandeburg 2016-01-13  601  					 "   d[%03x] = 0x%016llx 0x%016llx\n",
68bf94aae1873cb Shannon Nelson   2014-01-15  602  					 i, txd->buffer_addr,
68bf94aae1873cb Shannon Nelson   2014-01-15  603  					 txd->cmd_type_offset_bsz);
68bf94aae1873cb Shannon Nelson   2014-01-15  604  			} else {
e6c97234d1b18d4 Joe Perches      2014-11-18  605  				rxd = I40E_RX_DESC(ring, i);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  606  				dev_info(&pf->pdev->dev,
13cb3e9d71d5823 Jesse Brandeburg 2016-01-13  607  					 "   d[%03x] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n",
68bf94aae1873cb Shannon Nelson   2014-01-15  608  					 i, rxd->read.pkt_addr,
68bf94aae1873cb Shannon Nelson   2014-01-15  609  					 rxd->read.hdr_addr,
68bf94aae1873cb Shannon Nelson   2014-01-15  610  					 rxd->read.rsvd1, rxd->read.rsvd2);
68bf94aae1873cb Shannon Nelson   2014-01-15  611  			}
02e9c290814cc14 Jesse Brandeburg 2013-09-11  612  		}
02e9c290814cc14 Jesse Brandeburg 2013-09-11  613  	} else if (cnt == 3) {
e6c97234d1b18d4 Joe Perches      2014-11-18  614  		if (desc_n >= ring->count || desc_n < 0) {
02e9c290814cc14 Jesse Brandeburg 2013-09-11  615  			dev_info(&pf->pdev->dev,
02e9c290814cc14 Jesse Brandeburg 2013-09-11  616  				 "descriptor %d not found\n", desc_n);
e3fe44c75913076 Joe Perches      2014-12-08  617  			goto out;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  618  		}
68bf94aae1873cb Shannon Nelson   2014-01-15  619  		if (!is_rx_ring) {
e6c97234d1b18d4 Joe Perches      2014-11-18  620  			txd = I40E_TX_DESC(ring, desc_n);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  621  			dev_info(&pf->pdev->dev,
13cb3e9d71d5823 Jesse Brandeburg 2016-01-13  622  				 "vsi = %02i tx ring = %02i d[%03x] = 0x%016llx 0x%016llx\n",
68bf94aae1873cb Shannon Nelson   2014-01-15  623  				 vsi_seid, ring_id, desc_n,
68bf94aae1873cb Shannon Nelson   2014-01-15  624  				 txd->buffer_addr, txd->cmd_type_offset_bsz);
68bf94aae1873cb Shannon Nelson   2014-01-15  625  		} else {
e6c97234d1b18d4 Joe Perches      2014-11-18  626  			rxd = I40E_RX_DESC(ring, desc_n);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  627  			dev_info(&pf->pdev->dev,
13cb3e9d71d5823 Jesse Brandeburg 2016-01-13  628  				 "vsi = %02i rx ring = %02i d[%03x] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n",
68bf94aae1873cb Shannon Nelson   2014-01-15  629  				 vsi_seid, ring_id, desc_n,
68bf94aae1873cb Shannon Nelson   2014-01-15  630  				 rxd->read.pkt_addr, rxd->read.hdr_addr,
68bf94aae1873cb Shannon Nelson   2014-01-15  631  				 rxd->read.rsvd1, rxd->read.rsvd2);
68bf94aae1873cb Shannon Nelson   2014-01-15  632  		}
02e9c290814cc14 Jesse Brandeburg 2013-09-11  633  	} else {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  634  		dev_info(&pf->pdev->dev, "dump desc rx/tx/xdp <vsi_seid> <ring_id> [<desc_n>]\n");
02e9c290814cc14 Jesse Brandeburg 2013-09-11  635  	}
e3fe44c75913076 Joe Perches      2014-12-08  636  
e3fe44c75913076 Joe Perches      2014-12-08  637  out:
e6c97234d1b18d4 Joe Perches      2014-11-18  638  	kfree(ring);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  639  }
02e9c290814cc14 Jesse Brandeburg 2013-09-11  640  

:::::: The code at line 582 was first introduced by commit
:::::: e6c97234d1b18d4751671df15d52e29daa8a7ba8 i40e: Reduce stack in i40e_dbg_dump_desc

:::::: TO: Joe Perches <joe@perches.com>
:::::: CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29834 bytes --]

             reply	other threads:[~2020-12-27 15:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27 15:16 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-10-06 12:45 drivers/net/ethernet/intel/i40e/i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring' Dan Carpenter
2020-10-06 12:45 ` Dan Carpenter
2020-10-06 12:45 ` Dan Carpenter
2020-10-01 14:12 kernel test robot
2020-08-19 14:01 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202012272316.HzgB8nzz-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.