Commit Graph

41 Commits

Author SHA1 Message Date
Sepherosa Ziehau
1feb13270d hyperv/ic: Cleanup shutdown channel callback.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7744
2016-09-02 06:15:30 +00:00
Sepherosa Ziehau
9c040f41df hyperv/ic: Minor style fix.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7743
2016-09-02 06:08:08 +00:00
Sepherosa Ziehau
4bddf0c813 hyperv/timesync: Rework time adjustment policy
- By default, adjust time upon SYNC request.  It can be disabled
  through hw.hvtimesync.ignore_sync_req.  SYNC request will be
  sent by hypervisor the host is resumed, rebooted, etc.
- By default, adjust time upon SAMPLE request, if there is 100ms
  difference between VM time and hypervisor time.  This can be
  disabled through hw.hvtimesync.sample_drift.

And nuke the unnecessary task, since channel callback is running
in a Hyper-V taskqueue nowadays.

Submitted by:	YanZhe Chen <t-yachen microsoft com>
Discussed with:	Dexuan Cui <decui microsoft com>, Hongjiang Zhang <honzhan microsoft com>, sephe
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7707
2016-08-31 06:00:20 +00:00
Sepherosa Ziehau
c72fc9d2b9 hyperv/ic: Update total message size if negotiate message size grows.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7627
2016-08-25 05:24:57 +00:00
Sepherosa Ziehau
02d9926559 hyperv/ic: Cleanup heartbeat channel callback.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7626
2016-08-25 05:11:04 +00:00
Sepherosa Ziehau
8f555c7d0a hyperv/ic: Redefine IC version negotiate message.
And stringent input IC version negotiate message checks.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7614
2016-08-24 04:36:04 +00:00
Sepherosa Ziehau
5afcbd41b5 hyperv/kvp: Remove unnecessary function parameter.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7550
2016-08-18 06:03:55 +00:00
Sepherosa Ziehau
c4b78a2628 hyperv/util: Factor out helper for IC device_probe DEVMETHOD
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7530
2016-08-17 08:38:49 +00:00
Sepherosa Ziehau
eacbe92463 hyperv/util: Don't reference hn_softc in KVP
hn_softc is private data struct.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7519
2016-08-17 08:26:08 +00:00
Sepherosa Ziehau
f077729dbd hyperv/ic: Pass the channel callback to hv_util_attach()
The saved channel callback in util softc is actually never used.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7424
2016-08-08 06:18:54 +00:00
Sepherosa Ziehau
9b6306f287 hyperv/ic: Expose the receive buffer length for callers to use.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7423
2016-08-08 06:11:28 +00:00
Sepherosa Ziehau
f5207880ba hyperv/ic: Remove never used second parameter of hv_negotiate_version()
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7422
2016-08-08 05:57:38 +00:00
Sepherosa Ziehau
7d8ee480c4 hyperv/vmbus: Inclusion cleanup
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7334
2016-07-28 06:46:10 +00:00
Sepherosa Ziehau
82b8a87964 hyperv: hv_vmbus_channel -> vmbus_channel
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7260
2016-07-21 06:09:47 +00:00
Sepherosa Ziehau
6254947245 hyperv/vmbus: Hide channel struct definition.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7245
2016-07-20 06:00:27 +00:00
Sepherosa Ziehau
ca871fb75c hyperv/vmbus: Pass channel as the first argument for channel callback
The prepares to kill device private fields in channel struct, which
are not flexible and extensible.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7243
2016-07-20 05:34:28 +00:00
Sepherosa Ziehau
4cd995ff5d hyperv/vmbus: Move IC register definition to Hyper-V utilities
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7241
2016-07-20 05:16:23 +00:00
Sepherosa Ziehau
e93854c495 hyperv/vmbus: Function rename
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7230
2016-07-19 05:57:19 +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
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
2d19acf75b hyperv/util: Avoid the 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/D7028
2016-07-13 05:35:28 +00:00
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
7f9e539e14 hyperv/kvp: Use if_xname.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6641
2016-05-31 06:00:18 +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
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
Pedro F. Giffuni
74b8d63dcc Cleanup unnecessary semicolons from the kernel.
Found with devel/coccinelle.
2016-04-10 23:07:00 +00:00
Sepherosa Ziehau
0fc8db6eed hyperv/utils: Allow hint to disable individual utility
Reviewed by:	kib, Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5714
2016-03-24 01:12:28 +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
0bc2abddc8 hyperv/utils: Code rearrange and cleanup
Split heartbeat, shutdown and timesync out of utils code
and name them properly.

Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	adrian, sephe, Hongjiang Zhang <honzhan microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5216
2016-02-24 05:01:18 +00:00
Sepherosa Ziehau
f11ef33f0d hyperv: Use standard taskqueue instead of hv_work_queue
HyperV code was ported from Linux.  There is an implementation of
work queue called hv_work_queue.  In FreeBSD, taskqueue could be
used for the same purpose.  Convert all the consumer of hv_work_queue
to use taskqueue, and remove work queue implementation.

Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	adrian, Hongjiang Zhang <honzhan microsoft com>
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D4963
2016-02-05 07:09:58 +00:00
Roger Pau Monné
f3b0813aee hyperv/kvp: wake up the daemon if it's sleeping due to poll()
Without the patch, there is a race condition: when poll() is invoked(),
if kvp_globals.daemon_busy is false, the daemon won't be timely
woke up, because hv_kvp_send_msg_to_daemon() can't wake up the daemon
in this case.

Submitted by:           Dexuan Cui <decui@microsoft.com>
Sponsored by:		Microsoft OSTC
Reviewed by:		delphij, royger
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D4258
2015-12-15 11:20:20 +00:00
Wei Hu
da2f98a1cf Microsoft vmbus, storage and other related driver enhancements for HyperV.
- Vmbus multi channel support.
    - Vector interrupt support.
    - Signal optimization.
    - Storvsc driver performance improvement.
    - Scatter and gather support for storvsc driver.
    - Minor bug fix for KVP driver.
Thanks royger, jhb and delphij from FreeBSD community for the reviews
and comments. Also thanks Hovy Xu from NetApp for the contributions to
the storvsc driver.

PR:     195238
Submitted by:   whu
Reviewed by:    royger, jhb, delphij
Approved by:    royger
MFC after:      2 weeks
Relnotes:       yes
Sponsored by:   Microsoft OSTC
2015-04-29 10:12:34 +00:00
Xin LI
20e27addbf Return BUS_PROBE_DEFAULT instead of BUS_PROBE_VENDOR or 0 for in-tree
driver.  This change was verified by Microsoft.
2014-10-24 06:27:45 +00:00
Xin LI
e72055b7fe Import HyperV Key-Value Pair (KVP) driver and daemon code by Microsoft,
many thanks for their continued support of FreeBSD.

While I'm there, also implement a new build knob, WITHOUT_HYPERV to
disable building and installing of the HyperV utilities when necessary.

The HyperV utilities are only built for i386 and amd64 targets.

This is a stable/10 candidate for inclusion with 10.1-RELEASE.

Submitted by:	Wei Hu <weh microsoft com>
MFC after:	1 week
2014-09-13 02:15:31 +00:00
Peter Grehan
2ee2dc6fd6 Revert the kvp code - there's still some work that
needs to be done for that.

Discussed with:	Microsoft hyper-v devs
2013-09-09 19:27:44 +00:00
Peter Grehan
d940bfec8c Latest update from Microsoft.
Obtained from:	Microsoft Hyper-v dev team
2013-09-09 08:07:46 +00:00
Peter Grehan
672ed870a7 IFC @ r253862
- change the SI_SUB_RUN_SCHEDULER sysinits in hv_utilc and
hv_netvsc_drv_freebsd.c to SI_SUB_KTHREAD_IDLE, since the
former is no longer in FreeBSD.
  The use of these SYSINITs can probably be removed.
2013-08-01 22:09:57 +00:00
Peter Grehan
cc759c1995 Microsoft have changed their policy on how the hyper-v code will
be pulled into FreeBSD. From now, FreeBSD will be considered the
upstream repo.

First step: move the drivers away from the contrib area and into
the base system.

A follow-on commit will include the drivers in the amd64 GENERIC kernel.
2013-07-17 06:30:23 +00:00