Commit Graph

93 Commits

Author SHA1 Message Date
Sepherosa Ziehau
19b2340a76 hyperv/hn: Move hn_softc to if_hnvar.h
While I'm here, use consistent macro names.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8345
2016-10-27 05:13:00 +00:00
Sepherosa Ziehau
5341cc1c91 hyperv/hn: Move %b format string for capabilities near their definition.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8341
2016-10-27 04:42:39 +00:00
Sepherosa Ziehau
90321eb752 hyperv/hn: Nuke unnecessary M_NETVSC
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8340
2016-10-27 04:28:01 +00:00
Sepherosa Ziehau
20b3dcf039 hyperv/hn: Properly configure RSS according to RSS capabilities
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8338
2016-10-27 03:43:27 +00:00
Sepherosa Ziehau
121e98e697 hyperv/hn: Fix RX filter settings.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8313
2016-10-24 05:10:35 +00:00
Sepherosa Ziehau
b7009d5392 hyperv/hn: Move chimney buffer index and size to txdesc.
All RNDIS control messages have used SG list for a while.  This makes
the send context suitable for further refactoring.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8308
2016-10-24 03:26:34 +00:00
Sepherosa Ziehau
970ead008d hyperv/hn: Add network change support.
Currently the network change is simulated by link status changes.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8295
2016-10-21 08:02:05 +00:00
Sepherosa Ziehau
31f05efd89 hyperv/hn: Check NVS version for HASHVAL pktinfo on sending path.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8293
2016-10-21 07:46:35 +00:00
Sepherosa Ziehau
4afe249835 hyperv/hn: Rework link status support.
This is the preamble for network device SR-IOV and
NDIS_STATUS_NETWORK_CHANGE handling.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8209
2016-10-11 02:54:56 +00:00
Sepherosa Ziehau
c21d553cfa hyperv/hn: Fix if_hw_tsomax setup.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8089
2016-10-10 05:50:01 +00:00
Sepherosa Ziehau
fed9f4df75 hyperv/hn: If synthetic parts are detached, don't touch them.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8065
2016-09-30 06:21:00 +00:00
Sepherosa Ziehau
a53b5f81c2 hyperv/hn: Don't set HASHVAL pktinfo for NDIS < 6.30
This unbreaks packet sending on WS2008R2.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8057
2016-09-29 05:13:58 +00:00
Sepherosa Ziehau
2f1f7f4527 hyperv/hn: Flatten RX filter configuration.
This paves way for more fixes.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8049
2016-09-28 05:12:09 +00:00
Sepherosa Ziehau
c04dad64e2 hyperv/hn: Reorganize the synthetic parts detach.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8047
2016-09-28 04:45:00 +00:00
Sepherosa Ziehau
65fe5a4627 hyperv/hn: Suspend and resume the backend properly upon MTU change.
Suspend:
- Prevent the backend from being touched on TX path.
- Clear the RNDIS RX filter, and wait for RX to drain.
- Make sure that NVS see the chimney sending buffer and RXBUF
  disconnection, before unlink these buffers from the channel.

Resume:
- Reconfigure the RNDIS filter.
- Allow TX path to work on the backend.
- Kick start the TX eof task, in case the OACTIVE is set.

This fixes various panics, when the interface has traffic and MTU
is being changed.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8046
2016-09-28 04:34:21 +00:00
Sepherosa Ziehau
7a7e4e4449 hyperv/hn: Allocate bufrings in attach DEVMETHOD.
So that reinitialization, e.g. MTU change, will not fail when the system
memory is excessively fragmented.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7961
2016-09-21 06:27:42 +00:00
Sepherosa Ziehau
8377ced7ee hyperv/hn: Allow RSS capability flipping upon attach/reinit.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7927
2016-09-19 07:47:56 +00:00
Sepherosa Ziehau
ae75f7ee26 hyperv/hn: Save capabilities for later use.
And don't allow capability changes during reinitialization, which
breaks too much static configuration.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7922
2016-09-19 07:17:43 +00:00
Sepherosa Ziehau
8b7bba155c hyperv/hn: Use sx for the main lock.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7870
2016-09-14 08:33:08 +00:00
Sepherosa Ziehau
555e179833 hyperv/hn: Deprecate hn_softc_t
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7867
2016-09-14 08:00:30 +00:00
Sepherosa Ziehau
06100f2e8c hyperv/hn: Remove unused softc field
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7866
2016-09-14 06:47:25 +00:00
Sepherosa Ziehau
e0e273e2d4 hyperv/hn: Pull ether address and link status extraction up.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7831
2016-09-12 06:12:28 +00:00
Sepherosa Ziehau
b5f59ae0e2 hyperv/hn: Function rename.
- Minor style changes.
- Nuke unnecessary indirection.
- Nuke unapplied comment.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7827
2016-09-12 05:28:50 +00:00
Sepherosa Ziehau
a74e025394 hyperv/hn: Pass MTU around.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7808
2016-09-08 06:42:30 +00:00
Sepherosa Ziehau
021deece8f hyperv/hn: Factor out function to do NVS initialization.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7807
2016-09-08 06:23:08 +00:00
Sepherosa Ziehau
c8fca9324a hyperv/hn: Pull vmbus channel open up.
While I'm here, pull up the channel callback related code too.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7805
2016-09-08 05:27:43 +00:00
Sepherosa Ziehau
b67f3d2873 hyperv/hn: Nuke unused bits
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7795
2016-09-07 09:20:58 +00:00
Sepherosa Ziehau
ecb735a3ac hyperv/hn: Remove the useless rndis_device and related bits
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7687
2016-08-30 05:21:34 +00:00
Sepherosa Ziehau
fdda77284f hyperv/hn: Switch to new RNDIS set for RSS parameters.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7658
2016-08-29 05:35:35 +00:00
Sepherosa Ziehau
467da5ad48 hyperv/hn: Save the adopted NDIS version for RNDIS to use later.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7640
2016-08-26 05:15:08 +00:00
Sepherosa Ziehau
550bbdbd27 hyperv/hn: Use vmbus xact for RNDIS initialize.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7624
2016-08-25 05:00:41 +00:00
Sepherosa Ziehau
ef56e63fb3 hyperv/hn: Get rid of netvsc_dev
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7575
2016-08-22 07:44:11 +00:00
Sepherosa Ziehau
fdd6031b04 hyperv/hn: Move chimney sending buffer to hn_softc
And don't recreate chimney sending buffer for each primary channel
open, it is now created in device_attach DEVMETHOD and destroyed
in device_detach DEVMETHOD.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7574
2016-08-22 07:34:39 +00:00
Sepherosa Ziehau
852710e6db hyperv/hn: Move RXBUF to hn_softc
And don't recreate RXBUF for each primary channel open, it is now
created in device_attach DEVMETHOD and destroyed in device_detach
DEVMETHOD.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7556
2016-08-19 05:43:28 +00:00
Sepherosa Ziehau
d981413bcb hyperv/hn: Remove the useless num_channel
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7555
2016-08-19 05:30:39 +00:00
Sepherosa Ziehau
2a137ab6fd hyperv/hn: Remove assign-only struct field
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7554
2016-08-19 05:20:12 +00:00
Sepherosa Ziehau
0366a4a1e0 hyperv/hn: Move NVS version to softc
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7553
2016-08-19 03:32:04 +00:00
Sepherosa Ziehau
8caa09bd36 hyperv/hn: Get rid of the useless netvsc_packet
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7544
2016-08-18 05:52:03 +00:00
Sepherosa Ziehau
83ecbf4d6a hyperv/hn: Pass RX packet info to netvsc_recv.
This paves to nuke netvsc_packet, which does not serves much
purpose now.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7541
2016-08-18 05:33:58 +00:00
Sepherosa Ziehau
bf965e6dee hyperv/hn: Get rid of unused bits
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7518
2016-08-17 05:57:10 +00:00
Sepherosa Ziehau
62c4e6e992 hyperv/hn: Simplify RNDIS NVS message sending.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7501
2016-08-16 07:37:02 +00:00
Sepherosa Ziehau
d293af4049 hyperv/hn: Switch to vmbus xact APIs for NVS RXBUF connection.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7469
2016-08-12 08:07:56 +00:00
Sepherosa Ziehau
584e7c57f1 hyperv/hn: Switch to vmbus xact APIs for NVS initialization
Reviewed by:	Jun Su <junsu microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7457
2016-08-11 06:14:54 +00:00
Sepherosa Ziehau
127d6d1a64 hyperv/hn: Reorganize send done callback.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7450
2016-08-10 03:11:07 +00:00
Sepherosa Ziehau
b5070c1829 hyperv/hn: Move gpa array out of netvsc_packet.
Prepare to deprecate the netvsc_packet.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7436
2016-08-09 04:50:20 +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
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
fda1c6ee42 hyperv/vmbus: Deprecate the device private data in channel struct
They are neither flexible nor extensible.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7244
2016-07-20 05:48:52 +00:00
Sepherosa Ziehau
267fb25f21 hyperv/vmbus: Get rid of unnecessary definition.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7240
2016-07-20 05:03:04 +00:00