linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/net/ethernet/intel/ice/ice_dcb_nl.c:66:6: warning: variable 'bwcfg' set but not used
@ 2021-11-07  1:06 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-11-07  1:06 UTC (permalink / raw)
  To: Dave Ertman
  Cc: llvm, kbuild-all, linux-kernel, Tony Nguyen, Anirudh Venkataramanan

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   00f178e15095fbcf04db00486378a6fa416a125e
commit: 2a87bd73e50d1c71392c036b0b31c9b2418981d0 ice: Add DSCP support
date:   6 weeks ago
config: riscv-randconfig-r005-20211008 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 8ed2e8e04ff42eb4d8009999ae1fd341a30bf6c0)
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
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2a87bd73e50d1c71392c036b0b31c9b2418981d0
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 2a87bd73e50d1c71392c036b0b31c9b2418981d0
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv 

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

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/intel/ice/ice_dcb_nl.c:66:6: warning: variable 'bwcfg' set but not used [-Wunused-but-set-variable]
           int bwcfg = 0, bwrec = 0;
               ^
   1 warning generated.


vim +/bwcfg +66 drivers/net/ethernet/intel/ice/ice_dcb_nl.c

b94b013eb62695 Dave Ertman      2019-11-06   56  
b94b013eb62695 Dave Ertman      2019-11-06   57  /**
b94b013eb62695 Dave Ertman      2019-11-06   58   * ice_dcbnl_setets - set IEEE ETS configuration
b94b013eb62695 Dave Ertman      2019-11-06   59   * @netdev: pointer to relevant netdev
b94b013eb62695 Dave Ertman      2019-11-06   60   * @ets: struct to hold ETS configuration
b94b013eb62695 Dave Ertman      2019-11-06   61   */
b94b013eb62695 Dave Ertman      2019-11-06   62  static int ice_dcbnl_setets(struct net_device *netdev, struct ieee_ets *ets)
b94b013eb62695 Dave Ertman      2019-11-06   63  {
b94b013eb62695 Dave Ertman      2019-11-06   64  	struct ice_pf *pf = ice_netdev_to_pf(netdev);
b94b013eb62695 Dave Ertman      2019-11-06   65  	struct ice_dcbx_cfg *new_cfg;
b94b013eb62695 Dave Ertman      2019-11-06  @66  	int bwcfg = 0, bwrec = 0;
2a87bd73e50d1c Dave Ertman      2021-08-06   67  	int err, i;
b94b013eb62695 Dave Ertman      2019-11-06   68  
b94b013eb62695 Dave Ertman      2019-11-06   69  	if ((pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED) ||
b94b013eb62695 Dave Ertman      2019-11-06   70  	    !(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE))
b94b013eb62695 Dave Ertman      2019-11-06   71  		return -EINVAL;
b94b013eb62695 Dave Ertman      2019-11-06   72  
fc2d1165d4a424 Chinh T Cao      2020-11-20   73  	new_cfg = &pf->hw.port_info->qos_cfg.desired_dcbx_cfg;
b94b013eb62695 Dave Ertman      2019-11-06   74  
b94b013eb62695 Dave Ertman      2019-11-06   75  	mutex_lock(&pf->tc_mutex);
b94b013eb62695 Dave Ertman      2019-11-06   76  
b94b013eb62695 Dave Ertman      2019-11-06   77  	new_cfg->etscfg.willing = ets->willing;
b94b013eb62695 Dave Ertman      2019-11-06   78  	new_cfg->etscfg.cbs = ets->cbs;
b94b013eb62695 Dave Ertman      2019-11-06   79  	ice_for_each_traffic_class(i) {
b94b013eb62695 Dave Ertman      2019-11-06   80  		new_cfg->etscfg.tcbwtable[i] = ets->tc_tx_bw[i];
b94b013eb62695 Dave Ertman      2019-11-06   81  		bwcfg += ets->tc_tx_bw[i];
b94b013eb62695 Dave Ertman      2019-11-06   82  		new_cfg->etscfg.tsatable[i] = ets->tc_tsa[i];
2a87bd73e50d1c Dave Ertman      2021-08-06   83  		if (new_cfg->pfc_mode == ICE_QOS_MODE_VLAN) {
2a87bd73e50d1c Dave Ertman      2021-08-06   84  			/* in DSCP mode up->tc mapping cannot change */
b94b013eb62695 Dave Ertman      2019-11-06   85  			new_cfg->etscfg.prio_table[i] = ets->prio_tc[i];
2a87bd73e50d1c Dave Ertman      2021-08-06   86  			new_cfg->etsrec.prio_table[i] = ets->reco_prio_tc[i];
2a87bd73e50d1c Dave Ertman      2021-08-06   87  		}
b94b013eb62695 Dave Ertman      2019-11-06   88  		new_cfg->etsrec.tcbwtable[i] = ets->tc_reco_bw[i];
b94b013eb62695 Dave Ertman      2019-11-06   89  		bwrec += ets->tc_reco_bw[i];
b94b013eb62695 Dave Ertman      2019-11-06   90  		new_cfg->etsrec.tsatable[i] = ets->tc_reco_tsa[i];
b94b013eb62695 Dave Ertman      2019-11-06   91  	}
b94b013eb62695 Dave Ertman      2019-11-06   92  
a29a912d448dbc Avinash Dayanand 2020-02-13   93  	if (ice_dcb_bwchk(pf, new_cfg)) {
a29a912d448dbc Avinash Dayanand 2020-02-13   94  		err = -EINVAL;
a29a912d448dbc Avinash Dayanand 2020-02-13   95  		goto ets_out;
a29a912d448dbc Avinash Dayanand 2020-02-13   96  	}
a29a912d448dbc Avinash Dayanand 2020-02-13   97  
2a87bd73e50d1c Dave Ertman      2021-08-06   98  	new_cfg->etscfg.maxtcs = pf->hw.func_caps.common_cap.maxtc;
b94b013eb62695 Dave Ertman      2019-11-06   99  
b94b013eb62695 Dave Ertman      2019-11-06  100  	if (!bwrec)
b94b013eb62695 Dave Ertman      2019-11-06  101  		new_cfg->etsrec.tcbwtable[0] = 100;
b94b013eb62695 Dave Ertman      2019-11-06  102  
b94b013eb62695 Dave Ertman      2019-11-06  103  	err = ice_pf_dcb_cfg(pf, new_cfg, true);
b94b013eb62695 Dave Ertman      2019-11-06  104  	/* return of zero indicates new cfg applied */
b94b013eb62695 Dave Ertman      2019-11-06  105  	if (err == ICE_DCB_HW_CHG_RST)
b94b013eb62695 Dave Ertman      2019-11-06  106  		ice_dcbnl_devreset(netdev);
b94b013eb62695 Dave Ertman      2019-11-06  107  	if (err == ICE_DCB_NO_HW_CHG)
b94b013eb62695 Dave Ertman      2019-11-06  108  		err = ICE_DCB_HW_CHG_RST;
b94b013eb62695 Dave Ertman      2019-11-06  109  
a29a912d448dbc Avinash Dayanand 2020-02-13  110  ets_out:
b94b013eb62695 Dave Ertman      2019-11-06  111  	mutex_unlock(&pf->tc_mutex);
b94b013eb62695 Dave Ertman      2019-11-06  112  	return err;
b94b013eb62695 Dave Ertman      2019-11-06  113  }
b94b013eb62695 Dave Ertman      2019-11-06  114  

:::::: The code at line 66 was first introduced by commit
:::::: b94b013eb6269526eeb3768101666ba6f526313e ice: Implement DCBNL support

:::::: TO: Dave Ertman <david.m.ertman@intel.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@lists.01.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* drivers/net/ethernet/intel/ice/ice_dcb_nl.c:66:6: warning: variable 'bwcfg' set but not used
@ 2021-11-26 17:41 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-11-26 17:41 UTC (permalink / raw)
  To: Dave Ertman
  Cc: llvm, kbuild-all, linux-kernel, Tony Nguyen, Anirudh Venkataramanan

Hi Dave,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a4849f6000e29235a2707f22e39da6b897bb9543
commit: 2a87bd73e50d1c71392c036b0b31c9b2418981d0 ice: Add DSCP support
date:   8 weeks ago
config: i386-randconfig-a003-20211126 (https://download.01.org/0day-ci/archive/20211127/202111270145.6iqJ5sdb-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5162b558d8c0b542e752b037e72a69d5fd51eb1e)
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2a87bd73e50d1c71392c036b0b31c9b2418981d0
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 2a87bd73e50d1c71392c036b0b31c9b2418981d0
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/net/ethernet/intel/ice/

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

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/intel/ice/ice_dcb_nl.c:66:6: warning: variable 'bwcfg' set but not used [-Wunused-but-set-variable]
           int bwcfg = 0, bwrec = 0;
               ^
   1 warning generated.


vim +/bwcfg +66 drivers/net/ethernet/intel/ice/ice_dcb_nl.c

b94b013eb626952 Dave Ertman      2019-11-06   56  
b94b013eb626952 Dave Ertman      2019-11-06   57  /**
b94b013eb626952 Dave Ertman      2019-11-06   58   * ice_dcbnl_setets - set IEEE ETS configuration
b94b013eb626952 Dave Ertman      2019-11-06   59   * @netdev: pointer to relevant netdev
b94b013eb626952 Dave Ertman      2019-11-06   60   * @ets: struct to hold ETS configuration
b94b013eb626952 Dave Ertman      2019-11-06   61   */
b94b013eb626952 Dave Ertman      2019-11-06   62  static int ice_dcbnl_setets(struct net_device *netdev, struct ieee_ets *ets)
b94b013eb626952 Dave Ertman      2019-11-06   63  {
b94b013eb626952 Dave Ertman      2019-11-06   64  	struct ice_pf *pf = ice_netdev_to_pf(netdev);
b94b013eb626952 Dave Ertman      2019-11-06   65  	struct ice_dcbx_cfg *new_cfg;
b94b013eb626952 Dave Ertman      2019-11-06  @66  	int bwcfg = 0, bwrec = 0;
2a87bd73e50d1c7 Dave Ertman      2021-08-06   67  	int err, i;
b94b013eb626952 Dave Ertman      2019-11-06   68  
b94b013eb626952 Dave Ertman      2019-11-06   69  	if ((pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED) ||
b94b013eb626952 Dave Ertman      2019-11-06   70  	    !(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE))
b94b013eb626952 Dave Ertman      2019-11-06   71  		return -EINVAL;
b94b013eb626952 Dave Ertman      2019-11-06   72  
fc2d1165d4a424d Chinh T Cao      2020-11-20   73  	new_cfg = &pf->hw.port_info->qos_cfg.desired_dcbx_cfg;
b94b013eb626952 Dave Ertman      2019-11-06   74  
b94b013eb626952 Dave Ertman      2019-11-06   75  	mutex_lock(&pf->tc_mutex);
b94b013eb626952 Dave Ertman      2019-11-06   76  
b94b013eb626952 Dave Ertman      2019-11-06   77  	new_cfg->etscfg.willing = ets->willing;
b94b013eb626952 Dave Ertman      2019-11-06   78  	new_cfg->etscfg.cbs = ets->cbs;
b94b013eb626952 Dave Ertman      2019-11-06   79  	ice_for_each_traffic_class(i) {
b94b013eb626952 Dave Ertman      2019-11-06   80  		new_cfg->etscfg.tcbwtable[i] = ets->tc_tx_bw[i];
b94b013eb626952 Dave Ertman      2019-11-06   81  		bwcfg += ets->tc_tx_bw[i];
b94b013eb626952 Dave Ertman      2019-11-06   82  		new_cfg->etscfg.tsatable[i] = ets->tc_tsa[i];
2a87bd73e50d1c7 Dave Ertman      2021-08-06   83  		if (new_cfg->pfc_mode == ICE_QOS_MODE_VLAN) {
2a87bd73e50d1c7 Dave Ertman      2021-08-06   84  			/* in DSCP mode up->tc mapping cannot change */
b94b013eb626952 Dave Ertman      2019-11-06   85  			new_cfg->etscfg.prio_table[i] = ets->prio_tc[i];
2a87bd73e50d1c7 Dave Ertman      2021-08-06   86  			new_cfg->etsrec.prio_table[i] = ets->reco_prio_tc[i];
2a87bd73e50d1c7 Dave Ertman      2021-08-06   87  		}
b94b013eb626952 Dave Ertman      2019-11-06   88  		new_cfg->etsrec.tcbwtable[i] = ets->tc_reco_bw[i];
b94b013eb626952 Dave Ertman      2019-11-06   89  		bwrec += ets->tc_reco_bw[i];
b94b013eb626952 Dave Ertman      2019-11-06   90  		new_cfg->etsrec.tsatable[i] = ets->tc_reco_tsa[i];
b94b013eb626952 Dave Ertman      2019-11-06   91  	}
b94b013eb626952 Dave Ertman      2019-11-06   92  
a29a912d448dbc9 Avinash Dayanand 2020-02-13   93  	if (ice_dcb_bwchk(pf, new_cfg)) {
a29a912d448dbc9 Avinash Dayanand 2020-02-13   94  		err = -EINVAL;
a29a912d448dbc9 Avinash Dayanand 2020-02-13   95  		goto ets_out;
a29a912d448dbc9 Avinash Dayanand 2020-02-13   96  	}
a29a912d448dbc9 Avinash Dayanand 2020-02-13   97  
2a87bd73e50d1c7 Dave Ertman      2021-08-06   98  	new_cfg->etscfg.maxtcs = pf->hw.func_caps.common_cap.maxtc;
b94b013eb626952 Dave Ertman      2019-11-06   99  
b94b013eb626952 Dave Ertman      2019-11-06  100  	if (!bwrec)
b94b013eb626952 Dave Ertman      2019-11-06  101  		new_cfg->etsrec.tcbwtable[0] = 100;
b94b013eb626952 Dave Ertman      2019-11-06  102  
b94b013eb626952 Dave Ertman      2019-11-06  103  	err = ice_pf_dcb_cfg(pf, new_cfg, true);
b94b013eb626952 Dave Ertman      2019-11-06  104  	/* return of zero indicates new cfg applied */
b94b013eb626952 Dave Ertman      2019-11-06  105  	if (err == ICE_DCB_HW_CHG_RST)
b94b013eb626952 Dave Ertman      2019-11-06  106  		ice_dcbnl_devreset(netdev);
b94b013eb626952 Dave Ertman      2019-11-06  107  	if (err == ICE_DCB_NO_HW_CHG)
b94b013eb626952 Dave Ertman      2019-11-06  108  		err = ICE_DCB_HW_CHG_RST;
b94b013eb626952 Dave Ertman      2019-11-06  109  
a29a912d448dbc9 Avinash Dayanand 2020-02-13  110  ets_out:
b94b013eb626952 Dave Ertman      2019-11-06  111  	mutex_unlock(&pf->tc_mutex);
b94b013eb626952 Dave Ertman      2019-11-06  112  	return err;
b94b013eb626952 Dave Ertman      2019-11-06  113  }
b94b013eb626952 Dave Ertman      2019-11-06  114  

:::::: The code at line 66 was first introduced by commit
:::::: b94b013eb6269526eeb3768101666ba6f526313e ice: Implement DCBNL support

:::::: TO: Dave Ertman <david.m.ertman@intel.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@lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-26 17:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-07  1:06 drivers/net/ethernet/intel/ice/ice_dcb_nl.c:66:6: warning: variable 'bwcfg' set but not used kernel test robot
2021-11-26 17:41 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).