All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH net 1/2] mlxsw: spectrum_acl_bloom_filter: Expand chunk_key_offsets[chunk_index]
Date: Sun, 16 Mar 2025 21:31:35 +0800	[thread overview]
Message-ID: <202503162139.LEIr7P4G-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <78951564F9FEA017+20250311141701.1626533-1-wangyuli@uniontech.com>
References: <78951564F9FEA017+20250311141701.1626533-1-wangyuli@uniontech.com>
TO: WangYuli <wangyuli@uniontech.com>
TO: wangyuli@uniontech.com
CC: andrew+netdev@lunn.ch
CC: chenlinxuan@uniontech.com
CC: czj2441@163.com
CC: davem@davemloft.net
CC: edumazet@google.com
CC: guanwentao@uniontech.com
CC: idosch@nvidia.com
CC: kuba@kernel.org
CC: linux-kernel@vger.kernel.org
CC: netdev@vger.kernel.org
CC: niecheng1@uniontech.com
CC: pabeni@redhat.com
CC: petrm@nvidia.com
CC: zhanjun@uniontech.com

Hi WangYuli,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/WangYuli/mlxsw-spectrum_acl_bloom_filter-Expand-chunk_key_offsets-chunk_index/20250311-222122
base:   net/main
patch link:    https://lore.kernel.org/r/78951564F9FEA017%2B20250311141701.1626533-1-wangyuli%40uniontech.com
patch subject: [PATCH net 1/2] mlxsw: spectrum_acl_bloom_filter: Expand chunk_key_offsets[chunk_index]
:::::: branch date: 5 days ago
:::::: commit date: 5 days ago
config: riscv-randconfig-r073-20250316 (https://download.01.org/0day-ci/archive/20250316/202503162139.LEIr7P4G-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 14.2.0

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202503162139.LEIr7P4G-lkp@intel.com/

smatch warnings:
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c:264 __mlxsw_sp_acl_bf_key_encode() error: uninitialized symbol 'enc_key_src_ptr'.

vim +/enc_key_src_ptr +264 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c

7585cacdb978a0c Nir Dotan  2018-12-16  219  
7585cacdb978a0c Nir Dotan  2018-12-16  220  static void
5d5c3ba9e4121b7 Amit Cohen 2022-01-06  221  __mlxsw_sp_acl_bf_key_encode(struct mlxsw_sp_acl_atcam_region *aregion,
7585cacdb978a0c Nir Dotan  2018-12-16  222  			     struct mlxsw_sp_acl_atcam_entry *aentry,
5d5c3ba9e4121b7 Amit Cohen 2022-01-06  223  			     char *output, u8 *len, u8 max_chunks, u8 pad_bytes,
5d5c3ba9e4121b7 Amit Cohen 2022-01-06  224  			     u8 key_offset, u8 chunk_key_len, u8 chunk_len)
7585cacdb978a0c Nir Dotan  2018-12-16  225  {
7585cacdb978a0c Nir Dotan  2018-12-16  226  	struct mlxsw_afk_key_info *key_info = aregion->region->key_info;
7585cacdb978a0c Nir Dotan  2018-12-16  227  	u8 chunk_index, chunk_count, block_count;
7585cacdb978a0c Nir Dotan  2018-12-16  228  	char *chunk = output;
c0a2f6d8b271a37 WangYuli   2025-03-11  229  	char *enc_key_src_ptr;
7585cacdb978a0c Nir Dotan  2018-12-16  230  	__be16 erp_region_id;
7585cacdb978a0c Nir Dotan  2018-12-16  231  
7585cacdb978a0c Nir Dotan  2018-12-16  232  	block_count = mlxsw_afk_key_info_blocks_count_get(key_info);
7585cacdb978a0c Nir Dotan  2018-12-16  233  	chunk_count = 1 + ((block_count - 1) >> 2);
7585cacdb978a0c Nir Dotan  2018-12-16  234  	erp_region_id = cpu_to_be16(aentry->ht_key.erp_id |
7585cacdb978a0c Nir Dotan  2018-12-16  235  				   (aregion->region->id << 4));
5d5c3ba9e4121b7 Amit Cohen 2022-01-06  236  	for (chunk_index = max_chunks - chunk_count; chunk_index < max_chunks;
5d5c3ba9e4121b7 Amit Cohen 2022-01-06  237  	     chunk_index++) {
5d5c3ba9e4121b7 Amit Cohen 2022-01-06  238  		memset(chunk, 0, pad_bytes);
5d5c3ba9e4121b7 Amit Cohen 2022-01-06  239  		memcpy(chunk + pad_bytes, &erp_region_id,
7585cacdb978a0c Nir Dotan  2018-12-16  240  		       sizeof(erp_region_id));
c0a2f6d8b271a37 WangYuli   2025-03-11  241  /* Each chunk contains 4 key blocks. Chunk 2 uses key blocks 11-8,
c0a2f6d8b271a37 WangYuli   2025-03-11  242   * and we need to populate it with 4 key blocks copied from the entry encoded
c0a2f6d8b271a37 WangYuli   2025-03-11  243   * key. The original keys layout is same for Spectrum-{2,3,4}.
c0a2f6d8b271a37 WangYuli   2025-03-11  244   * Since the encoded key contains a 2 bytes padding, key block 11 starts at
c0a2f6d8b271a37 WangYuli   2025-03-11  245   * offset 2. block 7 that is used in chunk 1 starts at offset 20 as 4 key blocks
c0a2f6d8b271a37 WangYuli   2025-03-11  246   * take 18 bytes. See 'MLXSW_SP2_AFK_BLOCK_LAYOUT' for more details.
c0a2f6d8b271a37 WangYuli   2025-03-11  247   * This array defines key offsets for easy access when copying key blocks from
c0a2f6d8b271a37 WangYuli   2025-03-11  248   * entry key to Bloom filter chunk.
c0a2f6d8b271a37 WangYuli   2025-03-11  249   *
c0a2f6d8b271a37 WangYuli   2025-03-11  250   * Define the acceptable values for chunk_index to prevent LLVM from failing
c0a2f6d8b271a37 WangYuli   2025-03-11  251   * compilation in certain circumstances.
c0a2f6d8b271a37 WangYuli   2025-03-11  252   */
c0a2f6d8b271a37 WangYuli   2025-03-11  253  		switch (chunk_index) {
c0a2f6d8b271a37 WangYuli   2025-03-11  254  		case 0:
c0a2f6d8b271a37 WangYuli   2025-03-11  255  			enc_key_src_ptr = &aentry->ht_key.enc_key[2];
c0a2f6d8b271a37 WangYuli   2025-03-11  256  			break;
c0a2f6d8b271a37 WangYuli   2025-03-11  257  		case 1:
c0a2f6d8b271a37 WangYuli   2025-03-11  258  			enc_key_src_ptr = &aentry->ht_key.enc_key[20];
c0a2f6d8b271a37 WangYuli   2025-03-11  259  			break;
c0a2f6d8b271a37 WangYuli   2025-03-11  260  		case 2:
c0a2f6d8b271a37 WangYuli   2025-03-11  261  			enc_key_src_ptr = &aentry->ht_key.enc_key[38];
c0a2f6d8b271a37 WangYuli   2025-03-11  262  			break;
c0a2f6d8b271a37 WangYuli   2025-03-11  263  		}
c0a2f6d8b271a37 WangYuli   2025-03-11 @264  		memcpy(chunk + key_offset, enc_key_src_ptr, chunk_key_len);
5d5c3ba9e4121b7 Amit Cohen 2022-01-06  265  		chunk += chunk_len;
5d5c3ba9e4121b7 Amit Cohen 2022-01-06  266  	}
5d5c3ba9e4121b7 Amit Cohen 2022-01-06  267  	*len = chunk_count * chunk_len;
7585cacdb978a0c Nir Dotan  2018-12-16  268  }
5d5c3ba9e4121b7 Amit Cohen 2022-01-06  269  

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

             reply	other threads:[~2025-03-16 13:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-16 13:31 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-11 14:10 [PATCH net 0/2] mlxsw: spectrum_acl_bloom_filter: Fix compilation warning on s390x WangYuli
2025-03-11 14:17 ` [PATCH net 1/2] mlxsw: spectrum_acl_bloom_filter: Expand chunk_key_offsets[chunk_index] WangYuli
2025-03-12 13:20   ` Ido Schimmel
2025-03-13  8:52     ` WangYuli
2025-03-13 13:52     ` Paolo Abeni
2025-03-13 15:25       ` Ido Schimmel
2025-03-13 16:10         ` WangYuli
2025-03-13 19:41           ` Ido Schimmel
2025-03-14 18:10             ` WangYuli
2025-03-13 13:54   ` Paolo Abeni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202503162139.LEIr7P4G-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.