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: drivers/infiniband/hw/mlx5/umr.c:153 mlx5r_umr_resource_init() warn: missing error code 'ret'
Date: Sat, 14 Dec 2024 02:26:02 +0800	[thread overview]
Message-ID: <202412140235.cXqs4CTm-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Jianbo Liu <jianbol@nvidia.com>
CC: Leon Romanovsky <leon@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f932fb9b40749d1c9a539d89bb3e288c077aafe5
commit: 638420115cc4ad6c3a2683bf46a052b505abb202 IB/mlx5: Create UMR QP just before first reg_mr occurs
date:   6 months ago
:::::: branch date: 17 hours ago
:::::: commit date: 6 months ago
config: x86_64-randconfig-161-20241213 (https://download.01.org/0day-ci/archive/20241214/202412140235.cXqs4CTm-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.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/202412140235.cXqs4CTm-lkp@intel.com/

smatch warnings:
drivers/infiniband/hw/mlx5/umr.c:153 mlx5r_umr_resource_init() warn: missing error code 'ret'

vim +/ret +153 drivers/infiniband/hw/mlx5/umr.c

04876c12c19e94b Aharon Landau 2022-04-12  134  
04876c12c19e94b Aharon Landau 2022-04-12  135  int mlx5r_umr_resource_init(struct mlx5_ib_dev *dev)
04876c12c19e94b Aharon Landau 2022-04-12  136  {
04876c12c19e94b Aharon Landau 2022-04-12  137  	struct ib_qp_init_attr init_attr = {};
04876c12c19e94b Aharon Landau 2022-04-12  138  	struct ib_cq *cq;
04876c12c19e94b Aharon Landau 2022-04-12  139  	struct ib_qp *qp;
638420115cc4ad6 Jianbo Liu    2024-06-03  140  	int ret = 0;
04876c12c19e94b Aharon Landau 2022-04-12  141  
638420115cc4ad6 Jianbo Liu    2024-06-03  142  
638420115cc4ad6 Jianbo Liu    2024-06-03  143  	/*
638420115cc4ad6 Jianbo Liu    2024-06-03  144  	 * UMR qp is set once, never changed until device unload.
638420115cc4ad6 Jianbo Liu    2024-06-03  145  	 * Avoid taking the mutex if initialization is already done.
638420115cc4ad6 Jianbo Liu    2024-06-03  146  	 */
638420115cc4ad6 Jianbo Liu    2024-06-03  147  	if (dev->umrc.qp)
638420115cc4ad6 Jianbo Liu    2024-06-03  148  		return 0;
638420115cc4ad6 Jianbo Liu    2024-06-03  149  
638420115cc4ad6 Jianbo Liu    2024-06-03  150  	mutex_lock(&dev->umrc.init_lock);
638420115cc4ad6 Jianbo Liu    2024-06-03  151  	/* First user allocates the UMR resources. Skip if already allocated. */
638420115cc4ad6 Jianbo Liu    2024-06-03  152  	if (dev->umrc.qp)
638420115cc4ad6 Jianbo Liu    2024-06-03 @153  		goto unlock;
04876c12c19e94b Aharon Landau 2022-04-12  154  
04876c12c19e94b Aharon Landau 2022-04-12  155  	cq = ib_alloc_cq(&dev->ib_dev, NULL, 128, 0, IB_POLL_SOFTIRQ);
04876c12c19e94b Aharon Landau 2022-04-12  156  	if (IS_ERR(cq)) {
04876c12c19e94b Aharon Landau 2022-04-12  157  		mlx5_ib_dbg(dev, "Couldn't create CQ for sync UMR QP\n");
04876c12c19e94b Aharon Landau 2022-04-12  158  		ret = PTR_ERR(cq);
638420115cc4ad6 Jianbo Liu    2024-06-03  159  		goto unlock;
04876c12c19e94b Aharon Landau 2022-04-12  160  	}
04876c12c19e94b Aharon Landau 2022-04-12  161  
04876c12c19e94b Aharon Landau 2022-04-12  162  	init_attr.send_cq = cq;
04876c12c19e94b Aharon Landau 2022-04-12  163  	init_attr.recv_cq = cq;
04876c12c19e94b Aharon Landau 2022-04-12  164  	init_attr.sq_sig_type = IB_SIGNAL_ALL_WR;
04876c12c19e94b Aharon Landau 2022-04-12  165  	init_attr.cap.max_send_wr = MAX_UMR_WR;
04876c12c19e94b Aharon Landau 2022-04-12  166  	init_attr.cap.max_send_sge = 1;
04876c12c19e94b Aharon Landau 2022-04-12  167  	init_attr.qp_type = MLX5_IB_QPT_REG_UMR;
04876c12c19e94b Aharon Landau 2022-04-12  168  	init_attr.port_num = 1;
638420115cc4ad6 Jianbo Liu    2024-06-03  169  	qp = ib_create_qp(dev->umrc.pd, &init_attr);
04876c12c19e94b Aharon Landau 2022-04-12  170  	if (IS_ERR(qp)) {
04876c12c19e94b Aharon Landau 2022-04-12  171  		mlx5_ib_dbg(dev, "Couldn't create sync UMR QP\n");
04876c12c19e94b Aharon Landau 2022-04-12  172  		ret = PTR_ERR(qp);
04876c12c19e94b Aharon Landau 2022-04-12  173  		goto destroy_cq;
04876c12c19e94b Aharon Landau 2022-04-12  174  	}
04876c12c19e94b Aharon Landau 2022-04-12  175  
04876c12c19e94b Aharon Landau 2022-04-12  176  	ret = mlx5r_umr_qp_rst2rts(dev, qp);
04876c12c19e94b Aharon Landau 2022-04-12  177  	if (ret)
04876c12c19e94b Aharon Landau 2022-04-12  178  		goto destroy_qp;
04876c12c19e94b Aharon Landau 2022-04-12  179  
04876c12c19e94b Aharon Landau 2022-04-12  180  	dev->umrc.cq = cq;
04876c12c19e94b Aharon Landau 2022-04-12  181  
04876c12c19e94b Aharon Landau 2022-04-12  182  	sema_init(&dev->umrc.sem, MAX_UMR_WR);
158e71bb69e368b Aharon Landau 2022-05-15  183  	mutex_init(&dev->umrc.lock);
9b7d4be967f16f7 Maor Gottlieb 2022-08-29  184  	dev->umrc.state = MLX5_UMR_STATE_ACTIVE;
638420115cc4ad6 Jianbo Liu    2024-06-03  185  	dev->umrc.qp = qp;
04876c12c19e94b Aharon Landau 2022-04-12  186  
638420115cc4ad6 Jianbo Liu    2024-06-03  187  	mutex_unlock(&dev->umrc.init_lock);
04876c12c19e94b Aharon Landau 2022-04-12  188  	return 0;
04876c12c19e94b Aharon Landau 2022-04-12  189  
04876c12c19e94b Aharon Landau 2022-04-12  190  destroy_qp:
04876c12c19e94b Aharon Landau 2022-04-12  191  	ib_destroy_qp(qp);
04876c12c19e94b Aharon Landau 2022-04-12  192  destroy_cq:
04876c12c19e94b Aharon Landau 2022-04-12  193  	ib_free_cq(cq);
638420115cc4ad6 Jianbo Liu    2024-06-03  194  unlock:
638420115cc4ad6 Jianbo Liu    2024-06-03  195  	mutex_unlock(&dev->umrc.init_lock);
04876c12c19e94b Aharon Landau 2022-04-12  196  	return ret;
04876c12c19e94b Aharon Landau 2022-04-12  197  }
04876c12c19e94b Aharon Landau 2022-04-12  198  

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

             reply	other threads:[~2024-12-13 18:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13 18:26 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-26 11:04 drivers/infiniband/hw/mlx5/umr.c:153 mlx5r_umr_resource_init() warn: missing error code 'ret' kernel test robot
2024-09-24 16:18 kernel test robot

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=202412140235.cXqs4CTm-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.