Commit Graph

110578 Commits

Author SHA1 Message Date
Andrew Turner
2b48ec8e6d Move the call to intr_pic_init_secondary to the same place as in the
non-intrng case.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-05-16 12:02:06 +00:00
Andriy Gapon
20ec8b0f9b fix up r299902: mount_snapshot requires that the covered vnode is locked
Previously that was not strictly enforced.

MFC after:	4 weeks
X-MFC with:	r299902
2016-05-16 11:48:43 +00:00
Andriy Voskoboinyk
fb6844d810 rtwn: fix double free in raw xmit path.
Reported by:	mva
2016-05-16 10:51:35 +00:00
Andrew Turner
72b3f638b7 Add support for intrng to arm64. As the GICv3 drivers will need to be
updated, and until further testing can be done, this is disabled for now.

It is expected arm64 will switch to this interface, and the old interface
will be removed before 11.0 is released.

Obtained from:	ABT Systems Ltd
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2016-05-16 10:48:51 +00:00
Andrew Turner
4e1763d34c Teach the ThunderX PCI PEM driver about intrng. This will be used later
when arm64 is supported by intrng.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-05-16 10:03:57 +00:00
Hans Petter Selasky
b334cdea9b Implement more Linux device related functions in the LinuxKPI. While
at it use NULL for some pointer checks.

Bump the FreeBSD version to force recompilation of all kernel modules
due to a structure size change.

Obtained from:	kmacy @
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2016-05-16 09:56:48 +00:00
Andrew Turner
1e43b18c4b Add a pcib interface for use by interrupt controllers that need to
translate the pci rid to a controller ID. The translation could be based
on the 'msi-map' OFW property, a similar ACPI option, or hard-coded for
hardware lacking the above options.

Reviewed by:	wma
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-05-16 09:31:44 +00:00
Hans Petter Selasky
88fa0d734c Don't dereference parent pointer when it is NULL.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2016-05-16 09:25:56 +00:00
Hans Petter Selasky
03219fba43 Properly implement "cpu_has_clflush" macro.
Suggested by:	kib, jhb
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2016-05-16 09:16:15 +00:00
Andrew Turner
d7be980dbe Re-commit r299467 having fixed the build:
Add a new get_id interface to pci and pcib. This will allow us to both
detect failures, and get different PCI IDs.

For the former the interface returns an int to signal an error. The ID is
returned at a uintptr_t * argument.

For the latter there is a type argument that allows selecting the ID type.
This only specifies a single type, however a MSI type will be added
to handle the need to find the ID the hardware passes to the ARM GICv3
interrupt controller.

A follow up commit will be made to remove pci_get_rid.

Reviewed by:    jhb, rstone (previous version)
Obtained from:  ABT Systems Ltd
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D6239
2016-05-16 09:15:50 +00:00
Andrew Turner
3fc155dc64 Introduce MSI and MSI-X support to intrng. This adds a new msi device
interface with 5 methods to mirror the 5 MSI/MSI-X methods in the pcib
interface. The pcib driver will need to perform a device specific lookup
to find the MSI controller and pass this to intrng as the xref. Intrng
will finally find the controller and have it handle the requested operation.

Obtained from:	ABT Systems Ltd
MFH:		yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5985
2016-05-16 09:11:40 +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
Andrew Rybchenko
bba8dcbcd3 sfxge(4): cleanup: quieten more common code MCDI handlers
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 08:32:21 +00:00
Andrew Rybchenko
fb39178368 sfxge(4): cleanup: remove misnamed function declaration
Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 08:28:27 +00:00
Andrew Rybchenko
c6190b10d9 sfxge(4): cleanup: make MCDI license queries quieter in common code
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 08:27:20 +00:00
Andrew Rybchenko
ca2eff6584 sfxge(4): cleanup: simplify ef10_ev_qcreate
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 08:04:40 +00:00
Andrew Rybchenko
e9660953ab sfxge(4): translate MC_CMD_ERR_EEXIST to host errno value
This is needed because the new MCDI command nvram_private_append can
return MC_CMD_ERR_EEXIST

Submitted by:   Tom Millington <tmillington at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 07:47:20 +00:00
Andrew Rybchenko
7d17c52bb0 fxge(4): cleanup: run genfwdef to propogate prior changes to TLV headers
Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 07:45:43 +00:00
Andrew Rybchenko
ce674fe154 sfxge(4): set TSOv2 feature flag on Medford
Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 07:33:56 +00:00
Andriy Gapon
27d4b35f6e vfs_read_dirent: increment ncookies after adding a cookie
It seems that at present vfs_read_dirent() is used only with filesystems
that do not support cookies, so the bug never manifested itself.

MFC after:	1 week
2016-05-16 07:31:11 +00:00
Andrew Rybchenko
44e44413d4 sfxge(4): improve TX/RX queue error messages
Report the full error descriptor in a form that can be passed to
firmwaresrc/dpcpu/scripts/evdecode

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 07:29:50 +00:00
Andriy Gapon
cf7aa80bbd zfsctl_ops_snapshot: remove methods should never be called
We pretend that snapshots mounted under .zfs are part of the original
filesystem and we try very hard to hide vnodes on top of which the snapshots
are mounted.  Given that I believe that the removed operations should
never be called.  They might have been called previously because
of issues fixed in r299906, r299908 and r299913.

MFC after:	5 weeks
2016-05-16 07:24:30 +00:00
Andriy Gapon
8614f45b2d dounmount: do not call mountcheckdirs() for mounts with MNT_IGNORE
This is a bit hackish, but the flag is currently set only for ZFS
snapshots mounted under .zfs.  mountcheckdirs() can change cdir/rdir
references to a covered vnode.  But for the said snapshots the covered
vnode is really ephemeral and it must never be accessed (except
for a few specific cases).

To do:	consider removing mountcheckdirs() entirely

MFC after:	5 days
2016-05-16 07:23:24 +00:00
Sepherosa Ziehau
dfdc9a05c6 atomic: Add testandclear on i386/amd64
Reviewed by:	kib
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6381
2016-05-16 07:19:33 +00:00
Andrew Rybchenko
95c6a8211c sfxge(4): fix license validation check for V3 licenses
Length consistency checks were failing for ECC hashes.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 07:12:04 +00:00
Stanislav Galabov
dfb5178f9b Introduce basic etherswitch support for Ralink SoCs
This revision introduces basic support for the internal ESW switch found
Ralink/Mediatek SoCs such as RT3050, RT3352, RT5350, MT7628; and GSW
found in MT7620 and MT7621.

It only supports 802.1q VLANs and doesn't support external PHYs at the
moment (only the ones that are built into the switch itself).

Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D6348
2016-05-16 07:00:49 +00:00
Andrew Rybchenko
0ecc971831 sfxge(4): regenerate MCDI headers from firmwaresrc .yml
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 06:59:12 +00:00
Andriy Gapon
cb68fd3513 zfsctl_snapdir_lookup: always clear VV_ROOT flag of snapshot's root VV_ROOT
Previosuly we did that only if the snapshot was mounted earlier, its
root vnode got recycled and then we accessed it again.
We never cleared the flag for a freshly mounted snapshot.

That was very inconsistent and probably a source of some bugs.
Or maybe that painted over some bugs which might get revealed now.

We should consistently clear the flag because we try very hard to
pretend that snapshots auto-mounted under .zfs are part of their
original filesystem.  In other words, we try to hide the fact that they
are different filesystems / mountpoints.

MFC after:	5 weeks
2016-05-16 06:49:09 +00:00
Andrew Rybchenko
ff2e27e5bb sfxge(4): increase maximum size of license keys
Increase buffer sizes for license keys to 160 bytes to accomodate ECDSA
hashes.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 06:42:45 +00:00
Andriy Gapon
4df590b5b6 add zfs_vptocnp with special handling for snapshots under .zfs
The logic is similar to that already present in zfs_dirlook() to handle
a dot-dot lookup on a root vnode of a snapshot mounted under
.zfs/snapshot/.
illumos does not have an equivalent of vop_vptocnp, so there only the
lookup had to be patched up.

MFC after:	4 weeks
2016-05-16 06:40:51 +00:00
Andrew Rybchenko
b59e9e4a81 sfxge(4): fix V1 licensing MCDI operations
Implementation of the MCDI commands for Siena boards was requesting
the wrong operation.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6370
2016-05-16 06:40:17 +00:00
Andrew Rybchenko
f6d61784ad sfxge(4): improve PCIe link speed and width check
Perform a more accurate check of whether the PCIe bandwidth is
sufficient for the current/supported port modes.

Give a different warning if there is sufficient bandwidth to achieve
line rate, but the link is not fast enough for optimal latency.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6369
2016-05-16 06:38:51 +00:00
Andrew Rybchenko
1bc27f39c5 sfxge(4): cleanup: make TLV scans quieter
Find end of segments in a more direct way that avoids an error report at
the terminator.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6367
2016-05-16 06:32:06 +00:00
Andriy Gapon
a03fb1cf6a mount_snapshot: consolidate all error handling
This makes sure that the original vnode is always unlocked and released
if any error happens.

MFC after:	4 weeks
2016-05-16 06:30:25 +00:00
Andrew Rybchenko
01215be22d sfxge(4): cleanup: make VPD lookups quieter
A lookup on a VPD entry which is missing reports several failure
messages as it propagates through wrapper functions. Restructured
the wrappers to treat this gracefully as an expected case.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6366
2016-05-16 06:26:18 +00:00
Andriy Gapon
3055925d42 zfsctl: fix several problems with reference counts
* Remove excessive references on a snapshot mountpoint vnode.
  zfsctl_snapdir_lookup() called VN_HOLD() on a vnode returned from
  zfsctl_snapshot_mknode() and the latter also had a call to VN_HOLD()
  on the same vnode.
  On top of that gfs_dir_create() already returns the vnode with the
  use count of 1 (set in getnewvnode).
  So there was 3 references on the vnode.

* mount_snapshot() should keep a reference to a covered vnode.
  That reference is owned by the mountpoint (mounted snapshot filesystem).

* Remove cryptic manipulations of a covered vnode in zfs_umount().
  FreeBSD dounmount() already does the right thing and releases the covered
  vnode.

PR:		207464
Reported by:	dustinwenz@ebureau.com
Tested by:	Howard Powell <hpowell@lighthouseinstruments.com>
MFC after:	3 weeks
2016-05-16 06:24:04 +00:00
Andrew Rybchenko
7d4ce67a76 sfxge(4): cleanup: make licensing function quieter
Silent handling of failure to invoke functions that are not supported on
older licensing versions.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6365
2016-05-16 06:19:17 +00:00
Andrew Rybchenko
fc3a62cf60 sfxge(4): restructure efx_lic to support V3 licensing
Create separate implementations of the efx_lic API for each revision of
the licensing system. All processing of the V1/V2 license partition is
moved to efx_lic, and an implementation of V3 licensing uses the existing
TLV functions with extensions for writing new TLV entries.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6364
2016-05-16 06:17:56 +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
Adrian Chadd
16ff0ae77f [bwn] use contigmalloc to allocate descriptors.
We can't assume malloc() returns physically contiguous memory.

Submitted by:	Imre Vadasz <imre@vdsz.com>
Obtained from:	DragonflyBSD
2016-05-16 04:03:43 +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
Kevin Lo
cbb62fa6aa Follow-up r298818: hide size of 'bands' array behind a macro. 2016-05-16 02:27:28 +00:00
Rick Macklem
e6e2445622 Fix fuse for "cp" of a mode 0444 file to the file system.
When "cp" of a file with read-only (mode 0444) to a fuse mounted
file system was attempted it would fail with EACCES. This was because
fuse would attempt to open the file WRONLY and the open would fail.
This patch changes the fuse_vnop_open() to test for an extant read-write
open and use that, if it is available.
This makes the "cp" of a read-only file to the fuse mounted file system
work ok.
There are simpler ways to fix this than adding the fuse_filehandle_validrw()
function, but this function is useful for future patches related to
exporting a fuse filesystem via NFS.

MFC after:	2 weeks
2016-05-15 23:15:10 +00:00
Jared McNeill
343044c43b Add Allwinner A83T thermal sensor controller support.
The A83T thermal sensor controller has three sensors. Sensor 0 corresponds
to CPU cluster 0, sensor 1 to CPU cluster 1, and sensor 2 to the GPU. This
driver exports the temperature sensor readings via sysctl.

Calibration data is obtained from SRAM found in the Secure ID module.

Reviewed by:		manu
Differential Revision:	https://reviews.freebsd.org/D6378
2016-05-15 22:36:55 +00:00
Cy Schubert
54da23a7b3 Make subsequent code reachable.
Reported by:	Coverity CID 1354625
MFC after:	3 days
2016-05-15 22:35:11 +00:00
Don Lewis
1ef3d54d20 When handling SIOCSIFNAME ensure that the new interface name is NUL
terminated.  Reject the rename attempt if the name is too long.

MFC after:	1 week
2016-05-15 21:37:36 +00:00
Mark Johnston
565e7fd3bc opt_kdtrace.h is not needed for SDT probes as of r258541. 2016-05-15 20:04:43 +00:00
Jared McNeill
792492eee3 Enable SATA power regulator at boot on Sinovoip BananaPi BPI-M3. 2016-05-15 17:25:31 +00:00