From owner-svn-src-all@freebsd.org Fri Jul 15 06:49:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88343B99A39; Fri, 15 Jul 2016 06:49:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47EEF1DE2; Fri, 15 Jul 2016 06:49:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6F6nkHI005493; Fri, 15 Jul 2016 06:49:46 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6F6njNU005486; Fri, 15 Jul 2016 06:49:45 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607150649.u6F6njNU005486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 15 Jul 2016 06:49:45 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2016 06:49:47 -0000 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;