Date: Fri, 15 Jul 2016 08:13:44 +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: r302889 - in head/sys/dev/hyperv: include netvsc storvsc vmbus Message-ID: <201607150813.u6F8Divh039182@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sephe Date: Fri Jul 15 08:13:44 2016 New Revision: 302889 URL: https://svnweb.freebsd.org/changeset/base/302889 Log: hyperv/vmbus: Back out r302888 temporarily Committed by accident w/ duplicated commit log MFC after: 1 week Sponsored by: Microsoft OSTC 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_netvsc_drv_freebsd.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 08:08:13 2016 (r302888) +++ head/sys/dev/hyperv/include/hyperv.h Fri Jul 15 08:13:44 2016 (r302889) @@ -287,8 +287,22 @@ int hv_vmbus_channel_open( void hv_vmbus_channel_close(hv_vmbus_channel *channel); +int hv_vmbus_channel_teardown_gpdal( + hv_vmbus_channel* channel, + uint32_t gpadl_handle); + +int vmbus_chan_gpadl_connect(struct hv_vmbus_channel *chan, + bus_addr_t paddr, int size, uint32_t *gpadl); + struct hv_vmbus_channel* vmbus_select_outgoing_channel(struct hv_vmbus_channel *promary); +void vmbus_channel_cpu_set(struct hv_vmbus_channel *chan, int cpu); +void vmbus_channel_cpu_rr(struct hv_vmbus_channel *chan); +struct hv_vmbus_channel ** + vmbus_get_subchan(struct hv_vmbus_channel *pri_chan, int subchan_cnt); +void vmbus_rel_subchan(struct hv_vmbus_channel **subchan, int subchan_cnt); +void vmbus_drain_subchan(struct hv_vmbus_channel *pri_chan); + /** * @brief Get physical address from virtual */ Modified: head/sys/dev/hyperv/include/vmbus.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus.h Fri Jul 15 08:08:13 2016 (r302888) +++ head/sys/dev/hyperv/include/vmbus.h Fri Jul 15 08:13:44 2016 (r302889) @@ -89,20 +89,6 @@ struct vmbus_chanpkt_rxbuf { struct hv_vmbus_channel; -int vmbus_chan_gpadl_connect(struct hv_vmbus_channel *chan, - bus_addr_t paddr, int size, uint32_t *gpadl); -int vmbus_chan_gpadl_disconnect(struct hv_vmbus_channel *chan, - uint32_t gpadl); - -void vmbus_chan_cpu_set(struct hv_vmbus_channel *chan, int cpu); -void vmbus_chan_cpu_rr(struct hv_vmbus_channel *chan); - -struct hv_vmbus_channel ** - vmbus_subchan_get(struct hv_vmbus_channel *pri_chan, int subchan_cnt); -void vmbus_subchan_rel(struct hv_vmbus_channel **subchan, int subchan_cnt); -void vmbus_subchan_drain(struct hv_vmbus_channel *pri_chan); - - int vmbus_chan_recv(struct hv_vmbus_channel *chan, void *data, int *dlen, uint64_t *xactid); int vmbus_chan_recv_pkt(struct hv_vmbus_channel *chan, Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Jul 15 08:08:13 2016 (r302888) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Jul 15 08:13:44 2016 (r302889) @@ -363,7 +363,7 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ /* Tear down the gpadl on the vsp end */ if (net_dev->rx_buf_gpadl_handle) { - ret = vmbus_chan_gpadl_disconnect(net_dev->sc->hn_prichan, + ret = hv_vmbus_channel_teardown_gpdal(net_dev->sc->hn_prichan, net_dev->rx_buf_gpadl_handle); /* * If we failed here, we might as well return and have a leak @@ -430,7 +430,7 @@ hv_nv_destroy_send_buffer(netvsc_dev *ne /* Tear down the gpadl on the vsp end */ if (net_dev->send_buf_gpadl_handle) { - ret = vmbus_chan_gpadl_disconnect(net_dev->sc->hn_prichan, + ret = hv_vmbus_channel_teardown_gpdal(net_dev->sc->hn_prichan, net_dev->send_buf_gpadl_handle); /* Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Jul 15 08:08:13 2016 (r302888) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Jul 15 08:13:44 2016 (r302889) @@ -1586,7 +1586,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, } /* Wait for subchannels to be destroyed */ - vmbus_subchan_drain(sc->hn_prichan); + vmbus_drain_subchan(sc->hn_prichan); error = hv_rf_on_device_add(sc, &device_info, sc->hn_rx_ring_inuse); @@ -2950,7 +2950,7 @@ hn_channel_attach(struct hn_softc *sc, s } /* Bind channel to a proper CPU */ - vmbus_chan_cpu_set(chan, (sc->hn_cpu + idx) % mp_ncpus); + vmbus_channel_cpu_set(chan, (sc->hn_cpu + idx) % mp_ncpus); } static void @@ -2973,7 +2973,7 @@ hn_subchan_setup(struct hn_softc *sc) int i; /* Wait for sub-channels setup to complete. */ - subchan = vmbus_subchan_get(sc->hn_prichan, subchan_cnt); + subchan = vmbus_get_subchan(sc->hn_prichan, subchan_cnt); /* Attach the sub-channels. */ for (i = 0; i < subchan_cnt; ++i) { @@ -2983,7 +2983,7 @@ hn_subchan_setup(struct hn_softc *sc) } /* Release the sub-channels */ - vmbus_subchan_rel(subchan, subchan_cnt); + vmbus_rel_subchan(subchan, subchan_cnt); if_printf(sc->hn_ifp, "%d sub-channels setup done\n", subchan_cnt); } Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Jul 15 08:08:13 2016 (r302888) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Jul 15 08:13:44 2016 (r302889) @@ -315,7 +315,7 @@ storvsc_subchan_attach(struct storvsc_so memset(&props, 0, sizeof(props)); new_channel->hv_chan_priv1 = sc; - vmbus_chan_cpu_rr(new_channel); + vmbus_channel_cpu_rr(new_channel); ret = hv_vmbus_channel_open(new_channel, sc->hs_drv_props->drv_ringbuffer_size, sc->hs_drv_props->drv_ringbuffer_size, @@ -377,14 +377,14 @@ storvsc_send_multichannel_request(struct } /* Wait for sub-channels setup to complete. */ - subchan = vmbus_subchan_get(sc->hs_chan, request_channels_cnt); + subchan = vmbus_get_subchan(sc->hs_chan, request_channels_cnt); /* Attach the sub-channels. */ for (i = 0; i < request_channels_cnt; ++i) storvsc_subchan_attach(sc, subchan[i]); /* Release the sub-channels. */ - vmbus_subchan_rel(subchan, request_channels_cnt); + vmbus_rel_subchan(subchan, request_channels_cnt); if (bootverbose) printf("Storvsc create multi-channel success!\n"); @@ -574,7 +574,7 @@ hv_storvsc_connect_vsp(struct storvsc_so * Open the channel */ KASSERT(sc->hs_chan->hv_chan_priv1 == sc, ("invalid chan priv1")); - vmbus_chan_cpu_rr(sc->hs_chan); + vmbus_channel_cpu_rr(sc->hs_chan); ret = hv_vmbus_channel_open( sc->hs_chan, sc->hs_drv_props->drv_ringbuffer_size, Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Fri Jul 15 08:08:13 2016 (r302888) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Fri Jul 15 08:13:44 2016 (r302889) @@ -324,7 +324,7 @@ hv_vmbus_channel_open( failed: if (new_channel->ch_bufring_gpadl) { - vmbus_chan_gpadl_disconnect(new_channel, + hv_vmbus_channel_teardown_gpdal(new_channel, new_channel->ch_bufring_gpadl); new_channel->ch_bufring_gpadl = 0; } @@ -468,7 +468,7 @@ vmbus_chan_gpadl_connect(struct hv_vmbus * Disconnect the GPA from the target channel */ int -vmbus_chan_gpadl_disconnect(struct hv_vmbus_channel *chan, uint32_t gpadl) +hv_vmbus_channel_teardown_gpdal(struct hv_vmbus_channel *chan, uint32_t gpadl) { struct vmbus_softc *sc = chan->vmbus_sc; struct vmbus_msghc *mh; @@ -556,7 +556,8 @@ hv_vmbus_channel_close_internal(hv_vmbus /* Tear down the gpadl for the channel's ring buffer */ if (channel->ch_bufring_gpadl) { - vmbus_chan_gpadl_disconnect(channel, channel->ch_bufring_gpadl); + hv_vmbus_channel_teardown_gpdal(channel, + channel->ch_bufring_gpadl); channel->ch_bufring_gpadl = 0; } @@ -599,10 +600,10 @@ hv_vmbus_channel_close(struct hv_vmbus_c struct hv_vmbus_channel **subchan; int i; - subchan = vmbus_subchan_get(chan, subchan_cnt); + subchan = vmbus_get_subchan(chan, subchan_cnt); for (i = 0; i < subchan_cnt; ++i) hv_vmbus_channel_close_internal(subchan[i]); - vmbus_subchan_rel(subchan, subchan_cnt); + vmbus_rel_subchan(subchan, subchan_cnt); } /* Then close the primary channel. */ @@ -1037,7 +1038,7 @@ vmbus_chan_add(struct hv_vmbus_channel * } void -vmbus_chan_cpu_set(struct hv_vmbus_channel *chan, int cpu) +vmbus_channel_cpu_set(struct hv_vmbus_channel *chan, int cpu) { KASSERT(cpu >= 0 && cpu < mp_ncpus, ("invalid cpu %d", cpu)); @@ -1057,13 +1058,13 @@ vmbus_chan_cpu_set(struct hv_vmbus_chann } void -vmbus_chan_cpu_rr(struct hv_vmbus_channel *chan) +vmbus_channel_cpu_rr(struct hv_vmbus_channel *chan) { static uint32_t vmbus_chan_nextcpu; int cpu; cpu = atomic_fetchadd_int(&vmbus_chan_nextcpu, 1) % mp_ncpus; - vmbus_chan_cpu_set(chan, cpu); + vmbus_channel_cpu_set(chan, cpu); } static void @@ -1072,9 +1073,9 @@ vmbus_chan_cpu_default(struct hv_vmbus_c /* * By default, pin the channel to cpu0. Devices having * special channel-cpu mapping requirement should call - * vmbus_chan_cpu_{set,rr}(). + * vmbus_channel_cpu_{set,rr}(). */ - vmbus_chan_cpu_set(chan, 0); + vmbus_channel_cpu_set(chan, 0); } static void @@ -1308,7 +1309,7 @@ vmbus_select_outgoing_channel(struct hv_ } struct hv_vmbus_channel ** -vmbus_subchan_get(struct hv_vmbus_channel *pri_chan, int subchan_cnt) +vmbus_get_subchan(struct hv_vmbus_channel *pri_chan, int subchan_cnt) { struct hv_vmbus_channel **ret, *chan; int i; @@ -1339,14 +1340,14 @@ vmbus_subchan_get(struct hv_vmbus_channe } void -vmbus_subchan_rel(struct hv_vmbus_channel **subchan, int subchan_cnt __unused) +vmbus_rel_subchan(struct hv_vmbus_channel **subchan, int subchan_cnt __unused) { free(subchan, M_TEMP); } void -vmbus_subchan_drain(struct hv_vmbus_channel *pri_chan) +vmbus_drain_subchan(struct hv_vmbus_channel *pri_chan) { mtx_lock(&pri_chan->ch_subchan_lock); while (pri_chan->ch_subchan_cnt > 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607150813.u6F8Divh039182>