freebsd.git
8 years agocxgbe(4): Add a new knob that controls the congestion response of netmap
np [Mon, 6 Jul 2015 20:56:59 +0000 (20:56 +0000)]
cxgbe(4): Add a new knob that controls the congestion response of netmap
rx queues.  The default is to drop rather than backpressure.

This decouples the congestion settings of NIC and netmap rx queues.

MFC after: 3 days

8 years agocxgbe(4): Do not override the the global defaults for congestion drops.
np [Mon, 6 Jul 2015 20:28:42 +0000 (20:28 +0000)]
cxgbe(4): Do not override the the global defaults for congestion drops.
The hw.cxgbe.cong_drop knob is not affected by this change because the
driver sets up congestion drop on a per-queue basis.

MFC after: 3 days

8 years agoThe results of the vote are in. This reflects that vote. Single
imp [Mon, 6 Jul 2015 20:10:47 +0000 (20:10 +0000)]
The results of the vote are in. This reflects that vote. Single
line statements inside of braces is recognized as an acceptable
style.
http://reviews.freebsd.org/V3
As always, this isn't license for wholesale change, etc.

8 years agoMove the 'devmem' device nodes from /dev/vmm to /dev/vmm.io
neel [Mon, 6 Jul 2015 19:41:43 +0000 (19:41 +0000)]
Move the 'devmem' device nodes from /dev/vmm to /dev/vmm.io

Some external tools just do a 'ls /dev/vmm' to figure out the bhyve virtual
machines on the host. These tools break if the devmem device nodes also
appear in /dev/vmm.

Requested by: grehan

8 years agoAlways assert DCD and DSR in bhyve's uart emulation.
neel [Mon, 6 Jul 2015 19:33:29 +0000 (19:33 +0000)]
Always assert DCD and DSR in bhyve's uart emulation.

The /etc/ttys entry for a serial console in FreeBSD/x86 is as follows:
ttyu0   "/usr/libexec/getty 3wire"      vt100   onifconsole secure

The initial terminal type passed to getty(8) is "3wire" which sets the
CLOCAL flag. However reset(1) clears this flag and any programs that try
to open the terminal will hang waiting for DCD to be asserted.

Fix this by always asserting DCD and DSR in the emulated uart.

The following discussion on virtualization@ has more details:
https://lists.freebsd.org/pipermail/freebsd-virtualization/2015-June/003666.html

Reported by: jmg
Discussed with: grehan

8 years agoFix for non-random IV's when CRD_F_IV_PRESENT and CRD_F_IV_EXPLICIT
jmg [Mon, 6 Jul 2015 19:30:29 +0000 (19:30 +0000)]
Fix for non-random IV's when CRD_F_IV_PRESENT and CRD_F_IV_EXPLICIT
flags are not specified... This bug was introduced in r275732...

This only affects IPsec ESP only policies w/ the aesni module loaded,
other subsystems specify one or both of the flags...

Reviewed by: gnn, delphij, eri

8 years agoremove _NORMAL flag which isn't suppose to be used w/ _alloc_ctx...
jmg [Mon, 6 Jul 2015 19:17:56 +0000 (19:17 +0000)]
remove _NORMAL flag which isn't suppose to be used w/ _alloc_ctx...

Reviewed by: kib (a while ago)

8 years agotty: replace several curthread->td_proc with stored curproc
mjg [Mon, 6 Jul 2015 18:53:56 +0000 (18:53 +0000)]
tty: replace several curthread->td_proc with stored curproc

No functional changes.

8 years agoIntroduce ITS support for ARM64
zbb [Mon, 6 Jul 2015 18:27:41 +0000 (18:27 +0000)]
Introduce ITS support for ARM64

Add ARM ITS (Interrupt Translation Services) support required
to bring-up message signalled interrupts on some ARM64 platforms.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation

8 years agoAdd more tlb invalidations. We currently invalidate when we may not need
andrew [Mon, 6 Jul 2015 18:27:18 +0000 (18:27 +0000)]
Add more tlb invalidations. We currently invalidate when we may not need
to, but with this I can boot on a simulator that models the tlb.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoWhen initializing the (unused) TX descriptors it is not necessary set the
loos [Mon, 6 Jul 2015 17:13:17 +0000 (17:13 +0000)]
When initializing the (unused) TX descriptors it is not necessary set the
chain bit.

Obtained from: NetBSD

8 years agoUse uint32_t consistently to store registers values.
loos [Mon, 6 Jul 2015 16:45:48 +0000 (16:45 +0000)]
Use uint32_t consistently to store registers values.

Always use unsigned numbers to avoid undefined behavior on (1 << 31).

Remove unused variables and some stray semicolons.

No functional changes.

8 years agoDon't acquire sysctlmemlock in userland_sysctl() when the old value
pkelsey [Mon, 6 Jul 2015 16:07:21 +0000 (16:07 +0000)]
Don't acquire sysctlmemlock in userland_sysctl() when the old value
pointer is NULL, as in that case there are no userland pages that
could potentially be wired.  It is common for old to be NULL and
oldlenp to be non-NULL in calls to userland_sysctl(), as this is used
to probe for the length of a variable-length sysctl entry before
retrieving a value.  Note that it is typical for such calls to be made
with an uninitialized value in *oldlenp, so sysctlmemlock was
essentially being acquired at random (depending on the uninitialized
value in *oldlenp being > PAGE_SIZE or not) for these calls prior to
this patch.

Differential Revision: https://reviews.freebsd.org/D2987
Reviewed by: mjg, kib
Approved by: jmallett (mentor)
MFC after: 1 month

8 years agoMutex memory is not zeroed, add MTX_NEW.
kib [Mon, 6 Jul 2015 14:09:00 +0000 (14:09 +0000)]
Mutex memory is not zeroed, add MTX_NEW.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoFill the port and protocol information in the SADB_ACQUIRE message
ae [Mon, 6 Jul 2015 12:40:31 +0000 (12:40 +0000)]
Fill the port and protocol information in the SADB_ACQUIRE message
in case when security policy has it as required by RFC 2367.

PR: 192774
Differential Revision: https://reviews.freebsd.org/D2972
MFC after: 1 week

8 years agoAdd hton and ntoh to the arm64 Symbols.map file, they exist but were not
andrew [Mon, 6 Jul 2015 09:57:40 +0000 (09:57 +0000)]
Add hton and ntoh to the arm64 Symbols.map file, they exist but were not
exported.

8 years agoCorrect bit offsets for ahci quirks
smh [Mon, 6 Jul 2015 09:44:07 +0000 (09:44 +0000)]
Correct bit offsets for ahci quirks

Fix bit offsets causing incorrect quirks being reported on boot for ahci
introduced by r280184.

MFC after: 3 days
Sponsored by: Multiplay

8 years agoMerge booke and aim interrupt.c files.
jhibbits [Mon, 6 Jul 2015 05:08:57 +0000 (05:08 +0000)]
Merge booke and aim interrupt.c files.

Summary:
Both booke and AIM interrupt.c files contain nearly identical code.  This merges
the two files, to reduce duplication.

Reviewers: #powerpc, marcel

Reviewed By: marcel

Subscribers: imp

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

8 years agoFix the sent packets statistics for if_dwc.
loos [Mon, 6 Jul 2015 03:06:13 +0000 (03:06 +0000)]
Fix the sent packets statistics for if_dwc.

8 years agoFix if_loop so bpfwrite() can use it regardless of the state of
pkelsey [Mon, 6 Jul 2015 02:12:49 +0000 (02:12 +0000)]
Fix if_loop so bpfwrite() can use it regardless of the state of
bd_hdrcmplt.  As if_loop does not use link-level headers, its behavior
when used by bpfwrite() should be the same regardless of the state of
bd_hdrcmplt.  Without this change, libpcap (and other BPF users that
work like it) fail when writing to loopback interfaces.

Differential Revision: https://reviews.freebsd.org/D2989
Reviewed by: gnn, melifaro
Approved by: jmallett (mentor)
MFC after: 3 days

8 years agoFix range upper bound for uint32_t and uint64_t, and reformat range
pkelsey [Mon, 6 Jul 2015 01:48:23 +0000 (01:48 +0000)]
Fix range upper bound for uint32_t and uint64_t, and reformat range
description for uint8_t, uint16_t, uint32_t, and uint64_t.

Differential Revision: https://reviews.freebsd.org/D2988
Reviewed by: rstone, wblock
Approved by: jmallett (mentor)
Sponsored by: Norse Corp, Inc.

8 years agoFix sysctl(3) so it returns the intended values for all mib names in
pkelsey [Mon, 6 Jul 2015 01:42:12 +0000 (01:42 +0000)]
Fix sysctl(3) so it returns the intended values for all mib names in
the 'user' sysctl tree, which have all been coming back 0 or empty
since r240176.

Differential Revision: https://reviews.freebsd.org/D2945
Reviewed by: sbruno
Approved by: jmallett (mentor)
MFC after: 3 days

8 years agoRemove a BUGS entry that was addressed by r282300.
markj [Sun, 5 Jul 2015 23:24:52 +0000 (23:24 +0000)]
Remove a BUGS entry that was addressed by r282300.

8 years agoRename the dtrace-* man pages to dtrace_* for consistency with other
markj [Sun, 5 Jul 2015 23:23:12 +0000 (23:23 +0000)]
Rename the dtrace-* man pages to dtrace_* for consistency with other
subsection man pages (e.g. geom_*, mac_*, snd_*).

8 years agoMove the comment describing namei(9) back to namei()'s definition.
markj [Sun, 5 Jul 2015 22:56:41 +0000 (22:56 +0000)]
Move the comment describing namei(9) back to namei()'s definition.

MFC after: 3 days

8 years agoThe bug caught by flock's test 16 was fixed by r268384.
markj [Sun, 5 Jul 2015 22:49:26 +0000 (22:49 +0000)]
The bug caught by flock's test 16 was fixed by r268384.

MFC after: 3 days

8 years agoRemove a stale descriptive comment for gbincore().
markj [Sun, 5 Jul 2015 22:44:41 +0000 (22:44 +0000)]
Remove a stale descriptive comment for gbincore().

The splay trees referenced in the comment were converted to
path-compressed tries in r250551.

MFC after: 3 days

8 years agoCheck suspendability on the mountpoint returned by VOP_GETWRITEMOUNT.
markj [Sun, 5 Jul 2015 22:37:33 +0000 (22:37 +0000)]
Check suspendability on the mountpoint returned by VOP_GETWRITEMOUNT.
This obviates the need for a MNTK_SUSPENDABLE flag, since passthrough
filesystems like nullfs and unionfs no longer need to inherit this
information from their lower layer(s). This change also restores the
pre-r273336 behaviour of using the presence of a susp_clean VFS method to
request suspension support.

Reviewed by: kib, mjg
Differential Revision: https://reviews.freebsd.org/D2937

8 years agoAdd a local variable initialization needed in the OBJT_DEFAULT case.
markj [Sun, 5 Jul 2015 22:26:19 +0000 (22:26 +0000)]
Add a local variable initialization needed in the OBJT_DEFAULT case.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D2992

8 years agoDocument the locking context for the directly dispatched callouts.
kib [Sun, 5 Jul 2015 19:29:24 +0000 (19:29 +0000)]
Document the locking context for the directly dispatched callouts.
Cross-reference timeout(9).

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agofd: make 'rights' a manadatory argument to fget* functions
mjg [Sun, 5 Jul 2015 19:05:16 +0000 (19:05 +0000)]
fd: make 'rights' a manadatory argument to fget* functions

8 years agoAdd the kernel functions needed to enable threading.
andrew [Sun, 5 Jul 2015 18:16:06 +0000 (18:16 +0000)]
Add the kernel functions needed to enable threading.

Sponsored by: ABT Systems Ltd

8 years agoUpdate ntp version number. (This is a manual update that was missed.)
cy [Sun, 5 Jul 2015 16:48:40 +0000 (16:48 +0000)]
Update ntp version number. (This is a manual update that was missed.)

8 years agoMFV ntp-4.2.8p3 (r284990).
cy [Sun, 5 Jul 2015 15:42:16 +0000 (15:42 +0000)]
MFV ntp-4.2.8p3 (r284990).

Approved by: roberto, delphij
Security: VuXML: 0d0f3050-1f69-11e5-9ba9-d050996490d0
Security: http://bugs.ntp.org/show_bug.cgi?id=2853
Security: https://www.kb.cert.org/vuls/id/668167
Security: http://support.ntp.org/bin/view/Main/SecurityNotice#June_2015_NTP_Security_Vulnerabi

8 years agoFix GENERIC64 and LINT64 powerpc builds after r285144.
bz [Sun, 5 Jul 2015 15:30:16 +0000 (15:30 +0000)]
Fix GENERIC64 and LINT64 powerpc builds after r285144.

8 years agoEnable ipsec by default on all armv6 platforms.
ian [Sun, 5 Jul 2015 14:16:31 +0000 (14:16 +0000)]
Enable ipsec by default on all armv6 platforms.

8 years agoEnsure all the required files get built when you include the IPSEC option.
ian [Sun, 5 Jul 2015 14:15:58 +0000 (14:15 +0000)]
Ensure all the required files get built when you include the IPSEC option.

8 years agoAdd on the addend when in the R_AARCH64_ABS64 and R_AARCH64_GLOB_DAT cases.
andrew [Sun, 5 Jul 2015 11:42:01 +0000 (11:42 +0000)]
Add on the addend when in the R_AARCH64_ABS64 and R_AARCH64_GLOB_DAT cases.
This fixes at least sshd, and some of the boehm-gc tests.

Sponsored by: ABT Systems Ltd

8 years agoRemove dead code
bapt [Sun, 5 Jul 2015 10:14:34 +0000 (10:14 +0000)]
Remove dead code

8 years agoAlso validate hours via strptime_l(3)
bapt [Sun, 5 Jul 2015 10:11:35 +0000 (10:11 +0000)]
Also validate hours via strptime_l(3)

Simplify the code, by only using one parser, ensure the dates (hours and dates)
are valid

8 years agoValidate expiration dates
bapt [Sun, 5 Jul 2015 09:48:03 +0000 (09:48 +0000)]
Validate expiration dates

Use strptime_l(3) to validate the dates provided in input

8 years agoMake first step toward supporting target and initiator roles same time.
mav [Sun, 5 Jul 2015 03:38:58 +0000 (03:38 +0000)]
Make first step toward supporting target and initiator roles same time.

To avoid conflicts between target and initiator devices in CAM, make
CTL use target ID reported by HBA as its initiator_id in XPT_PATH_INQ.
That target ID is known to never be used for initiator role, so it won't
conflict.  For Fibre Channel and FireWire HBAs this specific ID choice
is irrelevant since all target IDs there are virtual. Same time for SPI
HBAs it seems could be even requirement to use same target ID for both
initiator and target roles.

While there are some more things to polish in isp(4) driver, first tests
of using both roles same time on the same port appeared successfull:

# camcontrol devlist -v
scbus0 on isp0 bus 0:
<FREEBSD CTLDISK 0001>             at scbus0 target 1 lun 0 (da20,pass21)
<>                                 at scbus0 target 256 lun 0 (ctl0)
<>                                 at scbus0 target -1 lun ffffffff (ctl1)

8 years agoRemove extra level of target ID indirection (isp_dev_map).
mav [Sun, 5 Jul 2015 02:09:46 +0000 (02:09 +0000)]
Remove extra level of target ID indirection (isp_dev_map).

FreeBSD never had limitation on number of target IDs, and there is no
any other requirement to allocate them densely.  Since slots of port
database already populated just sequentially, there is no much need
for another indirection to allocate sequentially too.

8 years agoSummary: Add missing files necessary to build with IPSEC and crypto
gnn [Sat, 4 Jul 2015 21:32:44 +0000 (21:32 +0000)]
Summary: Add missing files necessary to build with IPSEC and crypto

8 years agoFix up tabs vs. spaces
gnn [Sat, 4 Jul 2015 20:31:06 +0000 (20:31 +0000)]
Fix up tabs vs. spaces

8 years agoAdd llvm patch corresponding to r285149.
dim [Sat, 4 Jul 2015 20:09:24 +0000 (20:09 +0000)]
Add llvm patch corresponding to r285149.

8 years agoPull in r241142 from upstream llvm trunk (by David Majnemer):
dim [Sat, 4 Jul 2015 20:07:37 +0000 (20:07 +0000)]
Pull in r241142 from upstream llvm trunk (by David Majnemer):

  [SCCP] Turn loads of null into undef instead of zero initialized values

  Surprisingly, this is a correctness issue: the mmx type exists for
  calling convention purposes, LLVM doesn't have a zero representation for
  them.

  This partially fixes PR23999.

Pull in r241143 from upstream llvm trunk (by David Majnemer):

  [LoopUnroll] Use undef for phis with no value live

  We would create a phi node with a zero initialized operand instead of
  undef in the case where no value was originally available.  This was
  problematic for x86_mmx which has no null value.

These fix a "Cannot create a null constant of that type!" error when
compiling the graphics/sdl2_gfx port with MMX enabled.

Reported by: amdmi3

8 years agoUse the correct type for physical addresses.
jhibbits [Sat, 4 Jul 2015 19:00:38 +0000 (19:00 +0000)]
Use the correct type for physical addresses.

On Book-E, physical addresses are actually 36-bits, not 32-bits.  This is
currently worked around by ignoring the top bits.  However, in some cases, the
boot loader configures CCSR to something above the 32-bit mark.  This is stage 1
in updating the pmap to handle 36-bit physaddr.

8 years agoChange comment added in r284540.
mav [Sat, 4 Jul 2015 18:51:54 +0000 (18:51 +0000)]
Change comment added in r284540.

This appeared to be not card's issue, but driver's, though solution is
the same so far.

8 years agoDrop discovered targets when initiator role is disabled.
mav [Sat, 4 Jul 2015 18:38:46 +0000 (18:38 +0000)]
Drop discovered targets when initiator role is disabled.

8 years agoRemove duplicate header string.h.
araujo [Sat, 4 Jul 2015 18:36:02 +0000 (18:36 +0000)]
Remove duplicate header string.h.

8 years agoAdd machine check register printing
jhibbits [Sat, 4 Jul 2015 18:16:41 +0000 (18:16 +0000)]
Add machine check register printing

This will print out the Memory Subsystem Status Register on MPC745x (G4+ class),
and the Machine Check Status Register on Book-E class CPUs, to aid in debugging
machine checks.  Other relevant registers, for other CPUs, can be added in the
future.

8 years agoRemove unused variable flags reported by clang. The function zygote_clone()
araujo [Sat, 4 Jul 2015 17:38:56 +0000 (17:38 +0000)]
Remove unused variable flags reported by clang. The function zygote_clone()
always receive the flags with value 0 and this flags is never checked on
zygote_main().

Differential Revision: D2689
Reviewed by: rodrigc, oshogbo

8 years agoEnable IPSEC in all GENERIC kernels.
gnn [Sat, 4 Jul 2015 17:37:00 +0000 (17:37 +0000)]
Enable IPSEC in all GENERIC kernels.

Universe and kernel build tests passed 4 July 2015

PR: 128030
Sponsored by: Rubicon Communications (Netgate)

8 years agoRemove unused variable to silence clang warning.
araujo [Sat, 4 Jul 2015 17:22:07 +0000 (17:22 +0000)]
Remove unused variable to silence clang warning.

Differential Revision: D2683
Reviewed by: rodrigc, bapt

8 years agoAdd fdclose(3) function.
oshogbo [Sat, 4 Jul 2015 16:42:14 +0000 (16:42 +0000)]
Add fdclose(3) function.

This function is equivalent to fclose(3) function except that it
does not close the underlying file descriptor.
fdclose(3) is step forward to make FILE structure private.

Reviewed by: wblock, jilles, jhb, pjd
Approved by: pjd (mentor)
Differential Revision: https://reviews.freebsd.org/D2697

8 years agoMove the nvlist source and private includes from sys/kern to seperate
oshogbo [Sat, 4 Jul 2015 16:33:37 +0000 (16:33 +0000)]
Move the nvlist source and private includes from sys/kern to seperate
directory sys/contrib/libnv.

The goal of this operation is to NOT install header files which shouldn't
be used outside the nvlist library.

Approved by: pjd (mentor)

8 years agoInstall loader.rc with ARM u-boot loader (ubldr).
loos [Sat, 4 Jul 2015 16:19:38 +0000 (16:19 +0000)]
Install loader.rc with ARM u-boot loader (ubldr).

loader.rc is the responsible to read and process loader.conf variables.

This fix the issue of loader.conf being silently ignored.

MFC after: 3 days

8 years agoFix validation of crypted password
bapt [Sat, 4 Jul 2015 15:56:59 +0000 (15:56 +0000)]
Fix validation of crypted password
Small cleanups

8 years agoAlso validate inputs of pw groupmod -h and groupmod -H
bapt [Sat, 4 Jul 2015 15:54:11 +0000 (15:54 +0000)]
Also validate inputs of pw groupmod -h and groupmod -H

8 years agovfs: use shared vnode locking when looking up ".." in vop_stdvptocnp
mjg [Sat, 4 Jul 2015 15:46:39 +0000 (15:46 +0000)]
vfs: use shared vnode locking when looking up ".." in vop_stdvptocnp

Briefly discussed with: kib

8 years agofd: de-k&r-ify functions + some whitespace fixes
mjg [Sat, 4 Jul 2015 15:42:03 +0000 (15:42 +0000)]
fd: de-k&r-ify functions + some whitespace fixes

No functional changes.

8 years agoValidate input of pw usermod -h and pwusermod -H
bapt [Sat, 4 Jul 2015 15:27:04 +0000 (15:27 +0000)]
Validate input of pw usermod -h and pwusermod -H

Push the code that set the password into a separate function to improve
readability

Add regression tests about pw usermod -h and pw usermod -H

8 years agosysctl: get rid of sysctl_lock/unlock
mjg [Sat, 4 Jul 2015 14:44:39 +0000 (14:44 +0000)]
sysctl: get rid of sysctl_lock/unlock

Inline their contents into the only consumer.

8 years agoRemove non-existent dnvlist functions.
oshogbo [Sat, 4 Jul 2015 10:33:33 +0000 (10:33 +0000)]
Remove non-existent dnvlist functions.

Approved by: pjd (mentor)

8 years agoMove nvlist documentation to the FreeBSD Kernel Developer's sections.
oshogbo [Sat, 4 Jul 2015 10:27:30 +0000 (10:27 +0000)]
Move nvlist documentation to the FreeBSD Kernel Developer's sections.

Approved by: pjd (mentor)

8 years agoStaticize some stuff in mountd(8); no functional changes.
trasz [Sat, 4 Jul 2015 08:40:48 +0000 (08:40 +0000)]
Staticize some stuff in mountd(8); no functional changes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoimprove dependencies for this module a bit... not great, but at
jmg [Sat, 4 Jul 2015 08:16:32 +0000 (08:16 +0000)]
improve dependencies for this module a bit...  not great, but at
least gives some basics...  I would add them to DPSRC, but due to the
intrinsics headers, they can't be added...

8 years agosysctl: remove a debugging printf which crept in with r285125
mjg [Sat, 4 Jul 2015 07:01:43 +0000 (07:01 +0000)]
sysctl: remove a debugging printf which crept in with r285125

8 years agosysctl: switch sysctllock to a sleepable rmlock
mjg [Sat, 4 Jul 2015 06:54:15 +0000 (06:54 +0000)]
sysctl: switch sysctllock to a sleepable rmlock

The lock is almost never taken for writing.

8 years agoCache _MPATH and pass it down into the modules build. Some NFS setups
imp [Sat, 4 Jul 2015 05:43:45 +0000 (05:43 +0000)]
Cache _MPATH and pass it down into the modules build. Some NFS setups
make the find it does extremely expensive, so compute it only
once. Also make sure the 'traditional' module building method works at
the expense of a bit of duplicated code.

8 years agoQuieten the scorpion SoC/WMAC reset path. Stuff the non-error stuff
adrian [Sat, 4 Jul 2015 03:15:42 +0000 (03:15 +0000)]
Quieten the scorpion SoC/WMAC reset path.  Stuff the non-error stuff
under HALDEBUG().

8 years agoCall the WMAC DDR flush before handling an interrupt for the
adrian [Sat, 4 Jul 2015 03:07:28 +0000 (03:07 +0000)]
Call the WMAC DDR flush before handling an interrupt for the
Atheros AHB (internally) connected MAC.

TODO:

* verify the interrupt was for us before doing the DDR flush.

8 years agoReshuffle all of the DDR flush operations into a single switch/mux,
adrian [Sat, 4 Jul 2015 03:05:57 +0000 (03:05 +0000)]
Reshuffle all of the DDR flush operations into a single switch/mux,
and start teaching subsystems about it.

The Atheros MIPS platforms don't guarantee any kind of FIFO consistency
with interrupts in hardware.  So software needs to do a flush when it
receives an interrupt and before it calls the interrupt handler.

There are new ones for the QCA934x and QCA955x, so do a few things:

* Get rid of the individual ones (for ethernet and IP2);
* Create a mux and enum listing all the variations on DDR flushes;
* replace the uses of IP2 with the relevant one (which will typically
  be "PCI" here);
* call the USB DDR flush before calling the real USB interrupt handlers;
* call the ethernet one upon receiving an interrupt that's for us,
  rather than never calling it during operation.

Tested:

* QCA9558 (TP-Link archer c7 v2)
* AR9331 (Carambola 2)

TODO:

* PCI, USB, ethernet, etc need to do a double-check to see if the
  interrupt was truely for them before doing the DDR.  For now I
  prefer "correct" over "fast".

8 years agoWake up the hardware before doing anything in sysctl.
adrian [Sat, 4 Jul 2015 02:59:30 +0000 (02:59 +0000)]
Wake up the hardware before doing anything in sysctl.

This stops the panics that occur on MIPS platforms when doing say,
'sysctl dev.ath.0' whilst the MAC is asleep.  The MIPS platform is
rather unforgiving in getting power-save register access wrong and you
will get all kinds of odd failures if you don't have things woken
up at the right times.

Tested:

* QCA9558 (TP-Link Archer C7 v2)
* AR9331 (Carambola 2)

.. with no VAPs configured and ath0 down (thus the MAC is definitely
   asleep.)

PR: kern/201117

8 years agoAdd support for TEST_METADATA
jmmv [Sat, 4 Jul 2015 02:37:36 +0000 (02:37 +0000)]
Add support for TEST_METADATA

Allow Makefiles to define generic metadata settings that apply to all test
programs defined by a Makefile.  The generic TEST_METADATA variable extends
the per-test program settings already supported via TEST_METADATA.<program>.

This feature will be useful to easily apply some settings to all programs
in a directory.  In particular, Kyua 0.12 will support parallel execution
of test programs and a bunch of them will need to be tagged as is_exclusive
to indicate that they cannot be run in parallel with anything else due to
their side-effects.  It will be reasonable to set this setting on whole
directories.

MFC after: 1 week

8 years agoAdd missing shebang
jmmv [Sat, 4 Jul 2015 02:24:47 +0000 (02:24 +0000)]
Add missing shebang

Plain test programs are not preprocessed by the build system (as opposed to
ATF test cases, which automatically gain a shebang pointing at atf-sh), so
we must take care of providing the shebang ourselves.

I'm not sure why this was not causing problems with Kyua 0.11, but the
upcoming 0.12 release chokes on this particular issue.

MFC after: 1 week

8 years agoMake cleanup routines idempotent
jmmv [Sat, 4 Jul 2015 02:22:26 +0000 (02:22 +0000)]
Make cleanup routines idempotent

cleanup routines can be executed at any point during the execution of the
body, including even before the body has done any real work.  In those
cases, cleanup routines should be careful to not raise spurious errors so
as to not "override" the actual result of the test case.

This is just general good coding style but is not a problem in practice
for these specific tests.  (The way I discovered the issue, though, was
due to a regression I introduced in Kyua itself while refactoring some
internals.)

MFC after: 1 week

8 years agoRevert r285018, r285019, r285076, r285078, r285082.
gjb [Sat, 4 Jul 2015 00:01:41 +0000 (00:01 +0000)]
Revert r285018, r285019, r285076, r285078, r285082.

The true cause of the missing UFS/MSDOSFS labels has been
identified, and only affects stable/10 at the moment.

An request for commit to stable/10 will be pending RE approval
after this commit.

MFC after: 1 day
X-MFC-Note: never
X-MFC-Never: r285018, r285019, r285076, r285078, r285082
Sponsored by: The FreeBSD Foundation

8 years agoIf a "principal" argument isn't provided for a Kerberized NFS mount,
rmacklem [Fri, 3 Jul 2015 22:11:07 +0000 (22:11 +0000)]
If a "principal" argument isn't provided for a Kerberized NFS mount,
the kernel would generate a bogus one with a ":/<path>" suffix.
This would only occur for the case where there was no explicit
"principal" argument and the getaddrinfo() call in mount_nfs.c failed to a
return a cannonical name for the server.
This patch fixes this unusual case.

PR: 201073
Submitted by: masato@itc.naist.jp
MFC after: 2 weeks

8 years agoUpdate the date on the manual page.
gnn [Fri, 3 Jul 2015 20:42:31 +0000 (20:42 +0000)]
Update the date on the manual page.

Noticed by: bz

8 years agoNew AES modes for IPSec, user space components.
gnn [Fri, 3 Jul 2015 20:09:14 +0000 (20:09 +0000)]
New AES modes for IPSec, user space components.
Update setkey and libipsec to understand aes-gcm-16 as an
encryption method.

A partial commit of the work in review D2936.

Submitted by: eri
Reviewed by: jmg
MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)

8 years agoKeep IPv6 address specified by IPV6_PKTINFO socket option in kernel
ae [Fri, 3 Jul 2015 19:01:38 +0000 (19:01 +0000)]
Keep IPv6 address specified by IPV6_PKTINFO socket option in kernel
internal form to be able handle link-local IPv6 addresses.

Reported by: kp
Tested by: kp

8 years agoAdd the routines to activate the GMAC clock and setup the GMAC mode.
loos [Fri, 3 Jul 2015 18:39:25 +0000 (18:39 +0000)]
Add the routines to activate the GMAC clock and setup the GMAC mode.

Tested on Cubieboard 2 and Banana pi.

8 years agoRename a10_emac_gpio_config() to a10_gpio_ethernet_activate() to make the
loos [Fri, 3 Jul 2015 17:54:41 +0000 (17:54 +0000)]
Rename a10_emac_gpio_config() to a10_gpio_ethernet_activate() to make the
change to GMAC easier on A20 SoCs.

On A10 only the EMAC controller is available (fast ethernet), but on A20
there is also GMAC a high (or better) performant controller (gigabit
ethernet).

On A20 the both controllers uses the same pins to talk to the ethernet PHY
(MII or RGMII) and they can be selected by the GPIO pin mux.

There is work in progress to bring in GMAC support.

8 years agoGrammar and language fixes.
kib [Fri, 3 Jul 2015 17:30:31 +0000 (17:30 +0000)]
Grammar and language fixes.

Submitted by: wblock
Review: https://reviews.freebsd.org/D2969
MFC after: 12 days

8 years agoRemove duplicate and unnecessary includes.
loos [Fri, 3 Jul 2015 17:09:27 +0000 (17:09 +0000)]
Remove duplicate and unnecessary includes.

While here remove an unused and wrong define.

8 years agoMake ctl(4) appear in "man -k iscsi" results.
trasz [Fri, 3 Jul 2015 16:55:08 +0000 (16:55 +0000)]
Make ctl(4) appear in "man -k iscsi" results.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

8 years agoMinor update to the proto(4) man page:
marcel [Fri, 3 Jul 2015 16:20:14 +0000 (16:20 +0000)]
Minor update to the proto(4) man page:
1.  We now support ISA devices
2.  DMA support has been added

8 years agoRemove commented-out and non-existent cbus(4) attachment for uart(4).
marcel [Fri, 3 Jul 2015 16:02:06 +0000 (16:02 +0000)]
Remove commented-out and non-existent cbus(4) attachment for uart(4).

8 years agoAllow proto(4) to be compiled into the kernel.
marcel [Fri, 3 Jul 2015 15:56:00 +0000 (15:56 +0000)]
Allow proto(4) to be compiled into the kernel.

8 years agoReduce overhead of IPSEC for traffic generated from host
eri [Fri, 3 Jul 2015 15:31:56 +0000 (15:31 +0000)]
Reduce overhead of IPSEC for traffic generated from host

When IPSEC is enabled on the kernel the forwarding path has an optimization to not enter the code paths
for checking security policies but first checks if there is any security policy active at all.

The patch introduces the same optimization but for traffic generated from the host itself.
This reduces the overhead by 50% on my tests for generated host traffic without and SP active.

Differential Revision: https://reviews.freebsd.org/D2980
Reviewed by: ae, gnn
Approved by: gnn(mentor)

8 years agoo Add a description for virtio block device implemented
br [Fri, 3 Jul 2015 14:46:57 +0000 (14:46 +0000)]
o Add a description for virtio block device implemented
  in PISM (Bluespec C-interface device)
o Add a kernel config

Sponsored by: HEIF5

8 years agoAllow BERI virtio-platform code to operate with no PIO devices specified.
br [Fri, 3 Jul 2015 14:27:28 +0000 (14:27 +0000)]
Allow BERI virtio-platform code to operate with no PIO devices specified.
We will use it with Bluespec simulator of CHERI processor for invalidating
caches only.

8 years agoAdd 'prewrite' method allowing us to run some platform-specific
br [Fri, 3 Jul 2015 14:13:16 +0000 (14:13 +0000)]
Add 'prewrite' method allowing us to run some platform-specific
code before each write happens, e.g. write-back caches.
This will help booting in Bluespec simulator of CHERI processor.

8 years agoAdd AHCI attachment code for Allwinner A10/A20 SoCs.
loos [Fri, 3 Jul 2015 14:11:01 +0000 (14:11 +0000)]
Add AHCI attachment code for Allwinner A10/A20 SoCs.

The Allwinner SoC has an AHCI device on its internal main bus rather
than the PCI bus.  This SoC is somewhat underdocumented, and its SATA
controller is no exception.  The methods to support this chip were
harvested from the Linux Allwinner SDK, and then constants invented to
describe what's going on based on low-level constants contained in the
SATA standard and guess work.

This SoC requires a specific AHCI channel setup in order to start the
operations on the channel properly.

Clock setup and AHCI channel setup idea came from NetBSD.

Tested on Cubieboard 2 and Banana pi (and attachment on Cubieboard by
Pratik Singhal).

Differential Revision: https://reviews.freebsd.org/D737
Submitted by: imp
Reviewed by: imp, ganbold, mav, andrew

8 years agonetfront: preserve configuration across migrations
royger [Fri, 3 Jul 2015 12:09:05 +0000 (12:09 +0000)]
netfront: preserve configuration across migrations

Try to preserve the xn configuration when migrating. This is not always
possible since the backend might not have the same set of options
available, in which case we will try to preserve as many as possible.

MFC after:    2 weeks
PR:           183139
Reported by:  mcdouga9@egr.msu.edu
Sponsored by: Citrix Systems R&D

8 years agoFix broken implementation of "kvasprintf()" function by adding missing
hselasky [Fri, 3 Jul 2015 11:16:20 +0000 (11:16 +0000)]
Fix broken implementation of "kvasprintf()" function by adding missing
kmalloc() call. Make function global instead of static inline to fix
compiler warnings about passing variable argument lists to inline
functions.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoRemove OpenSSL dependency from iscsid(8) and ctld(8).
trasz [Fri, 3 Jul 2015 10:08:10 +0000 (10:08 +0000)]
Remove OpenSSL dependency from iscsid(8) and ctld(8).

Differential Revision: https://reviews.freebsd.org/D2866
Submitted by: Tony Morlan <tony at scroner.com> (earlier version)
Reviewed by: bapt@, delphij@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoUser proper terminology - iSCSI sessions, not iSCSI connections.
trasz [Fri, 3 Jul 2015 10:04:41 +0000 (10:04 +0000)]
User proper terminology - iSCSI sessions, not iSCSI connections.

Sponsored by: The FreeBSD Foundation