pfg [Mon, 30 Jun 2014 14:52:40 +0000 (14:52 +0000)]
MFC r267627:
strptime: add support for %t and %n
Posix strptime() requires support for %t and %n, which were added
to the illumos port. Curiously we were skipping white spaces by
default in most other cases making %t meaningless.
We now skip spaces in the case of the %e specifier as strftime(3)
explicitly adds a space for the single digit case.
marius [Mon, 30 Jun 2014 09:59:23 +0000 (09:59 +0000)]
MFC: r267978
In order to get vt(4) a bit closer to the feature set provided by sc(4),
implement options TERMINAL_{KERN,NORM}_ATTR. These are aliased to
SC_{KERNEL_CONS,NORM}_ATTR and like these latter, allow to change the
default colors of normal and kernel text respectively.
Note on the naming: Although affecting the output of vt(4), technically
kern/subr_terminal.c is primarily concerned with changing default colors
so it would be inconsistent to term these options VT_{KERN,NORM}_ATTR.
Actually, if the architecture and abstraction of terminal+teken+vt would
be perfect, dev/vt/* wouldn't be touched by this commit at all.
Reviewed by: emaste
Sponsored by: Bally Wulff Games & Entertainment GmbH
kib [Mon, 30 Jun 2014 09:48:44 +0000 (09:48 +0000)]
MFC r267767:
Add FPU_KERN_KTHR flag to fpu_kern_enter(9).
Apply the flag to padlock(4) and aesni(4).
In aesni_cipher_process(), do not leak FPU context state on error.
marius [Mon, 30 Jun 2014 09:38:14 +0000 (09:38 +0000)]
MFC: r267967, r267968
- SC_NO_SYSMOUSE isn't currently supported by vt(4), so nuke it from vt.4.
- vt_vga(4) is a driver rather than a function so reference it accordingly.
- Uncomment HISTORY section given that vt(4) will first appear in 9.3.
Reviewed by: emaste (modulo last part)
Sponsored by: Bally Wulff Games & Entertainment GmbH
bryanv [Sun, 29 Jun 2014 00:50:56 +0000 (00:50 +0000)]
MFC r267661, r267662, r267663:
- Remove an unnecessary kick of the host at the end of transmitting
- Handle multiple calls to rxq_eof for single packet completion
- Increment the pending packets more aggressively for TSO
bryanv [Sun, 29 Jun 2014 00:37:59 +0000 (00:37 +0000)]
MFC r267520, r267521, r267522, r267523, r267524:
- Remove two write-only local variables
- Remove unused element in the vtnet_rxq structure
- Remove kernel specific macro out of the VirtIO PCI header file
- Move the VIRTIO_RING_F_* defines out of virtqueue.h into
virtio_config.h
- Make the feature negotiation code easier to follow
- Force two byte alignment for all control message headers
jhb [Fri, 27 Jun 2014 20:39:45 +0000 (20:39 +0000)]
MFC 267291:
Use strcasecmp() instead of strcmp() when checking user-supplied encoding
names so that encoding names are treated as case-insensitive. This allows
the use of 'utf-8' instead of 'UTF-8' for example and matches the behavior
of iconv(1).
jhb [Fri, 27 Jun 2014 20:34:22 +0000 (20:34 +0000)]
MFC 266293:
- Add support for dumping current resource usage for processes via a new -r
flag to procstat.
- Add an -H flag to request information about threads rather than processes
when dumping statistics. Currently it is only used for -r to display
resource usage for individual threads instead of the entire process.
jhb [Fri, 27 Jun 2014 17:22:18 +0000 (17:22 +0000)]
MFC 261781:
Don't waste a page of KVA for the boot-time memory test on x86. For amd64,
reuse the first page of the crashdumpmap as CMAP1/CADDR1. For i386,
remove CMAP1/CADDR1 entirely and reuse CMAP3/CADDR3 for the memory test.
emaste [Fri, 27 Jun 2014 14:42:13 +0000 (14:42 +0000)]
MFC r265613, r267649: Handle ELF files with 65280 or more sections
If e_shnum or e_shstrndx are at least SHN_LORESERVE (0xff00) then an
escape value is used to indicate that the actual value is found in one
of section 0's fields.
Don't dump core when the ELF file has no section headers. The ELF
core files created by gcore are among those.
kib [Fri, 27 Jun 2014 11:42:51 +0000 (11:42 +0000)]
MFC r267664:
Assert that the new entry is inserted into the right location in the
map entries list, and that it does not overlap with the previous and
next entries.
jhb [Thu, 26 Jun 2014 19:19:06 +0000 (19:19 +0000)]
MFC 264277:
Handle single-byte reads from the bvmcons port (0x220) by returning
0xff. Some guests may attempt to read from this port to identify
psuedo-PNP ISA devices. (The ie(4) driver in FreeBSD/i386 is one
example.)
gjb [Wed, 25 Jun 2014 18:59:43 +0000 (18:59 +0000)]
MFC r267693:
Fix a bug in bsdgrep(1) where patterns are not correctly
detected.
Certain criteria must be met for this bug to show up:
* the -w flag is specified, and
* neither -o or --color are specified, and
* the pattern is part of another word in the line, and
* the other word that contains the pattern occurs first
ume [Wed, 25 Jun 2014 17:10:26 +0000 (17:10 +0000)]
MFC r267616, 267640:
Retooling addrconfig() to exclude addresses on loopback interfaces
when looking for configured addresses.
This change is based upon the code from the submitter, and made
following changes:
- Exclude addresses assigned on interfaces which are down, like NetBSD
does.
- Exclude addresses assigned on interfaces which are ifdisabled.
dim [Tue, 24 Jun 2014 06:12:11 +0000 (06:12 +0000)]
MFC r267704:
Pull in r211435 from upstream llvm trunk (by Benjamin Kramer):
Legalizer: Add support for splitting insert_subvectors.
We handle this by spilling the whole thing to the stack and doing the
insertion as a store.
PR19492. This happens in real code because the vectorizer creates
v2i128 when AVX is enabled.
This fixes a "fatal error: error in backend: Do not know how to split
the result of this operator!" message encountered during compilation of
the net-p2p/libtorrent-rasterbar port.
rodrigc [Mon, 23 Jun 2014 22:37:49 +0000 (22:37 +0000)]
MFC r263795:
Strict value checking will cause problem.
Bay trail DN2820FYKH is supported on Linux but does not work on FreeBSD.
This behaviour is bug-compatible with Linux-3.13.5.
rodrigc [Mon, 23 Jun 2014 22:31:28 +0000 (22:31 +0000)]
MFC r263795:
Strict value checking will cause problem.
Bay trail DN2820FYKH is supported on Linux but does not work on FreeBSD.
This behaviour is bug-compatible with Linux-3.13.5.
marius [Mon, 23 Jun 2014 08:32:36 +0000 (08:32 +0000)]
MFC: r267638
Don't denounce peripherals on system shutdown. Together with r267321
(MFCed to stable/10 in r267775), we're now back to the pre-r228483
level of default verbosity. This in turn again typically allows for
reading information that userland might have printed on the screen
before initiating a halt, but still permits to debug potential device
shutdown problems on system shutdown via CAM_DEBUG etc.
Reviewed by: mav
Sponsored by: Bally Wulff Games & Entertainment GmbH
marius [Mon, 23 Jun 2014 08:27:15 +0000 (08:27 +0000)]
MFC: r267321
Avoid the USB device disconnected and controller shutdown clutter on system
shutdown by putting the former under !rebooting and turning the latter into
debug messages.
Reviewed by: hps
Sponsored by: Bally Wulff Games & Entertainment GmbH
tuexen [Mon, 23 Jun 2014 07:54:12 +0000 (07:54 +0000)]
MFC r267674:
Honor jails for unbound SCTP sockets when selecting source addresses,
reporting IP-addresses to the peer during the handshake, adding
addresses to the host, reporting the addresses via the sysctl
interface (used by netstat, for example) and reporting the
addresses to the application via socket options.
This issue was reported by Bernd Walter.
np [Mon, 23 Jun 2014 05:39:10 +0000 (05:39 +0000)]
MFC r267689:
Consider the total number of descriptors available (and not just those
that are ready to be reclaimed) when deciding whether to resume tx after
a stall.
mav [Sun, 22 Jun 2014 21:18:24 +0000 (21:18 +0000)]
MFC r267387:
Allocating new bucket for bucket zone, never take it from the zone itself,
since it will almost certanly fail. Take next bigger zone instead.
This situation should not happen with original bucket zones configuration:
"32 Bucket" zone uses "64 Bucket" and vice versa. But if "64 Bucket" zone
lock is congested, zone may grow its bucket size and start biting itself.
mav [Sun, 22 Jun 2014 21:16:18 +0000 (21:16 +0000)]
MFC r267392:
Implement simple direct-mapped cache for popular filesystem identifiers to
avoid congestion on global mountlist_mtx mutex in vfs_busyfs(), while
traversing through the list of mount points.
This change significantly improves NFS server scalability, since it had
to do this translation for every request, and the global lock becomes quite
congested.
This code is more optimized for relatively small number of mount points.
On systems with hundreds of active mount points this simple cache may have
many collisions. But the original traversal code in that case should also
behave much worse, so we are not loosing much.
pfg [Sun, 22 Jun 2014 20:24:17 +0000 (20:24 +0000)]
MFC r267490:
patch: unsign the line length to avoid overflows.
Patch(1) uses a short int for the line length, which is usually
sufficient for regular diffs, but makes no effort to signal
when there is an overflow.
Change the line length to an unsigned short int to better use
the fact that a length is never negative. The change is loosely
inspired on a related change in DragonFly, but we avoid spending
more memory than necessary.
While here adjust the messages to be clearer on what is happening.
mav [Sun, 22 Jun 2014 18:06:11 +0000 (18:06 +0000)]
MFC r267232, r267239:
Use atomics to modify numvnodes variable.
This allows to mostly avoid lock usage in getnewvnode_[drop_]reserve(),
that reduces number of global vnode_free_list_mtx mutex acquisitions
from 4 to 2 per NFS request on ZFS, improving SMP scalability.
mav [Sun, 22 Jun 2014 18:03:53 +0000 (18:03 +0000)]
MFC r267228:
Split RPC pool threads into number of smaller semi-isolated groups.
Old design with unified thread pool was good from the point of thread
utilization. But single pool-wide mutex became huge congestion point
for systems with many CPUs. To reduce the congestion create several
thread groups within a pool (one group for every 6 CPUs and 12 threads),
each group with own mutex. Each connection during its registration is
assigned to one of the groups in round-robin fashion. File affinify
code may still move requests between the groups, but otherwise groups
are self-contained.
tuexen [Sun, 22 Jun 2014 16:54:59 +0000 (16:54 +0000)]
MFC r265691:
For some UDP packets (for example with 200 byte payload) and IP options,
the IP header and the UDP header are not in the same mbuf.
Add code to in_delayed_cksum() to deal with this case.
tuexen [Sun, 22 Jun 2014 16:50:46 +0000 (16:50 +0000)]
MFC r265455:
Remove unused code. This is triggered by the bugreport of Sylvestre Ledru
which deal with useless code in the user land stack:
https://bugzilla.mozilla.org/show_bug.cgi?id=1003929
tuexen [Sun, 22 Jun 2014 16:45:42 +0000 (16:45 +0000)]
MFC r264838:
Don't free an mbuf twice. This only happens in very rare error
cases where the peer sends illegal sequencing information in
DATA chunks for an existing association.
tuexen [Sun, 22 Jun 2014 16:32:41 +0000 (16:32 +0000)]
MFC r263922:
Handle an edge case of address management similar to TCP.
This needs to be reconsidered when the address handling
will be reimplemented.
The patch is from rrs@.
tuexen [Sun, 22 Jun 2014 16:28:52 +0000 (16:28 +0000)]
MFC r263237:
* Provide information in error causes in ASCII instead of
proprietary binary format.
* Add support for a diagnostic information error cause.
The code is sysctlable and the default is 0, which
means it is not sent.
tuexen [Sun, 22 Jun 2014 16:26:16 +0000 (16:26 +0000)]
MFC r263096:
Put the offset of the CRC32C in csum_data instead of 0.
The virtio driver needs the offset to be stored in csum_data,
like in the case for UDP and TCP.
The virtio problem was reported by
Niu Zhixiong <kaiaixi@gmail.com>, who helped in debugging
and testing the patch.
pfg [Sat, 21 Jun 2014 01:48:45 +0000 (01:48 +0000)]
MFC r267426, r267464:
Avoid zeroing during allocation.
This change reverts a change from OpenBSD which made use of
calloc, and therefore wasted time initializing arrays that
will later be realloc'ed.
Consistently use FreeBSD's reallocf():
- Drop some bogus casts to size_t.
- The new_p_foo variables are not needed anymore.
Also merge the changes from OpenBSD's manpage
patch.1 Rev 1.27:
"patch was moved from user portability (UP) to base in issue 7
and is no longer optional"
pfg [Fri, 20 Jun 2014 15:43:58 +0000 (15:43 +0000)]
MFC r267544:
Update license to strptime(3) implementation.
Our strptime(3) implementation was the base for the illumos
implementation and after contacting the author, Kevin Rudy
stated the code is under a 2-Clause BSD License [1]
After reviewing our local changes to the file in question,
the FreeBSD Foundation has agreed that their contributions
to this file are not required to carry clause 3 or 4 so
the file can be relicensed as in Illumos [2].
tijl [Fri, 20 Jun 2014 07:32:03 +0000 (07:32 +0000)]
MFC r267436-267439:
- Replace malloc+memset with calloc.
- iconv_open(3): initialise ci_ilseq_invalid field of _citrus_iconv_shared
struct after allocation with malloc.
- iconvlist(3): reduce a memory leak by copying strings only once.
- iconv(1):
- Make invalids variable local to do_conv such that it prints the number
of invalid characters of the current file instead of an accumulated
value.
- Make do_conv return an error when invalid characters have been found.
Return EXIT_FAILURE from main if any file contained invalid characters.
This matches the behaviour of GNU iconv.
- Mark usage with __dead2 attribute.
- Make the long_options array const.
neel [Tue, 17 Jun 2014 21:49:03 +0000 (21:49 +0000)]
MFC r266901
Allocate a zeroed LDT.
Failing to do this might result in the LDT appearing to run out of free
descriptors because of random junk in the descriptor's 'sd_type' field.