Re: [PATCH net-next 2/2] net/smc: rdma write inline if qp has sufficient inline space

From: kernel test robot
Date: Fri May 13 2022 - 07:44:48 EST


Hi Guangguan,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url: https://github.com/intel-lab-lkp/linux/commits/Guangguan-Wang/net-smc-send-and-write-inline-optimization-for-smc/20220513-151715
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git b67fd3d9d94223b424674f45eeadeff58b4b03ef
config: nios2-allyesconfig (https://download.01.org/0day-ci/archive/20220513/202205131912.bHaVZP7f-lkp@xxxxxxxxx/config)
compiler: nios2-linux-gcc (GCC) 11.3.0
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://github.com/intel-lab-lkp/linux/commit/1e1003898ecdb92b0339075c7501e486bda2d8e8
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Guangguan-Wang/net-smc-send-and-write-inline-optimization-for-smc/20220513-151715
git checkout 1e1003898ecdb92b0339075c7501e486bda2d8e8
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=nios2 SHELL=/bin/bash net/smc/

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

All warnings (new ones prefixed by >>):

net/smc/smc_tx.c: In function 'smcr_tx_rdma_writes':
>> net/smc/smc_tx.c:399:37: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
399 | base_addr = (u64)conn->sndbuf_desc->cpu_addr;
| ^


vim +399 net/smc/smc_tx.c

376
377 /* SMC-R helper for smc_tx_rdma_writes() */
378 static int smcr_tx_rdma_writes(struct smc_connection *conn, size_t len,
379 size_t src_off, size_t src_len,
380 size_t dst_off, size_t dst_len,
381 struct smc_rdma_wr *wr_rdma_buf)
382 {
383 struct smc_link *link = conn->lnk;
384
385 dma_addr_t dma_addr =
386 sg_dma_address(conn->sndbuf_desc->sgt[link->link_idx].sgl);
387 int src_len_sum = src_len, dst_len_sum = dst_len;
388 int sent_count = src_off;
389 int srcchunk, dstchunk;
390 int num_sges;
391 int rc;
392
393 for (dstchunk = 0; dstchunk < 2; dstchunk++) {
394 struct ib_rdma_wr *wr = &wr_rdma_buf->wr_tx_rdma[dstchunk];
395 struct ib_sge *sge = wr->wr.sg_list;
396 u64 base_addr = dma_addr;
397
398 if (dst_len <= link->qp_attr.cap.max_inline_data) {
> 399 base_addr = (u64)conn->sndbuf_desc->cpu_addr;
400 wr->wr.send_flags |= IB_SEND_INLINE;
401 } else {
402 wr->wr.send_flags &= ~IB_SEND_INLINE;
403 }
404
405 num_sges = 0;
406 for (srcchunk = 0; srcchunk < 2; srcchunk++) {
407 sge[srcchunk].addr = base_addr + src_off;
408 sge[srcchunk].length = src_len;
409 num_sges++;
410
411 src_off += src_len;
412 if (src_off >= conn->sndbuf_desc->len)
413 src_off -= conn->sndbuf_desc->len;
414 /* modulo in send ring */
415 if (src_len_sum == dst_len)
416 break; /* either on 1st or 2nd iteration */
417 /* prepare next (== 2nd) iteration */
418 src_len = dst_len - src_len; /* remainder */
419 src_len_sum += src_len;
420 }
421 rc = smc_tx_rdma_write(conn, dst_off, num_sges, wr);
422 if (rc)
423 return rc;
424 if (dst_len_sum == len)
425 break; /* either on 1st or 2nd iteration */
426 /* prepare next (== 2nd) iteration */
427 dst_off = 0; /* modulo offset in RMBE ring buffer */
428 dst_len = len - dst_len; /* remainder */
429 dst_len_sum += dst_len;
430 src_len = min_t(int, dst_len, conn->sndbuf_desc->len -
431 sent_count);
432 src_len_sum = src_len;
433 }
434 return 0;
435 }
436

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