Commit Graph

204 Commits

Author SHA1 Message Date
Eitan Adler
cef367e6a1 Don't repeat the the word 'the'
(one manual change to fix grammar)

Confirmed With: db
Approved by: secteam (not really, but this is a comment typo fix)
2016-05-17 12:52:31 +00:00
Sepherosa Ziehau
81ccfbbc2e hyperv/vmbus: Use atomic_testandclear
Prepare to use unsigned long for event channel bit array.

Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6382
2016-05-16 08:50:32 +00:00
Sepherosa Ziehau
b3e348206c hyperv/vmbus: Fix event processing loop indentation.
No functional changes.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6334
2016-05-16 04:03:52 +00:00
Sepherosa Ziehau
2a616fdcda hyperv/vmbus: Simplify event processing
For channel0, it will never be processed on event handling path,
so there is no need to install it.  After skipping in the channel0
installation, we could discard the channel0 check on event
handling hot code path.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6333
2016-05-16 03:56:24 +00:00
Sepherosa Ziehau
2afc04024e hyperv/vmbus: Simplify event processing
While I'm here, remove useless comment and unnecessary return.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6332
2016-05-16 03:48:00 +00:00
Sepherosa Ziehau
aa77d82eca hyperv/hn: Combine per-packet-information parsing.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-05-16 03:26:16 +00:00
John Baldwin
fdce57a042 Add an EARLY_AP_STARTUP option to start APs earlier during boot.
Currently, Application Processors (non-boot CPUs) are started by
MD code at SI_SUB_CPU, but they are kept waiting in a "pen" until
SI_SUB_SMP at which point they are released to run kernel threads.
SI_SUB_SMP is one of the last SYSINIT levels, so APs don't enter
the scheduler and start running threads until fairly late in the
boot.

This change moves SI_SUB_SMP up to just before software interrupt
threads are created allowing the APs to start executing kernel
threads much sooner (before any devices are probed).  This allows
several initialization routines that need to perform initialization
on all CPUs to now perform that initialization in one step rather
than having to defer the AP initialization to a second SYSINIT run
at SI_SUB_SMP.  It also permits all CPUs to be available for
handling interrupts before any devices are probed.

This last feature fixes a problem on with interrupt vector exhaustion.
Specifically, in the old model all device interrupts were routed
onto the boot CPU during boot.  Later after the APs were released at
SI_SUB_SMP, interrupts were redistributed across all CPUs.

However, several drivers for multiqueue hardware allocate N interrupts
per CPU in the system.  In a system with many CPUs, just a few drivers
doing this could exhaust the available pool of interrupt vectors on
the boot CPU as each driver was allocating N * mp_ncpu vectors on the
boot CPU.  Now, drivers will allocate interrupts on their desired CPUs
during boot meaning that only N interrupts are allocated from the boot
CPU instead of N * mp_ncpu.

Some other bits of code can also be simplified as smp_started is
now true much earlier and will now always be true for these bits of
code.  This removes the need to treat the single-CPU boot environment
as a special case.

As a transition aid, the new behavior is available under a new kernel
option (EARLY_AP_STARTUP).  This will allow the option to be turned off
if need be during initial testing.  I plan to enable this on x86 by
default in a followup commit in the next few days and to have all
platforms moved over before 11.0.  Once the transition is complete,
the option will be removed along with the !EARLY_AP_STARTUP code.

These changes have only been tested on x86.  Other platform maintainers
are encouraged to port their architectures over as well.  The main
things to check for are any uses of smp_started in MD code that can be
simplified and SI_SUB_SMP SYSINITs in MD code that can be removed in
the EARLY_AP_STARTUP case (e.g. the interrupt shuffling).

PR:		kern/199321
Reviewed by:	markj, gnn, kib
Sponsored by:	Netflix
2016-05-14 18:22:52 +00:00
Sepherosa Ziehau
008c25ebb9 hyperv/stor: Enable INQUIRY result check only on WIN10 like host systems
On WIN8 like host systems, when rescan happens, the already installed
disks seem to return random invalid results for INQUIRY.

More investigation is under way to figure out why random invalid INQUIRY
results are delivered to VM on WIN8 like host systems.

Submitted by:	Hongjiang Zhang <honzhan microsoft com>
Reviewed by:	sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6316
2016-05-12 03:29:29 +00:00
Sepherosa Ziehau
11a55b7340 hyperv/hn: Extract RSS hash value and type.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6287
2016-05-11 03:31:25 +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
0fbe6eaef6 hyperv/hn: Add stat for # of chimney sending tries
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-27 06:49:16 +00:00
Sepherosa Ziehau
677d0d5076 hyperv/vmbus: Mark sysctls MPSAFE
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-27 05:45:14 +00:00
Sepherosa Ziehau
b649be4068 hyperv/hn: Mark sysctls MPSAFE
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-27 05:18:04 +00:00
Sepherosa Ziehau
6456e1587b hyperv/hn: Remove unapplied comment.
Chimney sending buffers are shared across channels.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-27 05:05:54 +00:00
Sepherosa Ziehau
ff1c886a59 hyperv/hn: Restart sending earlier once we gathered some free TX descs
This greatly reduces the oqdrops under heavy workload.

For TCP send/recv test (10K concurrent connections):
oqdrops is reduced by 17% on sending side, and 57% on receiving side.

For nginx-1.8/wrk-4 1KB object test (10K concurrent connections,
4 requests/connection):
oqdrops is reduced by 44% on nginx side, and 10% on wrk side.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-27 04:51:28 +00:00
Sepherosa Ziehau
49bebba7aa hyperv/hn: Change description to "Hyper-V Network Interface"
This is consistent w/ other Hyper-V devices.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-26 06:50:41 +00:00
Sepherosa Ziehau
f494006fdf hyperv/stor: Set description properly in probe devmethod
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-26 06:41:36 +00:00
Sepherosa Ziehau
96a8c456f1 hyperv/channel: Git rid of the sub-channel creation callback
It is no longer used.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-26 05:21:27 +00:00
Sepherosa Ziehau
99b476b1e8 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
2016-04-26 05:15:15 +00:00
Sepherosa Ziehau
03dbe733c5 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
2016-04-26 05:08:55 +00:00
Sepherosa Ziehau
232ab086dc hyperv/stor: Synchronize sub-channel offers
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-26 05:00:40 +00:00
Sepherosa Ziehau
f4ffb60d10 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
2016-04-26 04:48:57 +00:00
Sepherosa Ziehau
049efd1090 hyperv/hn: Synchronize sub-channel offers
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-25 10:16:07 +00:00
Sepherosa Ziehau
480805ab13 hyperv/channel: Add functions to synchronize sub-channel offers
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-25 09:00:06 +00:00
Sepherosa Ziehau
b9dfafffcd hyperv/channel: Log a warning about duplicated primary channel offer
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-25 05:58:32 +00:00
Sepherosa Ziehau
d4135e865c hyperv/channel: Remove unapplied comment
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-25 05:46:44 +00:00
Sepherosa Ziehau
a37ec104c5 hyperv/channel: Minor style changes; no functional changes.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-25 05:30:42 +00:00
Sepherosa Ziehau
84e83c0abd hyperv/channel: Remove the unnecessary 'new' flag
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-25 05:22:35 +00:00
Sepherosa Ziehau
625dc68a9e hyperv/et: Strip extra white space in function name
Reported by:	Sascha Wildner <saw online de>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-25 04:58:14 +00:00
Sepherosa Ziehau
4e0c3dc461 hyperv/hn: Allow users to configure ifq or bufring depth.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-25 03:48:28 +00:00
Sepherosa Ziehau
62cffb8d93 hn: Increase odrops for if_transmit method if drbr_enqueue fails.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-25 03:14:55 +00:00
Sepherosa Ziehau
d1c801bbf1 hyperv/et: Make Hyper-V event timer a device.
Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	sephe, Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5957
2016-04-22 05:15:59 +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
Sepherosa Ziehau
adc9edf341 hyperv/vmbus: Make device probe/attach synchronous w/ vmbus attach/SYSINIT
Discussed with:	Jun Su <junsu microsoft com>, Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-19 09:42:48 +00:00
Sepherosa Ziehau
55a1cfa16b hyperv: Remove two assign-only local variables
Submitted by:	Jun Su <junsu microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-19 09:25:56 +00:00
Sepherosa Ziehau
8310528673 hyperv/hn: Hide ring to channel linkage message under bootverbose
Suggested by:	Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-15 08:17:55 +00:00
Sepherosa Ziehau
5f9b92f865 hyperv: No need to zero out softc
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-15 08:08:46 +00:00
Sepherosa Ziehau
a014f7e1a6 hyperv/stor: Use xpt_done_direct() upon I/O completion
Reviewed by:	mav
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5955
2016-04-15 08:01:07 +00:00
Sepherosa Ziehau
4a060c8407 hyperv/vmbus: Put multi-channel offer logging under bootverbose
Suggested by:	Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-15 07:48:41 +00:00
Sepherosa Ziehau
97c4992c89 hyperv/stor: Temporary disable the wrongly done command timeout.
It will be reenabled once the request processing is corrected.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-15 07:39:43 +00:00
Sepherosa Ziehau
0c29fe6db8 hyperv: Deprecate HYPERV option by moving Hyper-V IDT vector into vmbus
Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	jhb, kib, sephe
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5910
2016-04-15 02:20:18 +00:00
Sepherosa Ziehau
7e98851e93 hyperv: device_get_softc does not return NULL
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-13 09:20:29 +00:00
Sepherosa Ziehau
1859e4178b hyperv/vmbus: Merge duplicated version check for events
Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5911
2016-04-13 03:45:39 +00:00
Sepherosa Ziehau
3d861d81b9 hyperv: Replace 0 w/ NULL
Submitted by:	pfg
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-12 02:01:16 +00:00
Sepherosa Ziehau
9859c43dfe hyperv: Typo
Noticed by:	kib
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-11 09:52:24 +00:00
Sepherosa Ziehau
e331206e0f hyperv/hn: Remove unnecessary NULL checks
Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5905
2016-04-11 06:59:13 +00:00
Sepherosa Ziehau
b81e22fced hyperv/hn: By default enable multiple TX/RX rings, aka vRSS.
Reviewed by:	Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5880
2016-04-11 06:37:50 +00:00
Sepherosa Ziehau
0e86334196 hyperv/hn: Cap default # of rings to 8.
8 gives the best performance in both Azure and local Hyper-V on both
10Ge and 40Ge. More rings are still allowed by manual configuration.

Reviewed by:	Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5879
2016-04-11 06:31:52 +00:00
Sepherosa Ziehau
083b2c353d hyperv: Define macro for Hyper-V interface
Suggested by:	rpokala
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-11 06:22:26 +00:00
Sepherosa Ziehau
29b7b56766 hyperv: Print more features
And add comment about the MSR features.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-11 06:15:40 +00:00