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>] [day] [month] [year] [list]
Message-ID: <202110111702.sm3nIqOs-lkp@intel.com>
Date:   Mon, 11 Oct 2021 17:48:09 +0800
From:   kernel test robot <lkp@...el.com>
To:     Grygorii Strashko <grygorii.strashko@...com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Vignesh Raghavendra <vigneshr@...com>
Subject: [ti:ti-linux-5.10.y 6791/9578]
 drivers/net/ethernet/ti/cpsw.c:916:22: warning: variable 'len' set but not
 used

tree:   git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-5.10.y
head:   f25fed53436a83d746c481ba852b3d4c10d0bab0
commit: 6853acd9be4e17522e3c3b2ec30c3ce8e46b6b9e [6791/9578] HACK: net: ethernet: ti: cpsw: allow to configure min tx packet size
config: alpha-allmodconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
        git fetch --no-tags ti ti-linux-5.10.y
        git checkout 6853acd9be4e17522e3c3b2ec30c3ce8e46b6b9e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=alpha 

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

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/ti/cpsw.c: In function 'cpsw_ndo_start_xmit':
>> drivers/net/ethernet/ti/cpsw.c:916:22: warning: variable 'len' set but not used [-Wunused-but-set-variable]
     916 |         unsigned int len;
         |                      ^~~


vim +/len +916 drivers/net/ethernet/ti/cpsw.c

   907	
   908	static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb,
   909					       struct net_device *ndev)
   910	{
   911		struct cpsw_priv *priv = netdev_priv(ndev);
   912		struct cpsw_common *cpsw = priv->cpsw;
   913		struct cpts *cpts = cpsw->cpts;
   914		struct netdev_queue *txq;
   915		struct cpdma_chan *txch;
 > 916		unsigned int len;
   917		int ret, q_idx;
   918	
   919		if (skb_padto(skb, tx_packet_min)) {
   920			cpsw_err(priv, tx_err, "packet pad failed\n");
   921			ndev->stats.tx_dropped++;
   922			return NET_XMIT_DROP;
   923		}
   924	
   925		len = skb->len < tx_packet_min ? tx_packet_min : skb->len;
   926	
   927		if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP &&
   928		    priv->tx_ts_enabled && cpts_can_timestamp(cpts, skb))
   929			skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
   930	
   931		q_idx = skb_get_queue_mapping(skb);
   932		if (q_idx >= cpsw->tx_ch_num)
   933			q_idx = q_idx % cpsw->tx_ch_num;
   934	
   935		txch = cpsw->txv[q_idx].ch;
   936		txq = netdev_get_tx_queue(ndev, q_idx);
   937		skb_tx_timestamp(skb);
   938		ret = cpdma_chan_submit(txch, skb, skb->data, skb->len,
   939					priv->emac_port + cpsw->data.dual_emac);
   940		if (unlikely(ret != 0)) {
   941			cpsw_err(priv, tx_err, "desc submit failed\n");
   942			goto fail;
   943		}
   944	
   945		/* If there is no more tx desc left free then we need to
   946		 * tell the kernel to stop sending us tx frames.
   947		 */
   948		if (unlikely(!cpdma_check_free_tx_desc(txch))) {
   949			netif_tx_stop_queue(txq);
   950	
   951			/* Barrier, so that stop_queue visible to other cpus */
   952			smp_mb__after_atomic();
   953	
   954			if (cpdma_check_free_tx_desc(txch))
   955				netif_tx_wake_queue(txq);
   956		}
   957	
   958		return NETDEV_TX_OK;
   959	fail:
   960		ndev->stats.tx_dropped++;
   961		netif_tx_stop_queue(txq);
   962	
   963		/* Barrier, so that stop_queue visible to other cpus */
   964		smp_mb__after_atomic();
   965	
   966		if (cpdma_check_free_tx_desc(txch))
   967			netif_tx_wake_queue(txq);
   968	
   969		return NETDEV_TX_BUSY;
   970	}
   971	

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

Download attachment ".config.gz" of type "application/gzip" (66551 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ