llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [rppt:execmem/x86-rox/v4 5/8] drivers/net/ethernet/pensando/ionic/ionic_txrx.c:203:30: warning: implicit conversion from 'unsigned long' to 'u16' (aka 'unsigned short') changes value from 65536 to 0
@ 2024-10-01 17:07 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-01 17:07 UTC (permalink / raw)
  To: Mike Rapoport (Microsoft); +Cc: llvm, oe-kbuild-all, Mike Rapoport

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git execmem/x86-rox/v4
head:   c90f89d40fd21ce040b5cf1485ec6913d1b4ea5d
commit: 394ca992d5179367add42d631858f72a3bf4870d [5/8] arch: introduce set_direct_map_valid_noflush()
config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20241002/202410020117.DiGJI30C-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 7773243d9916f98ba0ffce0c3a960e4aa9f03e81)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241002/202410020117.DiGJI30C-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/202410020117.DiGJI30C-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/net/ethernet/pensando/ionic/ionic_txrx.c:4:
   In file included from include/linux/ip.h:16:
   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/powerpc/include/asm/cacheflush.h:7:
   In file included from include/linux/mm.h:2213:
   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 drivers/net/ethernet/pensando/ionic/ionic_txrx.c:11:
   In file included from drivers/net/ethernet/pensando/ionic/ionic.h:10:
   In file included from drivers/net/ethernet/pensando/ionic/ionic_dev.h:11:
   In file included from include/linux/bpf_trace.h:5:
   In file included from include/trace/events/xdp.h:9:
   In file included from include/linux/filter.h:19:
   include/linux/set_memory.h:38:1: error: expected identifier or '('
      38 | {
         | ^
>> drivers/net/ethernet/pensando/ionic/ionic_txrx.c:203:30: warning: implicit conversion from 'unsigned long' to 'u16' (aka 'unsigned short') changes value from 65536 to 0 [-Wconstant-conversion]
     203 |                 frag_len = min_t(u16, len, IONIC_PAGE_SIZE);
         |                            ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
   drivers/net/ethernet/pensando/ionic/ionic_dev.h:184:32: note: expanded from macro 'IONIC_PAGE_SIZE'
     184 | #define IONIC_PAGE_SIZE                         MIN(PAGE_SIZE, IONIC_MAX_BUF_LEN)
         |                                                     ^
   arch/powerpc/include/asm/page.h:25:34: note: expanded from macro 'PAGE_SIZE'
      25 | #define PAGE_SIZE               (ASM_CONST(1) << PAGE_SHIFT)
         |                                               ^
   include/linux/minmax.h:329:28: note: expanded from macro 'MIN'
     329 | #define MIN(a,b) __cmp(min,a,b)
         |                            ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/minmax.h:213:52: note: expanded from macro 'min_t'
     213 | #define min_t(type, x, y) __cmp_once(min, type, x, y)
         |                           ~~~~~~~~~~~~~~~~~~~~~~~~~^~
   include/linux/minmax.h:96:33: note: expanded from macro '__cmp_once'
      96 |         __cmp_once_unique(op, type, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:93:31: note: expanded from macro '__cmp_once_unique'
      93 |         ({ type ux = (x); type uy = (y); __cmp(op, ux, uy); })
         |                                ~~    ^
   drivers/net/ethernet/pensando/ionic/ionic_txrx.c:803:36: warning: implicit conversion from 'unsigned long' to 'u16' (aka 'unsigned short') changes value from 65536 to 0 [-Wconstant-conversion]
     803 |                 first_frag_len = min_t(u16, len, IONIC_PAGE_SIZE);
         |                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
   drivers/net/ethernet/pensando/ionic/ionic_dev.h:184:32: note: expanded from macro 'IONIC_PAGE_SIZE'
     184 | #define IONIC_PAGE_SIZE                         MIN(PAGE_SIZE, IONIC_MAX_BUF_LEN)
         |                                                     ^
   arch/powerpc/include/asm/page.h:25:34: note: expanded from macro 'PAGE_SIZE'
      25 | #define PAGE_SIZE               (ASM_CONST(1) << PAGE_SHIFT)
         |                                               ^
   include/linux/minmax.h:329:28: note: expanded from macro 'MIN'
     329 | #define MIN(a,b) __cmp(min,a,b)
         |                            ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/minmax.h:213:52: note: expanded from macro 'min_t'
     213 | #define min_t(type, x, y) __cmp_once(min, type, x, y)
         |                           ~~~~~~~~~~~~~~~~~~~~~~~~~^~
   include/linux/minmax.h:96:33: note: expanded from macro '__cmp_once'
      96 |         __cmp_once_unique(op, type, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:93:31: note: expanded from macro '__cmp_once_unique'
      93 |         ({ type ux = (x); type uy = (y); __cmp(op, ux, uy); })
         |                                ~~    ^
   drivers/net/ethernet/pensando/ionic/ionic_txrx.c:838:38: warning: implicit conversion from 'unsigned long' to 'u16' (aka 'unsigned short') changes value from 65536 to 0 [-Wconstant-conversion]
     838 |                         frag_len = min_t(u16, remain_len, IONIC_PAGE_SIZE);
         |                                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
   drivers/net/ethernet/pensando/ionic/ionic_dev.h:184:32: note: expanded from macro 'IONIC_PAGE_SIZE'
     184 | #define IONIC_PAGE_SIZE                         MIN(PAGE_SIZE, IONIC_MAX_BUF_LEN)
         |                                                     ^
   arch/powerpc/include/asm/page.h:25:34: note: expanded from macro 'PAGE_SIZE'
      25 | #define PAGE_SIZE               (ASM_CONST(1) << PAGE_SHIFT)
         |                                               ^
   include/linux/minmax.h:329:28: note: expanded from macro 'MIN'
     329 | #define MIN(a,b) __cmp(min,a,b)
         |                            ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/minmax.h:213:52: note: expanded from macro 'min_t'
     213 | #define min_t(type, x, y) __cmp_once(min, type, x, y)
         |                           ~~~~~~~~~~~~~~~~~~~~~~~~~^~
   include/linux/minmax.h:96:33: note: expanded from macro '__cmp_once'
      96 |         __cmp_once_unique(op, type, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:93:31: note: expanded from macro '__cmp_once_unique'
      93 |         ({ type ux = (x); type uy = (y); __cmp(op, ux, uy); })
         |                                ~~    ^
   7 warnings and 1 error generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for MODVERSIONS
   Depends on [n]: MODULES [=y] && !COMPILE_TEST [=y]
   Selected by [y]:
   - RANDSTRUCT_FULL [=y] && (CC_HAS_RANDSTRUCT [=y] || GCC_PLUGINS [=n]) && MODULES [=y]


vim +203 drivers/net/ethernet/pensando/ionic/ionic_txrx.c

36a47c906b2324 Shannon Nelson 2024-03-06  174  
36a47c906b2324 Shannon Nelson 2024-03-06  175  static struct sk_buff *ionic_rx_build_skb(struct ionic_queue *q,
4dcd4575bfb17d Shannon Nelson 2024-03-06  176  					  struct ionic_rx_desc_info *desc_info,
f81da39bf4c0a5 Shannon Nelson 2024-02-14  177  					  unsigned int headroom,
f81da39bf4c0a5 Shannon Nelson 2024-02-14  178  					  unsigned int len,
f81da39bf4c0a5 Shannon Nelson 2024-02-14  179  					  unsigned int num_sg_elems,
180e35cdf035d1 Shannon Nelson 2024-02-14  180  					  bool synced)
0f3154e6bcb354 Shannon Nelson 2019-09-03  181  {
4b0a7539a3728f Shannon Nelson 2021-03-10  182  	struct ionic_buf_info *buf_info;
08f2e4b2b2008c Shannon Nelson 2019-10-23  183  	struct sk_buff *skb;
08f2e4b2b2008c Shannon Nelson 2019-10-23  184  	unsigned int i;
08f2e4b2b2008c Shannon Nelson 2019-10-23  185  	u16 frag_len;
08f2e4b2b2008c Shannon Nelson 2019-10-23  186  
4b0a7539a3728f Shannon Nelson 2021-03-10  187  	buf_info = &desc_info->bufs[0];
e75ccac1d0644c Shannon Nelson 2021-07-27  188  	prefetchw(buf_info->page);
08f2e4b2b2008c Shannon Nelson 2019-10-23  189  
89e572e7369fd9 Shannon Nelson 2021-03-10  190  	skb = napi_get_frags(&q_to_qcq(q)->napi);
89e572e7369fd9 Shannon Nelson 2021-03-10  191  	if (unlikely(!skb)) {
89e572e7369fd9 Shannon Nelson 2021-03-10  192  		net_warn_ratelimited("%s: SKB alloc failed on %s!\n",
36a47c906b2324 Shannon Nelson 2024-03-06  193  				     dev_name(q->dev), q->name);
2854242d23a7b3 Shannon Nelson 2024-03-06  194  		q_to_rx_stats(q)->alloc_err++;
08f2e4b2b2008c Shannon Nelson 2019-10-23  195  		return NULL;
89e572e7369fd9 Shannon Nelson 2021-03-10  196  	}
ac8813c0ab7d28 Shannon Nelson 2024-09-06  197  	skb_mark_for_recycle(skb);
08f2e4b2b2008c Shannon Nelson 2019-10-23  198  
f81da39bf4c0a5 Shannon Nelson 2024-02-14  199  	if (headroom)
36a47c906b2324 Shannon Nelson 2024-03-06  200  		frag_len = min_t(u16, len,
36a47c906b2324 Shannon Nelson 2024-03-06  201  				 IONIC_XDP_MAX_LINEAR_MTU + VLAN_ETH_HLEN);
f81da39bf4c0a5 Shannon Nelson 2024-02-14  202  	else
ac8813c0ab7d28 Shannon Nelson 2024-09-06 @203  		frag_len = min_t(u16, len, IONIC_PAGE_SIZE);
f81da39bf4c0a5 Shannon Nelson 2024-02-14  204  
36a47c906b2324 Shannon Nelson 2024-03-06  205  	if (unlikely(!buf_info->page))
36a47c906b2324 Shannon Nelson 2024-03-06  206  		goto err_bad_buf_page;
36a47c906b2324 Shannon Nelson 2024-03-06  207  	ionic_rx_add_skb_frag(q, skb, buf_info, headroom, frag_len, synced);
36a47c906b2324 Shannon Nelson 2024-03-06  208  	len -= frag_len;
4b0a7539a3728f Shannon Nelson 2021-03-10  209  	buf_info++;
4b0a7539a3728f Shannon Nelson 2021-03-10  210  
36a47c906b2324 Shannon Nelson 2024-03-06  211  	for (i = 0; i < num_sg_elems; i++, buf_info++) {
36a47c906b2324 Shannon Nelson 2024-03-06  212  		if (unlikely(!buf_info->page))
36a47c906b2324 Shannon Nelson 2024-03-06  213  			goto err_bad_buf_page;
ac8813c0ab7d28 Shannon Nelson 2024-09-06  214  		frag_len = min_t(u16, len, buf_info->len);
36a47c906b2324 Shannon Nelson 2024-03-06  215  		ionic_rx_add_skb_frag(q, skb, buf_info, 0, frag_len, synced);
36a47c906b2324 Shannon Nelson 2024-03-06  216  		len -= frag_len;
36a47c906b2324 Shannon Nelson 2024-03-06  217  	}
08f2e4b2b2008c Shannon Nelson 2019-10-23  218  
08f2e4b2b2008c Shannon Nelson 2019-10-23  219  	return skb;
36a47c906b2324 Shannon Nelson 2024-03-06  220  
36a47c906b2324 Shannon Nelson 2024-03-06  221  err_bad_buf_page:
36a47c906b2324 Shannon Nelson 2024-03-06  222  	dev_kfree_skb(skb);
36a47c906b2324 Shannon Nelson 2024-03-06  223  	return NULL;
0f3154e6bcb354 Shannon Nelson 2019-09-03  224  }
0f3154e6bcb354 Shannon Nelson 2019-09-03  225  

:::::: The code at line 203 was first introduced by commit
:::::: ac8813c0ab7d2816946379bff2677a5f725e37bf ionic: convert Rx queue buffers to use page_pool

:::::: TO: Shannon Nelson <shannon.nelson@amd.com>
:::::: CC: Jakub Kicinski <kuba@kernel.org>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-01 17:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-01 17:07 [rppt:execmem/x86-rox/v4 5/8] drivers/net/ethernet/pensando/ionic/ionic_txrx.c:203:30: warning: implicit conversion from 'unsigned long' to 'u16' (aka 'unsigned short') changes value from 65536 to 0 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).