Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jul 2016 06:49:45 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r302879 - in head/sys/dev/hyperv: include netvsc storvsc vmbus
Message-ID:  <201607150649.u6F6njNU005486@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Fri Jul 15 06:49:45 2016
New Revision: 302879
URL: https://svnweb.freebsd.org/changeset/base/302879

Log:
  hyperv/vmbus: Move channel packet flags definition to vmbus.h
  
  MFC after:	1 week
  Sponsored by:	Microsoft OSTC
  Differential Revision:	https://reviews.freebsd.org/D7176

Modified:
  head/sys/dev/hyperv/include/hyperv.h
  head/sys/dev/hyperv/include/vmbus.h
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
  head/sys/dev/hyperv/vmbus/hv_channel.c

Modified: head/sys/dev/hyperv/include/hyperv.h
==============================================================================
--- head/sys/dev/hyperv/include/hyperv.h	Fri Jul 15 06:40:59 2016	(r302878)
+++ head/sys/dev/hyperv/include/hyperv.h	Fri Jul 15 06:49:45 2016	(r302879)
@@ -129,8 +129,6 @@ typedef enum {
 	HV_VMBUS_PACKET_TYPE_ADDITIONAL_DATA = 0xd
 } hv_vmbus_packet_type;
 
-#define HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED    1
-
 #define HW_MACADDR_LEN	6
 
 /*

Modified: head/sys/dev/hyperv/include/vmbus.h
==============================================================================
--- head/sys/dev/hyperv/include/vmbus.h	Fri Jul 15 06:40:59 2016	(r302878)
+++ head/sys/dev/hyperv/include/vmbus.h	Fri Jul 15 06:49:45 2016	(r302879)
@@ -47,6 +47,8 @@ struct vmbus_gpa {
 	uint64_t	gpa_page;
 } __packed;
 
+#define VMBUS_CHANPKT_FLAG_RC	0x0001	/* report completion */
+
 #define VMBUS_CHAN_SGLIST_MAX	32
 #define VMBUS_CHAN_PRPLIST_MAX	32
 

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c	Fri Jul 15 06:40:59 2016	(r302878)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c	Fri Jul 15 06:49:45 2016	(r302879)
@@ -185,8 +185,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct
 
 	ret = hv_vmbus_channel_send_packet(sc->hn_prichan, init_pkt,
 	    sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt,
-	    HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
-	    HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+	    HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, VMBUS_CHANPKT_FLAG_RC);
 	if (ret != 0) {
 		goto cleanup;
 	}
@@ -279,8 +278,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru
 
 	ret = hv_vmbus_channel_send_packet(sc->hn_prichan, init_pkt,
   	    sizeof(nvsp_msg), (uint64_t)init_pkt,
-	    HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
-	    HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+	    HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, VMBUS_CHANPKT_FLAG_RC);
 	if (ret != 0) {
 		goto cleanup;
 	}
@@ -474,8 +472,7 @@ hv_nv_negotiate_nvsp_protocol(struct hn_
 	/* Send the init request */
 	ret = hv_vmbus_channel_send_packet(sc->hn_prichan, init_pkt,
 	    sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt,
-	    HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
-	    HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+	    HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, VMBUS_CHANPKT_FLAG_RC);
 	if (ret != 0)
 		return (-1);
 
@@ -604,8 +601,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc
 	/*
 	 * TODO:  BUGBUG - We have to wait for the above msg since the netvsp
 	 * uses KMCL which acknowledges packet (completion packet) 
-	 * since our Vmbus always set the
-	 * HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED flag
+	 * since our Vmbus always set the VMBUS_CHANPKT_FLAG_RC flag
 	 */
 	/* sema_wait(&NetVscChannel->channel_init_sema); */
 
@@ -822,8 +818,7 @@ hv_nv_on_send(struct hv_vmbus_channel *c
 	} else {
 		ret = hv_vmbus_channel_send_packet(chan,
 		    &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt,
-		    HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
-		    HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+		    HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, VMBUS_CHANPKT_FLAG_RC);
 	}
 
 	return (ret);

Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c	Fri Jul 15 06:40:59 2016	(r302878)
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c	Fri Jul 15 06:49:45 2016	(r302879)
@@ -1168,8 +1168,7 @@ hv_rf_on_device_add(struct hn_softc *sc,
 
 	ret = hv_vmbus_channel_send_packet(sc->hn_prichan, init_pkt,
 	    sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt,
-	    HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
-	    HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+	    HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, VMBUS_CHANPKT_FLAG_RC);
 	if (ret != 0) {
 		device_printf(dev, "Fail to allocate subchannel\n");
 		goto out;

Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c	Fri Jul 15 06:40:59 2016	(r302878)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c	Fri Jul 15 06:49:45 2016	(r302879)
@@ -362,7 +362,7 @@ storvsc_send_multichannel_request(struct
 	    VSTOR_PKT_SIZE,
 	    (uint64_t)(uintptr_t)request,
 	    HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
-	    HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+	    VMBUS_CHANPKT_FLAG_RC);
 
 	/* wait for 5 seconds */
 	ret = sema_timedwait(&request->synch_sema, 5 * hz);
@@ -433,7 +433,7 @@ hv_storvsc_channel_init(struct storvsc_s
 			VSTOR_PKT_SIZE,
 			(uint64_t)(uintptr_t)request,
 			HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
-			HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+			VMBUS_CHANPKT_FLAG_RC);
 
 	if (ret != 0)
 		goto cleanup;
@@ -467,7 +467,7 @@ hv_storvsc_channel_init(struct storvsc_s
 			VSTOR_PKT_SIZE,
 			(uint64_t)(uintptr_t)request,
 			HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
-			HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+			VMBUS_CHANPKT_FLAG_RC);
 
 		if (ret != 0)
 			goto cleanup;
@@ -510,7 +510,7 @@ hv_storvsc_channel_init(struct storvsc_s
 				VSTOR_PKT_SIZE,
 				(uint64_t)(uintptr_t)request,
 				HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
-				HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+				VMBUS_CHANPKT_FLAG_RC);
 
 	if ( ret != 0)
 		goto cleanup;
@@ -546,7 +546,7 @@ hv_storvsc_channel_init(struct storvsc_s
 			VSTOR_PKT_SIZE,
 			(uint64_t)(uintptr_t)request,
 			HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
-			HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+			VMBUS_CHANPKT_FLAG_RC);
 
 	if (ret != 0) {
 		goto cleanup;
@@ -636,7 +636,7 @@ hv_storvsc_host_reset(struct storvsc_sof
 			VSTOR_PKT_SIZE,
 			(uint64_t)(uintptr_t)&sc->hs_reset_req,
 			HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
-			HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+			VMBUS_CHANPKT_FLAG_RC);
 
 	if (ret != 0) {
 		goto cleanup;
@@ -700,7 +700,7 @@ hv_storvsc_io_request(struct storvsc_sof
 			VSTOR_PKT_SIZE,
 			(uint64_t)(uintptr_t)request,
 			HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
-			HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+			VMBUS_CHANPKT_FLAG_RC);
 	}
 	mtx_lock(&request->softc->hs_lock);
 

Modified: head/sys/dev/hyperv/vmbus/hv_channel.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hv_channel.c	Fri Jul 15 06:40:59 2016	(r302878)
+++ head/sys/dev/hyperv/vmbus/hv_channel.c	Fri Jul 15 06:49:45 2016	(r302879)
@@ -690,7 +690,7 @@ vmbus_chan_send_sglist(struct hv_vmbus_c
 	pad_pktlen = roundup2(pktlen, VMBUS_CHANPKT_SIZE_ALIGN);
 
 	pkt.cp_hdr.cph_type = HV_VMBUS_PACKET_TYPE_DATA_USING_GPA_DIRECT;
-	pkt.cp_hdr.cph_flags = HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED;
+	pkt.cp_hdr.cph_flags = VMBUS_CHANPKT_FLAG_RC;
 	pkt.cp_hdr.cph_data_ofs = hlen >> VMBUS_CHANPKT_SIZE_SHIFT;
 	pkt.cp_hdr.cph_len = pad_pktlen >> VMBUS_CHANPKT_SIZE_SHIFT;
 	pkt.cp_hdr.cph_xactid = xactid;
@@ -732,7 +732,7 @@ vmbus_chan_send_prplist(struct hv_vmbus_
 	pad_pktlen = roundup2(pktlen, VMBUS_CHANPKT_SIZE_ALIGN);
 
 	pkt.cp_hdr.cph_type = HV_VMBUS_PACKET_TYPE_DATA_USING_GPA_DIRECT;
-	pkt.cp_hdr.cph_flags = HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED;
+	pkt.cp_hdr.cph_flags = VMBUS_CHANPKT_FLAG_RC;
 	pkt.cp_hdr.cph_data_ofs = hlen >> VMBUS_CHANPKT_SIZE_SHIFT;
 	pkt.cp_hdr.cph_len = pad_pktlen >> VMBUS_CHANPKT_SIZE_SHIFT;
 	pkt.cp_hdr.cph_xactid = xactid;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607150649.u6F6njNU005486>