From: "Michael S. Tsirkin" <mst@redhat.com>
To: kernel test robot <lkp@intel.com>
Cc: Eli Cohen <eli@mellanox.com>,
kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Parav Pandit <parav@mellanox.com>
Subject: Re: drivers/vdpa/mlx5/core/mr.c:244: undefined reference to `vhost_iotlb_itree_first'
Date: Fri, 21 Aug 2020 10:41:14 -0400 [thread overview]
Message-ID: <20200821104033-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <202008202313.Y8g4FgxZ%lkp@intel.com>
On Thu, Aug 20, 2020 at 11:36:15PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 7eac66d0456fe12a462e5c14c68e97c7460989da
> commit: 94abbccdf2916cb03f9626f2d36c6e9971490c12 vdpa/mlx5: Add shared memory registration code
> date: 2 weeks ago
> config: x86_64-randconfig-m001-20200820 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
> reproduce (this is a W=1 build):
> git checkout 94abbccdf2916cb03f9626f2d36c6e9971490c12
> # save the attached .config to linux build tree
> make W=1 ARCH=x86_64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> ld: drivers/vdpa/mlx5/core/mr.o: in function `map_direct_mr':
> >> drivers/vdpa/mlx5/core/mr.c:244: undefined reference to `vhost_iotlb_itree_first'
> >> ld: drivers/vdpa/mlx5/core/mr.c:245: undefined reference to `vhost_iotlb_itree_next'
> >> ld: drivers/vdpa/mlx5/core/mr.c:260: undefined reference to `vhost_iotlb_itree_first'
> ld: drivers/vdpa/mlx5/core/mr.c:261: undefined reference to `vhost_iotlb_itree_next'
> ld: drivers/vdpa/mlx5/core/mr.o: in function `_mlx5_vdpa_create_mr':
> drivers/vdpa/mlx5/core/mr.c:377: undefined reference to `vhost_iotlb_itree_first'
> ld: drivers/vdpa/mlx5/core/mr.c:378: undefined reference to `vhost_iotlb_itree_next'
> ld: drivers/vdpa/mlx5/core/mr.o: in function `map_empty':
> drivers/vdpa/mlx5/core/mr.c:460: undefined reference to `vhost_iotlb_itree_first'
Looks like a missing select VHOST_IOTLB, right?
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=94abbccdf2916cb03f9626f2d36c6e9971490c12
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 94abbccdf2916cb03f9626f2d36c6e9971490c12
> vim +244 drivers/vdpa/mlx5/core/mr.c
>
> 225
> 226 static int map_direct_mr(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_direct_mr *mr,
> 227 struct vhost_iotlb *iotlb)
> 228 {
> 229 struct vhost_iotlb_map *map;
> 230 unsigned long lgcd = 0;
> 231 int log_entity_size;
> 232 unsigned long size;
> 233 u64 start = 0;
> 234 int err;
> 235 struct page *pg;
> 236 unsigned int nsg;
> 237 int sglen;
> 238 u64 pa;
> 239 u64 paend;
> 240 struct scatterlist *sg;
> 241 struct device *dma = mvdev->mdev->device;
> 242 int ret;
> 243
> > 244 for (map = vhost_iotlb_itree_first(iotlb, mr->start, mr->end - 1);
> > 245 map; map = vhost_iotlb_itree_next(map, start, mr->end - 1)) {
> 246 size = maplen(map, mr);
> 247 lgcd = gcd(lgcd, size);
> 248 start += size;
> 249 }
> 250 log_entity_size = ilog2(lgcd);
> 251
> 252 sglen = 1 << log_entity_size;
> 253 nsg = MLX5_DIV_ROUND_UP_POW2(mr->end - mr->start, log_entity_size);
> 254
> 255 err = sg_alloc_table(&mr->sg_head, nsg, GFP_KERNEL);
> 256 if (err)
> 257 return err;
> 258
> 259 sg = mr->sg_head.sgl;
> > 260 for (map = vhost_iotlb_itree_first(iotlb, mr->start, mr->end - 1);
> 261 map; map = vhost_iotlb_itree_next(map, mr->start, mr->end - 1)) {
> 262 paend = map->addr + maplen(map, mr);
> 263 for (pa = map->addr; pa < paend; pa += sglen) {
> 264 pg = pfn_to_page(__phys_to_pfn(pa));
> 265 if (!sg) {
> 266 mlx5_vdpa_warn(mvdev, "sg null. start 0x%llx, end 0x%llx\n",
> 267 map->start, map->last + 1);
> 268 err = -ENOMEM;
> 269 goto err_map;
> 270 }
> 271 sg_set_page(sg, pg, sglen, 0);
> 272 sg = sg_next(sg);
> 273 if (!sg)
> 274 goto done;
> 275 }
> 276 }
> 277 done:
> 278 mr->log_size = log_entity_size;
> 279 mr->nsg = nsg;
> 280 ret = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0);
> 281 if (!ret)
> 282 goto err_map;
> 283
> 284 err = create_direct_mr(mvdev, mr);
> 285 if (err)
> 286 goto err_direct;
> 287
> 288 return 0;
> 289
> 290 err_direct:
> 291 dma_unmap_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0);
> 292 err_map:
> 293 sg_free_table(&mr->sg_head);
> 294 return err;
> 295 }
> 296
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next prev parent reply other threads:[~2020-08-21 14:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-20 15:36 kernel test robot
2020-08-21 14:41 ` Michael S. Tsirkin [this message]
2020-10-25 20:54 kernel test robot
2020-10-26 0:40 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=20200821104033-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=eli@mellanox.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=parav@mellanox.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome