All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [hyperv:hyperv-next 5/5] drivers/net/hyperv/netvsc.c:1026:5: warning: no previous prototype for 'netvsc_dma_map'
Date: Sat, 18 Dec 2021 12:23:30 +0800	[thread overview]
Message-ID: <202112181204.uRIUsFfa-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git hyperv-next
head:   19fd7ca00201c0525452dcf5a490e4b01674ef4c
commit: 19fd7ca00201c0525452dcf5a490e4b01674ef4c [5/5] net: netvsc: Add Isolation VM support for netvsc driver
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20211218/202112181204.uRIUsFfa-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git/commit/?id=19fd7ca00201c0525452dcf5a490e4b01674ef4c
        git remote add hyperv https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git
        git fetch --no-tags hyperv hyperv-next
        git checkout 19fd7ca00201c0525452dcf5a490e4b01674ef4c
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/net/hyperv/netvsc.c:1026:5: warning: no previous prototype for 'netvsc_dma_map' [-Wmissing-prototypes]
    1026 | int netvsc_dma_map(struct hv_device *hv_dev,
         |     ^~~~~~~~~~~~~~


vim +/netvsc_dma_map +1026 drivers/net/hyperv/netvsc.c

  1007	
  1008	/* netvsc_dma_map - Map swiotlb bounce buffer with data page of
  1009	 * packet sent by vmbus_sendpacket_pagebuffer() in the Isolation
  1010	 * VM.
  1011	 *
  1012	 * In isolation VM, netvsc send buffer has been marked visible to
  1013	 * host and so the data copied to send buffer doesn't need to use
  1014	 * bounce buffer. The data pages handled by vmbus_sendpacket_pagebuffer()
  1015	 * may not be copied to send buffer and so these pages need to be
  1016	 * mapped with swiotlb bounce buffer. netvsc_dma_map() is to do
  1017	 * that. The pfns in the struct hv_page_buffer need to be converted
  1018	 * to bounce buffer's pfn. The loop here is necessary because the
  1019	 * entries in the page buffer array are not necessarily full
  1020	 * pages of data.  Each entry in the array has a separate offset and
  1021	 * len that may be non-zero, even for entries in the middle of the
  1022	 * array.  And the entries are not physically contiguous.  So each
  1023	 * entry must be individually mapped rather than as a contiguous unit.
  1024	 * So not use dma_map_sg() here.
  1025	 */
> 1026	int netvsc_dma_map(struct hv_device *hv_dev,
  1027			   struct hv_netvsc_packet *packet,
  1028			   struct hv_page_buffer *pb)
  1029	{
  1030		u32 page_count =  packet->cp_partial ?
  1031			packet->page_buf_cnt - packet->rmsg_pgcnt :
  1032			packet->page_buf_cnt;
  1033		dma_addr_t dma;
  1034		int i;
  1035	
  1036		if (!hv_is_isolation_supported())
  1037			return 0;
  1038	
  1039		packet->dma_range = kcalloc(page_count,
  1040					    sizeof(*packet->dma_range),
  1041					    GFP_KERNEL);
  1042		if (!packet->dma_range)
  1043			return -ENOMEM;
  1044	
  1045		for (i = 0; i < page_count; i++) {
  1046			char *src = phys_to_virt((pb[i].pfn << HV_HYP_PAGE_SHIFT)
  1047						 + pb[i].offset);
  1048			u32 len = pb[i].len;
  1049	
  1050			dma = dma_map_single(&hv_dev->device, src, len,
  1051					     DMA_TO_DEVICE);
  1052			if (dma_mapping_error(&hv_dev->device, dma)) {
  1053				kfree(packet->dma_range);
  1054				return -ENOMEM;
  1055			}
  1056	
  1057			/* pb[].offset and pb[].len are not changed during dma mapping
  1058			 * and so not reassign.
  1059			 */
  1060			packet->dma_range[i].dma = dma;
  1061			packet->dma_range[i].mapping_size = len;
  1062			pb[i].pfn = dma >> HV_HYP_PAGE_SHIFT;
  1063		}
  1064	
  1065		return 0;
  1066	}
  1067	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Tianyu Lan <Tianyu.Lan@microsoft.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Wei Liu <wei.liu@kernel.org>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Michael Kelley <mikelley@microsoft.com>
Subject: [hyperv:hyperv-next 5/5] drivers/net/hyperv/netvsc.c:1026:5: warning: no previous prototype for 'netvsc_dma_map'
Date: Sat, 18 Dec 2021 12:23:30 +0800	[thread overview]
Message-ID: <202112181204.uRIUsFfa-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git hyperv-next
head:   19fd7ca00201c0525452dcf5a490e4b01674ef4c
commit: 19fd7ca00201c0525452dcf5a490e4b01674ef4c [5/5] net: netvsc: Add Isolation VM support for netvsc driver
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20211218/202112181204.uRIUsFfa-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git/commit/?id=19fd7ca00201c0525452dcf5a490e4b01674ef4c
        git remote add hyperv https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git
        git fetch --no-tags hyperv hyperv-next
        git checkout 19fd7ca00201c0525452dcf5a490e4b01674ef4c
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/net/hyperv/netvsc.c:1026:5: warning: no previous prototype for 'netvsc_dma_map' [-Wmissing-prototypes]
    1026 | int netvsc_dma_map(struct hv_device *hv_dev,
         |     ^~~~~~~~~~~~~~


vim +/netvsc_dma_map +1026 drivers/net/hyperv/netvsc.c

  1007	
  1008	/* netvsc_dma_map - Map swiotlb bounce buffer with data page of
  1009	 * packet sent by vmbus_sendpacket_pagebuffer() in the Isolation
  1010	 * VM.
  1011	 *
  1012	 * In isolation VM, netvsc send buffer has been marked visible to
  1013	 * host and so the data copied to send buffer doesn't need to use
  1014	 * bounce buffer. The data pages handled by vmbus_sendpacket_pagebuffer()
  1015	 * may not be copied to send buffer and so these pages need to be
  1016	 * mapped with swiotlb bounce buffer. netvsc_dma_map() is to do
  1017	 * that. The pfns in the struct hv_page_buffer need to be converted
  1018	 * to bounce buffer's pfn. The loop here is necessary because the
  1019	 * entries in the page buffer array are not necessarily full
  1020	 * pages of data.  Each entry in the array has a separate offset and
  1021	 * len that may be non-zero, even for entries in the middle of the
  1022	 * array.  And the entries are not physically contiguous.  So each
  1023	 * entry must be individually mapped rather than as a contiguous unit.
  1024	 * So not use dma_map_sg() here.
  1025	 */
> 1026	int netvsc_dma_map(struct hv_device *hv_dev,
  1027			   struct hv_netvsc_packet *packet,
  1028			   struct hv_page_buffer *pb)
  1029	{
  1030		u32 page_count =  packet->cp_partial ?
  1031			packet->page_buf_cnt - packet->rmsg_pgcnt :
  1032			packet->page_buf_cnt;
  1033		dma_addr_t dma;
  1034		int i;
  1035	
  1036		if (!hv_is_isolation_supported())
  1037			return 0;
  1038	
  1039		packet->dma_range = kcalloc(page_count,
  1040					    sizeof(*packet->dma_range),
  1041					    GFP_KERNEL);
  1042		if (!packet->dma_range)
  1043			return -ENOMEM;
  1044	
  1045		for (i = 0; i < page_count; i++) {
  1046			char *src = phys_to_virt((pb[i].pfn << HV_HYP_PAGE_SHIFT)
  1047						 + pb[i].offset);
  1048			u32 len = pb[i].len;
  1049	
  1050			dma = dma_map_single(&hv_dev->device, src, len,
  1051					     DMA_TO_DEVICE);
  1052			if (dma_mapping_error(&hv_dev->device, dma)) {
  1053				kfree(packet->dma_range);
  1054				return -ENOMEM;
  1055			}
  1056	
  1057			/* pb[].offset and pb[].len are not changed during dma mapping
  1058			 * and so not reassign.
  1059			 */
  1060			packet->dma_range[i].dma = dma;
  1061			packet->dma_range[i].mapping_size = len;
  1062			pb[i].pfn = dma >> HV_HYP_PAGE_SHIFT;
  1063		}
  1064	
  1065		return 0;
  1066	}
  1067	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

             reply	other threads:[~2021-12-18  4:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-18  4:23 kernel test robot [this message]
2021-12-18  4:23 ` [hyperv:hyperv-next 5/5] drivers/net/hyperv/netvsc.c:1026:5: warning: no previous prototype for 'netvsc_dma_map' kernel test robot
2021-12-19 12:31 ` Wei Liu
2021-12-19 12:31   ` Wei Liu

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=202112181204.uRIUsFfa-lkp@intel.com \
    --to=lkp@intel.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.