Commit Graph

101230 Commits

Author SHA1 Message Date
Alexander V. Chernikov
27688dfe1d Temporarily revert r274774. 2014-11-22 17:57:54 +00:00
Alexander V. Chernikov
d7ebebfba1 Fix non-debug build after r274855. 2014-11-22 17:30:37 +00:00
Alexander V. Chernikov
8f465f6690 Convert &in_ifaddr_lock to dual-locking model:
use rwlock accessible via external functions
   (IN_IFADDR_CFG_* -> in_ifaddr_cfg_*()) for all control plane tasks
  use rmlock (IN_IFADDR_RUN_*) for fast-path lookups.
2014-11-22 16:27:51 +00:00
Alexander V. Chernikov
2e47d2f953 Mark ifaddr/rtsock static entries RLLE_VALID. 2014-11-21 23:37:59 +00:00
Alexander V. Chernikov
4194b42144 Another r274774 fix. 2014-11-21 23:37:14 +00:00
Alexander V. Chernikov
86b94cffe4 Finish r274774: add more headers/fix build for non-debug case. 2014-11-21 23:36:21 +00:00
Alexander V. Chernikov
9883e41b4b Switch IF_AFDATA lock to rmlock 2014-11-21 02:28:56 +00:00
Alexander V. Chernikov
aca894e07b Finish sync: remove if_faith.c 2014-11-21 01:27:27 +00:00
Alexander V. Chernikov
4d56c133fb Sync to HEAD@r274766 2014-11-21 01:22:33 +00:00
Ed Maste
201b654e38 Clamp too-large hwpmc callchaindepth to the maximum
If the depth requested by the user is too large, it's better to provide
the maximum than the smaller default.

Sponsored by:	The FreeBSD Foundation
2014-11-20 23:16:19 +00:00
Alexander V. Chernikov
f9723c7705 Simplify API: use new NHOP_LOOKUP_AIFP flag to select what ifp
we need to return.
Rename fib[64]_lookup_nh_basic to fib[64]_lookup_nh, add flags
fields for all relevant functions.
2014-11-20 22:41:59 +00:00
John Baldwin
a92cf726f8 Lock the scsi_low code and the drivers which use it along with other
related cleanups:
- Require each driver to initalize a mutex in the scsi_low_softc that
  is shared with the scsi_low code.  This mutex is used for CAM SIMs,
  timers, and interrupt handlers.
- Replace the osdep function switch with direct calls to the relevant
  CAM functions and direct manipulation of timers via callout(9).
- Collapse the CAM-specific scsi_low_osdep_interface substructure
  directly into scsi_low_softc.
- Use bus_*() instead of bus_space_*().
- Return BUS_PROBE_DEFAULT from probe routines instead of 0.
- No need to zero softcs.
- Pass 0ul and ~0ul instead of 0 and ~0 to bus_alloc_resource().
- Spell "dettach" as "detach".
- Remove unused 'dvname' variables.
- De-spl().

Tested by:	no one
2014-11-20 20:50:05 +00:00
John Baldwin
87c4a62333 Lock spic(4) and mark it MPSAFE:
- Add a per-softc mutex as a driver lock.
- Use callout(9) instead of timeout(9).
- Set softc pointer in si_drv1 of cdev instead of looking softc
  up via devclass in cdev methods.

Tested by:	no one
2014-11-20 20:24:30 +00:00
John Baldwin
7e88c64c79 Various fixes for wl(4):
- Don't recurse driver mutex.
- Don't hold driver mutex across fubyte/subyte.
- Replace fubyte/subyte loops with copyin/copyout calls.
- Use relatively sane locking in wl_ioctl().
- Use bus space accessors instead of in*()/out*().
- Use callout(9) instead of timeout(9).
- Stop watchdog timer in detach and don't hold mutex across
  bus_teardown_intr().
- Use device_printf() and if_printf().
- De-spl().

Tested by:	no one
2014-11-20 20:09:18 +00:00
Alexander Motin
68355d6522 Remove residual xpt_release_device() call left after r272406 cleanup.
Excessive release here could trigger use-after-free condition and kernel
panic on LUN 0 disconnect.

MFC after:	1 week
2014-11-20 19:28:42 +00:00
Warner Losh
66cc25a224 Actually, that was a bad idea. Go back to MAXPARTITIONS.
Submitted by: bruce
2014-11-20 17:31:25 +00:00
Ruslan Bukin
209fe5ef9a Add L2-cache writeback/flush operations. Supported 32,128-byte line-size,
else ignored. Cavium Networks also ignored as it has non-standard config
registers.

Obtained from:	NetBSD
Sponsored by:	DARPA, AFRL
2014-11-20 17:06:41 +00:00
Andrew Turner
d455cc0410 The ranges parent bus address may just be a tag to the entry in the parent
node. Take this in to account by searching until we find the range for the
root node.

Differential Revision:	https://reviews.freebsd.org/D1160
Reviewed by:	ian
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2014-11-20 17:03:40 +00:00
Craig Rodrigues
f687a7c2dd Set the current vnet inside the ioctl handler for ipfilter.
Without this fix, the vnet was NULL and would crash.
This fix is similar to what was done inside the ioctl handler for PF.

Tested by:
   (1) Boot a kernel with "options VIMAGE" enabled
   (2) Type:

   echo "map lo0 from 10.0.0.0/24 to ! 10.0.0.0/24 -> 127.0.0.1/32" > /etc/ipnat.rules ; service ipnat onerestart

PR: 176992
Differential Revision: https://reviews.freebsd.org/D1191
Reviewed by: cy
2014-11-20 08:11:54 +00:00
Justin Hibbits
eaed5fd136 cpudep_ap_early_bootstrap() takes no arguments, so no need to give it one.
MFC after:	3 weeks
2014-11-20 06:32:47 +00:00
Adrian Chadd
7bfcb6f698 * Add a random device
* Use the same rootdev path as MALTA, so the same emulator setups
  can be used with minimal fuss.
2014-11-20 05:54:29 +00:00
Adrian Chadd
6b5b4bfa80 Include a random device. 2014-11-20 05:52:48 +00:00
Justin Hibbits
8f92db287e Use db_printsym() instead of our own in backtraces
Summary:
Currently if there are problems finding a symbol, backtrace ends up printing
something like:

0xdeadbeef: at +0x12345

Which is pretty useless.  This on its own should be fixed (retrieving symbols),
but aside from that, using db_printsym() is a better solution anyway.  If it
can't find a valid symbol it prints the actual address, and it has the added
benefit that if it can find the symbol, it might be able to print the file and
line as well.

Test Plan: Tested on my G4 PowerBook

Reviewers: #powerpc, nwhitehorn

Reviewed By: nwhitehorn

Differential Revision: https://reviews.freebsd.org/D1173

MFC after:	3 weeks
2014-11-20 03:47:04 +00:00
Justin Hibbits
a1afe0bf8e Add support for Power Button PMU events on non-ADB macs, such as aluminum
PowerBooks.

MFC after:	2 weeks
Relnotes:	yes
2014-11-20 03:23:33 +00:00
Navdeep Parhar
729fee332b cxgbe(4): figure out the max payload size and save it for later.
MFC after:	1 week
2014-11-19 20:16:56 +00:00
Warner Losh
dd87e2c610 The number of BSD partitions is variable. Return the proper number
(which is in basetable->gpt_entries).

Submitted by: ae@
2014-11-19 18:55:27 +00:00
Gleb Smirnoff
79f0deb938 Use __func__ in KASSERTs, since the code is about to be moved to other place.
Sponsored by:	Nginx, Inc.
2014-11-19 16:29:39 +00:00
Gleb Smirnoff
2a5eef69a6 In vnode_pager_generic_getpages() vp->v_mount is dereferenced in the
beginning, thus can't be NULL.

Sponsored by:	Nginx, Inc.
2014-11-19 15:17:19 +00:00
Ruslan Bukin
1230159bc7 Add BERI-specific virtio mmio "platform" device.
This device provides a connector to Altera PIO allowing us
to interrupt software-implemented virtio mmio backend.

Sponsored by:	DARPA, AFRL
2014-11-19 14:49:29 +00:00
Gleb Smirnoff
67af272bcf Do not allocate zero-length mbuf in sosend_generic().
Found by:	pho
Sponsored by:	Nginx, Inc.
2014-11-19 14:27:38 +00:00
Zbigniew Bodek
dc61566f95 Stop using early_putc immediately after configuring console with cninit()
Early UART should be released right after system console initialization is
completed. Otherwise, after cninit() both early and system console coexist
what may lead to various issues (i.a. writing to unmapped early
UART address). This cannot be done in cninit_finish() since it can be
called late at the end of MI configuration.

Obtained from:   Semihalf
Reviewed by:     andrew
Sponsored by:    The FreeBSD Foundation
2014-11-19 14:23:29 +00:00
Ermal Luçi
7b56cc430a pf(4) needs to have a correct checksum during its processing.
Calculate checksums for the IPv6 path when needed before
delving into pf(4) code as required.

PR:     172648, 179392
Reviewed by:    glebius@
Approved by:    gnn@
Obtained from:  pfSense
MFC after:      1 week
Sponsored by:   Netgate
2014-11-19 13:31:08 +00:00
Alexander Motin
b3a9e657c3 Fix build without INVARIANTS, broken by r274675. 2014-11-19 13:04:25 +00:00
Dmitry Chagin
34b3339810 Revert r274635 as it's completely wrong.
The parent of a pci dev device is a pciX device which do not
implement the PCIB_POWER_FOR_SLEEP method from pcib_if.m.
2014-11-19 11:05:45 +00:00
Edward Tomasz Napierala
9606f9b5c4 Fix typo.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-11-19 08:59:49 +00:00
Dimitry Andric
cfd2f3f928 Fix the following -Werror warning from clang 3.5.0, while building
lib/libngatm:

sys/contrib/ngatm/netnatm/saal/saal_sscop.c:4030:32: error: 'break' is bound to current loop, GCC binds it to the enclosing loop [-Werror,-Wgcc-compat]
                } while(sn < sscop->vr_h && !QFIND(&sscop->rbuf, sn));
                                             ^
sys/contrib/ngatm/netnatm/saal/saal_sscop.c:173:4: note: expanded from macro 'QFIND'
                        break;                                          \
                        ^
1 error generated.

The idea is to remove any ambiguity by replacing the macro with an
equivalent static inline function.

Reviewed by:	emaste, rpaulo
See also:	http://reviews.llvm.org/D2518
Differential Revision: https://reviews.freebsd.org/D1188
2014-11-19 07:47:37 +00:00
Dimitry Andric
c577699e4b Fix the following -Werror warning from clang 3.5.0, while building cddl/lib/libctf:
In file included from cddl/contrib/opensolaris/common/ctf/ctf_create.c:31:
In file included from sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h:34:
sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h:334:9: warning: '_ILP32' macro redefined [-Wmacro-redefined]
#define _ILP32
        ^
<built-in>:26:9: note: previous definition is here
#define _ILP32 1
        ^
1 warning generated.

This is because clang 3.5.0 started predefining _ILP32 and __ILP32__ for
the i386 arch.  (Earlier versions already predefined _LP64 and __LP64__
for the x86_64 arch.)

Reviewed by:	emaste, avg, smh, delphij, markj
Differential Revision: https://reviews.freebsd.org/D1187
2014-11-19 07:44:21 +00:00
Kevin Lo
fa20eb98a8 Add Trendnet TEW-646UBH.
Submitted by:	bolshakov_1 at yahoo dot com
2014-11-19 05:38:45 +00:00
Xin LI
8c3d6a4ab2 Make vfs.zfs.max_recordsize read-write at runtime.
MFC after:	2 weeks
2014-11-18 22:35:19 +00:00
John Baldwin
c1dffb2f08 Add locking to wds(4) and mark MPSAFE.
- Add per-softc mutex.
- Use mutex for CAM SIM lock.
- Use bus_*() instead of inb() and outb().
- Use bus_alloc_resource_any() when reasonable.

Tested by:	no one
2014-11-18 22:12:51 +00:00
John Baldwin
42e8c47b78 Add locking to scd(4) and mark MPSAFE.
- Actually use existing per-softc mutex.
- Use mutex in cdev routines and remove D_NEEDGIANT.
- Use callout(9) instead of timeout(9).
- Don't check for impossible conditions (e.g. SCDINIT being clear).
- Use bus_*() instead of bus_space_*().

Tested by:	no one
2014-11-18 22:02:37 +00:00
John Baldwin
369934d602 Cleanups to pst(4):
- Use callout(9) instead of timeout(9).
- Don't bother zero'ing the softc.
- Destroy mutex on detach.

Tested by:	no one
2014-11-18 21:58:57 +00:00
John Baldwin
caddd60abd Add locking to mly(4) and mark MPSAFE.
- Add a per-softc mutex.
- Use mutex as CAM sim lock.
- Use taskqueue_thread instead of taskqueue_swi_giant.
- Use callout(9) instead of timeout(9).
- Use bus_*() instead of bus_space_*().

Tested by:	no one
2014-11-18 21:55:50 +00:00
John Baldwin
23c31a3c5d Add locking to mcd(4) and mark MPSAFE.
- Actually use existing per-softc mutex.
- Use mutex in cdev routines and remove D_NEEDGIANT.
- Use callout(9) instead of timeout(9).
- Don't check for impossible conditions (e.g. MCDINIT being clear).
- Remove critical_enter/exit when sending a PIO command.
- Use bus_*() instead of bus_space_*().

Tested by:	no one
2014-11-18 21:51:01 +00:00
John Baldwin
2a0db815fe Convert the refire_notify_ack timer from timeout(9) to callout(9).
Tested by:	no one
2014-11-18 21:03:46 +00:00
Xin LI
8efcd876ca Add a tunable for spa_slop_shift which controls how much space we
would reserve by default.  Tuning is not recommended.

MFC after:	2 weeks
2014-11-18 18:52:38 +00:00
Xin LI
18144ab1a3 Allow tuning zfs_max_recordsize via loader tunable. Tuning is NOT
recommended.

Requested by:	Slawa Olhovchenkov <slw zxy spb ru>
MFC after:	2 weeks
2014-11-18 18:40:01 +00:00
Luiz Otavio O Souza
edd14576c4 Make gpio_default_map_gpios() static. No functional changes. 2014-11-18 17:37:33 +00:00
Luiz Otavio O Souza
667357dc9b Moves all the duplicate code to a single function.
Verify for invalid modes and unwanted flags before pass the new flags to
driver.
2014-11-18 17:22:08 +00:00
Warner Losh
61c009a1a8 These delays aren't needed. Elimate them. They should be on the order
of a few cycles at most, not 10us. They make it impossible to
implement half-duplex protocols that are faster than about 1KHz.

Sponsored by: Netflix
2014-11-18 17:07:02 +00:00