John Marino [Wed, 4 Nov 2015 09:36:11 +0000 (10:36 +0100)]
Merge branch 'vendor/BINUTILS225'
John Marino [Wed, 4 Nov 2015 09:11:25 +0000 (10:11 +0100)]
Vendor branch: Upgrade binutils 2.25 => 2.25.1
Sepherosa Ziehau [Wed, 4 Nov 2015 08:44:17 +0000 (16:44 +0800)]
Sepherosa Ziehau [Wed, 4 Nov 2015 03:31:32 +0000 (11:31 +0800)]
uipc: Use CTASSERT to simplify the externalize/internalize code
Sepherosa Ziehau [Wed, 4 Nov 2015 03:09:05 +0000 (11:09 +0800)]
uipc: Remove unnecessary unp_token in unp_dispose()
Sepherosa Ziehau [Wed, 4 Nov 2015 02:38:13 +0000 (10:38 +0800)]
socket: Dispose rights directly in soreceive(), if them are not wanted
Instead of leaving them to unp_gc(). This paves the way to simplify
unp_gc() and to remove filehead.
While I'm here, minor style changes.
John Marino [Tue, 3 Nov 2015 23:46:37 +0000 (00:46 +0100)]
Complete upgrade of libedit from 2014-06-20 to 2015-03-25
John Marino [Tue, 3 Nov 2015 23:58:27 +0000 (00:58 +0100)]
Merge branch 'vendor/LIBEDIT'
Conflicts:
contrib/libedit/src/chartype.h
contrib/libedit/src/eln.c
John Marino [Tue, 3 Nov 2015 23:27:04 +0000 (00:27 +0100)]
libedit: Revert locale modification that modifies locale
The intent was just to query the current locale, not change it.
Original modificatoin came from FreeBSD which also reverted it.
John Marino [Tue, 3 Nov 2015 23:23:15 +0000 (00:23 +0100)]
Update libedit from version 2014-06-20 to 2015-03-25 on vendor branch
John Marino [Tue, 3 Nov 2015 22:48:42 +0000 (23:48 +0100)]
lib/: Fix library build dependencies
Several libraries were not listed in the SUBDIR_ORDERED definition,
but should have been. Many of these were accounted for in the
_prebuild_libs functionality of Makefile.inc1. The rest were far
down on the alphabetical list and probably satisfied their dependency
requirements by luck (implying a machine with a sufficiently high
-j number would fail so lib/ wasn't jobs safe).
I've listed all the libraries that link to other libraries or have
other libraries (within lib/) link to them in SUBDIR_ORDERED. I've
completed the requirement annotations and separated them
requirements that are handled by Makefile.inc1 so it's clear. This
results with seven libraries moving from the alphabetical list to
the ordered list.
This makes the "serial" part of the lib/ building pretty long and
unnecessarily long, but it's not possible to get to a lower granularity
with the current framework without creating a new level (having the
subdirectories with their own library subdirectories, similar to
how gcc50 was implemented).
John Marino [Tue, 3 Nov 2015 20:03:18 +0000 (21:03 +0100)]
unbreak full buildworld (liblzma order again)
The lzma library is part of the "prebuild libraries" group in
the buildworld makefile. Once the pthread library was required
for the latest verson of xz, the order of lzma building had to
move after the pthread library. This unbreaks the build after
the XZ upgrade.
John Marino [Tue, 3 Nov 2015 13:34:49 +0000 (14:34 +0100)]
lib: Add liblzma to the build order
The latest liblzma now requires libpthread and thus it must be
guaranteed to be built before liblzma is built. Move liblzma into
the library ordering accordingly.
John Marino [Tue, 3 Nov 2015 11:06:24 +0000 (12:06 +0100)]
xz: Upgrade from version 5.0.7 to 5.2.2
See vendor branch commit for the many changes, including parallel
compression with multiple threads.
John Marino [Tue, 3 Nov 2015 12:13:43 +0000 (13:13 +0100)]
Merge branch 'vendor/XZ'
John Marino [Tue, 3 Nov 2015 10:21:55 +0000 (11:21 +0100)]
Upgrade xz from 5.0.7 to 5.2.2 on the vendor branch
5.2.2 (2015-09-29)
* Fixed bugs in QNX-specific code.
* Omitted the use of pipe2() even if it is available to avoid
portability issues with some old Linux and glibc combinations.
* Updated German translation.
* Added project files to build static and shared liblzma (not the
whole XZ Utils) with Visual Studio 2013 update 2 or later.
* Documented that threaded decompression hasn't been implemented
yet. A 5.2.0 NEWS entry describing multi-threading support had
incorrectly said "decompression" when it should have said
"compression".
5.2.1 (2015-02-26)
* Fixed a compression-ratio regression in fast mode of LZMA1 and
LZMA2. The bug is present in 5.1.4beta and 5.2.0 releases.
* Fixed a portability problem in xz that affected at least OpenBSD.
* Fixed xzdiff to be compatible with FreeBSD's mktemp which differs
from most other mktemp implementations.
* Changed CPU core count detection to use cpuset_getaffinity() on
FreeBSD.
5.2.0 (2014-12-21)
Since 5.1.4beta:
* All fixes from 5.0.8
* liblzma: Fixed lzma_stream_encoder_mt_memusage() when a preset
was used.
* xzdiff: If mktemp isn't installed, mkdir will be used as
a fallback to create a temporary directory. Installing mktemp
is still recommended.
* Updated French, German, Italian, Polish, and Vietnamese
translations.
Summary of fixes and new features added in the 5.1.x development
releases:
* liblzma:
- Added support for multi-threaded compression. See the
lzma_mt structure, lzma_stream_encoder_mt(), and
lzma_stream_encoder_mt_memusage() in <lzma/container.h>,
lzma_get_progress() in <lzma/base.h>, and lzma_cputhreads()
in <lzma/hardware.h> for details.
- Made the uses of lzma_allocator const correct.
- Added lzma_block_uncomp_encode() to create uncompressed
.xz Blocks using LZMA2 uncompressed chunks.
- Added support for LZMA_IGNORE_CHECK.
- A few speed optimizations were made.
- Added support for symbol versioning. It is enabled by default
on GNU/Linux, other GNU-based systems, and FreeBSD.
- liblzma (not the whole XZ Utils) should now be buildable
with MSVC 2013 update 2 or later using windows/config.h.
* xz:
- Fixed a race condition in the signal handling. It was
possible that e.g. the first SIGINT didn't make xz exit
if reading or writing blocked and one had bad luck. The fix
is non-trivial, so as of writing it is unknown if it will be
backported to the v5.0 branch.
- Multi-threaded compression can be enabled with the
--threads (-T) option.
[Fixed: This originally said "decompression".]
- New command line options in xz: --single-stream,
--block-size=SIZE, --block-list=SIZES,
--flush-timeout=TIMEOUT, and --ignore-check.
- xz -lvv now shows the minimum xz version that is required to
decompress the file. Currently it is 5.0.0 for all supported
.xz files except files with empty LZMA2 streams require 5.0.2.
* xzdiff and xzgrep now support .lzo files if lzop is installed.
The .tzo suffix is also recognized as a shorthand for .tar.lzo.
5.1.4beta (2014-09-14)
* All fixes from 5.0.6
* liblzma: Fixed the use of presets in threaded encoder
initialization.
* xz --block-list and --block-size can now be used together
in single-threaded mode. Previously the combination only
worked in multi-threaded mode.
* Added support for LZMA_IGNORE_CHECK to liblzma and made it
available in xz as --ignore-check.
* liblzma speed optimizations:
- Initialization of a new LZMA1 or LZMA2 encoder has been
optimized. (The speed of reinitializing an already-allocated
encoder isn't affected.) This helps when compressing many
small buffers with lzma_stream_buffer_encode() and other
similar situations where an already-allocated encoder state
isn't reused. This speed-up is visible in xz too if one
compresses many small files one at a time instead running xz
once and giving all files as command-line arguments.
- Buffer comparisons are now much faster when unaligned access
is allowed (configured with --enable-unaligned-access). This
speeds up encoding significantly. There is arch-specific code
for 32-bit and 64-bit x86 (32-bit needs SSE2 for the best
results and there's no run-time CPU detection for now).
For other archs there is only generic code which probably
isn't as optimal as arch-specific solutions could be.
- A few speed optimizations were made to the SHA-256 code.
(Note that the builtin SHA-256 code isn't used on all
operating systems.)
* liblzma can now be built with MSVC 2013 update 2 or later
using windows/config.h.
* Vietnamese translation was added.
5.1.3alpha (2013-10-26)
* All fixes from 5.0.5
* liblzma:
- Fixed a deadlock in the threaded encoder.
- Made the uses of lzma_allocator const correct.
- Added lzma_block_uncomp_encode() to create uncompressed
.xz Blocks using LZMA2 uncompressed chunks.
- Added support for native threads on Windows and the ability
to detect the number of CPU cores.
* xz:
- Fixed a race condition in the signal handling. It was
possible that e.g. the first SIGINT didn't make xz exit
if reading or writing blocked and one had bad luck. The fix
is non-trivial, so as of writing it is unknown if it will be
backported to the v5.0 branch.
- Made the progress indicator work correctly in threaded mode.
- Threaded encoder now works together with --block-list=SIZES.
- Added preliminary support for --flush-timeout=TIMEOUT.
It can be useful for (somewhat) real-time streaming. For
now the decompression side has to be done with something
else than the xz tool due to how xz does buffering, but this
should be fixed.
5.1.2alpha (2012-07-04)
* All fixes from 5.0.3 and 5.0.4
* liblzma:
- Fixed a deadlock and an invalid free() in the threaded encoder.
- Added support for symbol versioning. It is enabled by default
on GNU/Linux, other GNU-based systems, and FreeBSD.
- Use SHA-256 implementation from the operating system if one is
available in libc, libmd, or libutil. liblzma won't use e.g.
OpenSSL or libgcrypt to avoid introducing new dependencies.
- Fixed liblzma.pc for static linking.
- Fixed a few portability bugs.
* xz --decompress --single-stream now fixes the input position after
successful decompression. Now the following works:
echo foo | xz > foo.xz
echo bar | xz >> foo.xz
( xz -dc --single-stream ; xz -dc --single-stream ) < foo.xz
Note that it doesn't work if the input is not seekable
or if there is Stream Padding between the concatenated
.xz Streams.
* xz -lvv now shows the minimum xz version that is required to
decompress the file. Currently it is 5.0.0 for all supported .xz
files except files with empty LZMA2 streams require 5.0.2.
* Added an *incomplete* implementation of --block-list=SIZES to xz.
It only works correctly in single-threaded mode and when
--block-size isn't used at the same time. --block-list allows
specifying the sizes of Blocks which can be useful e.g. when
creating files for random-access reading.
5.1.1alpha (2011-04-12)
* All fixes from 5.0.2
* liblzma fixes that will also be included in 5.0.3:
- A memory leak was fixed.
- lzma_stream_buffer_encode() no longer creates an empty .xz
Block if encoding an empty buffer. Such an empty Block with
LZMA2 data would trigger a bug in 5.0.1 and older (see the
first bullet point in 5.0.2 notes). When releasing 5.0.2,
I thought that no encoder creates this kind of files but
I was wrong.
- Validate function arguments better in a few functions. Most
importantly, specifying an unsupported integrity check to
lzma_stream_buffer_encode() no longer creates a corrupt .xz
file. Probably no application tries to do that, so this
shouldn't be a big problem in practice.
- Document that lzma_block_buffer_encode(),
lzma_easy_buffer_encode(), lzma_stream_encoder(), and
lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK.
- The return values of the _memusage() functions are now
documented better.
* Support for multithreaded compression was added using the simplest
method, which splits the input data into blocks and compresses
them independently. Other methods will be added in the future.
The current method has room for improvement, e.g. it is possible
to reduce the memory usage.
* Added the options --single-stream and --block-size=SIZE to xz.
* xzdiff and xzgrep now support .lzo files if lzop is installed.
The .tzo suffix is also recognized as a shorthand for .tar.lzo.
* Support for short 8.3 filenames under DOS was added to xz. It is
experimental and may change before it gets into a stable release.
5.0.8 (2014-12-21)
* Fixed an old bug in xzgrep that affected OpenBSD and probably
a few other operating systems too.
* Updated French and German translations.
* Added support for detecting the amount of RAM on AmigaOS/AROS.
* Minor build system updates.
Sascha Wildner [Tue, 3 Nov 2015 12:09:59 +0000 (13:09 +0100)]
Fix various typos in manual pages.
Sepherosa Ziehau [Tue, 3 Nov 2015 03:42:28 +0000 (11:42 +0800)]
uipc: Reduce token coverage on detach path
Sepherosa Ziehau [Tue, 3 Nov 2015 03:38:28 +0000 (11:38 +0800)]
uipc: Remove unnecessary socket ref/unref on detach path
Sepherosa Ziehau [Tue, 3 Nov 2015 03:32:22 +0000 (11:32 +0800)]
uipc: Hold unp_token before calling unp_find_lockref()
Mainly to avoid name resolution and v_socket accessing races.
Add comment about it.
Sepherosa Ziehau [Tue, 3 Nov 2015 03:07:12 +0000 (11:07 +0800)]
gdb: Unbreak building
John Marino [Mon, 2 Nov 2015 23:18:13 +0000 (00:18 +0100)]
lib: hook libelf and libexecinfo (in order) into the build
The ELF library must be built before the execinfo library that uses it.
Bump the DragonFly version because ports will alter its behavior from this
point forward.
John Marino [Tue, 3 Nov 2015 00:07:57 +0000 (01:07 +0100)]
Add libexecinfo to lib directory, but leave it unhooked
The execinfo library is used to fill in the backtrace of the currently
executing thread. It originated in Linux and has found its way into a
lot of vendor software. NetBSD created a BSD-licensed implementation
which FreeBSD imported a while back.
The execinfo library has been in FreeBSD since Release 10. FreeBSD 9
is the only release that needs libexecinfo from ports and when that
release hits EOL, DragonFly could be left unsupported if ports
maintainers assumes libexecinfo is always available and removes USES
support for it.
To avoid this situation, bring libexecinfo into DragonFly's base for
the purpose of supporting ports. It requires libelf which has also
been brought in as an internal library.
John Marino [Mon, 2 Nov 2015 23:53:41 +0000 (00:53 +0100)]
libelf: Add libelf to lib directory, but leave it unhooked
The ELF library is part of FreeBSD's ELF Tool Chain project that has the
goal to be a drop-in replacement for binutils. It isn't quite there yet
but the toolchain project has replaced most of the tools. There may be
interest to bring the entire toolchain into DragonFly once the project is
production ready, but for now we are only interested in libelf.
This library is a required component for the incoming execinfo library.
The ELF library is for internal use only. It will not be installed, but
instead only statically linked to the execinfo library. The
contrib/elftoolchain directory has been arranged in a "placeholder"
fashion so the source for more of the tools can be added there later.
John Marino [Mon, 2 Nov 2015 23:46:21 +0000 (00:46 +0100)]
Add READMEs for ELF Tool Chain contrib directory
John Marino [Mon, 2 Nov 2015 23:44:27 +0000 (00:44 +0100)]
Merge branch 'vendor/ELFTOOLCHAIN'
John Marino [Mon, 2 Nov 2015 23:43:51 +0000 (00:43 +0100)]
Import ELF Tool Chain r3255 into vendor branch
Sascha Wildner [Mon, 2 Nov 2015 22:56:43 +0000 (23:56 +0100)]
gdb: Reduce the recent changes to only the necessary bits in amd64dfly-nat.c.
This makes maintenance of base and dports gdb easier.
Suggested-by: marino
Discussed-with: tuxillo
John Marino [Mon, 2 Nov 2015 23:04:24 +0000 (00:04 +0100)]
euc encoding: Emit EILSEQ on illegal euc conversions
Omission caught by NetBSD testsuite, run by bapt@FreeBSD.org
François Tigeot [Mon, 2 Nov 2015 19:18:32 +0000 (20:18 +0100)]
drm: Add ACCESS_ONCE()
Antonio Huete Jimenez [Mon, 2 Nov 2015 16:35:26 +0000 (17:35 +0100)]
gdb - Workaround to enable debugging in vkernels.
- Currently vkernel(7) does not have support for PT_GETDBREGS/PT_SETDBREGS
via ptrace(2) so conditionalize gdb initialization code to make a special
case for vkernels.
Antonio Huete Jimenez [Mon, 2 Nov 2015 15:31:18 +0000 (16:31 +0100)]
gdb - Remove FreeBSD specific code.
Antonio Huete Jimenez [Mon, 2 Nov 2015 15:18:26 +0000 (16:18 +0100)]
gdb - Fix indentantion in DragonFly specific files.
- No functional changes
Sascha Wildner [Mon, 2 Nov 2015 17:59:15 +0000 (18:59 +0100)]
drm.4: Document new sysctls.
Submitted-by: Rimvydas Jasinskas <rimvydas.jasinskas@gmail.com>
Sascha Wildner [Mon, 2 Nov 2015 17:56:39 +0000 (18:56 +0100)]
drm.4: Move the sysctl section to using .Bl/.El
John Marino [Mon, 2 Nov 2015 11:48:22 +0000 (12:48 +0100)]
locales: Remove symlinks UTF8 => UTF-8
In retrospect, having an alias for UTF-8 does not bring any real benefits
and it can cause confusion. Let's remove this *.UTF8 locale symlinks
which is closer to the convention of the other BSDs.
GCC testsuite is also removing utf8 and UTF8 locales for portability
with BSD.
zrj [Sat, 31 Oct 2015 15:34:58 +0000 (17:34 +0200)]
socket/recvfrom: Add MSG_CMSG_CLOEXEC support
While there, add test case and update manpages.
Obtained-from: FreeBSD
Imre Vadász [Sun, 1 Nov 2015 21:03:43 +0000 (22:03 +0100)]
drm: Simplify the initialization of the hw.dri sysctl tree.
* Just use SYSCTL_NODE and SYSCTL_INT declarations, for initializing and
and destroying the hw.dri subtree atomagically (including the debug,
notyet, vblank_offdelay and timestamp_precision integer nodes) on
module load/unload.
John Marino [Sun, 1 Nov 2015 21:29:52 +0000 (22:29 +0100)]
locale type makefiles: respect ${SHAREDIR}
The cldr2def tool was modified to generate makefiles that respect
the SHAREDIR definition rather than hardcoding it.
Taken-from: FreeBSD (collation branch)
John Marino [Sun, 1 Nov 2015 20:47:23 +0000 (21:47 +0100)]
locales: Fix eucJP sorting (broken upstream?)
Sorting eucJP text with "sort" resulted in an illegal sequence while
"gsort" worked. This was traced back to mbrtowc handling which was
broken for eucJP (probably eucCN, eucKR, and eucTW as well). This
small fix took hours to figure out. The OR operation to build the
wide character requires an unsigned character to work correctly. The
euc wcrtowc conversion is probably broken upstream in Illumos as well.
Reported by: bapt@FreeBSD.org
Triggered by: misc/freebsd-doc-ja in ports (encoded in eucJP)
Imre Vadász [Sat, 31 Oct 2015 15:49:31 +0000 (16:49 +0100)]
if_vtnet: Add support for indirect buffers. Activate LRO by default again.
Taken-From: FreeBSD
Imre Vadász [Fri, 30 Oct 2015 22:15:40 +0000 (23:15 +0100)]
virtio: Add indirect buffers support to common virtio code.
* Uses contigmalloc instead of kmalloc for allocating the indirect
descriptors, because DragonFly's kmalloc doesn't return sufficiently
aligned or physically contiguous memory.
Taken-From: FreeBSD
François Tigeot [Sun, 1 Nov 2015 18:16:28 +0000 (19:16 +0100)]
drm/radeon: Export PCI ID
Submitted-by: Rimvydas Jasinskas
Tomohiro Kusumi [Sun, 1 Nov 2015 15:02:59 +0000 (00:02 +0900)]
sys/dev/disk/dm: Add error count for stripe device
This is for compatibility with Linux, but currently not used.
In order to use it, dm target needs to be able to implement
bio's completion handler which is currently unaccessible from
outside of sys/kern/vfs_bio.c.
Tomohiro Kusumi [Sun, 1 Nov 2015 14:42:25 +0000 (23:42 +0900)]
sys/dev/disk/dm: Don't statically allocate MAX_STRIPES devices
struct target_stripe_config should have 0 sized array for
struct target_stripe_dev instead of MAX_STRIPES sized one,
and kmalloc() whatever size necessary depending on # of
stripe devices.
Antonio Huete Jimenez [Sun, 1 Nov 2015 12:48:25 +0000 (13:48 +0100)]
vkernel - Override max-page-size for ld.*
- Move max-page-size setting to the vkernel-specific SYSTEM_LD as it
was probably intended in ed9f17e. This overrides whatever the default
is in ld.bfd or ld.gold.
Antonio Huete Jimenez [Sun, 1 Nov 2015 12:40:54 +0000 (13:40 +0100)]
vkernel - Bring back .hash section
As of the switch to GCC 5 the default hash style to ld has changed from both
(sysv,gnu) to gnu alone. This results in binaries without a .hash section
which is fine for userland binaries but not for kernel ones since our kernel
linker uses .hash section to resolve its own symbols.
With the missing .hash section the vkernel kernel linker was not able do
symbol lookups and that rendered kvm(3) useless and all its consumers stopped
working.
During the vkernel build, SYSTEM_LD is changed so that the normal buildkernel
settings are overridden so by changing the parameters passed to ld we bring
back the .hash section.
John Marino [Sun, 1 Nov 2015 10:42:10 +0000 (11:42 +0100)]
libc: Fix (and improve) nl_langinfo (CODESET)
The output of "locale charmap" is identical to the result of
nl_langinfo (CODESET) for any given locale. The logic for returning the
codeset was very simplistic. It just returned portion of the locale name
after the period (e.g. en_FR.ISO8859-1 returned "ISO8859-1").
When softlinks were added to locales, this broke. e.g.:
en_US returned ""
en_FR.UTF8 returned "UTF8"
en_FR.UTF-8 returned "UTF-8"
zh_Hant_HK.Big5HKSCS returned "Big5HKSCS"
zh_Hant_TW.Big5 returned "Big5"
es_ES@euro returned ""
In order to fix this properly, the named locale cannot be used to
determine the encoding. This information was almost available in the
rune data. Unfortunately, all the single byte encodings were listed
as "NONE" encoding.
So I adjusted localedef tool to provide more information about the
encoding. For example, instead of "NONE", the LC_CTYPE used by
fr_FR.ISO8859-15 is now encoded as "NONE:ISO8859-15". The locale
handlers now check if the first four characters of the encoding is
"NONE" and if so, treats it as a single-byte encoding.
The nl_langinfo handling of CODESET was adjusting accordingly. Now the
following is returned:
en_US returns "ISO8859-1"
fr_FR.UTF8 returns "UTF-8"
fr_FR.UTF-8 returns "UTF-8"
zh_Hant_HK.Big5HKSCS returns "Big5"
zh_Hant_TW.Big5 returns "Big5"
es_ES@euro returns "ISO8859-15"
as before, "C" and "POSIX" locales return "US-ASCII". This is a big
improvement. The result of nl_langinfo can never be a zero-length
string and it will always exclusively one of the values of the
character maps of /usr/src/tools/tools/locale/etc/final-maps.
Sascha Wildner [Sat, 31 Oct 2015 21:50:02 +0000 (22:50 +0100)]
kernel/drm: In linux/types.h, remove the duplicate definition of gfp_t.
Sascha Wildner [Sat, 31 Oct 2015 21:13:34 +0000 (22:13 +0100)]
kernel/drm: In linux/kernel.h add missing parentheses/casts to min_t/max_t.
Tomohiro Kusumi [Sat, 31 Oct 2015 11:55:26 +0000 (20:55 +0900)]
sys/dev/disk/dm: Remove misleading comment
It takes offset and size parameters in sectors.
This comment seems to be specifying them in bytes, which is wrong.
Tomohiro Kusumi [Sat, 31 Oct 2015 09:07:54 +0000 (18:07 +0900)]
sys/dev/disk/dm: Fix sanity checks for striped target [4/4]
Add sanity checks on relation among
number of stripes, device size, and chunk size.
This is one of the requirements in Linux dm-striped, but
disable it for now as it may break systems that currently
use this target (which I doubt there is any because lvm2
and dm raid seem to be unusable on DragonFly).
Tomohiro Kusumi [Fri, 30 Oct 2015 15:16:12 +0000 (00:16 +0900)]
sys/dev/disk/dm: Fix sanity checks for striped target [3/4]
0 stripe is apparently invalid, but it's currently allowed
and generates unusable device.
# kldload dm
# dmsetup create stripe1 --table '0 1000 striped 0 10 /dev/da3 0 /dev/da4 0'
# dmsetup ls --tree
stripe1 (255:
504430599)
# dmsetup deps /dev/mapper/stripe1
0 dependencies :
# dmsetup status /dev/mapper/stripe1
# dmsetup table /dev/mapper/stripe1
#
Tomohiro Kusumi [Sat, 31 Oct 2015 10:57:29 +0000 (19:57 +0900)]
sys/dev/disk/dm: Fix sanity checks for striped target [2/4]
Target specific args for striped is redundant in the sense
that it has an arg for # of stripes other than the args for
actual stripe devices. These two must meet below.
((argc - 2) / 2) == # of stripe devices.
e.g.
--table '0 100 stripe1 3 10 /dev/da3 0 /dev/da4 0 /dev/da5 0'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 8 target args
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 6 device args
^ # of stripe devices
((8 - 2) / 2) = 6/2 = 3
-> 3 stripe devices (/dev/da[345])
Tomohiro Kusumi [Sat, 31 Oct 2015 10:46:22 +0000 (19:46 +0900)]
sys/dev/disk/dm: Fix sanity checks for striped target [1/4]
Bring sanity checks before kmalloc().
Tomohiro Kusumi [Fri, 30 Oct 2015 12:51:44 +0000 (21:51 +0900)]
sbin/hammer: Fix improper perror(3) usage
2550036f and
fff0110a should have used err(3) instead of perror(3).
Spotted-by: swildner
Tomohiro Kusumi [Fri, 30 Oct 2015 12:34:10 +0000 (21:34 +0900)]
sys/dev/disk/dm: Return EINVAL on invalid argc
but not ENOMEM.
Other targets return EINVAL for this and there shouldn't be
any reason not to do so for dm-crypt.
Tomohiro Kusumi [Wed, 28 Oct 2015 17:57:10 +0000 (02:57 +0900)]
sys/dev/disk/dm: Make target's init() take argc and argv
dm core shouldn't be passing char *params to targets' init()
because all targets are basically going to copy-paste a code
snippet (that strseps params) from the existing targets code
which is inefficient and should be avoided.
This commit adds dm_table_init() which converts char *params
to int argc and char **argv, and passes them to init().
Tomohiro Kusumi [Wed, 28 Oct 2015 13:14:14 +0000 (22:14 +0900)]
sys/dev/disk/dm: Use correct module name for dm_target_striped
The name of this target is striped, but not stripe.
This target is called stripe in NetBSD, but striped in Linux.
Since DragonFly seems to have renamed it to striped when
porting from NetBSD, strings used within this module should
be striped.
# kldload dm
# kldload dm_target_striped
# kldstat | grep stripe
6 1 0xffffffff832a7000 11000 dm_target_striped.ko
Tomohiro Kusumi [Wed, 28 Oct 2015 12:43:40 +0000 (21:43 +0900)]
sys/dev/disk/dm: Refactor dm_target_stripe_table()
Use return value of ksnprintf() instead of strlen().
Tomohiro Kusumi [Tue, 27 Oct 2015 15:33:09 +0000 (00:33 +0900)]
sys/dev/disk/dm: Fix indentation
Tomohiro Kusumi [Tue, 27 Oct 2015 15:17:46 +0000 (00:17 +0900)]
sys/dev/disk/dm: Add info() handler for striped target for compatibility
f134a703 mentioned output of dmsetup(8) "status" and "table"
were compatible with that of Linux till dm-delay was added,
but striped target was not compatible. The stripe target in
Linux has different implementation for these two like delay
target has.
This commit adds info() handler for striped target similar
to what
f134a703 did to delay target.
Tomohiro Kusumi [Tue, 27 Oct 2015 13:28:35 +0000 (22:28 +0900)]
sys/dev/disk/dm: Make dm-linear table show major:minor for compatibility
It should be "major:minor" rather than "/dev/xxx"
for compatibility with Linux.
Use pdev->udev_name added by ^^^.
Also see
abe62df9.
Tomohiro Kusumi [Mon, 26 Oct 2015 16:27:13 +0000 (01:27 +0900)]
sys/dev/disk/dm: Make dm-stripe table show major:minor for compatibility
It should be "major:minor" rather than "/dev/xxx"
for compatibility with Linux.
Use pdev->udev_name added by ^^.
Also see
abe62df9.
Tomohiro Kusumi [Mon, 26 Oct 2015 16:10:32 +0000 (01:10 +0900)]
sys/dev/disk/dm: Add udev_t field to dm_pdev_t
Tomohiro Kusumi [Mon, 26 Oct 2015 16:01:48 +0000 (01:01 +0900)]
sys/dev/disk/dm: Add "major:minor" name to dm_pdev_t
François Tigeot [Sat, 31 Oct 2015 09:26:48 +0000 (10:26 +0100)]
drm/radeon: Use atomic_cmpxchg()
Possibly fixing a few bugs in the process
François Tigeot [Sat, 31 Oct 2015 09:02:16 +0000 (10:02 +0100)]
drm: Add atomic_cmpxchg()
François Tigeot [Sat, 31 Oct 2015 08:51:57 +0000 (09:51 +0100)]
drm: Fix atomic_add_unless()
* atomic_cmpset_int() doesn't return the same kind of results as the
Linux atomic_cmpxchg() function
* this code was semi-randomly breaking HDMI detection on Radeon hardware
Author: Yellow Rabbit
François Tigeot [Sat, 31 Oct 2015 08:51:00 +0000 (09:51 +0100)]
kernel: Add atomic_cmpxchg_int()
Submitted-by: Yellow Rabbit
François Tigeot [Sat, 31 Oct 2015 07:37:37 +0000 (08:37 +0100)]
drm/i915: Reduce differences with Linux in i915_gem_fault()
* The convoluted DragonFly-specific lock/unlock/try again VM fault
handling code path was not treating gem objects in the same way
during each try.
* vma->pin_count could be zero, leading to a kernel panic.
François Tigeot [Sat, 31 Oct 2015 07:23:13 +0000 (08:23 +0100)]
drm: Add linux/dma-mapping.h
Imre Vadász [Fri, 30 Oct 2015 19:20:23 +0000 (20:20 +0100)]
if_vtnet, sync 8/x: Move structs and #define-s into if_vtnetvar.h
Taken-From: FreeBSD
Imre Vadász [Fri, 30 Oct 2015 18:36:06 +0000 (19:36 +0100)]
if_vtnet, sync 7/x: Clean up vtnet_enqueue_txbuf() a bit.
* Adds tx_defragged and tx_defrag_failed statistics.
Taken-From: FreeBSD
Sepherosa Ziehau [Fri, 30 Oct 2015 08:33:05 +0000 (16:33 +0800)]
bpf: Add support for 802.11 packet injection via bpf
Obtained-from: FreeBSD
Submitted-by: shamaz
DragonFly-bug: http://bugs.dragonflybsd.org/issues/2849
Sepherosa Ziehau [Fri, 30 Oct 2015 07:01:51 +0000 (15:01 +0800)]
tools/kq_connect_client: Use SOCK_NONBLOCK if it's available
Sepherosa Ziehau [Thu, 29 Oct 2015 03:20:39 +0000 (11:20 +0800)]
socket: Add accept4 syscall and bump __DragonFly_version
Suggested-by: zrj on #dragonflybsd@efnet
Sepherosa Ziehau [Wed, 28 Oct 2015 15:32:43 +0000 (23:32 +0800)]
socket: Shortcircuit FIONBIO in soo_ioctl().
Instead of fallback to so_pru_control().
Sepherosa Ziehau [Wed, 28 Oct 2015 13:22:47 +0000 (21:22 +0800)]
socket/socketpair: Add SOCK_{NONBLOCK,CLOEXEC} support.
Obtained-from: FreeBSD
Suggested-by: zrj on #dragonflybsd@efnet
Sepherosa Ziehau [Wed, 28 Oct 2015 13:15:56 +0000 (21:15 +0800)]
tools/kq_connect_client: Add option to bind process to cpu.
While I'm here, sort options in alphabetical order.
Sepherosa Ziehau [Tue, 27 Oct 2015 12:43:11 +0000 (20:43 +0800)]
tcp: Use 4-tuple hash to optimize local port selection.
So that the connection can:
- Stay in the current netisr to avoid connection forwarding.
- Use the portinfo of the target netisr to avoid portinfo
contention, if connection forwarding could not be avoided,
e.g. when the ports of current netisr are depleted.
And don't try too hard to perform this local port selection
optimization (it's relative time consuming). Number of tries
for this optimized local port selection is controlled by sysctl
node net.inet.ip.porthash_trycount (15 by default). Setting
this sysctl node to 0 will disable this local port selection
optimization.
Total IPI rate and MP collision rate is significantly reduced,
when tools/kq_connect_client runs @395Kconns/s:
- Total IPI rate is reduced by 64K/s (421K/s -> 357K/s).
- Total MP collision rate is reduced by 81K/s (310K/s -> 229K/s).
Imre Vadász [Thu, 29 Oct 2015 22:23:20 +0000 (23:23 +0100)]
if_vtnet: Recognize VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature bit.
Just adds the #define and prints a name for the feature bit instead of
the raw hex number in dmesg.
Imre Vadász [Thu, 29 Oct 2015 22:01:37 +0000 (23:01 +0100)]
if_vtnet: Add, and negotiate the VIRTIO_F_ANY_LAYOUT feature bit
Imre Vadász [Thu, 29 Oct 2015 21:10:53 +0000 (22:10 +0100)]
if_vtnet, sync 6/x: refactor rx_- and update_vlan_filter functions.
* Also, remove IFCAP_TSO4 and IFCAP_TSO6 #define-s, they are available
in sys/net/if.h.
* Renames vtnet_set_vlan_filter() to vtnet_update_vlan_filter().
* Refactors vtnet_ctrl_rx_cmd(), making the usage of stack variables for
DMA and the sglist_append() usage safer.
Taken-From: FreeBSD
Sascha Wildner [Thu, 29 Oct 2015 17:38:38 +0000 (18:38 +0100)]
kernel/drm: In linux/kernel.h, add parentheses around macro parameters.
Sascha Wildner [Thu, 29 Oct 2015 17:36:47 +0000 (18:36 +0100)]
kernel/drm: In linux/slab.h, add parentheses around macro parameters.
Such parameters must be in parentheses for numerous good reasons, one
of which is precedence issues like the one we had in intel_sdvo.c
before this commit:
msgs = kcalloc(args_len + 3, sizeof(*msgs), GFP_KERNEL);
Sepherosa Ziehau [Tue, 27 Oct 2015 12:41:33 +0000 (20:41 +0800)]
systat/pv: Log total IPI, external interrupts and MP collision rate.
Sepherosa Ziehau [Tue, 27 Oct 2015 12:40:24 +0000 (20:40 +0800)]
ipdemux: Better initial so_port distribution for non-power-of-2 ncpus
The measured effect of this change on 2-ways E5-2600v2 with Intel 82599
(10Gbe) using tools/kq_connect_client -u, i.e. UDP socket/connect/send/
close before initiating a TCP connection:
- Connect rate increases by ~15Kconns/s; we are now doing 315Kconns/s.
- This also improves tools/kq_connect_client w/o -u a little bit.
Sepherosa Ziehau [Fri, 23 Oct 2015 13:40:23 +0000 (21:40 +0800)]
udp: Implement asynchronized pru_connect.
This is mainly used to improve UDP connect(2) performance. Most
of the DNS resolvers (getaddrinfo(3) and curl's DNS resolver, etc)
and RTP application will see improvement.
Before this commit the user space thread uses connect(2) will have
to wait for the netisr to complete all preceeding messages. This
could be performance hit for connect(2): the user space thread is
suspended, even if the UDP connect(2) should always be nonblocking.
The only drawback is that bunch of datagrams sent immediately after
connect(2) may not appear on the network in the sending order, but
UDP applications should always be able to handle out-of-order data-
grams.
UDP's asynchronous pru_connect implementation will set ISCONNECTED
before dispatching connect message to netisr. The errors like
EADDRNOTAVAIL, i.e. out of local port space, will be notified
through later send(2)/recv(2), or getsockopt(2) SOL_SOCKET/SO_ERROR.
The measured effect of this change on 2-ways E5-2600v2 with Intel
82599 (10Gbe) using tools/kq_connect_client -u, i.e. UDP socket/
connect/send /close before initiating a TCP connection:
- Connect rate increases by ~45Kconns/s; we are now doing
300Kconns/s.
- IPIs rate to the CPUs not running netisrs reduces (23Kipis/s ->
16Kipis/s).
Sepherosa Ziehau [Fri, 23 Oct 2015 13:37:46 +0000 (21:37 +0800)]
udp: Save original protocol processing port for later synchronizing.
Unlike TCP, user could send data w/ address to a UDP socket that
connect(2) is being called (those data messages will be on the
original protocol processing port and forwarded to the new protocol
processing port later), and then close the UDP socket (the detach
message could be sent to the new protocol processing port before
the inflight data messages). The inflight data messages will cause
later panic, since the socket/inp has been destroyed by the detach
message. I will have to say this probably will never happen for any
real world applications.
We fix this by recording the original message port, and synchronize
inflight data messages on it upon detaching. If the connect(2) moves
between protocol processing ports more than once, we will go though
all UDP processing netisrs to synchronize all possible inflight data
messages.
Sepherosa Ziehau [Thu, 29 Oct 2015 01:20:29 +0000 (09:20 +0800)]
udp/usrreq: Add brackets properly
The brackets were left out pretty accidentally, but the code
also worked pretty accidentally:
int error = 0;
if (ai != NULL)
error = udp_preattach(...);
if (error)
goto out
else {
/* mismatched comment */
}
Reported-by: s4 on DragonFlyDigest
Antonio Huete Jimenez [Wed, 28 Oct 2015 22:08:11 +0000 (23:08 +0100)]
make.conf(5) - Fix default WORLD_CCVER value.
- This follows up commit
4e8e707f
Imre Vadász [Wed, 28 Oct 2015 21:49:54 +0000 (22:49 +0100)]
if_vtnet, sync 5/x: Make stat counters uint64_t instead of unsigned long.
* Removes unused rx_csum_bad_start counter.
* Rename vtnet_reinit() to vtnet_virtio_reinit() which matches the
function with that name in FreeBSD's code.
Taken-From: FreeBSD
Imre Vadász [Wed, 28 Oct 2015 21:10:07 +0000 (22:10 +0100)]
if_vtnet, sync 4/x: Factor out vtnet_setup_interface from vtnet_attach
Taken-From: FreeBSD
François Tigeot [Wed, 28 Oct 2015 19:54:55 +0000 (20:54 +0100)]
drm: Remove the MODULE_LICENSE and EXPORT_SYMBOL_GPL macros
It's not clear what they are supposed to do and the drm code
is not under a GPL license anyway.
Sascha Wildner [Wed, 28 Oct 2015 18:56:31 +0000 (19:56 +0100)]
kernel/drm: In asm/io.h, improve the iowriteN() macros.
The main issue were the trailing semicolons in the definitions.
These prevent usage in braceless if/else, for example:
if (blah)
iowrite32(...);
else
...
The resulting double semicolons after preprocessing lead to the
closing of the if (), resulting in an "'else' without a previous 'if'"
error.
Imre Vadász [Tue, 27 Oct 2015 22:35:29 +0000 (23:35 +0100)]
if_vtnet, sync 3/x: No LRO without mergeable receive buffers.
* Add VIRTIO_RING_F_INDIRECT_DESC #define.
Taken-From: FreeBSD
Imre Vadász [Tue, 27 Oct 2015 22:27:43 +0000 (23:27 +0100)]
drm.4: Document the hw.dri.vblank_offdelay sysctl.
* hw.dri.0.debug doesn't exist, but hw.dri.debug actually exists.
* Mention, that hw.dri.vblank_offdelay can be relevant for
panel-self-refresh effectivity.
Sascha Wildner [Tue, 27 Oct 2015 18:16:37 +0000 (19:16 +0100)]
<stdlib.h>/<unistd.h>: Expose mkdtemp()'s prototype also if XSI is visible.
The history of this function in the specs seems to be a bit convoluted
for this function, to say the least. Even though I can't find it in
either Issue 5 or 6, go with what Issue 7's HISTORY says and treat it
like it was moved from XSI to base starting with Issue 7:
http://pubs.opengroup.org/onlinepubs/
9699919799/functions/mkdtemp.html
Most importantly, this commit fixes x11/xterm which was building but
segfaulting after
8eb95a5667325.
Reported-by: Rimvydas Jasinskas <rimvydas.jasinskas@gmail.com>
Imre Vadász [Mon, 26 Oct 2015 21:49:22 +0000 (22:49 +0100)]
if_vtnet, sync with FreeBSD 2/x: Sync vtnet_*_filter functions.
* Sync vtnet_rx_filter_mac() and vtnet_exec_vlan_filter() functions.
* s/vlan_unconfg/vlan_unconfig/ in the EVENTHANDLER_DEREGISTER statement.
Taken-From: FreeBSD