Commit Graph

291 Commits

Author SHA1 Message Date
Sepherosa Ziehau
eaaa9935d4 hyperv/vmbus: Implement vmbus_chan_printf.
And use it for vmbus channel logging, which can log the channel
owner's name properly, instead of vmbus0.

Submitted by:	QianYue You <t-youqi microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft
2016-10-26 05:06:23 +00:00
Sepherosa Ziehau
91833b0f3c hyperv/vmbus: Add missing white space.
Submitted by:	QianYue You <t-youqi microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft
2016-10-26 04:26:17 +00:00
Sepherosa Ziehau
e41136c060 hyperv/vmbus: Expose channel management taskqueue for driver to use.
MFC after:	3 days
Sponsored by:	Microsoft
2016-10-19 09:12:14 +00:00
Sepherosa Ziehau
4e3e6410ad hyperv/vmbus: Add __FBSDID
Sponsored by:	Microsoft
2016-10-14 05:47:59 +00:00
Sepherosa Ziehau
cca23e7c3c hyperv/vmbus: Allow driver to inject synchronous task into channel taskq.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8208
2016-10-11 02:43:23 +00:00
Sepherosa Ziehau
c8e8d13398 hyperv/vmbus: Add function to drain channel interrupt task.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8045
2016-09-28 04:25:25 +00:00
Sepherosa Ziehau
e8223cc6cf hyperv/vmbus: Add functions to test RX/TX bufring emptiness
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8044
2016-09-28 04:08:20 +00:00
Sepherosa Ziehau
9f06037b0d hyperv/vmbus: Add dynamic device add and remove support
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8008
2016-09-27 06:30:24 +00:00
Sepherosa Ziehau
d1c1d97e6a hyperv/vmbus: Assert that the bufring address is page aligned.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7962
2016-09-21 06:43:52 +00:00
Sepherosa Ziehau
9613ad24b0 hyperv/vmbus: Allow bufrings preallocation.
The assumption that the channel is only opened upon synthetic device
attach time no longer holds, e.g. Hyper-V network device MTU changes.
We have to allow device drivers to preallocate bufrings, e.g. in
attach DEVMETHOD, to prevent bufring allocation failure once the
system memory is fragmented after running for a while.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7960
2016-09-21 05:56:47 +00:00
Sepherosa Ziehau
67e44048f0 hyperv/vmbus: Make sure that the sub-channel count is valid.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7865
2016-09-14 06:30:14 +00:00
Sepherosa Ziehau
19c8ea1086 hyperv/vmbus: Stringent header length and total length check.
While I'm here, minor style changes.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7752
2016-09-05 03:21:31 +00:00
Sepherosa Ziehau
dd9af4103b hyperv/vmbus: Add function to calculate max # of elements in a bufring.
MFC after:	1 week
Sponsored by:	Microsoft
2016-08-25 05:35:51 +00:00
Sepherosa Ziehau
3dba61dd3c hyperv/vmbus: Use xact APIs to implement post message Hypercall APIs
Avoid code duplication.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7458
2016-08-11 06:24:17 +00:00
Sepherosa Ziehau
6212aa15fc hyperv/vmbus: Add APIs for various types of transactions.
Reviewed by:	Jun Su <junsu microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7456
2016-08-11 05:49:49 +00:00
Sepherosa Ziehau
6fd14eb940 hyperv/vmbus: Only make sure the TX bufring will not be closed.
KVP can write data, whose size is > 1/2 TX bufring size.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7414
2016-08-05 08:57:51 +00:00
Sepherosa Ziehau
9d6016a773 hyperv/vmbus: Remove the artificial entry limit of SG and PRP list.
Just make sure that the total channel packet size does not exceed 1/2
data size of the TX bufring.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7359
2016-08-01 04:26:24 +00:00
Sepherosa Ziehau
c0c9089709 hyperv/vmbus: Revoke unnecessary exposure of vmbus softc
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7348
2016-07-29 06:10:27 +00:00
Sepherosa Ziehau
fd42dfc550 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.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7347
2016-07-29 05:58:24 +00:00
Sepherosa Ziehau
5b444edabc hyperv/vmbus: Forward declare static functions
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7346
2016-07-29 05:49:12 +00:00
Sepherosa Ziehau
8018156f90 hyperv/vmbus: Reindent function declarations.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7344
2016-07-29 03:16:51 +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
0bc135dffc hyperv/vmbus: Avoid unnecessary mb()
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7333
2016-07-28 06:30:29 +00:00
Sepherosa Ziehau
dc831186e3 hyperv/vmbus: Rename cleaned up bufring code
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7318
2016-07-27 09:27:08 +00:00
Sepherosa Ziehau
b5ddb4093a hyperv/vmbus: Cleanup RX bufring read process.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7317
2016-07-27 07:36:54 +00:00
Sepherosa Ziehau
3ddfec1f17 hyperv/vmbus: Stringent RX bufring data length checks.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7316
2016-07-27 07:19:06 +00:00
Sepherosa Ziehau
455cc95f3f hyperv/vmbus: Cleanup TX bufring write process.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7315
2016-07-27 06:52:43 +00:00
Sepherosa Ziehau
ca7c18e5c4 hyperv/vmbus: Update comment for bufring
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7314
2016-07-27 06:36:57 +00:00
Sepherosa Ziehau
ea06b5d3ec hyperv/vmbus: Use different struct for RX/TX bufring.
So that they can use suitable MP synchronization mechanism.

While I'm here change the bufring init/read/write function names.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7313
2016-07-27 06:17:20 +00:00
Sepherosa Ziehau
a0c3998ea9 hyperv/vmbus: Initialize RX/TX bufring mutex at channel creation time
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7312
2016-07-27 05:47:32 +00:00
Sepherosa Ziehau
34c30e12e2 hyperv/vmbus: Nuke unnecessary accessor functions.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7303
2016-07-26 05:06:00 +00:00
Sepherosa Ziehau
afffab7e8b hyperv/vmbus: Move bufring info definition to vmbus_brvar.h
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7282
2016-07-25 03:30:26 +00:00
Sepherosa Ziehau
7dd8881ca6 hyperv/vmbus: Rename hv_vmbus_priv.h to vmbus_brvar.h
It only contains bufring related bits for a while.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7281
2016-07-25 03:12:40 +00:00
Sepherosa Ziehau
031e155216 hyperv/vmbus: Move vmbus bufring definition to vmbus_reg.h
And add more comment about its fields.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7269
2016-07-22 05:09:08 +00:00
Sepherosa Ziehau
bafad35c7d hyperv/vmbus: Cleanup and augment bufring sysctl tree creation
Binary state node is added, so that userland programs do not have
to parse human readable state string.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7268
2016-07-22 03:42:32 +00:00
Sepherosa Ziehau
a6c54e7eea hyperv/vmbus: Cosmetic bufring cleanup.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7267
2016-07-22 03:30:00 +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
f62b3ae3be hyperv/vmbus: Shuffle function declaration and macro definition.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7259
2016-07-21 05:46:26 +00:00
Sepherosa Ziehau
3fcf36f408 hyperv/vmbus: Reorder channel fields.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7258
2016-07-21 05:38:05 +00:00
Sepherosa Ziehau
f617e011c9 hyperv/vmbus: Save event flag location and evet flag mask.
This avoids unnecessary access to the vmbus_softc struct on sending path.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7257
2016-07-21 05:30:31 +00:00
Sepherosa Ziehau
e90bb68be6 hyperv/vmbus: Save MNF trigger location instead of MNF trigger index.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7246
2016-07-20 06:12:32 +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
9129ad2d70 hyperv/vmbus: Channel struct field rename
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7242
2016-07-20 05:26:04 +00:00
Sepherosa Ziehau
e62409966b hyperv/vmbus: Rename laundered vmbus channel code
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7232
2016-07-19 07:51:22 +00:00
Sepherosa Ziehau
d9687005ae hyperv/vmbus: Temp/internal variable/function rename
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7231
2016-07-19 06:04:44 +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
742fb4f669 hyperv/vmbus: Cleanup cpu based channel selection.
And create cpu to channel map at device attach time for storvsc(4).

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7229
2016-07-19 05:46:15 +00:00
Sepherosa Ziehau
367d703632 hyperv/vmbus: Cosmetic vmbus channel open cleanup
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7217
2016-07-18 05:36:31 +00:00
Sepherosa Ziehau
d745ae11c9 hyperv/vmbus: Cleanup channel sysctl tree creation
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7214
2016-07-15 08:40:22 +00:00