Commit Graph

197903 Commits

Author SHA1 Message Date
Ryan Stone
fad0a26408 Add tests for nvlist_take_*
Differential Revision:		https://reviews.freebsd.org/D1873
Reviewed by:			jfv, pjd
MFC after:			1 month
Sponsored by:			Sandvine Inc.
2015-03-01 00:21:43 +00:00
Ryan Stone
71637d76b1 Add test cases for nvlist_move_*
Differential Revision:		https://reviews.freebsd.org/D1872
Reviewed by:			jfv, pjd
MFC after:			1 month
Sponsored by:			Sandvine Inc.
2015-03-01 00:21:37 +00:00
Ryan Stone
6c721f8217 Add tests for nvlist_pack/unpack
Differential Revision:		https://reviews.freebsd.org/D1871
Reviewed by:			jfv, pjd
MFC after:			1 month
Sponsored by:			Sandvine Inc.
2015-03-01 00:21:30 +00:00
Ryan Stone
6e623ffd77 Add tests for nvlist_clone
Differential Revision:		https://reviews.freebsd.org/D1870
Reviewed by:			pjd, jfv
MFC after:			1 month
Sponsored by:			Sandvine Inc
2015-03-01 00:21:24 +00:00
Ryan Stone
3075c896f0 Tests of basic nvlist add functions
Differential Revision:		https://reviews.freebsd.org/D1869
Reviewed by:			jfv, pjd
MFC after:			1 month
Sponsored by:			Sandvine Inc.
2015-03-01 00:20:57 +00:00
Ryan Stone
c58da4beb1 Revert r279422. My "apply patch and commit" script wasn't adding
new files properly.

Pointy hat to: rstone
2015-03-01 00:05:45 +00:00
Ryan Stone
65d1148aa6 Tests of basic nvlist add functions
Differential Revision:		https://reviews.freebsd.org/D1869
Reviewed by:			jfv, pjd
MFC after:			1 month
Sponsored by:			Sandvine Inc.
2015-03-01 00:01:44 +00:00
Ryan Stone
da8c9a4fb0 Make libnv headers includable from C++
Differential Revision:		https://reviews.freebsd.org/D1868
Reviewed by:			jfv, pjd
MFC after:			1 month
Sponsored by:			Sandvine Inc.
2015-03-01 00:01:36 +00:00
Adrian Chadd
0f3ec57676 Add another register definition for the AR8327.
Obtained from:	OpenWRT
2015-02-28 23:59:29 +00:00
Mark Johnston
1e28e010e4 Remove the old DTrace test suite makefile - it was somewhat primitive and
mostly unmaintained, and it has been superseded by the infrastructure added
in r279418.

Reviewed by:	ngie
Sponsored by:	EMC / Isilon Storage Divison
2015-02-28 23:35:29 +00:00
Mark Johnston
4ddbe5ac37 Add infrastructure to integrate the DTrace test suite with Kyua.
For each test category, we generate a script containing ATF test cases for
the tests under that category. Each test case simply runs dtest.pl (the
upstream test harness) with the corresponding test files. The exclude.sh
script is used to record info about tests which should be skipped or are
expected to fail; it is used to generate atf_skip and atf_expect_fail calls.
The genmakefiles.sh script can be used to regenerate the test makefiles when
new tests are brought it from upstream.

The test suite is currently not connected to the build as there is a small
number of lingering test issues which still need to be worked out. In the
meantime however, the test suite can be easily built and installed
manually from cddl/usr.sbin/dtrace/tests.

Reviewed by:	ngie
Sponsored by:	EMC / Isilon Storage Division
2015-02-28 23:30:06 +00:00
Mark Johnston
d914572890 Use the -shared option to create a shared library.
MFC after:	1 week
2015-02-28 23:14:35 +00:00
Mark Johnston
24d6f0ffa5 Remove a leading tab that causes a make(1) error when running the test.
MFC after:	1 week
2015-02-28 23:11:18 +00:00
Mark Johnston
8ddb6d86de Only kill sleep processes that were forked from the test script.
MFC after:	1 week
2015-02-28 23:10:26 +00:00
Mark Johnston
2c4c1a261e Stop hard-coding an incorrect path to rm(1).
MFC after:	1 week
2015-02-28 23:09:01 +00:00
Ryan Stone
ce6682d990 Add a missing include of an options header.
watchdog.c does an #ifdef DDB but does not #include "opt_ddb.h".
Fixing this turned up a missing include file.

MFC after:	1 week
X-MFC-With:	r261495, r279410
2015-02-28 22:37:48 +00:00
Alexander Kabaev
0fd841369a Do not leak 'copy' buffer if bmap_truncate_indirect fails.
Reported by: Brainy Code Scanner, by Maxime Villard.
MFC after: 2 weeks
2015-02-28 22:24:45 +00:00
Enji Cooper
c14bdeb07e Unbreak 'make depend' with sfxge by removing debugging code activated in the
INET || INET6 case

X-MFC with: r279398
Pointyhat to: arybchik
2015-02-28 21:50:04 +00:00
Ryan Stone
3d59729556 Correct the use of an unitialized variable in sendfind_getobj()
When sendfile_getobj() is called on a DTYPE_SHM file, it never
initializes error, which is eventually returned to the caller.

Differential Revision:		https://reviews.freebsd.org/D1989
Reviewed by:			kib
Reported by: 			Brainy Code Scanner, by Maxime Villard.
2015-02-28 21:49:59 +00:00
Luiz Otavio O Souza
e8da3e8aaf Add ofw_gpiobus_parse_gpios(), a new public function, to parse the gpios
property for devices that doesn't descend directly from gpiobus.

The parser supports multiple pins, different GPIO controllers and can use
arbitrary names for the property (to match the many linux variants:
cd-gpios, power-gpios, wp-gpios, etc.).

Pass the driver name on ofw_gpiobus_add_fdt_child().  Update gpioled to
match.

An usage example of ofw_gpiobus_parse_gpios() will follow soon.
2015-02-28 21:01:01 +00:00
Konstantin Belousov
81f94399a9 Supposed fix for some SandyBridge mobile CPUs hang on AP startup when
x2APIC mode is detected and enabled.  Current theory is that switching
the APIC mode while an IPI is in flight might be the issue.

Postpone switching to x2APIC mode until we are guaranteed that all
starting IPIs are already send and aknowledged.  Use aps_ready signal
as an indication that the BSP is done with us.

Tested by:	adrian
Sponsored by:	The FreeBSD Foundation
MFC after:	2 months
2015-02-28 20:37:38 +00:00
Alexander Kabaev
2b7432629c Avoid closing unallocated socket in case socreate fails.
Found by: Brainy Code Scanner
Reported by: Maxime Villard <max@M00nBSD.net>
MFC after: 2 weeks
2015-02-28 20:30:29 +00:00
Alexander Kabaev
3956b1013e Avoid lookup of CODESET aliases using uninitialized path
We do not use iconv.alias file, so avoid using the vestiges
of the code that do.

Differential Revision:	https://reviews.freebsd.org/D1729
Reviewed by: emaste
MFC after: 2 weeks
2015-02-28 20:30:25 +00:00
Luiz Otavio O Souza
5019630122 Rename and move gpiobus_alloc_ivars() and gpiobus_free_ivars() so they can
be used on non FDT systems.

This prevents access to uninitialized memory on drivers that try to access
pin flags on non FDT systems.
2015-02-28 20:02:41 +00:00
Konstantin Belousov
4fc4286fbc Some fixes for fdescfs lookup code.
Do not ever return doomed vnode from lookup.  This could happen, if
not checked, since dvp is relocked in the 'looking up ourselves' case.

In the other case, since dvp is relocked, mount point might go away
while fdesc_allocvp() is called.  Prevent the situation by doing
vfs_busy() before unlocking dvp.  Reuse the vn_vget_ino_gen() helper.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2015-02-28 19:57:22 +00:00
Alan Cox
f81b73f3aa Eliminate a variable that became unused when VFS_LOCK_GIANT() was
eliminated.

MFC after:	3 days
2015-02-28 19:11:37 +00:00
Luiz Otavio O Souza
befcc3e26b Add a driver for the Maxim DS3231 a low-cost, extremely accurate (+-2PPM)
I2C real-time clock (RTC).

The DS3231 has an integrated temperature-compensated crystal oscillator
(TXCO) and crystal.

DS3231 has a temperature sensor, an independent 32kHz output (which can be
turned on and off by the driver) and another output that can be used as
interrupt for alarms or as a second square-wave output, which frequency and
operation mode can be set by driver sysctl(8) knobs.

Differential Revision:	https://reviews.freebsd.org/D1016
Reviewed by:	ian, rpaulo
Tested on:	Raspberry pi model B
2015-02-28 19:02:44 +00:00
Andrew Rybchenko
18daa0ee9a sfxge: compile out LRO if kernel is compiled without IPv4 and IPv6
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-28 19:01:43 +00:00
Jilles Tjoelker
c317cb51b2 nice(): Put back old return value, keeping [EPERM] error.
Commit r279154 changed the API and ABI significantly, and {NZERO} is still
wrong.

Also, preserve errno on success instead of setting it to 0.

PR:		189821
Reported by:	bde
Relnotes:	yes
2015-02-28 18:22:10 +00:00
Ian Lepore
bd96bd15b2 Format the line properly (wrap before column 80). 2015-02-28 17:44:31 +00:00
Ian Lepore
a1a4c1b0d4 Export the new osreldate and osrelease jail parms in jail_get(2). 2015-02-28 17:32:31 +00:00
Roger Pau Monné
691a22f94e netback: disable GSO
The current GSO implementation in netback is broken and causes errors on the
guest tx path. While this is fixed disable GSO in order to have a working
netback.

Sponsored by: Citrix Systems R&D
Discussed with: gibbs
2015-02-28 15:21:06 +00:00
Enji Cooper
74c1c91c47 Pad RX copy alignment calculation to avoid illegal memory accesses
The optimization made in r239940 is valid for struct mbuf's current structure
and size in FreeBSD, but hardcodes assumptions about sizes of struct mbuf,
which are unfortunately broken if additional data is added to the beginning of
struct mbuf

X-MFC note (discussed with rwatson):

This change requires the MPKTHSIZE definition, which is only available after
head@r277203 and will not be MFCed as it breaks mbuf(9) KPI.

A direct commit to stable/10 and merges to other branches to add the necessary
definitions to work with the code as-is will be done to facilitate this MFC

PR: 194314
MFC after: 2 weeks
Approved/Reviewed by: erj, jfv
Sponsored by: EMC / Isilon Storage Division
2015-02-28 14:57:57 +00:00
Edward Tomasz Napierala
a9d7821075 Move the "offload" clause from the target section to portal-group
section; it makes more sense there.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-02-28 12:02:32 +00:00
Enji Cooper
8e16f692a0 Fix typo (_DP_grom -> _DP_geom) so applications that need to link against
libgeom do so successfully

Tested by running `geom part list` produced from a -DWITHOUT_DYNAMICROOT built
world

PR: 198078
Reported by: Eir Nym <eirnym@gmail.com>
2015-02-28 05:14:42 +00:00
Konstantin Belousov
13dad10871 The umtx_lock mutex is used by top-half of the kernel, but is
currently a spin lock.  Apparently, the only reason for this is that
umtx_thread_exit() is called under the process spinlock, which put the
requirement on the umtx_lock.  Note that the witness static order list
is wrong for the umtx_lock, umtx_lock is explicitely before any thread
lock, so it is also before sleepq locks.

Change umtx_lock to be the sleepable mutex.  For the reason above, the
calls to umtx_thread_exit() are moved from thread_exit() earlier in
each caller, when the process spin lock is not yet taken.

Discussed with:	jhb
Tested by:	pho (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2015-02-28 04:19:02 +00:00
Jayachandran C.
c483877531 Whitespace fixes for sys/mips/nlm/dev
Clean up whitespace issues under sys/mips/nlm/dev. No functional
change in this commit.
2015-02-28 00:22:10 +00:00
Jayachandran C.
72e64728c9 Whitespace fixes for files in sys/mips/nlm
Clean up whitespace issues under sys/mips/nlm (except dev). No
functional change in this commit.
2015-02-28 00:17:29 +00:00
Warner Losh
3a6a9a3bcc Merge latest (commit c8c1b3a77934768c7f7a4a9c10140c8bec529059) files
from the git tree. This merges a lot that we're not using, but there's
too many files to be selective and have a hope of catching everything.
If there are conflicts with the rest of the tree, we'll resolve them
on a case by case basis.

MFC after:	2 weeks
Sponsored by:	Netflix, Inc.
2015-02-28 00:06:04 +00:00
Jayachandran C.
e45f3fe8bd Add subclass of simplebus for Broadcom XLP
This will override the resource allocation of simplebus, and also
merge the resource allocation code which was in xlp_pci.c.

With this change the SoC devices that does not have proper PCI
resources will be on the FDT simplebus. We can remove
sys/mips/nlm/dev/cfi_pci_xlp.c and sys/mips/nlm/dev/uart_pci_xlp.c
2015-02-27 23:33:53 +00:00
Warner Losh
5837276ce2 Put back Andy's void for gcc happiness.
Submitted by:	jchandra@
2015-02-27 23:14:08 +00:00
David E. O'Brien
eda6932911 sys/boot/userboot/libstand/libstand.a should also include strtoul.c;
as lib/libstand/ and sys/boot/libstand32/ already does.
2015-02-27 22:23:35 +00:00
David E. O'Brien
48f73a80ba Use sys/boot/userboot/libstand/ and not /usr/lib/libstand.a. 2015-02-27 22:22:05 +00:00
David E. O'Brien
f76aa51521 Remove duplicated -I. 2015-02-27 22:20:07 +00:00
David E. O'Brien
1b398e4ee3 Update r279018 so it only applies to Clang version 3.5+ and not 3.4.[1-9]. 2015-02-27 22:18:33 +00:00
Warner Losh
da75c2cc58 Import from device-tree git://xenbits.xen.org/people/ianc/device-tree-rebasing.git @c8c1b3a77934768c7f7a4a9c10140c8bec529059 2015-02-27 22:16:54 +00:00
David E. O'Brien
01b792f1f5 These CTF tools do not use anything from libctf, so no need to link with it. 2015-02-27 22:10:31 +00:00
Kenneth D. Merry
fd8be18f3f Fix I/O size calculation for pass(4) driver requests and add latency
tracking.

It is important to subtract the residual from the requested
transfer size to see how much data was actually transferred.  With
tape drives in particular, it is common to request more data than is
returned.

Also, add I/O latency tracking for CAM requests issued by
cam_periph_runccb().

If the caller supplies a struct devstat, and the I/O is a SCSI or
ATA I/O, we will track the elapsed time to provide I/O latency
statistics for the request.

sys/cam/scsi/cam_periph.c:
	In cam_periph_runccb(), subtract the residual when reporting I/O
	totals to devstat(9) for SCSI and ATA passthrough requests.

	In cam_periph_runccb(), grab the I/O start time and supply
	the start time to devstat_end_transaction() so that it can
	calculate the elapsed I/O time.

Sponsored by:	Spectra Logic
MFC after:	1 week
2015-02-27 21:35:36 +00:00
Warner Losh
b250ad3499 Make sched_random() return an unsigned number, and use uint32_t
consistently. This also matches the per-cpu pointer declaration
anyway.

This changes the tweak we give to the load from -32..31 to be 0..31
which seems more inline with the rest of the code (- rnd and the -=
64). It should also provide the randomness we need, and may fix a
signedness bug in the old code (it isn't clear that the effect was
intentional as opposed to sloppy, and the right shift of a signed
value is undefined to boot).

This stores sched_balance() behavior when it used random().

Differential Revision: https://reviews.freebsd.org/D1981
2015-02-27 21:15:12 +00:00
Nathan Whitehorn
e52a2dc83c Use appropriate alternative to -msoft-float for clang-built PowerPC kernels. 2015-02-27 20:32:50 +00:00