All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Bhargava Marreddy <bhargava.marreddy@broadcom.com>,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org
Cc: oe-kbuild-all@lists.linux.dev, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, michael.chan@broadcom.com,
	pavan.chebbi@broadcom.com, vsrama-krishna.nemani@broadcom.com,
	Bhargava Marreddy <bhargava.marreddy@broadcom.com>,
	Vikas Gupta <vikas.gupta@broadcom.com>,
	Rajashekar Hudumula <rajashekar.hudumula@broadcom.com>
Subject: Re: [net-next 1/9] bng_en: Add initial support for RX and TX rings
Date: Thu, 14 Aug 2025 13:32:49 +0800	[thread overview]
Message-ID: <202508141306.LMpg4Jkx-lkp@intel.com> (raw)
In-Reply-To: <20250813215603.76526-2-bhargava.marreddy@broadcom.com>

Hi Bhargava,

kernel test robot noticed the following build warnings:

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

url:    https://github.com/intel-lab-lkp/linux/commits/Bhargava-Marreddy/bng_en-Add-initial-support-for-RX-and-TX-rings/20250814-004339
base:   net-next/main
patch link:    https://lore.kernel.org/r/20250813215603.76526-2-bhargava.marreddy%40broadcom.com
patch subject: [net-next 1/9] bng_en: Add initial support for RX and TX rings
config: loongarch-randconfig-r073-20250814 (https://download.01.org/0day-ci/archive/20250814/202508141306.LMpg4Jkx-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 3769ce013be2879bf0b329c14a16f5cb766f26ce)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250814/202508141306.LMpg4Jkx-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508141306.LMpg4Jkx-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/broadcom/bnge/bnge_netdev.c:276:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     276 |         if (!bn->tx_ring_map)
         |             ^~~~~~~~~~~~~~~~
   drivers/net/ethernet/broadcom/bnge/bnge_netdev.c:315:9: note: uninitialized use occurs here
     315 |         return rc;
         |                ^~
   drivers/net/ethernet/broadcom/bnge/bnge_netdev.c:276:2: note: remove the 'if' if its condition is always false
     276 |         if (!bn->tx_ring_map)
         |         ^~~~~~~~~~~~~~~~~~~~~
     277 |                 goto err_free_core;
         |                 ~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/broadcom/bnge/bnge_netdev.c:270:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     270 |         if (!bn->tx_ring)
         |             ^~~~~~~~~~~~
   drivers/net/ethernet/broadcom/bnge/bnge_netdev.c:315:9: note: uninitialized use occurs here
     315 |         return rc;
         |                ^~
   drivers/net/ethernet/broadcom/bnge/bnge_netdev.c:270:2: note: remove the 'if' if its condition is always false
     270 |         if (!bn->tx_ring)
         |         ^~~~~~~~~~~~~~~~~
     271 |                 goto err_free_core;
         |                 ~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/broadcom/bnge/bnge_netdev.c:253:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     253 |         if (!bn->rx_ring)
         |             ^~~~~~~~~~~~
   drivers/net/ethernet/broadcom/bnge/bnge_netdev.c:315:9: note: uninitialized use occurs here
     315 |         return rc;
         |                ^~
   drivers/net/ethernet/broadcom/bnge/bnge_netdev.c:253:2: note: remove the 'if' if its condition is always false
     253 |         if (!bn->rx_ring)
         |         ^~~~~~~~~~~~~~~~~
     254 |                 goto err_free_core;
         |                 ~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/broadcom/bnge/bnge_netdev.c:228:14: note: initialize the variable 'rc' to silence this warning
     228 |         int i, j, rc, size, arr_size;
         |                     ^
         |                      = 0
   3 warnings generated.


vim +276 drivers/net/ethernet/broadcom/bnge/bnge_netdev.c

   224	
   225	static int bnge_alloc_core(struct bnge_net *bn)
   226	{
   227		struct bnge_dev *bd = bn->bd;
   228		int i, j, rc, size, arr_size;
   229		void *bnapi;
   230	
   231		arr_size = L1_CACHE_ALIGN(sizeof(struct bnge_napi *) *
   232				bd->nq_nr_rings);
   233		size = L1_CACHE_ALIGN(sizeof(struct bnge_napi));
   234		bnapi = kzalloc(arr_size + size * bd->nq_nr_rings, GFP_KERNEL);
   235		if (!bnapi)
   236			return -ENOMEM;
   237	
   238		bn->bnapi = bnapi;
   239		bnapi += arr_size;
   240		for (i = 0; i < bd->nq_nr_rings; i++, bnapi += size) {
   241			struct bnge_nq_ring_info *nqr;
   242	
   243			bn->bnapi[i] = bnapi;
   244			bn->bnapi[i]->index = i;
   245			bn->bnapi[i]->bn = bn;
   246			nqr = &bn->bnapi[i]->nq_ring;
   247			nqr->ring_struct.ring_mem.flags = BNGE_RMEM_RING_PTE_FLAG;
   248		}
   249	
   250		bn->rx_ring = kcalloc(bd->rx_nr_rings,
   251				      sizeof(struct bnge_rx_ring_info),
   252				      GFP_KERNEL);
   253		if (!bn->rx_ring)
   254			goto err_free_core;
   255	
   256		for (i = 0; i < bd->rx_nr_rings; i++) {
   257			struct bnge_rx_ring_info *rxr = &bn->rx_ring[i];
   258	
   259			rxr->rx_ring_struct.ring_mem.flags =
   260				BNGE_RMEM_RING_PTE_FLAG;
   261			rxr->rx_agg_ring_struct.ring_mem.flags =
   262				BNGE_RMEM_RING_PTE_FLAG;
   263			rxr->bnapi = bn->bnapi[i];
   264			bn->bnapi[i]->rx_ring = &bn->rx_ring[i];
   265		}
   266	
   267		bn->tx_ring = kcalloc(bd->tx_nr_rings,
   268				      sizeof(struct bnge_tx_ring_info),
   269				      GFP_KERNEL);
   270		if (!bn->tx_ring)
   271			goto err_free_core;
   272	
   273		bn->tx_ring_map = kcalloc(bd->tx_nr_rings, sizeof(u16),
   274					  GFP_KERNEL);
   275	
 > 276		if (!bn->tx_ring_map)
   277			goto err_free_core;
   278	
   279		if (bd->flags & BNGE_EN_SHARED_CHNL)
   280			j = 0;
   281		else
   282			j = bd->rx_nr_rings;
   283	
   284		for (i = 0; i < bd->tx_nr_rings; i++) {
   285			struct bnge_tx_ring_info *txr = &bn->tx_ring[i];
   286			struct bnge_napi *bnapi2;
   287			int k;
   288	
   289			txr->tx_ring_struct.ring_mem.flags = BNGE_RMEM_RING_PTE_FLAG;
   290			bn->tx_ring_map[i] = i;
   291			k = j + BNGE_RING_TO_TC_OFF(bd, i);
   292	
   293			bnapi2 = bn->bnapi[k];
   294			txr->txq_index = i;
   295			txr->tx_napi_idx =
   296				BNGE_RING_TO_TC(bd, txr->txq_index);
   297			bnapi2->tx_ring[txr->tx_napi_idx] = txr;
   298			txr->bnapi = bnapi2;
   299		}
   300	
   301		bnge_init_ring_struct(bn);
   302	
   303		rc = bnge_alloc_rx_rings(bn);
   304		if (rc)
   305			goto err_free_core;
   306	
   307		rc = bnge_alloc_tx_rings(bn);
   308		if (rc)
   309			goto err_free_core;
   310	
   311		return 0;
   312	
   313	err_free_core:
   314		bnge_free_core(bn);
   315		return rc;
   316	}
   317	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2025-08-14  5:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13 21:55 [net-next 0/9] Add more functionality to BNGE Bhargava Marreddy
2025-08-13 21:55 ` [net-next 1/9] bng_en: Add initial support for RX and TX rings Bhargava Marreddy
2025-08-14  5:32   ` kernel test robot [this message]
2025-08-13 21:55 ` [net-next 2/9] bng_en: Add initial support for CP and NQ rings Bhargava Marreddy
2025-08-13 21:55 ` [net-next 3/9] bng_en: Introduce VNIC Bhargava Marreddy
2025-08-13 21:55 ` [net-next 4/9] bng_en: Initialise core resources Bhargava Marreddy
2025-08-13 21:55 ` [net-next 5/9] bng_en: Allocate packet buffers Bhargava Marreddy
2025-08-13 21:56 ` [net-next 6/9] bng_en: Allocate stat contexts Bhargava Marreddy
2025-08-13 21:56 ` [net-next 7/9] bng_en: Register rings with the firmware Bhargava Marreddy
2025-08-14  6:47   ` kernel test robot
2025-08-14  7:54   ` kernel test robot
2025-08-13 21:56 ` [net-next 8/9] bng_en: Register default VNIC Bhargava Marreddy
2025-08-13 21:56 ` [net-next 9/9] bng_en: Configure " Bhargava Marreddy

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=202508141306.LMpg4Jkx-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bhargava.marreddy@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.com \
    --cc=rajashekar.hudumula@broadcom.com \
    --cc=vikas.gupta@broadcom.com \
    --cc=vsrama-krishna.nemani@broadcom.com \
    /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.