All of lore.kernel.org
 help / color / mirror / Atom feed
* [leon-rdma:rdma-next 13/42] drivers/infiniband/hw/mlx5/odp.c:1544 mlx5r_odp_create_eq() warn: missing error code 'err'
@ 2021-03-12  3:04 kernel test robot
  2021-03-12 11:16 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-03-12  3:04 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2754 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git rdma-next
head:   05f9b877d9328976740745c6f5451a83685920d6
commit: 44d753250016442d012948cd500e94dfb4f1eea4 [13/42] RDMA/mlx5: Create ODP EQ only when ODP MR is created
config: arc-randconfig-m031-20210311 (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.0

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

New smatch warnings:
drivers/infiniband/hw/mlx5/odp.c:1544 mlx5r_odp_create_eq() warn: missing error code 'err'

Old smatch warnings:
drivers/infiniband/hw/mlx5/odp.c:264 mlx5_ib_invalidate_range() warn: should '(((1))) << (umem_odp->page_shift)' be a 64 bit type?

vim +/err +1544 drivers/infiniband/hw/mlx5/odp.c

  1533	
  1534	int mlx5r_odp_create_eq(struct mlx5_ib_dev *dev, struct mlx5_ib_pf_eq *eq)
  1535	{
  1536		struct mlx5_eq_param param = {};
  1537		int err = 0;
  1538	
  1539		if (eq->core)
  1540			return 0;
  1541	
  1542		mutex_lock(&dev->odp_eq_mutex);
  1543		if (eq->core)
> 1544			goto unlock;
  1545		INIT_WORK(&eq->work, mlx5_ib_eq_pf_action);
  1546		spin_lock_init(&eq->lock);
  1547		eq->dev = dev;
  1548	
  1549		eq->pool = mempool_create_kmalloc_pool(MLX5_IB_NUM_PF_DRAIN,
  1550						       sizeof(struct mlx5_pagefault));
  1551		if (!eq->pool) {
  1552			err = -ENOMEM;
  1553			goto unlock;
  1554		}
  1555	
  1556		eq->wq = alloc_workqueue("mlx5_ib_page_fault",
  1557					 WQ_HIGHPRI | WQ_UNBOUND | WQ_MEM_RECLAIM,
  1558					 MLX5_NUM_CMD_EQE);
  1559		if (!eq->wq) {
  1560			err = -ENOMEM;
  1561			goto err_mempool;
  1562		}
  1563	
  1564		eq->irq_nb.notifier_call = mlx5_ib_eq_pf_int;
  1565		param = (struct mlx5_eq_param){
  1566			.irq_index = 0,
  1567			.nent = MLX5_IB_NUM_PF_EQE,
  1568		};
  1569		param.mask[0] = 1ull << MLX5_EVENT_TYPE_PAGE_FAULT;
  1570		eq->core = mlx5_eq_create_generic(dev->mdev, &param);
  1571		if (IS_ERR(eq->core)) {
  1572			err = PTR_ERR(eq->core);
  1573			goto err_wq;
  1574		}
  1575		err = mlx5_eq_enable(dev->mdev, eq->core, &eq->irq_nb);
  1576		if (err) {
  1577			mlx5_ib_err(dev, "failed to enable odp EQ %d\n", err);
  1578			goto err_eq;
  1579		}
  1580	
  1581		mutex_unlock(&dev->odp_eq_mutex);
  1582		return 0;
  1583	err_eq:
  1584		mlx5_eq_destroy_generic(dev->mdev, eq->core);
  1585	err_wq:
  1586		eq->core = NULL;
  1587		destroy_workqueue(eq->wq);
  1588	err_mempool:
  1589		mempool_destroy(eq->pool);
  1590	unlock:
  1591		mutex_unlock(&dev->odp_eq_mutex);
  1592		return err;
  1593	}
  1594	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28911 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [leon-rdma:rdma-next 13/42] drivers/infiniband/hw/mlx5/odp.c:1544 mlx5r_odp_create_eq() warn: missing error code 'err'
  2021-03-12  3:04 [leon-rdma:rdma-next 13/42] drivers/infiniband/hw/mlx5/odp.c:1544 mlx5r_odp_create_eq() warn: missing error code 'err' kernel test robot
@ 2021-03-12 11:16 ` Leon Romanovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2021-03-12 11:16 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3053 bytes --]

On Fri, Mar 12, 2021 at 11:04:49AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git rdma-next
> head:   05f9b877d9328976740745c6f5451a83685920d6
> commit: 44d753250016442d012948cd500e94dfb4f1eea4 [13/42] RDMA/mlx5: Create ODP EQ only when ODP MR is created
> config: arc-randconfig-m031-20210311 (attached as .config)
> compiler: arceb-elf-gcc (GCC) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> New smatch warnings:
> drivers/infiniband/hw/mlx5/odp.c:1544 mlx5r_odp_create_eq() warn: missing error code 'err'

It is false alarm, we are returning err which is set to be 0.

Thanks

>
> Old smatch warnings:
> drivers/infiniband/hw/mlx5/odp.c:264 mlx5_ib_invalidate_range() warn: should '(((1))) << (umem_odp->page_shift)' be a 64 bit type?
>
> vim +/err +1544 drivers/infiniband/hw/mlx5/odp.c
>
>   1533
>   1534	int mlx5r_odp_create_eq(struct mlx5_ib_dev *dev, struct mlx5_ib_pf_eq *eq)
>   1535	{
>   1536		struct mlx5_eq_param param = {};
>   1537		int err = 0;
>   1538
>   1539		if (eq->core)
>   1540			return 0;
>   1541
>   1542		mutex_lock(&dev->odp_eq_mutex);
>   1543		if (eq->core)
> > 1544			goto unlock;
>   1545		INIT_WORK(&eq->work, mlx5_ib_eq_pf_action);
>   1546		spin_lock_init(&eq->lock);
>   1547		eq->dev = dev;
>   1548
>   1549		eq->pool = mempool_create_kmalloc_pool(MLX5_IB_NUM_PF_DRAIN,
>   1550						       sizeof(struct mlx5_pagefault));
>   1551		if (!eq->pool) {
>   1552			err = -ENOMEM;
>   1553			goto unlock;
>   1554		}
>   1555
>   1556		eq->wq = alloc_workqueue("mlx5_ib_page_fault",
>   1557					 WQ_HIGHPRI | WQ_UNBOUND | WQ_MEM_RECLAIM,
>   1558					 MLX5_NUM_CMD_EQE);
>   1559		if (!eq->wq) {
>   1560			err = -ENOMEM;
>   1561			goto err_mempool;
>   1562		}
>   1563
>   1564		eq->irq_nb.notifier_call = mlx5_ib_eq_pf_int;
>   1565		param = (struct mlx5_eq_param){
>   1566			.irq_index = 0,
>   1567			.nent = MLX5_IB_NUM_PF_EQE,
>   1568		};
>   1569		param.mask[0] = 1ull << MLX5_EVENT_TYPE_PAGE_FAULT;
>   1570		eq->core = mlx5_eq_create_generic(dev->mdev, &param);
>   1571		if (IS_ERR(eq->core)) {
>   1572			err = PTR_ERR(eq->core);
>   1573			goto err_wq;
>   1574		}
>   1575		err = mlx5_eq_enable(dev->mdev, eq->core, &eq->irq_nb);
>   1576		if (err) {
>   1577			mlx5_ib_err(dev, "failed to enable odp EQ %d\n", err);
>   1578			goto err_eq;
>   1579		}
>   1580
>   1581		mutex_unlock(&dev->odp_eq_mutex);
>   1582		return 0;
>   1583	err_eq:
>   1584		mlx5_eq_destroy_generic(dev->mdev, eq->core);
>   1585	err_wq:
>   1586		eq->core = NULL;
>   1587		destroy_workqueue(eq->wq);
>   1588	err_mempool:
>   1589		mempool_destroy(eq->pool);
>   1590	unlock:
>   1591		mutex_unlock(&dev->odp_eq_mutex);
>   1592		return err;
>   1593	}
>   1594
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-12 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12  3:04 [leon-rdma:rdma-next 13/42] drivers/infiniband/hw/mlx5/odp.c:1544 mlx5r_odp_create_eq() warn: missing error code 'err' kernel test robot
2021-03-12 11:16 ` Leon Romanovsky

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.