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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202412050416.e7egEz4f-lkp@intel.com>
Date: Thu, 5 Dec 2024 05:00:58 +0800
From: kernel test robot <lkp@...el.com>
To: Tariq Toukan <tariqt@...dia.com>,
	"David S. Miller" <davem@...emloft.net>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Eric Dumazet <edumazet@...gle.com>,
	Andrew Lunn <andrew+netdev@...n.ch>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	netdev@...r.kernel.org, Saeed Mahameed <saeedm@...dia.com>,
	Gal Pressman <gal@...dia.com>, Leon Romanovsky <leonro@...dia.com>,
	linux-rdma@...r.kernel.org, Carolina Jubran <cjubran@...dia.com>,
	Cosmin Ratiu <cratiu@...dia.com>, Jiri Pirko <jiri@...dia.com>,
	Tariq Toukan <tariqt@...dia.com>
Subject: Re: [PATCH net-next V4 07/11] devlink: Extend devlink rate API with
 traffic classes bandwidth management

Hi Tariq,

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/Tariq-Toukan/net-mlx5-ifc-Reorganize-mlx5_ifc_flow_table_context_bits/20241204-124235
base:   net-next/main
patch link:    https://lore.kernel.org/r/20241203202924.228440-8-tariqt%40nvidia.com
patch subject: [PATCH net-next V4 07/11] devlink: Extend devlink rate API with traffic classes bandwidth management
config: x86_64-buildonly-randconfig-001-20241205 (https://download.01.org/0day-ci/archive/20241205/202412050416.e7egEz4f-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241205/202412050416.e7egEz4f-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412050416.e7egEz4f-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from net/devlink/rate.c:7:
   In file included from net/devlink/devl_internal.h:7:
   In file included from include/linux/etherdevice.h:20:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:8:
   In file included from include/linux/cacheflush.h:5:
   In file included from arch/x86/include/asm/cacheflush.h:5:
   In file included from include/linux/mm.h:2223:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   In file included from net/devlink/rate.c:7:
   net/devlink/devl_internal.h:29:19: warning: arithmetic between different enumeration types ('enum devlink_reload_limit' and 'enum devlink_reload_action') [-Wenum-enum-conversion]
      29 |         u32 reload_stats[DEVLINK_RELOAD_STATS_ARRAY_SIZE];
         |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/devlink/devl_internal.h:26:30: note: expanded from macro 'DEVLINK_RELOAD_STATS_ARRAY_SIZE'
      26 |         (__DEVLINK_RELOAD_LIMIT_MAX * __DEVLINK_RELOAD_ACTION_MAX)
         |          ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/devlink/devl_internal.h:30:26: warning: arithmetic between different enumeration types ('enum devlink_reload_limit' and 'enum devlink_reload_action') [-Wenum-enum-conversion]
      30 |         u32 remote_reload_stats[DEVLINK_RELOAD_STATS_ARRAY_SIZE];
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/devlink/devl_internal.h:26:30: note: expanded from macro 'DEVLINK_RELOAD_STATS_ARRAY_SIZE'
      26 |         (__DEVLINK_RELOAD_LIMIT_MAX * __DEVLINK_RELOAD_ACTION_MAX)
         |          ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> net/devlink/rate.c:403:4: warning: 'snprintf' will always be truncated; specified size is 80, but format string expands to at least 83 [-Wformat-truncation]
     403 |                         NL_SET_ERR_MSG_FMT(info->extack,
         |                         ^
   include/linux/netlink.h:116:6: note: expanded from macro 'NL_SET_ERR_MSG_FMT'
     116 |         if (snprintf(__extack->_msg_buf, NETLINK_MAX_FMTMSG_LEN,               \
         |             ^
   7 warnings generated.


vim +/snprintf +403 net/devlink/rate.c

   381	
   382	static int devlink_nl_rate_tc_bw_set(struct devlink_rate *devlink_rate,
   383					     struct genl_info *info)
   384	{
   385		DECLARE_BITMAP(bitmap, IEEE_8021QAZ_MAX_TCS) = {};
   386		struct devlink *devlink = devlink_rate->devlink;
   387		const struct devlink_ops *ops = devlink->ops;
   388		u32 tc_bw[IEEE_8021QAZ_MAX_TCS] = {};
   389		int rem, err = -EOPNOTSUPP, i;
   390		struct nlattr *attr;
   391	
   392		nla_for_each_attr(attr, genlmsg_data(info->genlhdr),
   393				  genlmsg_len(info->genlhdr), rem) {
   394			if (nla_type(attr) == DEVLINK_ATTR_RATE_TC_BWS) {
   395				err = devlink_nl_rate_tc_bw_parse(attr, tc_bw, bitmap, info->extack);
   396				if (err)
   397					return err;
   398			}
   399		}
   400	
   401		for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
   402			if (!test_bit(i, bitmap)) {
 > 403				NL_SET_ERR_MSG_FMT(info->extack,
   404						   "Incomplete traffic class bandwidth values, all %u traffic classes must be specified",
   405						   IEEE_8021QAZ_MAX_TCS);
   406				return -EINVAL;
   407			}
   408		}
   409	
   410		if (devlink_rate_is_leaf(devlink_rate))
   411			err = ops->rate_leaf_tc_bw_set(devlink_rate, devlink_rate->priv, tc_bw,
   412						       info->extack);
   413		else if (devlink_rate_is_node(devlink_rate))
   414			err = ops->rate_node_tc_bw_set(devlink_rate, devlink_rate->priv, tc_bw,
   415						       info->extack);
   416	
   417		if (err)
   418			return err;
   419	
   420		memcpy(devlink_rate->tc_bw, tc_bw, sizeof(tc_bw));
   421	
   422		return 0;
   423	}
   424	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ