CC: [email protected]
CC: [email protected]
TO: Ciara Loftus <[email protected]>
CC: Tony Nguyen <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   18445bf405cb331117bc98427b1ba6f12418ad17
commit: 44ea803e2fa7e12adb5d6260da4e4956e784effb i40e: introduce new dump desc 
XDP command
date:   7 weeks ago
:::::: branch date: 17 hours ago
:::::: commit date: 7 weeks ago
config: x86_64-randconfig-m001-20200819 (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 <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

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

# 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=44ea803e2fa7e12adb5d6260da4e4956e784effb
git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 44ea803e2fa7e12adb5d6260da4e4956e784effb
vim +/ring +582 drivers/net/ethernet/intel/i40e/i40e_debugfs.c

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

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to