Commit Graph

62 Commits

Author SHA1 Message Date
Sepherosa Ziehau
43bbe6b27f hyperv/vmbus: Cleanup channel packet receiving.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7204
2016-07-15 07:53:45 +00:00
Sepherosa Ziehau
7c55724859 hyperv/vmbus: Cleanup channel receiving.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7202
2016-07-15 07:45:30 +00:00
Sepherosa Ziehau
12140675e8 hyperv/vmbus: Function rename
And reorder the error prone parameters list.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7191
2016-07-15 07:16:46 +00:00
Sepherosa Ziehau
03055a2cea hyperv/vmbus: Move channel packet types definition to vmbus.h
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7177
2016-07-15 06:58:21 +00:00
Sepherosa Ziehau
1680fb300c 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
2016-07-15 06:49:45 +00:00
Sepherosa Ziehau
66e132bd0f hyeprv/vmbus: Rework prplist sending.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7175
2016-07-15 06:40:59 +00:00
Sepherosa Ziehau
6199f16549 hyperv/vmbus: Rework sglist sending.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7156
2016-07-15 06:29:19 +00:00
Sepherosa Ziehau
013c69bf17 hyperv/vmbus: Field rename
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7146
2016-07-15 06:08:48 +00:00
Sepherosa Ziehau
23eaa43cc8 hyperv/vmbus: Set vcpuid to 0, if MSR_HV_VP_INDEX does not exist.
Mainly for compatibility.  While I'm here, rename cpuid related
fields in hv_vmbus_channel.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7141
2016-07-15 05:59:27 +00:00
Sepherosa Ziehau
29bf5462b5 hyperv/vmbus: Busdma-fy channel bufring.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7140
2016-07-15 05:51:58 +00:00
Sepherosa Ziehau
9ab42c2138 hyperv/vmbus: Add vmbus_chan_gpadl_connect, which takes GPA physaddr
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7139
2016-07-15 05:40:34 +00:00
Sepherosa Ziehau
7e70f1cbaf hyperv/vmbus: Sub-channel related fields renaming
And reorganize comment.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7113
2016-07-14 08:15:13 +00:00
Sepherosa Ziehau
c1bea00ed1 hyperv/vmbus: Field renaming to reflect reality
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7111
2016-07-14 07:48:26 +00:00
Sepherosa Ziehau
3a1079321c hyperv/vmbus: Use sub-channel index to detect primary channel
In case that VMBUS_CHAN_ISPRIMARY is needed in the early place of
channel setup.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7108
2016-07-14 07:24:03 +00:00
Sepherosa Ziehau
8c1ac91660 hyperv/vmbus: Nuke the channel open state.
Channel is either opened or not-opened.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7105
2016-07-14 06:59:04 +00:00
Sepherosa Ziehau
5ef8204d4b hyperv/vmbus: Remove unused bits
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7095
2016-07-14 06:00:40 +00:00
Sepherosa Ziehau
71ac1309f0 hyperv: hv_guid -> struct hyperv_guid.
This paves way for the further cleanup/disentangle.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7092
2016-07-14 05:25:31 +00:00
Sepherosa Ziehau
6c3a5c5759 hyperv/vmbus: Remove unused bits
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7091
2016-07-14 05:14:12 +00:00
Sepherosa Ziehau
8c8cf3f2e2 hyperv/vmbus: Reorganize MNF event sending.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7088
2016-07-13 09:28:46 +00:00
Sepherosa Ziehau
562d480b7d hyperv: Signal event input parameter is shared w/ MNF
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7087
2016-07-13 09:19:33 +00:00
Sepherosa Ziehau
df1021e7bf hyperv/vmbus: Pack bool field into flags field
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7038
2016-07-13 06:46:29 +00:00
Sepherosa Ziehau
7c2abef176 hyperv/bufring: Remove unused fields
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7037
2016-07-13 06:39:04 +00:00
Sepherosa Ziehau
6de616d3a0 hyperv/vmbus: Nuke unused field from hv_vmbus_channel.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7036
2016-07-13 06:30:33 +00:00
Sepherosa Ziehau
3b50b13baa hyperv: Get rid of hv_device, which is unnecessary indirection.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7034
2016-07-13 06:17:15 +00:00
Sepherosa Ziehau
47575345ba hyperv/vmbus: Deprecate the usage of hv_device.
This paves way to nuke the hv_device, which is actually an unncessary
indirection.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7032
2016-07-13 05:47:09 +00:00
Sepherosa Ziehau
edd0c2c7c7 hyperv/vmbus: Add channel ivar accessor.
This makes life easier during the transition period to nuke the hv_device.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7026
2016-07-13 05:19:45 +00:00
Sepherosa Ziehau
abe9fa4996 hyperv/vmbus: Remove the embedded offer message from hv_vmbus_channel
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7021
2016-07-13 04:51:37 +00:00
Sepherosa Ziehau
5c604feb67 hyperv/vmbus: Add type/instance guid fields into hv_vmbus_channel
This prepares to remove the unnecessary offer message embedding in
hv_vmbus_channel.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7020
2016-07-13 04:39:16 +00:00
Sepherosa Ziehau
d74e22ed4a hyperv/vmbus: Add flags field into hv_vmbus_channel for MNF indication
This prepares to remove the unnecessary offer message embedding in
hv_vmbus_channel.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7019
2016-07-13 04:31:08 +00:00
Sepherosa Ziehau
4ac0a9bf1e hyperv/vmbus: Make subchan index a field of hv_vmbus_channel.
This prepares to remove the unnecessary offer message embedding in
hv_vmbus_channel.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7015
2016-07-13 03:35:22 +00:00
Sepherosa Ziehau
2c4888c75b hyperv/vmbus: Make channel id a field of hv_vmbus_channel.
This prepares to remove the unnecessary offer message embedding in
hv_vmbus_channel.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7014
2016-07-13 03:24:29 +00:00
Sepherosa Ziehau
99e315276a hyperv/vmbus: Fix sub-channel re-open support.
For multi-channel devices, once the primary channel is closed,
a set of 'rescind' messages for sub-channels will be delivered
by Hypervisor.  Sub-channel MUST be freed according to these
'rescind' messages; directly re-openning sub-channels in the
same fashion as the primary channel's re-opening does NOT work
at all.

After the primary channel is re-opened, requested # of sub-
channels will be delivered though 'channel offer' messages, and
this set of newly offered channels can be opened along side with
the primary channel.

This unbreaks the MTU setting for hn(4), which requires re-
openning all existsing channels upon MTU change.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6978
2016-07-12 08:38:03 +00:00
Sepherosa Ziehau
81e1f05268 hyperv/vmbus: Free sysctl properly upon channel close.
Prepare for sub-channel re-open.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6977
2016-07-12 08:28:51 +00:00
Sepherosa Ziehau
7fbf073008 hyperv/vmbus: Move channel list to vmbus_softc
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6956
2016-07-12 08:11:16 +00:00
Sepherosa Ziehau
38d19df6ff hyperv/vmbus: Rework vmbus version accessing.
Instead of global variable, vmbus version is accessed through
a vmbus DEVMETHOD now.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6953
2016-07-12 07:33:39 +00:00
Sepherosa Ziehau
9e6efea698 hyperv/vmbus: Don't be oversmart in default cpu selection.
Pin the channel to cpu0 by default.  Drivers having special channel-cpu
mapping requirement should call vmbus_channel_cpu_{set,rr}() themselves.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6918
2016-07-12 05:31:33 +00:00
Sepherosa Ziehau
e44bdd84c9 hyperv/vmbus: Busdma-fy Hypercall signal event input parameter.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6916
2016-07-12 05:09:07 +00:00
Sepherosa Ziehau
1f175550a0 hyperv: Nuke unused stuffs
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6913
2016-07-12 03:38:29 +00:00
Sepherosa Ziehau
60169cb210 hyperv/vmbus: Embed channel detach task in channel itself.
GC work queue stuffs.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6864
2016-07-11 08:12:04 +00:00
Sepherosa Ziehau
3e1c325e63 hyperv/vmbus: Save vmbus softc to channels.
So that we don't need to access the global vmbus softc.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6863
2016-07-11 07:54:58 +00:00
Sepherosa Ziehau
236764b1c2 hyperv/vmbus: Implement a new set of APIs for post message Hypercall
And use this new APIs for Initial Contact post message Hypercall.
More post message Hypercalls will be converted.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6830
2016-07-11 04:52:11 +00:00
Sepherosa Ziehau
7df850a759 hyperv: Move guid2str from vmbus file to hyperv file
- Use uint8_t for GUID byte array.
- Define GUID string length.
- Break long lines.
- Nuke unnecessary stack variable.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6640
2016-05-31 05:43:59 +00:00
Pedro F. Giffuni
453130d9bf sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
2016-05-03 03:41:25 +00:00
Sepherosa Ziehau
96a8c456f1 hyperv/channel: Git rid of the sub-channel creation callback
It is no longer used.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-26 05:21:27 +00:00
Sepherosa Ziehau
480805ab13 hyperv/channel: Add functions to synchronize sub-channel offers
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-25 09:00:06 +00:00
Sepherosa Ziehau
7cd9b96b7a hyperv: Update copyright to 2016 for the files Microsoft changed in 2016
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6039
2016-04-22 05:01:43 +00:00
Sepherosa Ziehau
57a339543d hyperv: Factor out snprinf_hv_guid()
Submitted by:	Ju Sun <junsu microsoft com>
Reviewed by:	Dexuan Cui <decui microsoft com>, sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5651
2016-03-21 06:54:21 +00:00
Sepherosa Ziehau
21640df213 hyperv/hn: Add multiple channel support, a.k.a. vRSS
Each channel contains one RX ring and one TX ring.  And we
try to distribute the channels to different evenly.

Note: Currently we don't have enough information to extract
the RSS type and RSS hash value from the received packets.

This greatly improves the TX/RX performance for 8 virtual CPU
Hyper-V over 10Ge: it can max out 10Ge for TCP when multiple
RX/TX rings are enabled.

This almost doubles the TX/RX performance for locally connected
Hyper-Vs: was 6Gbps w/ 128 TCP streams, now 11Gbps w/ multiple
RX/TX rings enabled.

It is not enabled by default; it will be switched on after more
tests.

Collaborated with:	Hongjiang Zhang <honzhan microsoft com>
MFC after:	2 week
Sponsored by:	Microsoft OSTC
2016-03-04 06:52:11 +00:00
Sepherosa Ziehau
6c03f94bb3 hyperv/hn: Make read buffer per-channel
Submitted by:	Hongjiang Zhang <honzhan microsoft com>
Reorganized by:	sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-03-02 03:07:31 +00:00
Sepherosa Ziehau
3f919777b6 hyperv/hn: Associate TX/RX ring with channel
This fixes the TX/RX ring selection for TX/RX done.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5454
2016-02-26 09:41:00 +00:00