]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoInclude stdlib.h to get devname() prototype.
rodrigc [Mon, 31 Aug 2015 19:40:54 +0000 (19:40 +0000)]
Include stdlib.h to get devname() prototype.

Eliminates -Wmissing-prototypes warnings with gcc

8 years agoRestrict tso_max to IP_MAXPACKET to avoid the panic reported in:
sbruno [Mon, 31 Aug 2015 19:12:10 +0000 (19:12 +0000)]
Restrict tso_max to IP_MAXPACKET to avoid the panic reported in:
https://lists.freebsd.org/pipermail/freebsd-current/2015-August/057192.html

Submitted by: pyunyh@gmail.com
MFC after: 2 weeks

8 years agoar: Deobfuscate a while loop
emaste [Mon, 31 Aug 2015 18:07:17 +0000 (18:07 +0000)]
ar: Deobfuscate a while loop

8 years agoar: fix deterministic mode when running as ranlib
emaste [Mon, 31 Aug 2015 12:28:13 +0000 (12:28 +0000)]
ar: fix deterministic mode when running as ranlib

This was broken by r286024.

PR: 202741
Submitted by: fk@fabiankeil.de
Obtained from: ElectroBSD

8 years agoRemove now unneeded includes.
glebius [Mon, 31 Aug 2015 10:43:00 +0000 (10:43 +0000)]
Remove now unneeded includes.

8 years agoClean up the style of the LEAVE_HYP macro.
andrew [Mon, 31 Aug 2015 09:39:16 +0000 (09:39 +0000)]
Clean up the style of the LEAVE_HYP macro.

8 years agoAdd new USB quirk.
hselasky [Mon, 31 Aug 2015 07:18:13 +0000 (07:18 +0000)]
Add new USB quirk.

MFC after: 1 week
PR: 202783

8 years ago - uri is expected to be nul-terminated (strchr used later),
delphij [Mon, 31 Aug 2015 06:11:39 +0000 (06:11 +0000)]
 - uri is expected to be nul-terminated (strchr used later),
   so use strlcpy instead of strncpy.
 - unroll the other two cases of strncpy+\0 to strlcpy.

MFC after: 2 weeks

8 years agoConstify opt_f and opt_t and eliminate unneeded copying. This fixes
delphij [Mon, 31 Aug 2015 05:57:26 +0000 (05:57 +0000)]
Constify opt_f and opt_t and eliminate unneeded copying.  This fixes
memory leaks.

Reported by: clang static analyzer
MFC after: 2 weeks

8 years agoSimplify lla_rt_output()/nd6_add_ifa_lle() by setting lle state in
melifaro [Mon, 31 Aug 2015 05:03:36 +0000 (05:03 +0000)]
Simplify lla_rt_output()/nd6_add_ifa_lle() by setting lle state in
  alloc handler, based on flags.

8 years agoAdd support for the UGA draw protocol. This includes adding a
marcel [Sun, 30 Aug 2015 23:58:53 +0000 (23:58 +0000)]
Add support for the UGA draw protocol. This includes adding a
command called 'uga' to show whether UGA is implemented by the
firmware and what the settings are. It also includes filling
the efi_fb structure from the UGA information when GOP isn't
implemented by the firmware.

Since UGA does not provide information about the stride, we
set the stride to the horizontal resolution. This is likely
not correct and we should determine the stride by trial and
error. For now, this should show something on the console
rather than nothing.

Refactor this file to maximize code reuse.

PR: 202730

8 years agoAdd the LED definitions from vendor's DTS.
loos [Sun, 30 Aug 2015 23:20:00 +0000 (23:20 +0000)]
Add the LED definitions from vendor's DTS.

Add gpioled support to A20 kernel.

While here rename the gpio phandle to match the one used in the vendor's
DTS.

8 years agoThe vendor's DTS for Allwinner A20 uses a different way to map the gpio
loos [Sun, 30 Aug 2015 22:38:06 +0000 (22:38 +0000)]
The vendor's DTS for Allwinner A20 uses a different way to map the gpio
pins, they specify the bank and the pin in two separated cells.

This allow the use of vendor's DTS definitions by adding a gpio map
routine that copes with that.

8 years agooops - mis-commit.
adrian [Sun, 30 Aug 2015 21:55:01 +0000 (21:55 +0000)]
oops - mis-commit.

8 years agoConvert this over to use the new cdev based ioctl path.
adrian [Sun, 30 Aug 2015 21:54:47 +0000 (21:54 +0000)]
Convert this over to use the new cdev based ioctl path.

8 years agoMigrate the stats API for iwn(4) into a cdev ioctl, rather than tying
adrian [Sun, 30 Aug 2015 21:54:33 +0000 (21:54 +0000)]
Migrate the stats API for iwn(4) into a cdev ioctl, rather than tying
into the vap.

This allows for possible hardware interaction without needing a vap
configured.

8 years agoA bibliography of FreeBSD and BSD related papers and books.
gnn [Sun, 30 Aug 2015 20:59:19 +0000 (20:59 +0000)]
A bibliography of FreeBSD and BSD related papers and books.
Keep this file in order by primary key which is the first author's
last name and the year of publication.

8 years agoUse P1B_PRIO_MAX to designate max posix priority for the RR/FIFO
kib [Sun, 30 Aug 2015 18:02:57 +0000 (18:02 +0000)]
Use P1B_PRIO_MAX to designate max posix priority for the RR/FIFO
scheduler types.  It was intended to be used there, compare with the
min value, and with the test for correctness in ksched_setscheduler().

Note that P1B_PRIO_MAX and RTP_PRIO_MAX do have the same numerical
values, the change is cosmetical.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoRemove single-use macros obfuscating malloc(9) and free(9) calls.
kib [Sun, 30 Aug 2015 17:58:11 +0000 (17:58 +0000)]
Remove single-use macros obfuscating malloc(9) and free(9) calls.
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agosh: Fix read with escaped IFS characters at the end.
jilles [Sun, 30 Aug 2015 17:24:22 +0000 (17:24 +0000)]
sh: Fix read with escaped IFS characters at the end.

Characters escaped with a backslash must be treated as if they were not in
IFS. This includes stripping trailing IFS characters.

8 years agoReduce the difference to vendor DTS by using the vendor compat strings (at
loos [Sun, 30 Aug 2015 16:10:12 +0000 (16:10 +0000)]
Reduce the difference to vendor DTS by using the vendor compat strings (at
some point we have to use the complete vendor DTS files, but we're not
there yet).

8 years agoIn preparation to support other A20 based boards, rename the CUBIEBOARD2
loos [Sun, 30 Aug 2015 15:38:41 +0000 (15:38 +0000)]
In preparation to support other A20 based boards, rename the CUBIEBOARD2
kernel configuration to A20.

There are other boards (namely the banana pi) that use exactly the same
devices.

Additionally, we are moving from static FDT support (DTB compiled
in-kernel) to DTB passed to kernel by the boot loader (ubldr).  The u-boot
for these boards are already available on ports and as the crochet support
for these boards isn't committed yet, this should not bring any issues.

Discussed with: ian

8 years agoRevert r286880: If at first this change made sense, it turns out
jch [Sun, 30 Aug 2015 13:44:46 +0000 (13:44 +0000)]
Revert r286880:  If at first this change made sense, it turns out
it helps only the TCP timers callout(9) usage.  As the benefit for
others callout(9) usages did not reach a consensus the historical
usage should prevail.

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

8 years agoPut r284245 back in place: If at first this fix was seen as a temporary
jch [Sun, 30 Aug 2015 13:44:39 +0000 (13:44 +0000)]
Put r284245 back in place:  If at first this fix was seen as a temporary
workaround for a callout(9) issue, it turns out it is instead the right
way to use callout in mpsafe mode without using callout_drain().

r284245 commit message:

Fix a callout race condition introduced in TCP timers callouts with r281599.
In TCP timer context, it is not enough to check callout_stop() return value
to decide if a callout is still running or not, previous callout_reset()
return values have also to be checked.

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

8 years agoRemove support for FreeBSD < 602110.
delphij [Sun, 30 Aug 2015 08:48:31 +0000 (08:48 +0000)]
Remove support for FreeBSD < 602110.

8 years agoFix compilation error on gcc-5.2.0 - it now warns on non-paranthen'ed
adrian [Sun, 30 Aug 2015 08:46:50 +0000 (08:46 +0000)]
Fix compilation error on gcc-5.2.0 - it now warns on non-paranthen'ed
logical negation when used in this fashion.

Tested:

* compile only

8 years agoDon't assign 'ptr' without using it.
delphij [Sun, 30 Aug 2015 08:38:59 +0000 (08:38 +0000)]
Don't assign 'ptr' without using it.

Reported by: clang static analyzer
MFC after: 2 weeks

8 years agoFix a mistake in r287292. Despite correctly stating intent in the
kib [Sun, 30 Aug 2015 04:46:44 +0000 (04:46 +0000)]
Fix a mistake in r287292.  Despite correctly stating intent in the
comment above, POSIX_SPAWN_SETSIGMASK and POSIX_SPAWN_SETSIGDEF
handlers used libthr interposed functions instead of syscalls.

Noted by: jilles
Sponsored by: The FreeBSD Foundation
MFC after: 6 days

8 years agoAdd a gop command to help diagnose VT efifb problems. The gop
marcel [Sun, 30 Aug 2015 01:39:59 +0000 (01:39 +0000)]
Add a gop command to help diagnose VT efifb problems. The gop
command has the following sub-commands:
  list - list all possible modes (paged)
  get - return the current mode
  set <mode> - set the current mode to <mode>

8 years ago- Replace N(a)/N(i)/N(T)/LEN(a)/ARRAY_SIZE(a) with nitems()
rodrigc [Sat, 29 Aug 2015 19:47:20 +0000 (19:47 +0000)]
- Replace N(a)/N(i)/N(T)/LEN(a)/ARRAY_SIZE(a) with nitems()
- Add missing <err.h> for err() and <sys/sysctl.h> for sysctlbyname()
- NULL -> 0 for 5th parameter of sysctlbyname()

Submitted by: Andriy Voskoboinyk <s3erios@gmail com>
Differential Revision: https://reviews.freebsd.org/D3442

8 years agosh: Add set -o nolog.
jilles [Sat, 29 Aug 2015 19:41:47 +0000 (19:41 +0000)]
sh: Add set -o nolog.

POSIX requires this to prevent entering function definitions in history but
this implementation does nothing except retain the option's value. In ksh88,
function definitions were usually entered in the history file, even when
they came from ~/.profile and the $ENV file, to allow displaying their
definitions.

This is also the first option that does not have a letter.

8 years agoSupport the ZTE MF112 HSUPA 3G USB stick.
gavin [Sat, 29 Aug 2015 18:37:09 +0000 (18:37 +0000)]
Support the ZTE MF112 HSUPA 3G USB stick.

MFC after: 1 week

8 years agoUse 5 times RTO.Max as the default for the shutdown guard timer
tuexen [Sat, 29 Aug 2015 17:26:29 +0000 (17:26 +0000)]
Use 5 times RTO.Max as the default for the shutdown guard timer
as required by RFC 4960. The sysctl variable can be used to
overwrite this.

Discussed with: rrs
MFC after: 1 week

8 years agoRemove 600 bytes of port_priv from struct ctl_io_hdr.
mav [Sat, 29 Aug 2015 15:33:31 +0000 (15:33 +0000)]
Remove 600 bytes of port_priv from struct ctl_io_hdr.

This field used only for camtgt frontend, and once it any way preallocates
all requests, let it preallocate this memory too, not bothering core code.

8 years agoSwitch libc from using _sig{procmask,action,suspend} symbols, which
kib [Sat, 29 Aug 2015 14:25:01 +0000 (14:25 +0000)]
Switch libc from using _sig{procmask,action,suspend} symbols, which
are aliases for the syscall stubs and are plt-interposed, to the
libc-private aliases of internally interposed sigprocmask() etc.

Since e.g. _sigaction is not interposed by libthr, calling signal()
removes thr_sighandler() from the handler slot etc.  The result was
breaking signal semantic and rtld locking.

The added __libc_sigprocmask and other symbols are hidden, they are
not exported and cannot be called through PLT.  The setjmp/longjmp
functions for x86 were changed to use direct calls, and since
PIC_PROLOGUE only needed for functional PLT indirection on i386, it is
removed as well.

The PowerPC bug of calling the syscall directly in the setjmp/longjmp
implementation is kept as is.

Reported by: Pete French <petefrench@ingresso.co.uk>
Tested by: Michiel Boland <boland37@xs4all.nl>
Reviewed by: jilles (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoAttach pass driver to LUNs is OFFLINE state.
mav [Sat, 29 Aug 2015 11:21:20 +0000 (11:21 +0000)]
Attach pass driver to LUNs is OFFLINE state.

Previously such LUNs were silently ignored.  But while they indeed unable
to process most of SCSI commands, some, like RTPG, they still can.

MFC after: 1 month

8 years agoUse the userland exported states and handle them completely.
tuexen [Sat, 29 Aug 2015 09:27:29 +0000 (09:27 +0000)]
Use the userland exported states and handle them completely.

8 years agoFix a buffer overrun which may lead to data corruption, introduced in
delphij [Sat, 29 Aug 2015 09:22:32 +0000 (09:22 +0000)]
Fix a buffer overrun which may lead to data corruption, introduced in
r286951 by reinstating changes in r274628.

In l2arc_compress_buf(), we allocate a buffer to stash away the compressed
data in 'cdata', allocated of l2hdr->b_asize bytes.

We then ask zio_compress_data() to compress the buffer, b_l1hdr.b_tmp_cdata,
which is of l2hdr->b_asize bytes, and have the compressed size (or original
size, if compress didn't gain enough) stored in csize.

To pad the buffer to fit the optimal write size, we round up the compressed
size to L2 device's vdev_ashift.

Illumos code rounds up the size by at most SPA_MINBLOCKSIZE.  Because we
know csize <= b_asize, and b_asize is integer multiple of SPA_MINBLOCKSIZE,
we are guaranteed that the rounded up csize would be <= b_asize. However,
this is not necessarily true when we round up to 1 << vdev_ashift, because
it could be larger than SPA_MINBLOCKSIZE.

So, in the worst case scenario, we are overwriting at most

(1 << vdev_ashift - SPA_MINBLOCKSIZE)

bytes of memory next to the compressed data buffer.

Andriy's original change in r274628 reorganized the code a little bit,
by moving the padding to after we determined that the compression was
beneficial.  At which point, we would check rounded size against the
allocated buffer size, and the buffer overrun would not be possible.

8 years agoFix the exporting of SCTP association states to userland. Without this,
tuexen [Sat, 29 Aug 2015 09:14:32 +0000 (09:14 +0000)]
Fix the exporting of SCTP association states to userland. Without this,
associations in SHUTDOWN-PENDING were never reported correctly.

MFC after: 3 weeks

8 years agoReport CLOSED as state for bound sockets for consistency with
tuexen [Sat, 29 Aug 2015 09:10:52 +0000 (09:10 +0000)]
Report CLOSED as state for bound sockets for consistency with
netstat and the way TCP is handled.

PR: 201585
MFC after: 3 weeks

8 years agoIn r286705 (Illumos 5960/a2cdcdd), a separate thread is created with curproc
delphij [Sat, 29 Aug 2015 08:16:57 +0000 (08:16 +0000)]
In r286705 (Illumos 5960/a2cdcdd), a separate thread is created with curproc
as parent.  In the case of a send or receive, the curproc would be the
userland application that issues the ioctl.  This would trigger an assertion
failure introduced in Solaris compatibility shims in r196458 when kernel is
compiled with INVARIANTS.

Fix this by using p0 (proc0 or kernel) as the parent thread when creating
the kernel threads.

8 years agoAdd reminder to run etcupdate or mergemaster to get updated
glebius [Sat, 29 Aug 2015 07:59:31 +0000 (07:59 +0000)]
Add reminder to run etcupdate or mergemaster to get updated
rc.d scripts for wireless.

Poked by: adrian

8 years agoImplement RSS hashing/re-hashing for IPv6 ingress packets.
adrian [Sat, 29 Aug 2015 07:14:29 +0000 (07:14 +0000)]
Implement RSS hashing/re-hashing for IPv6 ingress packets.

This mirrors the basic IPv4 implementation - IPv6 packets under RSS
now are checked for a correct RSS hash and if one isn't provided,
it's done in software.

This only handles the initial receive - it doesn't yet handle
reinjecting / rehashing packets after being decapsulated from
various tunneling setups.  That'll come in some follow-up work.

For non-RSS users, this is almost a giant no-op.

It does change a couple of ipv6 methods to use const mbuf * instead of
mbuf * but it doesn't have any functional changes.

So, the following now occurs:

* If the NIC doesn't do any RSS hashing, it's all done in software.
  Single-queue, non-RSS NICs will now have the RX path distributed
  into multiple receive netisr queues.

* If the NIC provides the wrong hash (eg only IPv6 hash when we needed
  an IPv6 TCP hash, or IPv6 UDP hash when we expected IPv6 hash)
  then the hash is recalculated.

* .. if the hash is recalculated, it'll end up being injected into
  the correct netisr queue for v6 processing.

Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision: https://reviews.freebsd.org/D3504

8 years agoRename rss_soft_m2cpuid() -> rss_soft_m2cpuid_v4() in preparation for
adrian [Sat, 29 Aug 2015 06:58:30 +0000 (06:58 +0000)]
Rename rss_soft_m2cpuid() ->  rss_soft_m2cpuid_v4() in preparation for
an IPv6 version to show up.

Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision: https://reviews.freebsd.org/D3504

8 years agoThe TLB1 TSIZE is a multiple of 4, not 2, so shift 2 bits, not 1.
jhibbits [Sat, 29 Aug 2015 06:52:14 +0000 (06:52 +0000)]
The TLB1 TSIZE is a multiple of 4, not 2, so shift 2 bits, not 1.

8 years agoRemove now unused (and #if 0'ed out) headers.
adrian [Sat, 29 Aug 2015 04:33:31 +0000 (04:33 +0000)]
Remove now unused (and #if 0'ed out) headers.

8 years agoMark ValleyView/Bay Trail as not supported
bapt [Sat, 29 Aug 2015 00:05:39 +0000 (00:05 +0000)]
Mark ValleyView/Bay Trail as not supported

8 years agoRemove now obsolete comment.
imp [Fri, 28 Aug 2015 20:06:58 +0000 (20:06 +0000)]
Remove now obsolete comment.

MFC After: 2 days

8 years agoPer overwhelming sentiment in the code review, use FEATURE instead.
imp [Fri, 28 Aug 2015 19:53:19 +0000 (19:53 +0000)]
Per overwhelming sentiment in the code review, use FEATURE instead.

Differential Revision: https://reviews.freebsd.org/D3488
MFC After: 2 days

8 years agoComment out cleaning files, since it cleans too much.
imp [Fri, 28 Aug 2015 16:29:38 +0000 (16:29 +0000)]
Comment out cleaning files, since it cleans too much.

8 years agoRemove .WAIT hacks and put in specific dependencies.
imp [Fri, 28 Aug 2015 16:23:03 +0000 (16:23 +0000)]
Remove .WAIT hacks and put in specific dependencies.

8 years agoAdd missing ofw_machdep.h. Make x86 ofw_machdep.h work pc98 too.
imp [Fri, 28 Aug 2015 15:41:09 +0000 (15:41 +0000)]
Add missing ofw_machdep.h. Make x86 ofw_machdep.h work pc98 too.
This allows the owc module to compile on pc98 and seems preferable to
adding another special case in the build system.

8 years agoAdd underscores to attributes when checking for __has_attribute.
pfg [Fri, 28 Aug 2015 15:36:05 +0000 (15:36 +0000)]
Add underscores to attributes when checking for __has_attribute.

This is a good practice to avoid confusion with allowed macros.

Suggested by: jilles

8 years agoMove dwmmc.h to dwmmc_reg.h. This is in preperation for adding support to
andrew [Fri, 28 Aug 2015 15:27:55 +0000 (15:27 +0000)]
Move dwmmc.h to dwmmc_reg.h. This is in preperation for adding support to
subclass the dwmmc driver to allow SoC specific attachments.

Sponsored by: ABT Systems Ltd

8 years agoAdd back missing -m32 for amd64 and powerpc64 that was lost
imp [Fri, 28 Aug 2015 14:50:36 +0000 (14:50 +0000)]
Add back missing -m32 for amd64 and powerpc64 that was lost
in the move to bsd.stand.mk.

8 years agoFix an NFS server bug that manifested in "ls -al" displaying a plus
trasz [Fri, 28 Aug 2015 14:26:11 +0000 (14:26 +0000)]
Fix an NFS server bug that manifested in "ls -al" displaying a plus
sign on every directory exported via NFSv4 with NFSv4 ACLs enabled.

Reviewed by: rmacklem@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3502

8 years agotrailing space
pfg [Fri, 28 Aug 2015 14:13:01 +0000 (14:13 +0000)]
trailing space

8 years agoBe more GCC-friendly with attributes
pfg [Fri, 28 Aug 2015 14:06:28 +0000 (14:06 +0000)]
Be more GCC-friendly with attributes

Being clang the default compiler, we were always giving precedence to
the __has_attribute check. Unfortunately clang generally doesn't support
the new attributes (alloc_size was briefly supported and then reverted)
so we were always doing both checks. Give the precedence to GCC as that is
the working case now.

Do the same for  __has_builtin() for consistency.

8 years agoFix cleaning of files generated from .m sources.
imp [Fri, 28 Aug 2015 13:57:30 +0000 (13:57 +0000)]
Fix cleaning of files generated from .m sources.

8 years agoOnly check for the bus frequency if it has not already been set, for
andrew [Fri, 28 Aug 2015 10:34:37 +0000 (10:34 +0000)]
Only check for the bus frequency if it has not already been set, for
example through a driver running as a subclass of this.

Sponsored by: ABT Systems Ltd

8 years agoremove a left-over after r220463 empty #ifdef INET check.
bz [Fri, 28 Aug 2015 09:38:18 +0000 (09:38 +0000)]
remove a left-over after r220463 empty #ifdef INET check.

MFC after: 1 week

8 years agoPlug memory leaks when running out of memory.
delphij [Fri, 28 Aug 2015 06:41:40 +0000 (06:41 +0000)]
Plug memory leaks when running out of memory.

Reported by: clang scan-build
MFC after: 2 weeks

8 years agoReplace the printf()s with optional rate limited debugging for RSS.
adrian [Fri, 28 Aug 2015 05:58:16 +0000 (05:58 +0000)]
Replace the printf()s with optional rate limited debugging for RSS.

Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision: https://reviews.freebsd.org/D3471

8 years agoFix text alignment. mcsr was indented one too many spaces.
jhibbits [Fri, 28 Aug 2015 05:20:31 +0000 (05:20 +0000)]
Fix text alignment.  mcsr was indented one too many spaces.

8 years agoAdd another .WAIT since sometimes we lose the race.
imp [Fri, 28 Aug 2015 04:32:43 +0000 (04:32 +0000)]
Add another .WAIT since sometimes we lose the race.

8 years agoExtend pmap to support e500mc and e5500.
jhibbits [Fri, 28 Aug 2015 03:03:09 +0000 (03:03 +0000)]
Extend pmap to support e500mc and e5500.

As part of this, clean up tlb1_init(), since bootinfo is always NULL here just
eliminate the loop altogether.

Also, fix a bug in mmu_booke_mapdev_attr() where it's possible to map a larger
immediately following a smaller page, causing the mappings to overlap.  Instead,
break up the new mapping into smaller chunks.  The downside to this is that it
uses more precious TLB1 entries, which, on smaller chips (e500v2) it could cause
problems with TLB1 being out of space (e500v2 only has 16 TLB1 entries).

Obtained from: Semihalf (partial)
Sponsored by: Alex Perez/Inertial Computing

8 years agoSimply to appease gcc's warnings.
imp [Fri, 28 Aug 2015 02:29:31 +0000 (02:29 +0000)]
Simply to appease gcc's warnings.

8 years agoSet DMA alignment constraint of status, TX and RX LEs(List Elements
yongari [Fri, 28 Aug 2015 01:32:42 +0000 (01:32 +0000)]
Set DMA alignment constraint of status, TX and RX LEs(List Elements
in Marvell terms) to 32768.  32768 looks overkill but it will
ensure correct DMAed update.  This change addresses occasional
watchdog timeouts reported on 10.2-RELEASE.

Tested by: Johann Hugo <jhugo@meraka.csir.co.za>
MFC after: 2 weeks

8 years agoRespect locale settings.
delphij [Fri, 28 Aug 2015 00:49:30 +0000 (00:49 +0000)]
Respect locale settings.

MFC after: 2 weeks

8 years agoUse exit() instead of return in main().
delphij [Fri, 28 Aug 2015 00:44:58 +0000 (00:44 +0000)]
Use exit() instead of return in main().

MFC after: 2 weeks

8 years agoRemove weighted page handling from vm_page_advise().
markj [Fri, 28 Aug 2015 00:44:17 +0000 (00:44 +0000)]
Remove weighted page handling from vm_page_advise().

This was added in r51337 as part of the implementation of
madvise(MADV_DONTNEED).  Its objective was to ensure that the page daemon
would eventually reclaim other unreferenced pages (i.e., unreferenced pages
not touched by madvise()) from the active queue.

Now that the pagedaemon performs steady scanning of the active page queue,
this weighted handling is unnecessary.  Instead, always "cache" clean pages
by moving them to the head of the inactive page queue.  This simplifies the
implementation of vm_page_advise() and eliminates the fragmentation that
resulted from the distribution of pages among multiple queues.

Suggested by: alc
Reviewed by: alc
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3401

8 years agoRe-apply r274569. It was reverted in r276848 since that appeared to fix
markj [Fri, 28 Aug 2015 00:38:18 +0000 (00:38 +0000)]
Re-apply r274569. It was reverted in r276848 since that appeared to fix
some ctfmerge crashes that started to occur on i386 weeks after r274569 was
committed. Some later investigation indicated that the crashes were caused
by malformed CTF info that led to a stack overflow. The issue with CTF
info in i386 kernels seems to have been resolved by r261246, which updated
libdwarf and libelf.

r274569 fixes a bug which caused duplicate types to appear in the kernel's
CTF info. This duplication generally does not cause problems when using
DTrace, but makes it easier to hit the limit of 2^15 - 1 distinct type
definitions in a CTF container.

MFC after: 2 weeks

8 years agoRemove an unneeded instruction.
markj [Fri, 28 Aug 2015 00:17:21 +0000 (00:17 +0000)]
Remove an unneeded instruction.

MFC after: 1 week

8 years agonv.h lives in sys/ as of r279439.
markj [Fri, 28 Aug 2015 00:12:59 +0000 (00:12 +0000)]
nv.h lives in sys/ as of r279439.

8 years agoUse CFLAGS_NO_SIMD in preference to varying lists of -mno-xxxx flags.
imp [Thu, 27 Aug 2015 23:46:42 +0000 (23:46 +0000)]
Use CFLAGS_NO_SIMD in preference to varying lists of -mno-xxxx flags.
Go ahead and defined -D_STANDALONE for all targets (only strictly
needed for some architecture, but harmless on those it isn't required
for). Also add -msoft-float to all architectures uniformly rather
that higgley piggley like it is today.

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

8 years agoNew 1-Wire bus implementation. 1-Wire controller is abstracted, though
imp [Thu, 27 Aug 2015 23:33:38 +0000 (23:33 +0000)]
New 1-Wire bus implementation. 1-Wire controller is abstracted, though
only gpiobus configured via FDT is supported. Bus enumeration is
supported. Devices are created for each device found. 1-Wire
temperature controllers are supported, but other drivers could be
written. Temperatures are polled and reported via a sysctl.  Errors
are reported via sysctl counters. Mis-wired bus detection is included
for more trouble shooting. See ow(4), owc(4) and ow_temp(4) for
details of what's supported and known issues.

This has been tested on Raspberry Pi-B, Pi2 and Beagle Bone Black
with up to 7 devices.

Differential Revision: https://reviews.freebsd.org/D2956
Relnotes: yes
MFC after: 2 weeks
Reviewed by: loos@ (with many insightful comments)

8 years agoDocument bsd.endian.mk.
imp [Thu, 27 Aug 2015 22:42:02 +0000 (22:42 +0000)]
Document bsd.endian.mk.

8 years agopf: Remove support for 'scrub fragment crop|drop-ovl'
kp [Thu, 27 Aug 2015 21:27:47 +0000 (21:27 +0000)]
pf: Remove support for 'scrub fragment crop|drop-ovl'

The crop/drop-ovl fragment scrub modes are not very useful and likely to confuse
users into making poor choices.
It's also a fairly large amount of complex code, so just remove the support
altogether.

Users who have 'scrub fragment crop|drop-ovl' in their pf configuration will be
implicitly converted to 'scrub fragment reassemble'.

Reviewed by: gnn, eri
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D3466

8 years agoFix type bug introduced at r286811.
mav [Thu, 27 Aug 2015 21:16:24 +0000 (21:16 +0000)]
Fix type bug introduced at r286811.

8 years agoFix a conversion error in rc.d/jail
peter [Thu, 27 Aug 2015 20:52:41 +0000 (20:52 +0000)]
Fix a conversion error in rc.d/jail

8 years agoIn vm_pageout_scan(), simplify the logic for determining if a page can be
alc [Thu, 27 Aug 2015 20:38:45 +0000 (20:38 +0000)]
In vm_pageout_scan(), simplify the logic for determining if a page can be
paged out and apply some nearby style fixes.

In collaboration with: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation, EMC / Isilon Storage Division

8 years agoadd documentation for timers that silby added in r197244, almost 6 years
jmg [Thu, 27 Aug 2015 19:12:42 +0000 (19:12 +0000)]
add documentation for timers that silby added in r197244, almost 6 years
ago...

8 years agodie() would never return, mark it as so.
delphij [Thu, 27 Aug 2015 18:11:00 +0000 (18:11 +0000)]
die() would never return, mark it as so.

MFC after: 2 weeks

8 years agoMove setting of LDFLAGS to the modules which require it actually, as
ume [Thu, 27 Aug 2015 17:16:18 +0000 (17:16 +0000)]
Move setting of LDFLAGS to the modules which require it actually, as
other kerberos5 modules do so.

8 years agoThere is no need to get the bus tag or handle.
andrew [Thu, 27 Aug 2015 16:27:51 +0000 (16:27 +0000)]
There is no need to get the bus tag or handle.

Sponsored by: ABT Systems Ltd

8 years agoLimit the speed to the bus frequency.
andrew [Thu, 27 Aug 2015 16:24:30 +0000 (16:24 +0000)]
Limit the speed to the bus frequency.

Sponsored by: ABT Systems Ltd

8 years agoAllow the fifo-depth and num-slots to be missing. For the former we read
andrew [Thu, 27 Aug 2015 16:18:22 +0000 (16:18 +0000)]
Allow the fifo-depth and num-slots to be missing. For the former we read
the value from the hardware, for the latter assume a single slot.

Sponsored by: ABT Systems Ltd

8 years agoget_inpcbinfo() and get_pcblist() are UDP local functions and
bz [Thu, 27 Aug 2015 15:27:41 +0000 (15:27 +0000)]
get_inpcbinfo() and get_pcblist() are UDP local functions and
do not do what one would expect by name. Prefix them with "udp_"
to at least obviously limit the scope.

This is a non-functional change.

Reviewed by: gnn, rwatson
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3505

8 years agoDecompose linkat()/renameat() rights to source and target.
ed [Thu, 27 Aug 2015 15:16:41 +0000 (15:16 +0000)]
Decompose linkat()/renameat() rights to source and target.

To make it easier to understand how Capsicum interacts with linkat() and
renameat(), rename the rights to CAP_{LINK,RENAME}AT_{SOURCE,TARGET}.

This also addresses a shortcoming in Capsicum, where it isn't possible
to disable linking to files stored in a directory. Creating hardlinks
essentially makes it possible to access files with additional rights.

Reviewed by: rwatson, wblock
Differential Revision: https://reviews.freebsd.org/D3411

8 years agoMake it buildable with WITH_OPENLDAP, again.
ume [Thu, 27 Aug 2015 15:03:34 +0000 (15:03 +0000)]
Make it buildable with WITH_OPENLDAP, again.

MFC after: 1 week

8 years agoRepair sys/cdefs.h enough to be usable with GCC 5.x
kan [Thu, 27 Aug 2015 14:00:23 +0000 (14:00 +0000)]
Repair sys/cdefs.h enough to be usable with GCC 5.x

The __alloc_size and __alloc_align need to be defined to
nothingness for lint, but the existing check is deficient
and allows attributes with working __has_attrubute() to
slip through.

8 years agoMake ncurses build with GCC 5.0 and up
kan [Thu, 27 Aug 2015 14:00:20 +0000 (14:00 +0000)]
Make ncurses build with GCC 5.0 and up

Merge the end result of two upstream changes:

Original fix from 20141206:
  + modify MKlib_gen.sh to work around change in development version of
    gcc introduced here:
            https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
            https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html
    (reports by Marcus Shawcroft, Maohui Lei).

Later fixed in different manner in 20150725:
  + use alternate workaround for gcc 5.x feature (adapted from patch by
    Mikhail Peselnik).

8 years agoUnbreak nvi message catalog generation for 8 bit locales.
kan [Thu, 27 Aug 2015 14:00:16 +0000 (14:00 +0000)]
Unbreak nvi message catalog generation for 8 bit locales.

Feeding any file encoded in 8 bit locales such as KOI8-RU
to sort utility running under UTF-8 locale produces astonishing
result of recoding the output to UTF-8. To counter that, just
run sort under 'C' locale for now.

8 years agoAllow us to select the transfer count. This allows us to work with hardware
andrew [Thu, 27 Aug 2015 13:08:45 +0000 (13:08 +0000)]
Allow us to select the transfer count. This allows us to work with hardware
that seems to only work with a single block at a time.

Sponsored by: ABT Systems Ltd

8 years agoSilent a compilation warning on callout_stop()
jch [Thu, 27 Aug 2015 10:43:35 +0000 (10:43 +0000)]
Silent a compilation warning on callout_stop()

8 years agoIn callout_stop(), do not forget to initialize not_running variable.
jch [Thu, 27 Aug 2015 08:58:03 +0000 (08:58 +0000)]
In callout_stop(), do not forget to initialize not_running variable.
Thanks to hselasky for noticing that.

Differential Revision: https://reviews.freebsd.org/D3078 (Updated)
Submitted by: hselasky
Pointy hat to: jch

8 years agoReplay r286410. Change KPI of how device drivers that provide wireless
glebius [Thu, 27 Aug 2015 08:56:39 +0000 (08:56 +0000)]
Replay r286410. Change KPI of how device drivers that provide wireless
connectivity interact with the net80211 stack.

Historical background: originally wireless devices created an interface,
just like Ethernet devices do. Name of an interface matched the name of
the driver that created. Later, wlan(4) layer was introduced, and the
wlanX interfaces become the actual interface, leaving original ones as
"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer
and a driver became a mix of methods that pass a pointer to struct ifnet
as identifier and methods that pass pointer to struct ieee80211com. From
user point of view, the parent interface just hangs on in the ifconfig
list, and user can't do anything useful with it.

Now, the struct ifnet goes away. The struct ieee80211com is the only
KPI between a device driver and net80211. Details:

- The struct ieee80211com is embedded into drivers softc.
- Packets are sent via new ic_transmit method, which is very much like
  the previous if_transmit.
- Bringing parent up/down is done via new ic_parent method, which notifies
  driver about any changes: number of wlan(4) interfaces, number of them
  in promisc or allmulti state.
- Device specific ioctls (if any) are received on new ic_ioctl method.
- Packets/errors accounting are done by the stack. In certain cases, when
  driver experiences errors and can not attribute them to any specific
  interface, driver updates ic_oerrors or ic_ierrors counters.

Details on interface configuration with new world order:
- A sequence of commands needed to bring up wireless DOESN"T change.
- /etc/rc.conf parameters DON'T change.
- List of devices that can be used to create wlan(4) interfaces is
  now provided by net.wlan.devices sysctl.

Most drivers in this change were converted by me, except of wpi(4),
that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing
changes to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann,
Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in
testing.

Reviewed by: adrian
Sponsored by: Netflix
Sponsored by: Nginx, Inc.

8 years agoIn callout_stop(), if a callout is both pending and currently
jch [Thu, 27 Aug 2015 08:15:32 +0000 (08:15 +0000)]
In callout_stop(), if a callout is both pending and currently
being serviced return 0 (fail) but it is applicable only
mpsafe callouts.  Thanks to hselasky for finding this.

Differential Revision: https://reviews.freebsd.org/D3078 (Updated)
Submitted by: hselasky
Reviewed by: jch

8 years agoFix packets/bytes accounting on i386.
melifaro [Thu, 27 Aug 2015 07:53:58 +0000 (07:53 +0000)]
Fix packets/bytes accounting on i386.

Spotted by: julian

8 years agoPlug a possible memory leak.
delphij [Thu, 27 Aug 2015 06:28:42 +0000 (06:28 +0000)]
Plug a possible memory leak.

MFC after: 2 weeks