* [leon-rdma:rdma-next 67/71] drivers/infiniband/hw/mlx5/qp.c:861:42: sparse: sparse: subtraction of Share your drugs
@ 2020-09-29 19:24 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-09-29 19:24 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 5895 bytes --]
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
79b20a6c3014c7 Yishai Hadas 2016-05-23 862 rwq->wq_sig = !!(ucmd->flags & MLX5_WQ_FLAG_SIGNATURE);
79b20a6c3014c7 Yishai Hadas 2016-05-23 863
97cb748d1478c1 Jason Gunthorpe 2020-08-19 864 mlx5_ib_dbg(
97cb748d1478c1 Jason Gunthorpe 2020-08-19 865 dev,
b287f59569b5dd Jason Gunthorpe 2020-08-21 866 "addr 0x%llx, size %zd, npages %zu, page_size %ld, ncont %d, offset %d\n",
79b20a6c3014c7 Yishai Hadas 2016-05-23 867 (unsigned long long)ucmd->buf_addr, rwq->buf_size,
b287f59569b5dd Jason Gunthorpe 2020-08-21 868 ib_umem_num_pages(rwq->umem), page_size, rwq->rq_num_pas,
97cb748d1478c1 Jason Gunthorpe 2020-08-19 869 offset);
79b20a6c3014c7 Yishai Hadas 2016-05-23 870
89944450547334 Shamir Rabinovitch 2019-02-07 871 err = mlx5_ib_db_map_user(ucontext, udata, ucmd->db_addr, &rwq->db);
79b20a6c3014c7 Yishai Hadas 2016-05-23 872 if (err) {
79b20a6c3014c7 Yishai Hadas 2016-05-23 873 mlx5_ib_dbg(dev, "map failed\n");
79b20a6c3014c7 Yishai Hadas 2016-05-23 874 goto err_umem;
79b20a6c3014c7 Yishai Hadas 2016-05-23 875 }
79b20a6c3014c7 Yishai Hadas 2016-05-23 876
79b20a6c3014c7 Yishai Hadas 2016-05-23 877 return 0;
79b20a6c3014c7 Yishai Hadas 2016-05-23 878
79b20a6c3014c7 Yishai Hadas 2016-05-23 879 err_umem:
79b20a6c3014c7 Yishai Hadas 2016-05-23 880 ib_umem_release(rwq->umem);
79b20a6c3014c7 Yishai Hadas 2016-05-23 881 return err;
79b20a6c3014c7 Yishai Hadas 2016-05-23 882 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 39138 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [kbuild] [leon-rdma:rdma-next 67/71] drivers/infiniband/hw/mlx5/qp.c:861:42: sparse: sparse: subtraction of Share your drugs
@ 2020-09-29 19:24 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-09-29 19:24 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 5895 bytes --]
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
79b20a6c3014c7 Yishai Hadas 2016-05-23 862 rwq->wq_sig = !!(ucmd->flags & MLX5_WQ_FLAG_SIGNATURE);
79b20a6c3014c7 Yishai Hadas 2016-05-23 863
97cb748d1478c1 Jason Gunthorpe 2020-08-19 864 mlx5_ib_dbg(
97cb748d1478c1 Jason Gunthorpe 2020-08-19 865 dev,
b287f59569b5dd Jason Gunthorpe 2020-08-21 866 "addr 0x%llx, size %zd, npages %zu, page_size %ld, ncont %d, offset %d\n",
79b20a6c3014c7 Yishai Hadas 2016-05-23 867 (unsigned long long)ucmd->buf_addr, rwq->buf_size,
b287f59569b5dd Jason Gunthorpe 2020-08-21 868 ib_umem_num_pages(rwq->umem), page_size, rwq->rq_num_pas,
97cb748d1478c1 Jason Gunthorpe 2020-08-19 869 offset);
79b20a6c3014c7 Yishai Hadas 2016-05-23 870
89944450547334 Shamir Rabinovitch 2019-02-07 871 err = mlx5_ib_db_map_user(ucontext, udata, ucmd->db_addr, &rwq->db);
79b20a6c3014c7 Yishai Hadas 2016-05-23 872 if (err) {
79b20a6c3014c7 Yishai Hadas 2016-05-23 873 mlx5_ib_dbg(dev, "map failed\n");
79b20a6c3014c7 Yishai Hadas 2016-05-23 874 goto err_umem;
79b20a6c3014c7 Yishai Hadas 2016-05-23 875 }
79b20a6c3014c7 Yishai Hadas 2016-05-23 876
79b20a6c3014c7 Yishai Hadas 2016-05-23 877 return 0;
79b20a6c3014c7 Yishai Hadas 2016-05-23 878
79b20a6c3014c7 Yishai Hadas 2016-05-23 879 err_umem:
79b20a6c3014c7 Yishai Hadas 2016-05-23 880 ib_umem_release(rwq->umem);
79b20a6c3014c7 Yishai Hadas 2016-05-23 881 return err;
79b20a6c3014c7 Yishai Hadas 2016-05-23 882 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 39138 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [kbuild] [leon-rdma:rdma-next 67/71] drivers/infiniband/hw/mlx5/qp.c:861:42: sparse: sparse: subtraction of Share your drugs
2020-09-29 19:24 ` [kbuild] " Dan Carpenter
(?)
@ 2020-09-29 19:31 ` Jason Gunthorpe
-1 siblings, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2020-09-29 19:31 UTC (permalink / raw)
To: kbuild-all
[-- 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-29 19:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.