Commit Graph

31797 Commits

Author SHA1 Message Date
Sepherosa Ziehau
fc1208d658 hyperv/vmbus: Use post message Hypercall APIs for channel open
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6876
2016-07-12 03:09:10 +00:00
Sepherosa Ziehau
796a90bf5d hyperv/vmbus: Reorganize vmbus scan process.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6875
2016-07-12 03:03:17 +00:00
Sepherosa Ziehau
7a49521a4b hyperv/stor: Save the response status and xfer length properly.
The current command response handling discards status and xfer
length unconditionally, so that all of the commands would be
considered successful, even if errors happened.  When errors
really happens, this causes all kinds of wiredness, since the
buffer will not be filled on the host side and sense data will
be ignored.

Most of the time, errors do not happen, however, error does
happen for the request sent immediately after the disk resizing.
Discarding the SCSI status (SCSI_STATUS_CHECK_COND) and sense
data (capacity changes) prevents the disk resizing from working
properly.

This commit saves the response status and xfer length properly
for later use.

Submitted by:	Dexuan Cui <decui microsoft com>
Noticed by:	sephe
MFC after:	3 days
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7181
2016-07-12 02:57:13 +00:00
Landon J. Fuller
fdedcd9f95 bhnd(4): Add bus pass-aware discovery of platform devices (PMU,
NVRAM, ChipCommon, etc).

This extends the existing handling of NVRAM core discovery to support
locating additional devices that may be attached either directly as real
cores, or indirectly via ChipCommon (e.g. bhnd_pmu).

When attached as a SoC root bus (as opposed to a bridged WiFi device),
the platform devices may not be attached until later bus passes,
necessitating delayed discovery/initialization.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D6962
2016-07-12 02:16:48 +00:00
Landon J. Fuller
692f593c23 bhnd(4): print extra register information on chipc SPI timeout.
Submitted by:	Michael Zhilin <mizhka@gmail.com>
Reviewed by:	imp
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D6993
2016-07-12 01:15:00 +00:00
Enji Cooper
092af585e1 Remove redundant declaration for tcp_dooptions, similar to r302576
netinet/tcp_var.h already defines this function

Differential Revision:	https://reviews.freebsd.org/D7189
MFC after:	1 week
PR:	209920
Reported by:	Mark Millard <markmi@dsl-only.net>
Reviewed by:	np
Tested with:	clang 3.8.0, gcc 4.2.1, gcc 5.3.0
Sponsored by:	EMC / Isilon Storage Division
2016-07-11 17:11:18 +00:00
Enji Cooper
e3c76b36f6 Add missing default case to capable(..) function definition
By definition (enum __drm_capabilities), cases other than CAP_SYS_ADMIN
aren't possible. Add in a KASSERT safety belt and return false in
!INVARIANTS case if an invalid value is passed in, as it would be a
programmer error.

This fixes a -Wreturn-type error with gcc 5.3.0.

Differential Revision:	https://reviews.freebsd.org/D7188
MFC after:	1 week
Reported by:	devel/amd64-gcc (5.3.0)
Reviewed by:	dumbbell
Sponsored by:	EMC / Isilon Storage Division
2016-07-11 17:01:07 +00:00
Enji Cooper
763a7be673 (Re-do r302574 with corrected commit message..)
Remove redundant declaration for tcp_dooptions

netinet/tcp_var.h already defines this function

Differential Revision:	https://reviews.freebsd.org/D7187
MFC after:	1 week
PR:		209920
Reported by:	Mark Millard <markmi@dsl-only.net>
Reviewed by:	np
Tested with:	clang 3.8.0, gcc 4.2.1, gcc 5.3.0
Sponsored by:	EMC / Isilon Storage Division
2016-07-11 16:56:51 +00:00
Enji Cooper
d8d21a717c Revert r302574. I botched the commit message in more way than 1 2016-07-11 16:54:19 +00:00
Enji Cooper
ca733c43ff Remove redundant declaration for tcp_dooptions
netinet/tcp_var.h already defines this function

PR:		209924
Reported by:	Mark Millard <markmi@dsl-only.net>
Reviewed by:	np
Tested with:	clang 3.8.0, gcc 4.2.1, gcc 5.3.0
Sponsored by:	EMC / Isilon Storage Division
2016-07-11 16:52:04 +00:00
Enji Cooper
75f09ab639 Remove redundant declarations for intel_fbc_enabled(..) and
i915_gem_dump_object(..) to fix -Wredundant-decls warning

MFC after:	1 week
PR:		209924
Reported by:	Mark Millard <markmi@dsl-only.net>
Tested with:	devel/amd64-gcc (5.3.0)
Sponsored by:	EMC / Isilon Storage Division
2016-07-11 15:50:06 +00:00
Enji Cooper
966d9ae5b6 Remove redundant declaration for radeon_pm_acpi_event_handler(..) to fix
-Wredundant-decls warning

MFC after:	1 week
PR:		209924
Reported by:	Mark Millard <markmi@dsl-only.net>
Tested with:	devel/amd64-gcc (5.3.0)
Sponsored by:	EMC / Isilon Storage Division
2016-07-11 15:47:43 +00:00
Michal Meloun
fc3466adda OFWPCI: Fix style(9).
No functional change.

MFC after: 3 weeks
2016-07-11 08:24:04 +00:00
Sepherosa Ziehau
60169cb210 hyperv/vmbus: Embed channel detach task in channel itself.
GC work queue stuffs.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6864
2016-07-11 08:12:04 +00:00
Sepherosa Ziehau
3e1c325e63 hyperv/vmbus: Save vmbus softc to channels.
So that we don't need to access the global vmbus softc.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6863
2016-07-11 07:54:58 +00:00
Sepherosa Ziehau
fd5831c624 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.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6862
2016-07-11 07:45:31 +00:00
Sepherosa Ziehau
1ecb24660f hyperv/vmbus: Use post message Hypercall APIs for unload
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6861
2016-07-11 07:28:15 +00:00
Sepherosa Ziehau
47a3ee5c60 hyperv/vmbus: Add sysctl to expose vmbus version.
Requested by:	Hongxiong Xian <v-hoxian microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6860
2016-07-11 06:55:02 +00:00
Sepherosa Ziehau
833cfa5fcb 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.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6858
2016-07-11 06:37:04 +00:00
Sepherosa Ziehau
dd012a57a7 hyperv/vmbus: Function renaming.
And pass vmbus_softc to vmbus_doattach()

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6842
2016-07-11 06:29:56 +00:00
Sepherosa Ziehau
57bb267df3 hyperv/hn: Add tunable to allow tcp_lro_queue_mbuf()
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6841
2016-07-11 06:23:01 +00:00
Sepherosa Ziehau
c1cc5bdfe8 hyperv/vmbus: Use post message Hypercall APIs for channel request
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6831
2016-07-11 06:11:24 +00:00
Sepherosa Ziehau
2d774f207c hyperv/stor: Fix the INQUIRY checks
Don't check the area that the host has not filled.

PR:		https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209443
PR:		https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210425
Submitted by:	Hongjiang Zhang <honzhan microsoft com>
Reviewed by:	sephe, Dexuan Cui <decui microsoft com>
MFC after:	3 days
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6955
2016-07-11 05:17:48 +00:00
Sepherosa Ziehau
236764b1c2 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.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6830
2016-07-11 04:52:11 +00:00
Alexander Motin
ce35eeb771 Revert odd change, setting limit registers before base.
I don't know what errata is mentioned there, I was unable to find it, but
setting limit before the base simply does not work at all.  According to
specification attempt to set limit out of the present window range resets
it to zero, effectively disabling it.  And that is what I see in practice.

Fixing this properly disables access for remote side to our memory until
respective xlat is negotiated and set.  As I see, Linux does the same.
2016-07-10 20:22:04 +00:00
Alexander Motin
9c85a81906 Fix wrong copy/paste in r302510. 2016-07-10 19:52:26 +00:00
Alexander Motin
d2de6786c1 Remove callout_reset(link_work) from ntb_transport_attach().
At that point link is quite likely not established yet, so messing with
scratch registers is premature there.  Original commit message mentioned
code diff reduction from Linux, but this line is not present in Linux now.
2016-07-10 19:15:29 +00:00
Michal Meloun
dac935533b EXTRES: Add OF node as argument to all <foo>_get_by_ofw_<bar>() functions.
In some cases, the driver must handle given properties located in
specific OF subnode. Instead of creating duplicate set of function, add
'node' as argument to existing functions, defaulting it to device OF node.

MFC after: 3 weeks
2016-07-10 18:28:15 +00:00
Jared McNeill
0e1cdf8ba6 Add clk_get_by_ofw_node_index, which is like clk_get_by_ofw_index but
operates on a specific OF node instead of the pass in device's OF node.

Reviewed by:		andrew, mmel
Differential Revision:	https://reviews.freebsd.org/D6957
2016-07-10 10:53:50 +00:00
Alexander Motin
a8916479cc Simplify MSIX MW BAR xlat setup, and don't forget to unlock its limit.
The last fixes SB01BASE_LOCKUP workaround after driver reload.
2016-07-10 01:09:16 +00:00
Landon J. Fuller
71edabf7bd Fix heap overflow in bhnd(4) SPROM parsing.
The bus_region_* APIs accept the number of data items to be read, while
the code was passing the total number of bytes, resulting in an overflow
of the SPROM parser's buffer.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7168
2016-07-10 00:08:40 +00:00
Alexander Motin
eeed92a759 Disable SB01BASE_LOCKUP workaround when split BARs disabled.
For some reason hack with sending MSI-X interrupts by writing to remote
LAPIC memory works only for 32-bit BARs, that are available only if split
BARs mode is enabled in BIOS.  If it is not, complain loudly and fall back
to less efficient workaround.
2016-07-09 23:22:44 +00:00
Alexander Motin
c266ab3830 Improve checksum "offload" support.
For compatibility reasons make driver not report any checksum offload by
default, since there is indeed none.  But if administrator knows that
interface is used only for local traffic, he can enable fake checksum
offload manually on both sides to save some CPU cycles, since the data
are already protected by CRC32 of PCIe link.

Sponsored by:	iXsystems, Inc.
2016-07-09 14:59:16 +00:00
Alexander Motin
8795de77ce Rewrite if_ntb to use modern interface KPIs and features.
It includes: link state, if_transmit, buf_ring, multiple queues, bpf, etc.

Sponsored by:	iXsystems, Inc.
2016-07-09 12:10:08 +00:00
Alexander Motin
b42e3ec60b Improve memory allocation errors handling on receive. 2016-07-09 12:00:04 +00:00
Alexander Motin
a7e0f01a3d Synchronize MTU code with Linux.
It is mandatory for transport compatibility.
2016-07-09 11:58:59 +00:00
Alexander Motin
59850913b2 Reimplement doorbell register emulation for NTB_SB01BASE_LOCKUP.
This allows at least first three doorbells to work very close to normal
hardware, properly signaling events to upper layers without spurious or
lost events.  Doorbells above the first three may still report spurious
events due to lack of reliable information, but they are rarely used.
2016-07-09 11:57:21 +00:00
Alexander Motin
f31eea5c49 Bring some more order into link and qp state handling.
Do not touch scratchpad registers until link is reported up.
Mask and do not handle doorbell events until respective qp is up.
2016-07-09 11:48:57 +00:00
Alexander Motin
ef48f66349 Switch ctx_lock from mutex to rmlock.
It is odd idea to serialize different MSI-X vectors.  Use of rmlocks
here allows them to execute in parallel, but still protects ctx.
If upper layers require any additional serialization -- they can
do it by themselves.
2016-07-09 11:47:52 +00:00
Alexander Motin
1be8a2635c Create separate RX taskqueue for each qp. 2016-07-09 11:46:32 +00:00
Alexander Motin
784ec7043b Remove rx_completion_task taskqueue.
It is not needed after RX lock removed in previous commit.
2016-07-09 11:45:18 +00:00
Alexander Motin
0a42578f0d Remove unneeded RX lock, and make TX lock per-qp. 2016-07-09 11:43:51 +00:00
Alexander Motin
0c84bc33cf Reduce code divergence from Linux, preparing for DMA support. 2016-07-09 11:40:59 +00:00
Alexander Motin
f7be35856a Fix operation with multiple qps. 2016-07-09 11:36:09 +00:00
Alexander Motin
9a5325c205 NewBus'ify NTB subsystem.
This follows NTB subsystem modularization in Linux, tuning it to FreeBSD
native NewBus interfaces.  This change allows to support different types
of hardware with different drivers, support multiple NTB instances in a
system, ntb_transport module use for needs other then if_ntb, etc.

Sponsored by:	iXsystems, Inc.
2016-07-09 11:20:42 +00:00
Alexander Motin
12738808e7 Remove some dead code found by Clang static analyzer. 2016-07-09 09:47:11 +00:00
Alexander Motin
b56203ac03 Fix NTB_SDOORBELL_LOCKUP workaround.
Since SBARxSZ register can be write-once, it can be unusable for disabling
the SBAR.  For such case also set SBARxBASE to zero to not intersect with
config BAR.
2016-07-09 09:34:24 +00:00
Adrian Chadd
aaf8b608ca [ath] add a new buf flag, marking a buffer as involved with ToA/ToD positioning. 2016-07-08 22:20:35 +00:00
Adrian Chadd
23c4e11be6 [ath_hal] add capability bit for querying/controlling the ToA/ToD positioning code. 2016-07-08 21:37:04 +00:00
Adrian Chadd
5f01bf5405 [ath] include ath_hal accessor macro changes.
I missed this in the previous commit.
2016-07-08 21:35:44 +00:00