kernel test robot
2020-Jul-17 14:22 UTC
[PATCH] virtio_ring: use alloc_pages_node for NUMA-aware allocation
Hi Shile, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.8-rc5 next-20200716] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Shile-Zhang/virtio_ring-use-alloc_pages_node-for-NUMA-aware-allocation/20200717-173734 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 8882572675c1bb1cc544f4e229a11661f1fc52e4 config: alpha-allyesconfig (attached as .config) compiler: alpha-linux-gcc (GCC) 9.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp at intel.com> All error/warnings (new ones prefixed by >>): drivers/virtio/virtio_ring.c: In function 'vring_alloc_queue':>> drivers/virtio/virtio_ring.c:280:52: error: passing argument 1 of 'dev_to_node' from incompatible pointer type [-Werror=incompatible-pointer-types]280 | struct page *page = alloc_pages_node(dev_to_node(&vdev->dev.parent), | ^~~~~~~~~~~~~~~~~ | | | struct device ** In file included from include/linux/virtio.h:9, from drivers/virtio/virtio_ring.c:6: include/linux/device.h:668:46: note: expected 'struct device *' but argument is of type 'struct device **' 668 | static inline int dev_to_node(struct device *dev) | ~~~~~~~~~~~~~~~^~~>> drivers/virtio/virtio_ring.c:284:4: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]284 | phys_addr_t phys_addr = virt_to_phys(queue); | ^~~~~~~~~~~ cc1: some warnings being treated as errors vim +/dev_to_node +280 drivers/virtio/virtio_ring.c 271 272 static void *vring_alloc_queue(struct virtio_device *vdev, size_t size, 273 dma_addr_t *dma_handle, gfp_t flag) 274 { 275 if (vring_use_dma_api(vdev)) { 276 return dma_alloc_coherent(vdev->dev.parent, size, 277 dma_handle, flag); 278 } else { 279 void *queue = NULL; > 280 struct page *page = alloc_pages_node(dev_to_node(&vdev->dev.parent), 281 flag, get_order(size)); 282 if (page) { 283 queue = page_address(page); > 284 phys_addr_t phys_addr = virt_to_phys(queue); 285 *dma_handle = (dma_addr_t)phys_addr; 286 287 /* 288 * Sanity check: make sure we dind't truncate 289 * the address. The only arches I can find that 290 * have 64-bit phys_addr_t but 32-bit dma_addr_t 291 * are certain non-highmem MIPS and x86 292 * configurations, but these configurations 293 * should never allocate physical pages above 32 294 * bits, so this is fine. Just in case, throw a 295 * warning and abort if we end up with an 296 * unrepresentable address. 297 */ 298 if (WARN_ON_ONCE(*dma_handle != phys_addr)) { 299 free_pages_exact(queue, PAGE_ALIGN(size)); 300 return NULL; 301 } 302 } 303 return queue; 304 } 305 } 306 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all at lists.01.org -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: application/gzip Size: 65028 bytes Desc: not available URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20200717/8a4a96a2/attachment-0001.gz>
Reasonably Related Threads
- [PATCH] virtio_ring: use alloc_pages_node for NUMA-aware allocation
- [PATCH v2] virtio_ring: use alloc_pages_node for NUMA-aware allocation
- [PATCH 15/18] dma-mapping: add a new dma_alloc_pages API
- [RFC 1/4] virtio: Define virtio_direct_dma_ops structure
- [RFC 1/4] virtio: Define virtio_direct_dma_ops structure