Commit Graph

317 Commits

Author SHA1 Message Date
Sepherosa Ziehau
884d26c84c hyperv/vmbus: Add vmbus method for GUID base device probing.
Reduce the exposure of hv_device.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7024
2016-07-13 05:01:12 +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
e71d17193d hyperv/vmbus: Merge hv_connection.c into hv_channel.c
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7004
2016-07-13 03:14:29 +00:00
Sepherosa Ziehau
283ec9df45 hyperv/vmbus: Destroy channel list lock upon attach failure and detach.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7003
2016-07-12 09:06:25 +00:00
Sepherosa Ziehau
250ca4ca3b hyperv/vmbus: Remove needed bits
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7002
2016-07-12 08:55:08 +00:00
Sepherosa Ziehau
af3be0bfa5 hyperv/vmbus: Move channel map to vmbus_softc
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6982
2016-07-12 08:47:04 +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
3dee05577d hyperv/vmbus: More verbose for GPADL_connect/chan_{rescind,offer}
Reviewed by:	Dexuan Cui <decui microsoft com>, Hongjiang Zhang <honzhan microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6976
2016-07-12 08:21:28 +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
ee7e313f03 hyperv/vmbus: Move GPADL index into vmbus_softc
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6954
2016-07-12 07:49:38 +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
f24517f037 hyperv/vmbus: Minor renaming
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6919
2016-07-12 05:55:11 +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
fc7ddc1e23 hyperv: Nuke unused stuffs
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6917
2016-07-12 05:23:14 +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
44d03f9a5f hyperv/vmbus: Avoid tx_evtflags setting code duplication.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6915
2016-07-12 04:58:21 +00:00
Sepherosa Ziehau
88d2677299 hyperv/vmbus: Flatten channel message response processing.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6914
2016-07-12 04:35:32 +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
e90ec741f9 hyperv/vmbus: Use post message Hypercall APIs for GPA disconnect
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6912
2016-07-12 03:32:07 +00:00
Sepherosa Ziehau
e9bd7c4417 hyperv/vmbus: Use post message Hypercall APIs for channel close
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6906
2016-07-12 03:25:36 +00:00
Sepherosa Ziehau
2bf62f9a89 hyperv/vmbus: Use post message Hypercall APIs for GPADL connect.
This also fixes memory leakge if sub-connect messages are needed.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6878
2016-07-12 03:19:40 +00:00
Sepherosa Ziehau
df9f40d810 hyperv/vmbus: Remove unnecessary check and unapplied comment
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6877
2016-07-12 03:14:35 +00:00
Sepherosa Ziehau
fc1208d658 hyperv/vmbus: Use post message Hypercall APIs for channel open
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6876
2016-07-12 03:09:10 +00:00
Sepherosa Ziehau
796a90bf5d hyperv/vmbus: Reorganize vmbus scan process.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6875
2016-07-12 03:03:17 +00:00
Sepherosa Ziehau
7a49521a4b hyperv/stor: Save the response status and xfer length properly.
The current command response handling discards status and xfer
length unconditionally, so that all of the commands would be
considered successful, even if errors happened.  When errors
really happens, this causes all kinds of wiredness, since the
buffer will not be filled on the host side and sense data will
be ignored.

Most of the time, errors do not happen, however, error does
happen for the request sent immediately after the disk resizing.
Discarding the SCSI status (SCSI_STATUS_CHECK_COND) and sense
data (capacity changes) prevents the disk resizing from working
properly.

This commit saves the response status and xfer length properly
for later use.

Submitted by:	Dexuan Cui <decui microsoft com>
Noticed by:	sephe
MFC after:	3 days
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7181
2016-07-12 02:57:13 +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
fd5831c624 hyperv/vmbus: Create channel synchronously.
The device probe/attach has been move to a different thread, so the
reasons to create the channel asynchronously are no longer valid.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6862
2016-07-11 07:45:31 +00:00
Sepherosa Ziehau
1ecb24660f hyperv/vmbus: Use post message Hypercall APIs for unload
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6861
2016-07-11 07:28:15 +00:00
Sepherosa Ziehau
47a3ee5c60 hyperv/vmbus: Add sysctl to expose vmbus version.
Requested by:	Hongxiong Xian <v-hoxian microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6860
2016-07-11 06:55:02 +00:00
Sepherosa Ziehau
833cfa5fcb hyperv/vmbus: Explicitly assign channel message process array.
While I'm here, remove the useless message type from message process
array, which is not used and serves no purposes at all.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6858
2016-07-11 06:37:04 +00:00
Sepherosa Ziehau
dd012a57a7 hyperv/vmbus: Function renaming.
And pass vmbus_softc to vmbus_doattach()

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6842
2016-07-11 06:29:56 +00:00
Sepherosa Ziehau
57bb267df3 hyperv/hn: Add tunable to allow tcp_lro_queue_mbuf()
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6841
2016-07-11 06:23:01 +00:00
Sepherosa Ziehau
c1cc5bdfe8 hyperv/vmbus: Use post message Hypercall APIs for channel request
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6831
2016-07-11 06:11:24 +00:00
Sepherosa Ziehau
2d774f207c hyperv/stor: Fix the INQUIRY checks
Don't check the area that the host has not filled.

PR:		https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209443
PR:		https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210425
Submitted by:	Hongjiang Zhang <honzhan microsoft com>
Reviewed by:	sephe, Dexuan Cui <decui microsoft com>
MFC after:	3 days
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6955
2016-07-11 05:17:48 +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
51a9a000ee hyperv/vmbus: Change tx_evtflags type to u_long to match vmbus_evtflags
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6745
2016-06-08 07:47:21 +00:00
Sepherosa Ziehau
6523ab7e00 hyperv/vmbus: Busdma-fy MNF and event flags.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6744
2016-06-08 05:34:22 +00:00
Sepherosa Ziehau
36ad8372d4 net: Use M_HASHTYPE_OPAQUE_HASH if the mbuf flowid has hash properties
Reviewed by:	hps, erj, tuexen
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6688
2016-06-07 04:51:50 +00:00
Sepherosa Ziehau
43926ba13f hyperv/vmbus: Constify channel message
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6708
2016-06-06 07:39:44 +00:00
Sepherosa Ziehau
12ea25ae4f hyperv/vmbus: Factor out channel message processing
This paves the way for further cleanup.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6707
2016-06-06 07:27:57 +00:00
Sepherosa Ziehau
fa4828b0ab hyperv/vmbus: Define type for channel messages.
And fix message processing; only channel messages are supported.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6706
2016-06-06 06:18:18 +00:00
Sepherosa Ziehau
d8bf51683d hyperv: Move machine dependent bits into machine dependent files.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6701
2016-06-06 05:55:37 +00:00
Sepherosa Ziehau
b7bb4816a0 hyperv: Rename some cleaned up/almost cleaned up files
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-06-01 09:20:52 +00:00
Sepherosa Ziehau
5d8fdc7fe4 hyperv/channel: Only cpu0 is supported as channel target cpu on WIN7
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-06-01 07:11:54 +00:00