From: Jason Gunthorpe <jgg@nvidia.com>
To: kbuild-all@lists.01.org
Subject: Re: [kbuild] [leon-rdma:rdma-next 67/71] drivers/infiniband/hw/mlx5/qp.c:861:42: sparse: sparse: subtraction of Share your drugs
Date: Tue, 29 Sep 2020 16:31:48 -0300 [thread overview]
Message-ID: <20200929193148.GE9475@nvidia.com> (raw)
In-Reply-To: <20200929192441.GC18329@kadam>
[-- Attachment #1: Type: text/plain, Size: 4325 bytes --]
On Tue, Sep 29, 2020 at 10:24:41PM +0300, Dan Carpenter wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git rdma-next
> head: 41142fada89c77281000029c8f4ce28ea8ed95ac
> commit: b287f59569b5ddead80547afb3fbe54ba19d71a2 [67/71] RDMA/mlx5: Use mlx5_umem_find_best_quantized_pgoff() for WQ
> config: i386-randconfig-s002-20200929 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
> reproduce:
> # apt-get install sparse
> # sparse version: v0.6.2-201-g24bdaac6-dirty
> # https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/commit/?id=b287f59569b5ddead80547afb3fbe54ba19d71a2
> git remote add leon-rdma https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git
> git fetch --no-tags leon-rdma rdma-next
> git checkout b287f59569b5ddead80547afb3fbe54ba19d71a2
> # save the attached .config to linux build tree
> make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> echo
> echo "sparse warnings: (new ones prefixed by >>)"
> echo
> >> drivers/infiniband/hw/mlx5/qp.c:861:42: sparse: sparse: subtraction of functions? Share your drugs
>
> vim +861 drivers/infiniband/hw/mlx5/qp.c
>
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 830 static int create_user_rq(struct mlx5_ib_dev *dev, struct ib_pd *pd,
> b0ea0fa5435f9d Jason Gunthorpe 2019-01-09 831 struct ib_udata *udata, struct mlx5_ib_rwq *rwq,
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 832 struct mlx5_ib_create_wq *ucmd)
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 833 {
> 89944450547334 Shamir Rabinovitch 2019-02-07 834 struct mlx5_ib_ucontext *ucontext = rdma_udata_to_drv_context(
> 89944450547334 Shamir Rabinovitch 2019-02-07 835 udata, struct mlx5_ib_ucontext, ibucontext);
> b287f59569b5dd Jason Gunthorpe 2020-08-21 836 unsigned long page_size = 0;
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 837 u32 offset = 0;
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 838 int err;
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 839
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 840 if (!ucmd->buf_addr)
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 841 return -EINVAL;
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 842
> c320e527e15483 Moni Shoua 2020-01-15 843 rwq->umem = ib_umem_get(&dev->ib_dev, ucmd->buf_addr, rwq->buf_size, 0);
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 844 if (IS_ERR(rwq->umem)) {
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 845 mlx5_ib_dbg(dev, "umem_get failed\n");
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 846 err = PTR_ERR(rwq->umem);
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 847 return err;
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 848 }
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 849
> b287f59569b5dd Jason Gunthorpe 2020-08-21 850 page_size = mlx5_umem_find_best_quantized_pgoff(
> b287f59569b5dd Jason Gunthorpe 2020-08-21 851 rwq->umem, wq, log_wq_pg_sz, MLX5_ADAPTER_PAGE_SHIFT,
> b287f59569b5dd Jason Gunthorpe 2020-08-21 852 page_offset, 64, &rwq->rq_page_offset);
> b287f59569b5dd Jason Gunthorpe 2020-08-21 853 if (!page_size) {
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 854 mlx5_ib_warn(dev, "bad offset\n");
> b287f59569b5dd Jason Gunthorpe 2020-08-21 855 err = -EINVAL;
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 856 goto err_umem;
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 857 }
> 79b20a6c3014c7 Yishai Hadas 2016-05-23 858
> b287f59569b5dd Jason Gunthorpe 2020-08-21 859 rwq->rq_num_pas = ib_umem_num_dma_blocks(rwq->umem, page_size);
> b287f59569b5dd Jason Gunthorpe 2020-08-21 860 rwq->page_shift = order_base_2(page_size);
> b287f59569b5dd Jason Gunthorpe 2020-08-21 @861 rwq->log_page_size = page_shift - page_shift;
> ^^^^^^^^^^^^^^^^^^^^^^^^
> Sharing is caring. #Drugs #NancyReagan
Oh neat
Should be
rwq->log_page_size = rwq->page_shift - MLX5_ADAPTER_PAGE_SHIFT;
Thanks,
Jason
prev parent reply other threads:[~2020-09-29 19:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 19:24 [leon-rdma:rdma-next 67/71] drivers/infiniband/hw/mlx5/qp.c:861:42: sparse: sparse: subtraction of Share your drugs Dan Carpenter
2020-09-29 19:24 ` [kbuild] " Dan Carpenter
2020-09-29 19:31 ` Jason Gunthorpe [this message]
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=20200929193148.GE9475@nvidia.com \
--to=jgg@nvidia.com \
--cc=kbuild-all@lists.01.org \
/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.