All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Pawel Dembicki <paweldembicki@gmail.com>, netdev@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Linus Walleij <linus.walleij@linaro.org>,
	Pawel Dembicki <paweldembicki@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] net: dsa: vsc73xx: implement packet reception via control interface
Date: Tue, 22 Oct 2024 10:18:35 +0800	[thread overview]
Message-ID: <202410220908.uFiUPMGy-lkp@intel.com> (raw)
In-Reply-To: <20241020205452.2660042-2-paweldembicki@gmail.com>

Hi Pawel,

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/Pawel-Dembicki/net-dsa-vsc73xx-implement-packet-reception-via-control-interface/20241021-050041
base:   net-next/main
patch link:    https://lore.kernel.org/r/20241020205452.2660042-2-paweldembicki%40gmail.com
patch subject: [PATCH net-next 2/3] net: dsa: vsc73xx: implement packet reception via control interface
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20241022/202410220908.uFiUPMGy-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241022/202410220908.uFiUPMGy-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/202410220908.uFiUPMGy-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/dsa/vitesse-vsc73xx-core.c:935:30: warning: variable 'len' is uninitialized when used here [-Wuninitialized]
     935 |         skb = netdev_alloc_skb(dev, len);
         |                                     ^~~
   drivers/net/dsa/vitesse-vsc73xx-core.c:885:23: note: initialize the variable 'len' to silence this warning
     885 |         int ret, buf_len, len, part;
         |                              ^
         |                               = 0
   1 warning generated.


vim +/len +935 drivers/net/dsa/vitesse-vsc73xx-core.c

   879	
   880	static void vsc73xx_polled_rcv(struct kthread_work *work)
   881	{
   882		struct vsc73xx *vsc = container_of(work, struct vsc73xx, dwork.work);
   883		u16 ptr = VSC73XX_CAPT_FRAME_DATA;
   884		struct dsa_switch *ds = vsc->ds;
   885		int ret, buf_len, len, part;
   886		struct vsc73xx_ifh ifh;
   887		struct net_device *dev;
   888		struct dsa_port *dp;
   889		struct sk_buff *skb;
   890		u32 val, *buf;
   891		u16 count;
   892	
   893		ret = vsc73xx_read(vsc, VSC73XX_BLOCK_SYSTEM, 0, VSC73XX_CAPCTRL, &val);
   894		if (ret)
   895			goto queue;
   896	
   897		if (!(val & VSC73XX_CAPCTRL_QUEUE0_READY))
   898			/* No frame to read */
   899			goto queue;
   900	
   901		/* Initialise reading */
   902		ret = vsc73xx_read(vsc, VSC73XX_BLOCK_CAPTURE, VSC73XX_BLOCK_CAPT_Q0,
   903				   VSC73XX_CAPT_CAPREADP, &val);
   904		if (ret)
   905			goto queue;
   906	
   907		/* Get internal frame header */
   908		ret = vsc73xx_read(vsc, VSC73XX_BLOCK_CAPTURE,
   909				   VSC73XX_BLOCK_CAPT_FRAME0, ptr++, &ifh.datah);
   910		if (ret)
   911			goto queue;
   912	
   913		ret = vsc73xx_read(vsc, VSC73XX_BLOCK_CAPTURE,
   914				   VSC73XX_BLOCK_CAPT_FRAME0, ptr++, &ifh.datal);
   915		if (ret)
   916			goto queue;
   917	
   918		if (ifh.magic != VSC73XX_IFH_MAGIC) {
   919			/* Something goes wrong with buffer. Reset capture block */
   920			vsc73xx_write(vsc, VSC73XX_BLOCK_CAPTURE,
   921				      VSC73XX_BLOCK_CAPT_RST, VSC73XX_CAPT_CAPRST, 1);
   922			goto queue;
   923		}
   924	
   925		if (!dsa_is_user_port(ds, ifh.port))
   926			goto release_frame;
   927	
   928		dp = dsa_to_port(ds, ifh.port);
   929		dev = dp->user;
   930		if (!dev)
   931			goto release_frame;
   932	
   933		count = (ifh.frame_length + 7 + VSC73XX_IFH_SIZE - ETH_FCS_LEN) >> 2;
   934	
 > 935		skb = netdev_alloc_skb(dev, len);
   936		if (unlikely(!skb)) {
   937			netdev_err(dev, "Unable to allocate sk_buff\n");
   938			goto release_frame;
   939		}
   940	
   941		buf_len = ifh.frame_length - ETH_FCS_LEN;
   942		buf = (u32 *)skb_put(skb, buf_len);
   943		len = 0;
   944		part = 0;
   945	
   946		while (ptr < count) {
   947			ret = vsc73xx_read(vsc, VSC73XX_BLOCK_CAPTURE,
   948					   VSC73XX_BLOCK_CAPT_FRAME0 + part, ptr++,
   949					   buf + len);
   950			if (ret)
   951				goto free_skb;
   952			len++;
   953			if (ptr > VSC73XX_CAPT_FRAME_DATA_MAX &&
   954			    count != VSC73XX_CAPT_FRAME_DATA_MAX) {
   955				ptr = VSC73XX_CAPT_FRAME_DATA;
   956				part++;
   957				count -= VSC73XX_CAPT_FRAME_DATA_MAX;
   958			}
   959		}
   960	
   961		/* Get FCS */
   962		ret = vsc73xx_read(vsc, VSC73XX_BLOCK_CAPTURE,
   963				   VSC73XX_BLOCK_CAPT_FRAME0, ptr++, &val);
   964		if (ret)
   965			goto free_skb;
   966	
   967		/* Everything we see on an interface that is in the HW bridge
   968		 * has already been forwarded.
   969		 */
   970		if (dp->bridge)
   971			skb->offload_fwd_mark = 1;
   972	
   973		skb->protocol = eth_type_trans(skb, dev);
   974	
   975		netif_rx(skb);
   976		goto release_frame;
   977	
   978	free_skb:
   979		kfree_skb(skb);
   980	release_frame:
   981		/* Release the frame from internal buffer */
   982		vsc73xx_write(vsc, VSC73XX_BLOCK_CAPTURE, VSC73XX_BLOCK_CAPT_Q0,
   983			      VSC73XX_CAPT_CAPREADP, 0);
   984	queue:
   985		kthread_queue_delayed_work(vsc->rcv_worker, &vsc->dwork,
   986					   msecs_to_jiffies(VSC73XX_RCV_POLL_INTERVAL));
   987	}
   988	

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

  parent reply	other threads:[~2024-10-22  2:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-20 20:54 [PATCH net-next 1/3] net: dsa: vsc73xx: implement transmit via control interface Pawel Dembicki
2024-10-20 20:54 ` [PATCH net-next 2/3] net: dsa: vsc73xx: implement packet reception " Pawel Dembicki
2024-10-21 10:42   ` Simon Horman
2024-10-21 11:38   ` Vladimir Oltean
2024-10-21 11:42   ` Vladimir Oltean
2024-10-22  2:18   ` kernel test robot [this message]
2024-10-20 20:54 ` [PATCH net-next 3/3] net: dsa: vsc73xx: Remove FIXME Pawel Dembicki
2024-10-21 12:07 ` [PATCH net-next 1/3] net: dsa: vsc73xx: implement transmit via control interface Vladimir Oltean
2024-10-21 21:41 ` Vadim Fedorenko
2024-10-22  0:46 ` kernel test robot
2024-10-22  3:11 ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2024-10-25 21:06 [PATCH net-next 2/3] net: dsa: vsc73xx: implement packet reception " 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=202410220908.uFiUPMGy-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrew@lunn.ch \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=paweldembicki@gmail.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.