dragonfly.git
8 years agosys/dev/disk/dm: Add info() handler for striped target for compatibility
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.

8 years agosys/dev/disk/dm: Make dm-linear table show major:minor for compatibility
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.

8 years agosys/dev/disk/dm: Make dm-stripe table show major:minor for compatibility
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.

8 years agosys/dev/disk/dm: Add udev_t field to dm_pdev_t
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

8 years agosys/dev/disk/dm: Add "major:minor" name 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

8 years agodrm/radeon: Use atomic_cmpxchg()
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

8 years agodrm: Add atomic_cmpxchg()
François Tigeot [Sat, 31 Oct 2015 09:02:16 +0000 (10:02 +0100)]
drm: Add atomic_cmpxchg()

8 years agodrm: Fix atomic_add_unless()
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

8 years agokernel: Add atomic_cmpxchg_int()
François Tigeot [Sat, 31 Oct 2015 08:51:00 +0000 (09:51 +0100)]
kernel: Add atomic_cmpxchg_int()

Submitted-by: Yellow Rabbit
8 years agodrm/i915: Reduce differences with Linux in i915_gem_fault()
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.

8 years agodrm: Add linux/dma-mapping.h
François Tigeot [Sat, 31 Oct 2015 07:23:13 +0000 (08:23 +0100)]
drm: Add linux/dma-mapping.h

8 years agoif_vtnet, sync 8/x: Move structs and #define-s into if_vtnetvar.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

8 years agoif_vtnet, sync 7/x: Clean up vtnet_enqueue_txbuf() a bit.
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

8 years agobpf: Add support for 802.11 packet injection via bpf
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

8 years agotools/kq_connect_client: Use SOCK_NONBLOCK if it's available
Sepherosa Ziehau [Fri, 30 Oct 2015 07:01:51 +0000 (15:01 +0800)]
tools/kq_connect_client: Use SOCK_NONBLOCK if it's available

8 years agosocket: Add accept4 syscall and bump __DragonFly_version
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
8 years agosocket: Shortcircuit FIONBIO in soo_ioctl().
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().

8 years agosocket/socketpair: Add SOCK_{NONBLOCK,CLOEXEC} support.
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
8 years agotools/kq_connect_client: Add option to bind process to cpu.
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.

8 years agotcp: Use 4-tuple hash to optimize local port selection.
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).

8 years agoif_vtnet: Recognize VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature bit.
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.

8 years agoif_vtnet: Add, and negotiate the VIRTIO_F_ANY_LAYOUT feature bit
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

8 years agoif_vtnet, sync 6/x: refactor rx_- and update_vlan_filter functions.
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

8 years agokernel/drm: In linux/kernel.h, add parentheses around macro parameters.
Sascha Wildner [Thu, 29 Oct 2015 17:38:38 +0000 (18:38 +0100)]
kernel/drm: In linux/kernel.h, add parentheses around macro parameters.

8 years agokernel/drm: In linux/slab.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);

8 years agosystat/pv: Log total IPI, external interrupts and MP collision rate.
Sepherosa Ziehau [Tue, 27 Oct 2015 12:41:33 +0000 (20:41 +0800)]
systat/pv: Log total IPI, external interrupts and MP collision rate.

8 years agoipdemux: Better initial so_port distribution for non-power-of-2 ncpus
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.

8 years agoudp: Implement asynchronized pru_connect.
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).

8 years agoudp: Save original protocol processing port for later synchronizing.
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.

8 years agoudp/usrreq: Add brackets properly
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
8 years agomake.conf(5) - Fix default WORLD_CCVER value.
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

8 years agoif_vtnet, sync 5/x: Make stat counters uint64_t instead of unsigned long.
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

8 years agoif_vtnet, sync 4/x: Factor out vtnet_setup_interface from vtnet_attach
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

8 years agodrm: Remove the MODULE_LICENSE and EXPORT_SYMBOL_GPL macros
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.

8 years agokernel/drm: In asm/io.h, improve the iowriteN() macros.
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.

8 years agoif_vtnet, sync 3/x: No LRO without mergeable receive buffers.
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

8 years agodrm.4: Document the hw.dri.vblank_offdelay sysctl.
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.

8 years ago<stdlib.h>/<unistd.h>: Expose mkdtemp()'s prototype also if XSI is visible.
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>
8 years agoif_vtnet, sync with FreeBSD 2/x: Sync vtnet_*_filter functions.
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

8 years agokernel/p1003_1b: Fix the p1003_1b.shared_memory_objects sysctl.
Sascha Wildner [Mon, 26 Oct 2015 17:32:18 +0000 (18:32 +0100)]
kernel/p1003_1b: Fix the p1003_1b.shared_memory_objects sysctl.

8 years agosysconf.3: Document _SC_REGEXP and _SC_SHELL.
Sascha Wildner [Mon, 26 Oct 2015 08:40:26 +0000 (09:40 +0100)]
sysconf.3: Document _SC_REGEXP and _SC_SHELL.

8 years ago<unistd.h>: Add some comments to mandatory and obsolescent options.
Sascha Wildner [Mon, 26 Oct 2015 08:39:55 +0000 (09:39 +0100)]
<unistd.h>: Add some comments to mandatory and obsolescent options.

8 years agosysconf.3: Use .Dv for _SC*.
Sascha Wildner [Mon, 26 Oct 2015 08:33:38 +0000 (09:33 +0100)]
sysconf.3: Use .Dv for _SC*.

8 years agoif_vtnet: Use SetMacAddress feature; Add some new feature flags.
Imre Vadász [Sun, 25 Oct 2015 23:11:30 +0000 (00:11 +0100)]
if_vtnet: Use SetMacAddress feature; Add some new feature flags.

* If the VTNET_FLAG_CTRL_MAC and VTNET_FLAG_CTRL_RX features are
  available, we should set the MAC address via a control message.

* Add VIRTIO_NET_F_GUEST_ANNOUNCE feature flag.
* Add VIRTIO_CONFIG_STATUS_DEVICE_NEEDS_RESET device status bit.

* Do some reordering of function declarations/implementations to reduce
  differences to FreeBSD's code a bit.

Taken-From: FreeBSD

8 years agosysconf.3: Document _SC_XOPEN_SHM.
Sascha Wildner [Sun, 25 Oct 2015 23:19:40 +0000 (00:19 +0100)]
sysconf.3: Document _SC_XOPEN_SHM.

8 years agolibc/sysconf: Simplify sysconf(_SC_XOPEN_SHM) a bit.
Sascha Wildner [Sun, 25 Oct 2015 21:47:18 +0000 (22:47 +0100)]
libc/sysconf: Simplify sysconf(_SC_XOPEN_SHM) a bit.

We never had sysv_shm as a module like FreeBSD, only as a kernel
option (SYSVSHM), which was made a no-op when we started to compile
it into our kernels by default over a year ago (see 10ceb70237a5).

The sysctl check in the sysconf(3) code was only there to check if
it was compiled into the kernel or (in FreeBSD's case) if it was
loaded as a module, when it was still optional.

So the worst thing that could happen after this commit is a wrong
return value for sysconf(_SC_XOPEN_SHM) if someone was running a
kernel without "options SYSVSHM" from earlier than July 29, 2014
in combination with a current world. This all looks quite unlikely,
so remove the check.

Also, return the right variable from <unistd.h>.

8 years agosys/dev/disk/dm: Always initialize target's status string
Tomohiro Kusumi [Sun, 25 Oct 2015 12:33:42 +0000 (21:33 +0900)]
sys/dev/disk/dm: Always initialize target's status string

Ioctl by dmsetup(8)'s "status" subcommand doesn't necessary
have a handler function from the way it's implemented.

In such a case, it seems prop_dictionary_t object of libprop
(in-kernel library) isn't properly initialized. This results
in dmsetup(8)'s "status" subcommand showing a binary junk.
This commit explicitly initializes it with C string "" to
fix this in above case where char *params remains == NULL.

This issue existed before f134a703 (touched related code).

Below can reproduce this issue. Using a kernel prior to this
commit will show some junk after each line of dmsetup status
output except for the last line. Target type and definition
of table can be anything, but the target needs to have more
than 1 entries for the table to reproduce this.

=====(A) using the existing code
  # kldload dm
  # echo "0 117218241 linear /dev/daX 0" > ./table.txt
  # echo "117218241 117218241 linear /dev/daY 0" >> ./table.txt
  # dmsetup create linear1 ./table.txt
  # dmsetup status /dev/mapper/linear1
  0 117218241 linear \9bü
  117218241 117218241 linear

=====(B) using this commit
  # kldload dm
  # echo "0 117218241 linear /dev/daX 0" > ./table.txt
  # echo "117218241 117218241 linear /dev/daY 0" >> ./table.txt
  # dmsetup create linear1 ./table.txt
  # dmsetup status /dev/mapper/linear1
  0 117218241 linear
  117218241 117218241 linear

8 years agocontrib/lvm2: Add missing \n
Tomohiro Kusumi [Sat, 24 Oct 2015 17:44:38 +0000 (02:44 +0900)]
contrib/lvm2: Add missing \n

8 years agosys/dev/disk/dm: Fix comments and doc/proposal-dm.txt
Tomohiro Kusumi [Sat, 24 Oct 2015 14:04:59 +0000 (23:04 +0900)]
sys/dev/disk/dm: Fix comments and doc/proposal-dm.txt

These have been wrong prior to the last two commits.

8 years agosys/dev/disk/dm: Change pdev SLIST to TAILQ
Tomohiro Kusumi [Sat, 24 Oct 2015 13:59:46 +0000 (22:59 +0900)]
sys/dev/disk/dm: Change pdev SLIST to TAILQ

TAILQ is more flexible and better for what it's trying to do.

8 years agosys/dev/disk/dm: Change table SLIST to TAILQ
Tomohiro Kusumi [Sat, 24 Oct 2015 13:38:30 +0000 (22:38 +0900)]
sys/dev/disk/dm: Change table SLIST to TAILQ

TAILQ is more flexible and better for what it's trying to do.

8 years agosys/dev/disk/dm: Add dm_table_init_target()
Tomohiro Kusumi [Sat, 24 Oct 2015 16:04:14 +0000 (01:04 +0900)]
sys/dev/disk/dm: Add dm_table_init_target()

8 years agosys/dev/disk/dm: Don't let targets implement deps [2/2]
Tomohiro Kusumi [Sat, 24 Oct 2015 10:38:56 +0000 (19:38 +0900)]
sys/dev/disk/dm: Don't let targets implement deps [2/2]

This commit gets rid of target's deps handler by introducing
a new structure struct dm_mapping which embeds struct dm_pdev*
and a tailq structure for the next entry whose tailq head is
embedded within struct dm_table_entry.

=====(A) before this commit
table
    |                                     [dm core]
-------------------------------------------------------
    |           pdev      pdev      pdev  [dm targets]
    v          ^         ^         ^
    target----/---------/---------/
    (void*)

=====(B) this commit
table---->mapping-->mapping-->mapping-->...
    |           |         |         |
    |           v         v         v     [dm core]
-------------------------------------------------------
    |           pdev      pdev      pdev  [dm targets]
    v          ^         ^         ^
    target----/---------/---------/
    (void*)

Each target's init() now calls dm_table_add_deps(table, pdev)
to add a new dm_mapping (that points to pdev) to table. This
allows dm table structure to refer to underlying devices that
the target is dependent on (by following this tailq) without
using target specific deps handler.

dmsetup(8)'s deps subcommand is now handled by a newly added
dm core function dm_table_deps() that is common among targets.
This greatly reduces complexity and size of targets plus make
code less error prone. Targets only need to call dm_table_add
_deps() as mentioned above whenever they allocate underlying
device(s) via dm_pdev_insert().

8 years agosys/dev/disk/dm: Don't let targets implement deps [1/2]
Tomohiro Kusumi [Sat, 24 Oct 2015 09:35:47 +0000 (18:35 +0900)]
sys/dev/disk/dm: Don't let targets implement deps [1/2]

As mentioned in 66fee7cc, each dm target implementing its deps
ioctl handler is inefficient and error prone since each handler
is going to be just a copy pasted code from other target for
its underlying device(s).

The way dm computes device dependencies (i.e. deps handler)
shouldn't be targets specific in the first place. The problem
here is that dm table (struct dm_table_entry) is unable to see
its underlying device(s), but only each target specific data
structure can see them. This commit and next one fix it and
enables dm core to handle dependencies without using targets
specific code.

This commit only changes API format of init handler. It needs
to pass dm table instead of device and void**, for the next
commit.

8 years agosys/dev/disk/dm: Rename variable
Tomohiro Kusumi [Sat, 24 Oct 2015 08:59:57 +0000 (17:59 +0900)]
sys/dev/disk/dm: Rename variable

struct dm_dev *dm_dev;
is just confusing.

From the way other struct dm_dev type variables are named,
it should be either dev or dmv, and those two should probably
be either but not both. Same for struct dm_pdev.

8 years agosys/dev/disk/dm: Remove unnecessary ()
Tomohiro Kusumi [Sat, 24 Oct 2015 08:57:09 +0000 (17:57 +0900)]
sys/dev/disk/dm: Remove unnecessary ()

8 years agolibc: Remove unused (and public) locale_isstrict()
John Marino [Sun, 25 Oct 2015 07:19:14 +0000 (08:19 +0100)]
libc: Remove unused (and public) locale_isstrict()

The publicly exposed locale_isstrict function is not hooked into anything.
It was intended to implement LOCALE_STRICT environment variable handling,
but it only returns a boolean based on the value of LOCALE_STRICT, and not
even efficiently.

There is also a private "strict_mode" variable in locale_private.h that
apparently was intended to be used with LOCALE_STRICT, but it's also
seemingly useless.

The LOCALE_STRICT override still needs to be implemented if UTF-8B is
in use, but it can be handled at encoding initialization more
efficiently later.

8 years agokernel: Add missing linux_async.c to conf/files
François Tigeot [Sat, 24 Oct 2015 20:59:29 +0000 (22:59 +0200)]
kernel: Add missing linux_async.c to conf/files

It is required by LINT64 kernels where the drm code is compiled in
and not loaded on-demand as a module.

Pointed-out-by: swildner
8 years agodrm/i915: Update to Linux 3.18
François Tigeot [Sat, 24 Oct 2015 09:48:26 +0000 (11:48 +0200)]
drm/i915: Update to Linux 3.18

* Revamped, more robust vblank handling

* More paranoid pageflips, with added error detection and recovery logic

* Lots of Cherryview improvements, including runtime power management
  and better eDP panel support

* Lots of Broadwell improvements. GPU commands can now be submitted via
  a new execlist mechanism

* Preparatory work for Skylake support

8 years agodrm/linux: Add some list functions
François Tigeot [Sat, 24 Oct 2015 09:15:43 +0000 (11:15 +0200)]
drm/linux: Add some list functions

list_first, list_last and list_last_entry() obtained from NetBSD

8 years agodrm/linux: Add module_param_named()
François Tigeot [Sat, 24 Oct 2015 06:43:13 +0000 (08:43 +0200)]
drm/linux: Add module_param_named()

8 years agodrm/linux: Add BUILD_BUG()
François Tigeot [Sat, 24 Oct 2015 06:41:14 +0000 (08:41 +0200)]
drm/linux: Add BUILD_BUG()

8 years agodrm: Add asm/int-ll64.h
François Tigeot [Fri, 23 Oct 2015 20:06:29 +0000 (22:06 +0200)]
drm: Add asm/int-ll64.h

8 years agodrm: Add linux/lockdep.h
François Tigeot [Fri, 23 Oct 2015 19:58:55 +0000 (21:58 +0200)]
drm: Add linux/lockdep.h

8 years agodrm: Add Linux async functions
François Tigeot [Fri, 23 Oct 2015 19:53:16 +0000 (21:53 +0200)]
drm: Add Linux async functions

8 years agocollate: Fix expansion substitions (broken upstream too)
John Marino [Fri, 23 Oct 2015 12:57:32 +0000 (14:57 +0200)]
collate: Fix expansion substitions (broken upstream too)

Through testing, the user noted that some Cyrillic characters were not
sorting correctly, and this was confirmed.

After extensive testing and review, the localedef tool was eliminated
as the culprit.  The sustitutions were encoded correctly in LC_COLLATE.

The error was mainly in wcscoll where character expansions were
mishandled.  The main directive pass routines had to be written to
go back for a new collation value when the "state" variable was set.
Before pointers were being advanced, the second lookup was gettting
applied to the wrong character, etc.

The "eat expansion codes" section on collate.c also had a bug.  Later
own, the "state" variable logic was changed to only set if next
code was greater than zero (rather than >= 0).

Some additional cleanups got captured from previous work:
1) The previous commit moved the binary search comment from the
   correct location to a wrong location because it's wrong upstream
   in Illumos.  The comment has little value so I just removed it.
2) Don't check if pointers are null before freeing, this is
   redundant as free() handles null pointers.
3) The two binary search trees were standardized wrt initialization
4) On the binary search trees, a negative "high" exits rather than
   checking the table count again.

Reported-by: bapt@FreeBSD.org
diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c
index 0bd2e1c..6912732 100644
--- a/lib/libc/locale/collate.c
+++ b/lib/libc/locale/collate.c
@@ -216,27 +216,18 @@ substsearch(struct xlocale_collate *table, const wchar_t key, int pass)
  return (p->pri);
 }

-/*
- * Note: for performance reasons, we have expanded bsearch here.  This avoids
- * function call overhead with each comparison.
- */
-
 static collate_chain_t *
 chainsearch(struct xlocale_collate *table, const wchar_t *key, int *len)
 {
- int low;
- int high;
+ int low = 0;
+ int high = table->info->chain_count - 1;;
  int next, compar, l;
  collate_chain_t *p;
- collate_chain_t *tab;
+ collate_chain_t *tab = table->chain_pri_table;

- if (table->info->chain_count == 0)
+ if (high < 0)
  return (NULL);

- low = 0;
- high = table->info->chain_count - 1;
- tab = table->chain_pri_table;
-
  while (low <= high) {
  next = (low + high) / 2;
  p = tab + next;
@@ -266,7 +257,7 @@ largesearch(struct xlocale_collate *table, const wchar_t key)
  collate_large_t *p;
  collate_large_t *tab = table->large_pri_table;

- if (table->info->large_count == 0)
+ if (high < 0)
  return (NULL);

  while (low <= high) {
@@ -310,7 +301,10 @@ _collate_lookup(struct xlocale_collate *table, const wchar_t *t, int *len,
  if ((sptr = *state) != NULL) {
  *pri = *sptr;
  sptr++;
- *state = *sptr ? sptr : NULL;
+ if ((sptr == *state) || (sptr == NULL))
+ *state = NULL;
+ else
+ *state = sptr;
  *len = 0;
  return;
  }
@@ -371,7 +365,7 @@ _collate_lookup(struct xlocale_collate *table, const wchar_t *t, int *len,
   * code ensures this for us.
   */
  if ((sptr = substsearch(table, *pri, which)) != NULL) {
- if ((*pri = *sptr) != 0) {
+ if ((*pri = *sptr) > 0) {
  sptr++;
  *state = *sptr ? sptr : NULL;
  }
diff --git a/lib/libc/string/wcscoll.c b/lib/libc/string/wcscoll.c
index 87a91c2..c6cb890 100644
--- a/lib/libc/string/wcscoll.c
+++ b/lib/libc/string/wcscoll.c
@@ -74,6 +74,7 @@ wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale)
  const int32_t *st2 = NULL;
  const wchar_t *w1 = ws1;
  const wchar_t *w2 = ws2;
+ int check1, check2;

  /* special pass for UNDEFINED */
  if (pass == table->info->directive_count) {
@@ -107,25 +108,36 @@ wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale)
  }

  if (direc & DIRECTIVE_POSITION) {
- while ((*w1 || st1) && (*w2 || st2)) {
+ while (*w1 && *w2) {
  pri1 = pri2 = 0;
- _collate_lookup(table, w1, &len1, &pri1, pass,
-     &st1);
- if (pri1 <= 0) {
- if (pri1 < 0) {
- errno = EINVAL;
- goto fail;
+ check1 = check2 = 1;
+ while ((pri1 == pri2) && (check1 || check2)) {
+ if (check1) {
+ _collate_lookup(table, w1, &len1,
+     &pri1, pass, &st1);
+ if (pri1 < 0) {
+ errno = EINVAL;
+ goto fail;
+ }
+ if (!pri1) {
+ pri1 = COLLATE_MAX_PRIORITY;
+ st1 = NULL;
+ }
+ check1 = (st1 != NULL);
  }
- pri1 = COLLATE_MAX_PRIORITY;
- }
- _collate_lookup(table, w2, &len2, &pri2, pass,
-     &st2);
- if (pri2 <= 0) {
- if (pri2 < 0) {
- errno = EINVAL;
- goto fail;
+ if (check2) {
+ _collate_lookup(table, w2, &len2,
+     &pri2, pass, &st2);
+ if (pri2 < 0) {
+ errno = EINVAL;
+ goto fail;
+ }
+ if (!pri2) {
+ pri2 = COLLATE_MAX_PRIORITY;
+ st2 = NULL;
+ }
+ check2 = (st2 != NULL);
  }
- pri2 = COLLATE_MAX_PRIORITY;
  }
  if (pri1 != pri2) {
  ret = pri1 - pri2;
@@ -135,29 +147,38 @@ wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale)
  w2 += len2;
  }
  } else {
- while ((*w1 || st1) && (*w2 || st2)) {
+ while (*w1 && *w2) {
  pri1 = pri2 = 0;
- while (*w1) {
- _collate_lookup(table, w1, &len1,
-     &pri1, pass, &st1);
- if (pri1 > 0)
- break;
- if (pri1 < 0) {
- errno = EINVAL;
- goto fail;
+ check1 = check2 = 1;
+ while ((pri1 == pri2) && (check1 || check2)) {
+ while (check1 && *w1) {
+ _collate_lookup(table, w1,
+     &len1, &pri1, pass, &st1);
+ if (pri1 > 0)
+ break;
+ if (pri1 < 0) {
+ errno = EINVAL;
+ goto fail;
+ }
+ st1 = NULL;
+ w1 += 1;
  }
- w1 += len1;
- }
- while (*w2) {
- _collate_lookup(table, w2, &len2,
-     &pri2, pass, &st2);
- if (pri2 > 0)
- break;
- if (pri2 < 0) {
- errno = EINVAL;
- goto fail;
+ check1 = (st1 != NULL);
+ while (check2 && *w2) {
+ _collate_lookup(table, w2,
+     &len2, &pri2, pass, &st2);
+ if (pri2 > 0)
+ break;
+ if (pri2 < 0) {
+ errno = EINVAL;
+ goto fail;
+ }
+ st2 = NULL;
+ w2 += 1;
  }
- w2 += len2;
+ check2 = (st2 != NULL);
+ if (!pri1 || !pri2)
+ break;
  }
  if (!pri1 || !pri2)
  break;
@@ -182,10 +203,8 @@ wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale)
  ret = 0;

 end:
- if (tr1)
- free(tr1);
- if (tr2)
- free(tr2);
+ free(tr1);
+ free(tr2);

  return (ret);

8 years agoFix kernel compilation without INET6 in the config.
Sascha Wildner [Thu, 22 Oct 2015 11:14:03 +0000 (13:14 +0200)]
Fix kernel compilation without INET6 in the config.

Reported-by: Rimvydas Jasinskas <rimvydas.jasinskas@gmail.com>
8 years agoudp/usrreq: Implement asynchronized pru_attach for UDP
Sepherosa Ziehau [Thu, 22 Oct 2015 07:51:06 +0000 (15:51 +0800)]
udp/usrreq: Implement asynchronized pru_attach for UDP

The idea is same as c892825ffb53edaa4e5d7270b9254de80099dc53

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 260Kconns/s.
- IPIs rate to the CPUs not running netisrs reduces (36Kipis/s ->
  23Kipis/s).

8 years agokvm_getfiles.3: Fix return type.
Sascha Wildner [Wed, 21 Oct 2015 18:41:45 +0000 (20:41 +0200)]
kvm_getfiles.3: Fix return type.

8 years agokernel: Rename si(4)'s si.c to si_drv.c.
Sascha Wildner [Wed, 21 Oct 2015 18:04:01 +0000 (20:04 +0200)]
kernel: Rename si(4)'s si.c to si_drv.c.

It has a name conflict with radeon's si.c file.

8 years agoFix visibility of various functions in a number of headers.
Sascha Wildner [Wed, 21 Oct 2015 16:41:01 +0000 (18:41 +0200)]
Fix visibility of various functions in a number of headers.

The following functions were moved from XSI into the base with
POSIX 200809:

catclose(), catgets(), catopen(), dlclose(), dlerror(), dlopen(),
dlsym(), fchdir(), getpgid(), getsid(), getsubopt(), iconv(),
iconv_close(), iconv_open(), lchown(), mkstemp(), nl_langinfo(),
poll(), pread(), pwrite(), strdup(), strfmon(), tcgetsid(),
truncate(), and waitid().

This commit adjusts our headers to reflect that, i.e. specifying
_POSIX_C_SOURCE=200809 is now enough to expose their prototypes.

The checking of __XSI_VISIBLE's value (ranges) for XSI functions
could certainly be better (generally in our headers).

Also, we don't yet have waitid().

This change was build tested with around 8000 ports (until the
bulk build choked on a jdk7 memory leak (I suppose) while building
textproc/fop). The glibc conformance test suite thinks this
commit is correct, too.

8 years agobsd-family-tree: Sync with FreeBSD.
Sascha Wildner [Wed, 21 Oct 2015 07:10:23 +0000 (09:10 +0200)]
bsd-family-tree: Sync with FreeBSD.

8 years agoudp/usrreq: Add missing return
Sepherosa Ziehau [Wed, 21 Oct 2015 03:36:41 +0000 (11:36 +0800)]
udp/usrreq: Add missing return

8 years agoudp/usrreq: Fix up cleanup so_pcb checks
Sepherosa Ziehau [Wed, 21 Oct 2015 02:41:51 +0000 (10:41 +0800)]
udp/usrreq: Fix up cleanup so_pcb checks

- pru_attach must not be called twice, so so_pcb must be NULL.
- Check so_pcb in udp_ctloutput; this prepares asynchronized udp
  pru_attach.

8 years agotcp: In netisrs, if inpcb is valid, tcpcb will not be NULL
Sepherosa Ziehau [Tue, 20 Oct 2015 13:09:33 +0000 (21:09 +0800)]
tcp: In netisrs, if inpcb is valid, tcpcb will not be NULL

8 years agortadvd: Fix DNSSL options handling
Sepherosa Ziehau [Tue, 20 Oct 2015 12:41:24 +0000 (20:41 +0800)]
rtadvd: Fix DNSSL options handling

The rtadvd program, recently refreshed from FreeBSD, mishandles DNSSL
options, which need to be padded to an eight byte boundary.  The code
correctly calculates the padding length, then fails to increment the
pointer used to write the packet data by this amount.  As a result,
all subsequent option data gets written into the wrong place, making
the rest of the packet junk.

DragonFly-bug: http://bugs.dragonflybsd.org/issues/2847

8 years agolibc/resolve: Fix broken EDNS option
Sepherosa Ziehau [Tue, 20 Oct 2015 12:40:52 +0000 (20:40 +0800)]
libc/resolve: Fix broken EDNS option

EDNS option broken with unbound.  struct querybuf in net/gethnamaddr.c
defines MAXPACKET to 64K.  This in turn gets passed down until it
reached res_nopt(..., answer, anslen), where the size of the buffer
must fit in 16 bits.  Unfortunately we end up being one more than the
max so we end up sending a 0 as the size and unbound does not like
that. Instead we clip now to 64K - 1, and everyone is happy.

Obtained-from: NetBSD
DragonFly-bug: http://bugs.dragonflybsd.org/issues/2846

8 years ago<inttypes.h>: Expose wcstoimax() and wcstoumax() prototypes for C++ too.
Sascha Wildner [Wed, 21 Oct 2015 00:03:17 +0000 (02:03 +0200)]
<inttypes.h>: Expose wcstoimax() and wcstoumax() prototypes for C++ too.

I don't know why it was explicitly excluded in e2565a420c31.

I can only guess that because of the definition of wchar_t being in
"#ifndef __cplusplus", it was assumed that these functions (both
taking wchar_t's) should get the same treatment. However, the real
reason for the wchar_t handling is that wchar_t is a fundamental
type in C++, while in C it is not.

8 years agosys/dev/disk/dm: Remove unused macro DM_CMD_LEN
Tomohiro Kusumi [Tue, 20 Oct 2015 17:09:33 +0000 (02:09 +0900)]
sys/dev/disk/dm: Remove unused macro DM_CMD_LEN

that was added but never used in both DragonFly and NetBSD.

8 years agosys/dev/disk/dm: Comment out unused variables (that have future plans)
Tomohiro Kusumi [Tue, 20 Oct 2015 16:34:13 +0000 (01:34 +0900)]
sys/dev/disk/dm: Comment out unused variables (that have future plans)

Things that are supposed to be implemented in the future
according to sys/dev/disk/dm/doc/.

8 years agoMention tunables for toggling MSI support in iwm's and bge's manpages.
Sascha Wildner [Tue, 20 Oct 2015 16:27:22 +0000 (18:27 +0200)]
Mention tunables for toggling MSI support in iwm's and bge's manpages.

8 years agoifconfig(8): Fix support for automatic driver module loading.
Sascha Wildner [Tue, 20 Oct 2015 16:10:10 +0000 (18:10 +0200)]
ifconfig(8): Fix support for automatic driver module loading.

Before this commit, trying to configure for example 'ifconfig vxnet ..."
would have kldload'ed the if_vx module even if there was a if_vxnet one
if they both existed and none of them was loaded.

FreeBSD fixed this in r279951. This commit brings in their ifmaybeload()
function wholesale.

Taken-from:  FreeBSD
Reported-by: Bill Yuan <bycn82@leaf.dragonflybsd.org>
8 years agosys/dev/disk/dm: Change printf() to kprintf()
Tomohiro Kusumi [Tue, 20 Oct 2015 14:44:04 +0000 (23:44 +0900)]
sys/dev/disk/dm: Change printf() to kprintf()

Change disabled (i.e. either within a comment or not compiled)
printf() to kprintf().

8 years agosys/dev/disk/dm: Remove aprint_normal()
Tomohiro Kusumi [Tue, 20 Oct 2015 14:18:53 +0000 (23:18 +0900)]
sys/dev/disk/dm: Remove aprint_normal()

This is a macro for kprintf, but dm and targets basically
never use this except for a few. There isn't really any
point to keep macro version of kprintf, so get rid of it.

8 years agosys/dev/disk/dm: Don't expose cmd_function in header
Tomohiro Kusumi [Tue, 20 Oct 2015 13:36:53 +0000 (22:36 +0900)]
sys/dev/disk/dm: Don't expose cmd_function in header

This struct is necessary only for core part of ioctl where
it needs to translate C string to an appropriate handler.
It just doesn't need to expose everything in dm.h.

8 years agolibc/collate: minor tweaks / fix
John Marino [Tue, 20 Oct 2015 13:22:42 +0000 (15:22 +0200)]
libc/collate: minor tweaks / fix

The main "fix" here is properly setting a collate loading error for each
early return.  Tweaks include removing unnecessary null checks, adding
assertions (from Illumos) and a couple of variables to reduces code
differences and improve readability.  For normal use, there are no
functional changes here.

8 years agoinpcb: Reorder kmalloc and inp checking in set{peer,sock}addr().
Sepherosa Ziehau [Mon, 19 Oct 2015 13:36:27 +0000 (21:36 +0800)]
inpcb: Reorder kmalloc and inp checking in set{peer,sock}addr().

Since kmalloc(M_WAITOK) happens in the owner protocol thread of
inp, we don't care about possible kmalloc block.  This makes the
code more straightforward.

While I'm here:
- Staticize {in,in6}_setsockaddr().
- Remove unnecessary critical sections.
- Fix staled comment about NULL PCB for set{peer,sock}addr().

8 years agotest/udpecho: Allow binding to INADDR_ANY
Sepherosa Ziehau [Mon, 19 Oct 2015 13:02:03 +0000 (21:02 +0800)]
test/udpecho: Allow binding to INADDR_ANY

8 years agotcp/usrreq: In netisrs, if so_pcb is non-NULL, then tp is non-NULL
Sepherosa Ziehau [Sun, 18 Oct 2015 14:02:53 +0000 (22:02 +0800)]
tcp/usrreq: In netisrs, if so_pcb is non-NULL, then tp is non-NULL

8 years agotcp/usrreq: tcp_newtcpcb() never fails
Sepherosa Ziehau [Sun, 18 Oct 2015 12:49:43 +0000 (20:49 +0800)]
tcp/usrreq: tcp_newtcpcb() never fails

8 years agotcp/usrreq: There is no need to ref/deref socket in pru_attach
Sepherosa Ziehau [Sun, 18 Oct 2015 12:48:05 +0000 (20:48 +0800)]
tcp/usrreq: There is no need to ref/deref socket in pru_attach

8 years agotcp/usrreq: TCP socket must not be reattached
Sepherosa Ziehau [Sun, 18 Oct 2015 12:41:51 +0000 (20:41 +0800)]
tcp/usrreq: TCP socket must not be reattached

8 years agotcp/usrreq: No need to hold ssb_rcv token to call soreserve()
Sepherosa Ziehau [Sun, 18 Oct 2015 12:26:22 +0000 (20:26 +0800)]
tcp/usrreq: No need to hold ssb_rcv token to call soreserve()

8 years agotcp/usrreq: Minor comment fixup and style changes
Sepherosa Ziehau [Sun, 18 Oct 2015 11:49:42 +0000 (19:49 +0800)]
tcp/usrreq: Minor comment fixup and style changes

8 years agosocket/tcp: Implement asynchronized pru_attach for TCP
Sepherosa Ziehau [Thu, 15 Oct 2015 13:00:11 +0000 (21:00 +0800)]
socket/tcp: Implement asynchronized pru_attach for TCP

This commit mainly splits TCP pru_attach into two parts:
- First part operates on socket buffer, so it could run directly in
  the caller thread.
- The second part creates and initializes tcpcb, which still runs in
  netisr.  But we don't wait for the result of this operation
  (lwkt_sendmsg() is used instead of lwkt_domsg()).

This removes the last lwkt_domsg on commonly/mostly used socket APIs.
This is enabled by default and could be disabled by setting sysctl
kern.ipc.socreate_fast to 0.

The measured effect of this change on 2-ways E5-2600v2 with Intel 82599
(10Gbe) using tools/kq_connect_client:
- Connect rate increases by ~10Kconns/s; we are now doing 395Kconns/s.
- Idle time on the CPUs not running netisrs increases (55% -> 65%).
- IPIs rate to the CPUs not running netisrs reduces (40Kipis/s ->
  23Kipis/s).

8 years agosys/dev/disk/dm: Make dm-delay table show major:minor
Tomohiro Kusumi [Mon, 19 Oct 2015 15:05:15 +0000 (00:05 +0900)]
sys/dev/disk/dm: Make dm-delay table show major:minor

instead of underlying device path for compatibility with Linux.

8 years agosys/dev/disk/dm: Remove unnecessary kprintf
Tomohiro Kusumi [Mon, 19 Oct 2015 14:29:19 +0000 (23:29 +0900)]
sys/dev/disk/dm: Remove unnecessary kprintf

dmsetup(8) table for linear showing "/dev/xxx offset"
unconditionally without \n is just not necessary.

8 years agolocaledef: actually, not all xdigits are numbers
John Marino [Mon, 19 Oct 2015 14:46:31 +0000 (16:46 +0200)]
localedef: actually, not all xdigits are numbers

Automatically flagging xdigits as numbers is not correct.  The codes for
'A' to 'F' and 'a' to 'f' are xdigits not not numbers.  Revert part of
the previous commit accordingly.

8 years agosys/dev/disk/dm: Don't implement "status" as a subset of "table" [2/2]
Tomohiro Kusumi [Mon, 19 Oct 2015 12:52:25 +0000 (21:52 +0900)]
sys/dev/disk/dm: Don't implement "status" as a subset of "table" [2/2]

struct dm_target's "char *(*status)(void *);"
handler should be "char *(*table)(void *);"
given that it now has "char *(*info)(void *);"
to be compatible with Linux dm behavior.

This breaks API compatibility with NetBSD's dm, but the
previous commit already broke compatibility with NetBSD,
in order to implement it right.

8 years agosys/dev/disk/dm: Don't implement "status" as a subset of "table" [1/2]
Tomohiro Kusumi [Mon, 19 Oct 2015 12:36:16 +0000 (21:36 +0900)]
sys/dev/disk/dm: Don't implement "status" as a subset of "table" [1/2]

DragonFly's (and NetBSD's) dm implements "status" and "table"
of dmsetup(8) using the same handler dm_table_status_ioctl(),
and sees "status" as a subset of "table", however this is wrong.

Linux dm implements these two as different subcommands, so
the way these two are implemented in BSDs breaks compatibility
with Linux dm.

Actually it has never broke compatibility with Linux dm until
dm-delay target was added, because targets that were available
till then happened to have a blank "status" implementation,
which ended up being a subset of "table". This is not the case
with dm-delay target in Linux with different implmentation for
each, and this commit is to maintain the compatibility with Linux.