mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Shile Zhang <shile.zhang@linux.alibaba.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>
Cc: kbuild-all@lists.01.org,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org,
	Shile Zhang <shile.zhang@linux.alibaba.com>,
	Jiang Liu <liuj97@gmail.com>
Subject: Re: [PATCH] virtio_ring: use alloc_pages_node for NUMA-aware allocation
Date: Fri, 17 Jul 2020 22:22:17 +0800	[thread overview]
Message-ID: <202007172231.H7dJ4evw%lkp@intel.com> (raw)
In-Reply-To: <20200717093504.47794-1-shile.zhang@linux.alibaba.com>

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

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@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@lists.01.org

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

      parent reply	other threads:[~2020-07-17 15:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17  9:35 Shile Zhang
2020-07-17 14:15 ` kernel test robot
2020-07-17 14:22 ` kernel test robot [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=202007172231.H7dJ4evw%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jasowang@redhat.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuj97@gmail.com \
    --cc=mst@redhat.com \
    --cc=shile.zhang@linux.alibaba.com \
    --cc=virtualization@lists.linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®