History log of /freebsd-10-stable/sys/dev/hyperv/include/hyperv.h
Revision Date Author Comments
# 324573 13-Oct-2017 sephe

MFC 324488

hyperv/vmbus: Expose Hyper-V major version.

Sponsored by: Microsoft


# 324461 10-Oct-2017 sephe

MFC 322488

hyperv: Update copyright for the files changed in 2017

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11982


# 314018 21-Feb-2017 sephe

MFC 311743

hyperv: Add method to read 64bit Hyper-V specific time value.

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D9057


# 311223 04-Jan-2017 sephe

MFC 310048,310101

310048
hyperv: Implement "enlightened" time counter, which is rdtsc based.

Reviewed by: kib
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8763

310101
hyperv: Allow userland to ro-mmap reference TSC page

This paves way to implement VDSO for the enlightened time counter.

Reviewed by: kib
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8768


# 310801 30-Dec-2016 sephe

MFC 309705

hyperv/timesync: Support "sent TC" to improve accuracy.

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8723


# 308515 11-Nov-2016 sephe

MFC 308194

hyperv: GC unused functions.

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8406


# 307133 12-Oct-2016 sephe

MFC 303421,303422,303470-303473

303421
hyperv/vmbus: Avoid unnecessary mb()

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7333

303422
hyperv/vmbus: Inclusion cleanup

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7334

303470
hyperv/vmbus: Reindent function declarations.

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7344

303471
hyperv/vmbus: Forward declare static functions

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7346

303472
hyperv/vmbus: Move driver glue to the beginning of the files

Just as most of other drivers do. And move sysinit function close
to its SYSINIT.

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7347

303473
hyperv/vmbus: Revoke unnecessary exposure of vmbus softc

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7348


# 307096 11-Oct-2016 sephe

MFC 303066-303072,303127-303129,303131

303066
hyperv/vmbus: Get rid of unnecessary definition.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7240

303067
hyperv/vmbus: Move IC register definition to Hyper-V utilities

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7241

303068
hyperv/vmbus: Channel struct field rename

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7242

303069
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.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7243

303070
hyperv/vmbus: Deprecate the device private data in channel struct

They are neither flexible nor extensible.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7244

303071
hyperv/vmbus: Hide channel struct definition.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7245

303072
hyperv/vmbus: Save MNF trigger location instead of MNF trigger index.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7246

303127
hyperv/vmbus: Save event flag location and evet flag mask.

This avoids unnecessary access to the vmbus_softc struct on sending path.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7257

303128
hyperv/vmbus: Reorder channel fields.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7258

303129
hyperv/vmbus: Shuffle function declaration and macro definition.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7259

303131
hyperv: hv_vmbus_channel -> vmbus_channel

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7260


# 307084 11-Oct-2016 sephe

MFC 302888-302892,302986,303020-303022

302888
hyperv/hn: Busdma-fy rxbuf and chimney sending buffer

Nuke unused channel GPADL API.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7211

302889
hyperv/vmbus: Back out r302888 temporarily

Committed by accident w/ duplicated commit log

Sponsored by: Microsoft OSTC

302890
hyperv/vmbus: Function rename

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7212

302891
hyperv/vmbus: Cosmetic vmbus channel close cleanup

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7213

302892
hyperv/vmbus: Cleanup channel sysctl tree creation

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7214

302986
hyperv/vmbus: Cosmetic vmbus channel open cleanup

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7217

303020
hyperv/vmbus: Cleanup cpu based channel selection.

And create cpu to channel map at device attach time for storvsc(4).

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7229

303021
hyperv/vmbus: Function rename

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7230

303022
hyperv/vmbus: Temp/internal variable/function rename

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7231


# 307081 11-Oct-2016 sephe

MFC 302887

hyperv/hn: Busdma-fy rxbuf and chimney sending buffer

Nuke unused channel GPADL API.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7211


# 307080 11-Oct-2016 sephe

MFC 302885,302886

302885
hyperv/vmbus: Cleanup channel receiving.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7202

302886
hyperv/vmbus: Cleanup channel packet receiving.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7204


# 307079 11-Oct-2016 sephe

MFC 302882-302884

302882
hyperv/vmbus: Function rename

And reorder the error prone parameters list.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7191

302883
hyperv/vmbus: Field rename

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7193

302884
hyperv/vmbus: Factor out macros to do channel packet length conversion.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7194


# 307034 11-Oct-2016 sephe

MFC 302875,302876,302878-302881

302875
hyperv/vmbus: Redefine channel packet.

The channel packet header will be shared w/ PRP (physical region page)
list channel packet and SG (scatter gather) list channel packet.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7155

302876
hyperv/vmbus: Rework sglist sending.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7156

302878
hyeprv/vmbus: Rework prplist sending.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7175

302879
hyperv/vmbus: Move channel packet flags definition to vmbus.h

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7176

302880
hyperv/vmbus: Move channel packet types definition to vmbus.h

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7177

302881
hyperv/vmbus: Cleanup channel sending

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7178


# 307033 11-Oct-2016 sephe

MFC 302873,302874

302873
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.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7141

302874
hyperv/vmbus: Field rename

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7146


# 307032 11-Oct-2016 sephe

MFC 302871,302872

302871
hyperv/vmbus: Add vmbus_chan_gpadl_connect, which takes GPA physaddr

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7139

302872
hyperv/vmbus: Busdma-fy channel bufring.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7140


# 307029 11-Oct-2016 sephe

MFC 302819,302823

302819
hyperv/vmbus: Sub-channel related fields renaming

And reorganize comment.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7113

302823
hyperv/vmbus: Move bus related message processing into vmbus.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7125


# 307028 11-Oct-2016 sephe

MFC 302816-302818

302816
hyperv/vmbus: Release vmbus channel lock before detach devices

Device detach method may sleep.

While I'm here, rename the function, fix indentation and function
comment.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7110

302817
hyperv/vmbus: Field renaming to reflect reality

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7111

302818
hyperv/vmbus: Fix the racy channel close.

It is not safe to iterate the sub-channel list w/o lock on the
close path, while it's even more difficult to hold the lock
and iterate the sub-channel list. We leverage the
vmbua_{get,rel}_subchan() functions to solve this dilemma.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7112


# 307027 11-Oct-2016 sephe

MFC 302808-302815

302808
hyperv/vmbus: Alloc/Free monitor param in vmbus channel alloc/free.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7101

302809
hyperv/vmbus: Move device register and channel free to the caller.

This paves the way for more cleanup/disentangle.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7102

302810
hyperv/vmbus: Move new channel scan notification to device register

And nuke now unnecessary function indirection.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7103

302811
hyperv/vmbus: Cleanup vmbus_chan_msgproc_choffer

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7104

302812
hyperv/vmbus: Nuke the channel open state.

Channel is either opened or not-opened.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7105

302813
hyperv/vmbus: Cleanup vmbus_chan_add()

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7106

302814
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.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7108

302815
hyperv/vmbus: Only add primary channels to vmbus channel list

- Make the vmbus_chan_add more straightforward.
- Partially fix the hv_vmbus_release_unattached_channels().

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7109


# 307026 11-Oct-2016 sephe

MFC 302733,302737,302801-302806

302733
hyperv/vmbus: Remove unused code

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7089

302737
hyperv/vmbus: Cleanup channel rescind

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7090

302801
hyperv/vmbus: Remove unused bits

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7091

302802
hyperv: hv_guid -> struct hyperv_guid.

This paves way for the further cleanup/disentangle.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7092

302803
hyperv/vmbus: Move channel offer message definition to vmbus_reg.h

- Avoid bit fields.
- Avoid unnecessary indirection.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7093

302804
hyperv/vmbus: Switch to vmbus channel message macros

Prepare for more cleanup.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7094

302805
hyperv/vmbus: Remove unused bits

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7095

302806
hyperv/vmbus: Get rid of rel{_id,id}, use channel id consistently.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7100


# 307025 11-Oct-2016 sephe

MFC 302723,302726,302731

302723
hyperv: All Hypercall parameters have same alignment requirement.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7086

302726
hyperv: Signal event input parameter is shared w/ MNF

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7087

302731
hyperv/vmbus: Reorganize MNF event sending.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7088


# 307023 11-Oct-2016 sephe

MFC 302707-302709

302707
hyperv/vmbus: Nuke unused field from hv_vmbus_channel.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7036

302708
hyperv/bufring: Remove unused fields

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7037

302709
hyperv/vmbus: Pack bool field into flags field

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7038


# 307022 11-Oct-2016 sephe

MFC 302698-302704,302706

302698
hyperv/vmbus: Add vmbus method for GUID base device probing.

Reduce the exposure of hv_device.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7024

302699
hyperv/vmbus: All ivars are read-only; nuke unnecessary write_ivar

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7025

302700
hyperv/vmbus: Add channel ivar accessor.

This makes life easier during the transition period to nuke the hv_device.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7026

302701
hyperv/stor: Avoid the hv_device and nuke the broken get_stor_device

This paves way to nuke the hv_device, which is actually an unncessary
indirection.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7027

302702
hyperv/util: Avoid the hv_device

This paves way to nuke the hv_device, which is actually an unncessary
indirection.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7028

302703
hyperv/vmbus: Deprecate the usage of hv_device.

This paves way to nuke the hv_device, which is actually an unncessary
indirection.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7032

302704
hyperv/hn: Avoid the hv_device

This paves way to nuke the hv_device, which is actually an unncessary
indirection.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7033

302706
hyperv: Get rid of hv_device, which is unnecessary indirection.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7034


# 307021 11-Oct-2016 sephe

MFC 302693-302697

302693
hyperv/vmbus: Make channel id a field of hv_vmbus_channel.

This prepares to remove the unnecessary offer message embedding in
hv_vmbus_channel.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7014

302694
hyperv/vmbus: Make subchan index a field of hv_vmbus_channel.

This prepares to remove the unnecessary offer message embedding in
hv_vmbus_channel.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7015

302695
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.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7019

302696
hyperv/vmbus: Add type/instance guid fields into hv_vmbus_channel

This prepares to remove the unnecessary offer message embedding in
hv_vmbus_channel.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7020

302697
hyperv/vmbus: Remove the embedded offer message from hv_vmbus_channel

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7021


# 307019 11-Oct-2016 sephe

MFC 302632-302634

302632
hyperv/vmbus: More verbose for GPADL_connect/chan_{rescind,offer}

Reviewed by: Dexuan Cui <decui microsoft com>, Hongjiang Zhang <honzhan microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6976

302633
hyperv/vmbus: Free sysctl properly upon channel close.

Prepare for sub-channel re-open.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6977

302634
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.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6978


# 307018 11-Oct-2016 sephe

MFC 302617-302621,302623,302629-302631

302617
hyperv/vmbus: Flatten channel message response processing.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6914

302618
hyperv/vmbus: Avoid tx_evtflags setting code duplication.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6915

302619
hyperv/vmbus: Busdma-fy Hypercall signal event input parameter.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6916

302620
hyperv: Nuke unused stuffs

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6917

302621
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.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6918

302623
hyperv/vmbus: Minor renaming

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6919

302629
hyperv/vmbus: Rework vmbus version accessing.

Instead of global variable, vmbus version is accessed through
a vmbus DEVMETHOD now.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6953

302630
hyperv/vmbus: Move GPADL index into vmbus_softc

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6954

302631
hyperv/vmbus: Move channel list to vmbus_softc

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6956


# 307017 11-Oct-2016 sephe

MFC 302607-302612

302607
hyperv/vmbus: Use post message Hypercall APIs for channel open

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6876

302608
hyperv/vmbus: Remove unnecessary check and unapplied comment

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6877

302609
hyperv/vmbus: Use post message Hypercall APIs for GPADL connect.

This also fixes memory leakge if sub-connect messages are needed.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6878

302610
hyperv/vmbus: Use post message Hypercall APIs for channel close

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6906

302611
hyperv/vmbus: Use post message Hypercall APIs for GPA disconnect

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6912

302612
hyperv: Nuke unused stuffs

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6913


# 307016 11-Oct-2016 sephe

MFC 302543,302545,302547,302549,302554,302556,302557,302559,302606

302543
hyperv/vmbus: Use post message Hypercall APIs for channel request

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6831

302545
hyperv/vmbus: Function renaming.

And pass vmbus_softc to vmbus_doattach()

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6842

302547
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.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6858

302549
hyperv/vmbus: Add sysctl to expose vmbus version.

Requested by: Hongxiong Xian <v-hoxian microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6860

302554
hyperv/vmbus: Use post message Hypercall APIs for unload

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6861

302556
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.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6862

302557
hyperv/vmbus: Save vmbus softc to channels.

So that we don't need to access the global vmbus softc.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6863

302559
hyperv/vmbus: Embed channel detach task in channel itself.

GC work queue stuffs.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6864

302606
hyperv/vmbus: Reorganize vmbus scan process.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6875


# 307014 10-Oct-2016 sephe

MFC 302540

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.

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6830


# 302166 24-Jun-2016 sephe

MFC 301017,301018,301019,301020,301021,301022,301106

301017
hyperv/vmbus: Indentation cleanup

No functional changes.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6602

301018
hyperv/vmbus: Move global vmbus id array to stack.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6603

301019
hyperv/vmbus: Redefine SynIC message.

- Avoid unnecessary indirection.
- Avoid bit fields.
- Use __packed.

Reviewed by: Jun Su <junsu microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6636

301020
hyperv/vmbus: White space cleanup

No functional changes

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6637

301021
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

301022
hyperv/kvp: Use if_xname.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6641

301106
hyperv/vmbus: Redefine event flags.

- Nuke unnecessary union.
- Avoid convoluted macro indirection.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6671


# 302048 21-Jun-2016 sephe

MFC 298569,298570,298571,298572,298574,298575,298613,298614,298615,298616,298617

298569
hyperv/channel: Remove the unnecessary 'new' flag

MFC after: 1 week
Sponsored by: Microsoft OSTC

298570
hyperv/channel: Minor style changes; no functional changes.

MFC after: 1 week
Sponsored by: Microsoft OSTC

298571
hyperv/channel: Remove unapplied comment

MFC after: 1 week
Sponsored by: Microsoft OSTC

298572
hyperv/channel: Log a warning about duplicated primary channel offer

MFC after: 1 week
Sponsored by: Microsoft OSTC

298574
hyperv/channel: Add functions to synchronize sub-channel offers

MFC after: 1 week
Sponsored by: Microsoft OSTC

298575
hyperv/hn: Synchronize sub-channel offers

MFC after: 1 week
Sponsored by: Microsoft OSTC

298613
hyperv/stor: Remove the useless hs_open_multi_channel

This fixes the sub-channel offer race after Hyper-V device probe/attach
is moved to vmbus SYSINIT/attach.

MFC after: 1 week
Sponsored by: Microsoft OSTC

298614
hyperv/stor: Synchronize sub-channel offers

MFC after: 1 week
Sponsored by: Microsoft OSTC

298615
hyperv/hn: Avoid sub-channel creation callback.

Since the sub-channel offers are synchronized, we can do our own
channel setup without using the sub-channel creation callback.

This paves the way to whack the sub-channel creation callback.

MFC after: 1 week
Sponsored by: Microsoft OSTC

298616
hyperv/stor: Avoid sub-channel creation callback.

Since the sub-channel offers are synchronized, we can do our own
channel setup without using the sub-channel creation callback.

This paves the way to whack the sub-channel creation callback.

MFC after: 1 week
Sponsored by: Microsoft OSTC

298617
hyperv/channel: Git rid of the sub-channel creation callback

It is no longer used.

MFC after: 1 week
Sponsored by: Microsoft OSTC


# 302045 21-Jun-2016 sephe

MFC 298446

hyperv: Update copyright to 2016 for the files Microsoft changed in 2016

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6039


# 301946 16-Jun-2016 sephe

MFC 297142,297143,297176,297177,297178,297221

297142
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

297143
hyperv/vmbus: Implement bus_child_pnpinfo_str method

Submitted by: Jun Su <junsu microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5669

297176
hyperv/evttimer: Use an independent message slot so that it can work

Using the same message slot as the other types of the messages has
the side effect that the event timer message could be deferred to
the swi threads to run (lacking of trapframe and the original code
didn't even handle that, so the event timer was actually broken).

As of this commit we use an independent message slot for event timer,
so that we could handle all of event timer messages in the interrupt
handler directly. Note, the message slot for event timer is still
bind to the same interrupt vector as the other types of messages.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: sephe
Discussed with: Jun Su <junsu microsoft com>, Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5696

297177
hyperv/vmbus: Use taskqueue_fast for non-performance critical messages

This gets rid of the per-cpu SWIs.

Submitted by: Jun Su <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/D5215

297178
hyperv/vmbus: Remove NULL check for taskqueue_create_fast(M_WAITOK)

Submitted by: Jun Su <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/D5215

297221
hyperv/vmbus: Create per-cpu fast taskqueue for msg handling

Using one taskqueue does not work, since the EOM MSR must be written
on the msg's owner CPU.

Noticed by: Jun Su <junsu microsoft com>
Discussed with: Jun Su <junsu microsoft com>, Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC


# 301943 16-Jun-2016 sephe

MFC 296379,296380,296381,296593,296594,296595

296379
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

296380
hyperv/hn: Pass channel to send done callbacks.

Mainly to strigent the data packet send done check.

MFC after: 2 weeks
Sponsored by: Microsoft OSTC

296381
hyperv/hn: Add per-TX ring stats for # of transmitted packets

MFC after: 2 weeks
Sponsored by: Microsoft OSTC

296593
hyperv/hn: Move if_initname to an earlier place

So that functions shared w/ attach path could use if_printf().

While I'm here, remove unnecessary if_dunit and if_dname assignment.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5576

296594
hyperv/hn: Factor out hn_channel_attach

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5577

296595
hyperv/hn: Make the # of TX rings configurable.

Rename the tunables to avoid confusion.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5578


# 301918 15-Jun-2016 sephe

MFC 296293,296296,296297,296305

296293
hyperv/hn: Pass channel to hv_nv_on_receive_completion()

While I'm here, staticize this function.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
Modified by: sephe
MFC after: 1 week
Sponsored by: Microsoft OSTC

296296
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

296297
hyperv/hn: Fix typo in comment

MFC after: 1 week
Sponsored by: Microsoft OSTC

296305
hyperv/hn: Make # of rings configurable

And since the host may not being able to allocate the # of rings
requested by us, save the # of rings allocated by the host in the
ring_inuse counters; use ring_inuse counters for run time operation.

This paves the way for the upcoming vRSS support.

MFC after: 1 week
Sponsored by: Microsoft OSTC


# 301912 15-Jun-2016 sephe

MFC 296083,296084,296085,296086,296087,296088,296089

296083
hyperv: Remove useless channel inbound_lock

It serves no purpose.

Reviewed by: Hongjiang Zhang <honzhan microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5450

296084
hyperv: Always set device for channels

And unregister hv_device only for primary channels, who own the hv_device.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5451

296085
hyperv/hn: Pass channel as the channel callback argument

This is the preamble to pass channel back to hn(4) upon TX/RX done.

Reviewed by: Hongjiang Zhang <honzhan microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5452

296086
hyperv/hn: Pass channel to TX/RX done

This is preamble to associate the TX/RX rings to their channel.

While I'm here, revoke unused netvsc_recv_rollup.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5453

296087
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

296088
hyperv/hn: Remove the useless num_outstanding_sends

We rely on taskqueue draining now.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5456

296089
hyperv/hn: Make transmission path channel aware

Chimney sending buffer still needs conversion, which will be done
along with the upcoming vRSS support.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5457


# 301866 13-Jun-2016 sephe

MFC 295919,295958,295964

295919
hyperv/stor: Fix print format

Detected by: PVS Static Analysis
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5388

295958
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

295964
hyperv/vmbus: Use free(9) for interrupt page; it is allocated by malloc(9)

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5417


# 301859 13-Jun-2016 sephe

MFC 295307,295308,295309,295606

295307
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

295308
hyperv: Use WAITOK in the places where we can wait

And convert rndis non-hot path spinlock to mutex.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: adrian, sephe
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5081

295309
hyperv: Use malloc for page allocation.

We will eventually convert them to use busdma.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: adrian, sephe, Dexuan Cui <decui microsoft com>
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5087

295606
hyperv/hn: Fix typo in comment

Noticed by: avos
Reviewed by: adrian, avos, Hongjiang Zhang <honzhan microsoft com>
Approved by: adrian
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5199


# 301854 13-Jun-2016 sephe

MFC 294886

hyperv/vmbus: Event handling code refactor.

- Use taskqueue instead of swi for event handling.
- Scan the interrupt flags in filter
- Disable ringbuffer interrupt mask in filter to ensure no unnecessary
interrupts.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: adrian, sephe, Dexuan <decui microsoft com>
Approved by: adrian (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D4920


# 295789 19-Feb-2016 sephe

MFC [Hyper-V]: r293719-r293722, r293869-r293871, r293873-r293875, r293877

r293719 hyperv/hn: Implement LRO
r293720 hyperv/hn: Implement SIOC[SG]IFMEDIA support
r293721 hyperv/hn: Avoid mbuf cluster allocation, if the packet is small.
r293722 hyperv/hn: Removed unused netvsc_init()
r293869 hyperv/hn: Unbreak LINT-NOIP
r293870 hyperv: use x86 generic code to do the hypervisor detection
r293871 hyperv: remove unused vmbus definitions
r293873 hyperv: implement an event timer
r293874 hyperv: add interrupt counters
r293875 hyperv: set receive buffer size according to NVSP protocol version
r293877 Unbreak `make depend` with sys/modules/hyperv/vmbus after r293870

Approved by: re (glebius), adrian (mentor)
Sponsored by: Microsoft OSTC


# 293820 13-Jan-2016 delphij

MFC r292861:

hyperv: vmbus: run non-blocking message handlers in vmbus_msg_swintr()

We'll remove the per-channel control_work_queue because it can't properly
do serialization of message handling, e.g., when there are 2 NIC devices,
vmbus_channel_on_offer() -> hv_queue_work_item() has a race condition:
for an SMP VM, vmbus_channel_process_offer() can run concurrently on
different CPUs and if the second NIC's
vmbus_channel_process_offer() -> hv_vmbus_child_device_register() runs
first, the second NIC's name will be hn0 and the first NIC's name will
be hn1!

We can fix the race condition by removing the per-channel control_work_queue
and run all the message handlers in the global
hv_vmbus_g_connection.work_queue -- we'll do this in the next patch.

With the coming next patch, we have to run the non-blocking handlers
directly in the kernel thread vmbus_msg_swintr(), because the special
handling of sub-channel: when a sub-channel (e.g., of the storvsc driver)
is received and being handled in vmbus_channel_on_offer() running on the
global hv_vmbus_g_connection.work_queue, vmbus_channel_process_offer()
invokes channel->sc_creation_callback, i.e., storvsc_handle_sc_creation,
and the callback will invoke hv_vmbus_channel_open() -> hv_vmbus_post_message
and expect a further reply from the host, but the handling of the further
messag can't be done because the current message's handling hasn't finished
yet; as result, hv_vmbus_channel_open() -> sema_timedwait() will time out
and th device can't work.

Also renamed the handler type from hv_pfn_channel_msg_handler to
vmbus_msg_handler: the 'pfn' and 'channel' in the old name make no sense.

Submitted by: Dexuan Cui <decui microsoft com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D4596

MFC r292859:

hyperv: vmbus: remove the per-channel control_work_queue

Now vmbus_channel_on_offer() -> vmbus_channel_process_offer() can
safely run on the global hv_vmbus_g_connection.work_queue now.

We remove the per-channel control_work_queue to achieve the proper
serialization of the message handling.

I removed the bogus TODO in vmbus_channel_on_offer(): a vmbus offer
can only come from the parent partition, i.e., the host.

PR: kern/205156
Submitted by: Dexuan Cui <decui microsoft com>
Reviewed by: Howard Su <howard0su gmail com>, delphij
Differential Revision: https://reviews.freebsd.org/D4597


# 285236 07-Jul-2015 whu

MFC r284746 and r284889 TSO and checksum offloading support for Netvsc
driver on Hyper-V.

Submitted by: whu
Reviewed by: royger
Approved by: re
Relnotes: yes
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D2906


# 283280 22-May-2015 whu

MFC r282212:

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
Approved by: royger
Relnotes: yes
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D2575


# 272322 30-Sep-2014 delphij

MFC r271493,271688-271689,271696,271854,272139-272143:

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.

Approved by: re (gjb)


# 272152 26-Sep-2014 gjb

Properly revert r272128.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 272151 26-Sep-2014 gjb

Revert r272149, which introduces obscure vestiges from the
r272128 reversal.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 272149 25-Sep-2014 gjb

Revert r272128:
Though this passes the buildworld test, this fails during
installworld with:

make[3]: "/releng/scripts-release/chroots/10/i386/release/etc/devd/Makefile"
line 13: Malformed conditional (${MK_HYPERV} != "no")

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 272128 25-Sep-2014 delphij

MFC r271493,271688,271689,271696,271854:

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.

Approved by: re (gjb)


# 256352 11-Oct-2013 grehan

MFC r256350

Fix vmbus channel memory leak where incorrect length parameter was
being passed to contigfree().

Approved by: re@ (glebius)


# 285236 07-Jul-2015 whu

MFC r284746 and r284889 TSO and checksum offloading support for Netvsc
driver on Hyper-V.

Submitted by: whu
Reviewed by: royger
Approved by: re
Relnotes: yes
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D2906


# 283280 22-May-2015 whu

MFC r282212:

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
Approved by: royger
Relnotes: yes
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D2575


# 272322 30-Sep-2014 delphij

MFC r271493,271688-271689,271696,271854,272139-272143:

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.

Approved by: re (gjb)


# 272152 26-Sep-2014 gjb

Properly revert r272128.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 272151 26-Sep-2014 gjb

Revert r272149, which introduces obscure vestiges from the
r272128 reversal.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 272149 25-Sep-2014 gjb

Revert r272128:
Though this passes the buildworld test, this fails during
installworld with:

make[3]: "/releng/scripts-release/chroots/10/i386/release/etc/devd/Makefile"
line 13: Malformed conditional (${MK_HYPERV} != "no")

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 272128 25-Sep-2014 delphij

MFC r271493,271688,271689,271696,271854:

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.

Approved by: re (gjb)


# 256352 11-Oct-2013 grehan

MFC r256350

Fix vmbus channel memory leak where incorrect length parameter was
being passed to contigfree().

Approved by: re@ (glebius)