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: <202211241510.Aw8tB7vs-lkp@intel.com>
Date:   Thu, 24 Nov 2022 15:46:26 +0800
From:   kernel test robot <lkp@...el.com>
To:     Maxim Mikityanskiy <maximmi@...dia.com>
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        linux-kernel@...r.kernel.org, Saeed Mahameed <saeedm@...dia.com>,
        Tariq Toukan <tariqt@...dia.com>
Subject: drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h:448:44: warning:
 result of comparison of constant 256 with expression of type 'u8' (aka
 'unsigned char') is always false

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c3eb11fbb826879be773c137f281569efce67aa8
commit: f9c955b4fe5c8626d11b8a9b93ccc0ba77358fec net/mlx5e: Add missing sanity checks for max TX WQE size
date:   2 weeks ago
config: mips-randconfig-r005-20221124
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project af8c49dc1ec44339d915d988ffe0f38da68ca0e7)
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 mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f9c955b4fe5c8626d11b8a9b93ccc0ba77358fec
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout f9c955b4fe5c8626d11b8a9b93ccc0ba77358fec
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/net/ethernet/mellanox/mlx5/core/

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

All warnings (new ones prefixed by >>):

   In file included from drivers/net/ethernet/mellanox/mlx5/core/en/channels.c:6:
   In file included from drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h:9:
>> drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h:448:44: warning: result of comparison of constant 256 with expression of type 'u8' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare]
           WARN_ON_ONCE(PAGE_SIZE / MLX5_SEND_WQE_BB < mlx5e_get_max_sq_wqebbs(mdev));
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/bug.h:180:41: note: expanded from macro 'WARN_ON_ONCE'
   #define WARN_ON_ONCE(condition) WARN_ON(condition)
                                   ~~~~~~~~^~~~~~~~~~
   include/asm-generic/bug.h:167:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   1 warning generated.


vim +448 drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h

   445	
   446	static inline u16 mlx5e_stop_room_for_wqe(struct mlx5_core_dev *mdev, u16 wqe_size)
   447	{
 > 448		WARN_ON_ONCE(PAGE_SIZE / MLX5_SEND_WQE_BB < mlx5e_get_max_sq_wqebbs(mdev));
   449	
   450		/* A WQE must not cross the page boundary, hence two conditions:
   451		 * 1. Its size must not exceed the page size.
   452		 * 2. If the WQE size is X, and the space remaining in a page is less
   453		 *    than X, this space needs to be padded with NOPs. So, one WQE of
   454		 *    size X may require up to X-1 WQEBBs of padding, which makes the
   455		 *    stop room of X-1 + X.
   456		 * WQE size is also limited by the hardware limit.
   457		 */
   458		WARN_ONCE(wqe_size > mlx5e_get_max_sq_wqebbs(mdev),
   459			  "wqe_size %u is greater than max SQ WQEBBs %u",
   460			  wqe_size, mlx5e_get_max_sq_wqebbs(mdev));
   461	
   462		return MLX5E_STOP_ROOM(wqe_size);
   463	}
   464	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (161727 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ