All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 2/3] hv_netvsc: Wait for completion on request NVSP_MSG4_TYPE_SWITCH_DATA_PATH
Date: Wed, 06 Jan 2021 12:25:48 +0800	[thread overview]
Message-ID: <202101061221.LKsEcWmp-lkp@intel.com> (raw)
In-Reply-To: <1609895753-30445-2-git-send-email-longli@linuxonhyperv.com>

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

Hi Long,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.11-rc2 next-20210104]
[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/Long-Li/hv_netvsc-Check-VF-datapath-when-sending-traffic-to-VF/20210106-092237
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e71ba9452f0b5b2e8dc8aa5445198cd9214a6a62
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/8c92b5574da1b0c2aee3eab7da2c4dad8d92572c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Long-Li/hv_netvsc-Check-VF-datapath-when-sending-traffic-to-VF/20210106-092237
        git checkout 8c92b5574da1b0c2aee3eab7da2c4dad8d92572c
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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: In function 'netvsc_send_completion':
>> drivers/net/hyperv/netvsc.c:778:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     778 |   pkt_rqst = (struct nvsp_message *)cmd_rqst;
         |              ^


vim +778 drivers/net/hyperv/netvsc.c

   757	
   758	static void netvsc_send_completion(struct net_device *ndev,
   759					   struct netvsc_device *net_device,
   760					   struct vmbus_channel *incoming_channel,
   761					   const struct vmpacket_descriptor *desc,
   762					   int budget)
   763	{
   764		const struct nvsp_message *nvsp_packet = hv_pkt_data(desc);
   765		u32 msglen = hv_pkt_datalen(desc);
   766		struct nvsp_message *pkt_rqst;
   767		u64 cmd_rqst;
   768	
   769		/* First check if this is a VMBUS completion without data payload */
   770		if (!msglen) {
   771			cmd_rqst = vmbus_request_addr(&incoming_channel->requestor,
   772						      (u64)desc->trans_id);
   773			if (cmd_rqst == VMBUS_RQST_ERROR) {
   774				netdev_err(ndev, "Invalid transaction id\n");
   775				return;
   776			}
   777	
 > 778			pkt_rqst = (struct nvsp_message *)cmd_rqst;
   779			switch (pkt_rqst->hdr.msg_type) {
   780			case NVSP_MSG4_TYPE_SWITCH_DATA_PATH:
   781				complete(&net_device->channel_init_wait);
   782				break;
   783	
   784			default:
   785				netdev_err(ndev, "Unexpected VMBUS completion!!\n");
   786			}
   787			return;
   788		}
   789	
   790		/* Ensure packet is big enough to read header fields */
   791		if (msglen < sizeof(struct nvsp_message_header)) {
   792			netdev_err(ndev, "nvsp_message length too small: %u\n", msglen);
   793			return;
   794		}
   795	
   796		switch (nvsp_packet->hdr.msg_type) {
   797		case NVSP_MSG_TYPE_INIT_COMPLETE:
   798			if (msglen < sizeof(struct nvsp_message_header) +
   799					sizeof(struct nvsp_message_init_complete)) {
   800				netdev_err(ndev, "nvsp_msg length too small: %u\n",
   801					   msglen);
   802				return;
   803			}
   804			fallthrough;
   805	
   806		case NVSP_MSG1_TYPE_SEND_RECV_BUF_COMPLETE:
   807			if (msglen < sizeof(struct nvsp_message_header) +
   808					sizeof(struct nvsp_1_message_send_receive_buffer_complete)) {
   809				netdev_err(ndev, "nvsp_msg1 length too small: %u\n",
   810					   msglen);
   811				return;
   812			}
   813			fallthrough;
   814	
   815		case NVSP_MSG1_TYPE_SEND_SEND_BUF_COMPLETE:
   816			if (msglen < sizeof(struct nvsp_message_header) +
   817					sizeof(struct nvsp_1_message_send_send_buffer_complete)) {
   818				netdev_err(ndev, "nvsp_msg1 length too small: %u\n",
   819					   msglen);
   820				return;
   821			}
   822			fallthrough;
   823	
   824		case NVSP_MSG5_TYPE_SUBCHANNEL:
   825			if (msglen < sizeof(struct nvsp_message_header) +
   826					sizeof(struct nvsp_5_subchannel_complete)) {
   827				netdev_err(ndev, "nvsp_msg5 length too small: %u\n",
   828					   msglen);
   829				return;
   830			}
   831			/* Copy the response back */
   832			memcpy(&net_device->channel_init_pkt, nvsp_packet,
   833			       sizeof(struct nvsp_message));
   834			complete(&net_device->channel_init_wait);
   835			break;
   836	
   837		case NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE:
   838			netvsc_send_tx_complete(ndev, net_device, incoming_channel,
   839						desc, budget);
   840			break;
   841	
   842		default:
   843			netdev_err(ndev,
   844				   "Unknown send completion type %d received!!\n",
   845				   nvsp_packet->hdr.msg_type);
   846		}
   847	}
   848	

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

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Long Li <longli@linuxonhyperv.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, netdev@vger.kernel.org,
	Long Li <longli@microsoft.com>
Subject: Re: [PATCH 2/3] hv_netvsc: Wait for completion on request NVSP_MSG4_TYPE_SWITCH_DATA_PATH
Date: Wed, 6 Jan 2021 12:25:48 +0800	[thread overview]
Message-ID: <202101061221.LKsEcWmp-lkp@intel.com> (raw)
In-Reply-To: <1609895753-30445-2-git-send-email-longli@linuxonhyperv.com>

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

Hi Long,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.11-rc2 next-20210104]
[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/Long-Li/hv_netvsc-Check-VF-datapath-when-sending-traffic-to-VF/20210106-092237
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e71ba9452f0b5b2e8dc8aa5445198cd9214a6a62
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/8c92b5574da1b0c2aee3eab7da2c4dad8d92572c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Long-Li/hv_netvsc-Check-VF-datapath-when-sending-traffic-to-VF/20210106-092237
        git checkout 8c92b5574da1b0c2aee3eab7da2c4dad8d92572c
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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: In function 'netvsc_send_completion':
>> drivers/net/hyperv/netvsc.c:778:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     778 |   pkt_rqst = (struct nvsp_message *)cmd_rqst;
         |              ^


vim +778 drivers/net/hyperv/netvsc.c

   757	
   758	static void netvsc_send_completion(struct net_device *ndev,
   759					   struct netvsc_device *net_device,
   760					   struct vmbus_channel *incoming_channel,
   761					   const struct vmpacket_descriptor *desc,
   762					   int budget)
   763	{
   764		const struct nvsp_message *nvsp_packet = hv_pkt_data(desc);
   765		u32 msglen = hv_pkt_datalen(desc);
   766		struct nvsp_message *pkt_rqst;
   767		u64 cmd_rqst;
   768	
   769		/* First check if this is a VMBUS completion without data payload */
   770		if (!msglen) {
   771			cmd_rqst = vmbus_request_addr(&incoming_channel->requestor,
   772						      (u64)desc->trans_id);
   773			if (cmd_rqst == VMBUS_RQST_ERROR) {
   774				netdev_err(ndev, "Invalid transaction id\n");
   775				return;
   776			}
   777	
 > 778			pkt_rqst = (struct nvsp_message *)cmd_rqst;
   779			switch (pkt_rqst->hdr.msg_type) {
   780			case NVSP_MSG4_TYPE_SWITCH_DATA_PATH:
   781				complete(&net_device->channel_init_wait);
   782				break;
   783	
   784			default:
   785				netdev_err(ndev, "Unexpected VMBUS completion!!\n");
   786			}
   787			return;
   788		}
   789	
   790		/* Ensure packet is big enough to read header fields */
   791		if (msglen < sizeof(struct nvsp_message_header)) {
   792			netdev_err(ndev, "nvsp_message length too small: %u\n", msglen);
   793			return;
   794		}
   795	
   796		switch (nvsp_packet->hdr.msg_type) {
   797		case NVSP_MSG_TYPE_INIT_COMPLETE:
   798			if (msglen < sizeof(struct nvsp_message_header) +
   799					sizeof(struct nvsp_message_init_complete)) {
   800				netdev_err(ndev, "nvsp_msg length too small: %u\n",
   801					   msglen);
   802				return;
   803			}
   804			fallthrough;
   805	
   806		case NVSP_MSG1_TYPE_SEND_RECV_BUF_COMPLETE:
   807			if (msglen < sizeof(struct nvsp_message_header) +
   808					sizeof(struct nvsp_1_message_send_receive_buffer_complete)) {
   809				netdev_err(ndev, "nvsp_msg1 length too small: %u\n",
   810					   msglen);
   811				return;
   812			}
   813			fallthrough;
   814	
   815		case NVSP_MSG1_TYPE_SEND_SEND_BUF_COMPLETE:
   816			if (msglen < sizeof(struct nvsp_message_header) +
   817					sizeof(struct nvsp_1_message_send_send_buffer_complete)) {
   818				netdev_err(ndev, "nvsp_msg1 length too small: %u\n",
   819					   msglen);
   820				return;
   821			}
   822			fallthrough;
   823	
   824		case NVSP_MSG5_TYPE_SUBCHANNEL:
   825			if (msglen < sizeof(struct nvsp_message_header) +
   826					sizeof(struct nvsp_5_subchannel_complete)) {
   827				netdev_err(ndev, "nvsp_msg5 length too small: %u\n",
   828					   msglen);
   829				return;
   830			}
   831			/* Copy the response back */
   832			memcpy(&net_device->channel_init_pkt, nvsp_packet,
   833			       sizeof(struct nvsp_message));
   834			complete(&net_device->channel_init_wait);
   835			break;
   836	
   837		case NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE:
   838			netvsc_send_tx_complete(ndev, net_device, incoming_channel,
   839						desc, budget);
   840			break;
   841	
   842		default:
   843			netdev_err(ndev,
   844				   "Unknown send completion type %d received!!\n",
   845				   nvsp_packet->hdr.msg_type);
   846		}
   847	}
   848	

---
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: 76667 bytes --]

  reply	other threads:[~2021-01-06  4:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06  1:15 [PATCH 1/3] hv_netvsc: Check VF datapath when sending traffic to VF Long Li
2021-01-06  1:15 ` [PATCH 2/3] hv_netvsc: Wait for completion on request NVSP_MSG4_TYPE_SWITCH_DATA_PATH Long Li
2021-01-06  4:25   ` kernel test robot [this message]
2021-01-06  4:25     ` kernel test robot
2021-01-06 23:59     ` Long Li
2021-01-07 18:36       ` Long Li
2021-01-07 18:36       ` Long Li
2021-01-06 23:59     ` Long Li
2021-01-06 17:36   ` Haiyang Zhang
2021-01-06  1:15 ` [PATCH 3/3] hv_netvsc: Process NETDEV_GOING_DOWN on VF hot remove Long Li
2021-01-06 17:36   ` Haiyang Zhang
2021-01-06 17:36 ` [PATCH 1/3] hv_netvsc: Check VF datapath when sending traffic to VF Haiyang Zhang

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=202101061221.LKsEcWmp-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.