]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoPull in r292833 from upstream libc++ trunk (by Eric Fiselier):
dim [Mon, 23 Jan 2017 23:20:00 +0000 (23:20 +0000)]
Pull in r292833 from upstream libc++ trunk (by Eric Fiselier):

  Manually force the use of __decltype in C++03 with Clang 3.4.

  <string> uses `decltype` in a way incompatible with `__typeof__`.
  This is problematic when compiling <string> with Clang 3.4 because
  even though it provides `__decltype` libc++ still used `__typeof__`
  because clang 3.4 doesn't provide __is_identifier which libc++
  uses to detect __decltype.

  This patch manually detects Clang 3.4 and properly configures
  for it.

This allows the graphics/openshadinglanguage port to build with
lang/clang34.

PR: 216054

7 years agoPull in r292830 from upstream libc++ trunk (by Eric Fiselier):
dim [Mon, 23 Jan 2017 22:10:57 +0000 (22:10 +0000)]
Pull in r292830 from upstream libc++ trunk (by Eric Fiselier):

  Fix GCC C++03 build by hiding default template argument in C++03

This allows the graphics/GraphicsMagic to compile with gcc 4.9 and
libc++.

PR: 216404

7 years agoPull in r292758 from upstream llvm trunk (by Sanjay Patel):
dim [Sun, 22 Jan 2017 18:31:49 +0000 (18:31 +0000)]
Pull in r292758 from upstream llvm trunk (by Sanjay Patel):

  [x86] avoid crashing with illegal vector type (PR31672)

  https://llvm.org/bugs/show_bug.cgi?id=31672

This fixes an assertion while building graphics/gegl3.

PR: 216166

7 years agoMerge libc++ release_40 branch r292732.
dim [Sun, 22 Jan 2017 18:06:21 +0000 (18:06 +0000)]
Merge libc++ release_40 branch r292732.

7 years agoMerge llvm, clang, lld and lldb release_40 branch 292732, and update
dim [Sun, 22 Jan 2017 18:02:44 +0000 (18:02 +0000)]
Merge llvm, clang, lld and lldb release_40 branch 292732, and update
build glue.

7 years agoMerge ^/head r312309 through r312623.
dim [Sun, 22 Jan 2017 16:05:13 +0000 (16:05 +0000)]
Merge ^/head r312309 through r312623.

7 years agoRemove redundant KASSERT.
trasz [Sun, 22 Jan 2017 15:35:51 +0000 (15:35 +0000)]
Remove redundant KASSERT.

7 years agoAdd SCSI descriptors for USB Mass Storage.
trasz [Sun, 22 Jan 2017 15:32:17 +0000 (15:32 +0000)]
Add SCSI descriptors for USB Mass Storage.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

7 years agoImprove debugging printf.
trasz [Sun, 22 Jan 2017 15:27:14 +0000 (15:27 +0000)]
Improve debugging printf.

7 years ago[athalq] fix rxtimestamp wrapping; print out per-packet timestamp deltas.
adrian [Sun, 22 Jan 2017 07:05:41 +0000 (07:05 +0000)]
[athalq] fix rxtimestamp wrapping; print out per-packet timestamp deltas.

The delta here is just between the current TX/RX copmletion and the previous
TX/RX completion.  The metadata needed to link TX descriptor timestamps to their
/completion/ timestamp isn't there yet.

7 years agoHide the 'MOREARGS' macro, it conflicts with contrib code, and is only used in one...
jhibbits [Sun, 22 Jan 2017 06:30:55 +0000 (06:30 +0000)]
Hide the 'MOREARGS' macro, it conflicts with contrib code, and is only used in one file.

PR: 211818
Reported by: Mark Millard <markmi AT dsl-only.net>
MFC after: 2 weeks

7 years ago[athalq] print out unsigned tx timestamps.
adrian [Sun, 22 Jan 2017 06:25:41 +0000 (06:25 +0000)]
[athalq] print out unsigned tx timestamps.

7 years agoFix r312613.
jhibbits [Sun, 22 Jan 2017 06:17:31 +0000 (06:17 +0000)]
Fix r312613.

Somehow this slipped through my build testing.

7 years agoDon't pass -Wa,-many through clang, the integrated as doesn't support it.
jhibbits [Sun, 22 Jan 2017 06:00:05 +0000 (06:00 +0000)]
Don't pass -Wa,-many through clang, the integrated as doesn't support it.

Our base binutils sets -many by default anyway, but external gcc may not do
this.

PR: kern/215948
Submitted by: Mark Millard <markmi AT dsl-only DOT net>
Reported by: Mark Millard
MFC after: 2 weeks

7 years agoFix use of uninitialized variable.
jhibbits [Sun, 22 Jan 2017 05:49:43 +0000 (05:49 +0000)]
Fix use of uninitialized variable.

I don't know how gcc didn't catch this.  This was caught during test building
with clang.

7 years ago[ath] only apply the AR9300 delimiter workaround for the first sub-frame.
adrian [Sun, 22 Jan 2017 05:45:42 +0000 (05:45 +0000)]
[ath] only apply the AR9300 delimiter workaround for the first sub-frame.

This is supposed to only be applied to the first subframe and only if
RTS/CTS is being done.  I'm still not yet checking RTS/CTS exchange status
so it's just happening for all subframes on AR9380 and later.

This gets MCS23 throughput up from around 250mbit to 303mbit with RTS/CTS
protection enabled, and around 330mbit with no HT protection enabled.

Now, MCS23 has a PHY rate of 450mbit and we should be seeing closer to
400mbit for a straight one-way UDP test, but this beats the previous
maximum throughput.

Tested:

* AR9380 (STA) -> AR9580 (AP) - STA with the modifications, doing UDP TX
  test using iperf.

7 years ago[athalq] add debug parsing for the TX FIFO push status.
adrian [Sun, 22 Jan 2017 05:28:26 +0000 (05:28 +0000)]
[athalq] add debug parsing for the TX FIFO push status.

7 years agoLike r310481 for i386, move the objects used to create temporary
jah [Sun, 22 Jan 2017 00:46:04 +0000 (00:46 +0000)]
Like r310481 for i386, move the objects used to create temporary
mappings for armv6 pmap zero and copy operations to the MD PCPU region.
Change sysmap initialization to only allocate KVA pages for CPUs that
are actually present.

While here, collapse CMAP3 into CMAP2 (their use was mutually exclusive
anyway) and "recover" some space in PCPU padding that has always been
available due to 64-byte cacheline padding.

Reviewed by: skra
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9172

7 years ago[ath] improve the debugging when looking into the maximum A-MPDU size being chosen.
adrian [Sat, 21 Jan 2017 23:35:54 +0000 (23:35 +0000)]
[ath] improve the debugging when looking into the maximum A-MPDU size being chosen.

This is how I caught the "why are we only sending 8K aggregates?" problem.

7 years agoHandle the rx queue stall while reading the packets from NIC (when the
loos [Sat, 21 Jan 2017 23:07:15 +0000 (23:07 +0000)]
Handle the rx queue stall while reading the packets from NIC (when the
descriptor state will not change anymore).  This seems to eliminate the
race where we can miss a stalled queue under high load.

While here remove the unnecessary curly brackets.

Reported by: Konstantin Kormashev <konstantin@netgate.com>
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoath: adapt LDPC support checks
avos [Sat, 21 Jan 2017 21:03:26 +0000 (21:03 +0000)]
ath: adapt LDPC support checks

Set both IEEE80211_HTCAP_LDPC and IEEE80211_HTC_TXLDPC capability flags
if LDPC is supported + set 'do_ldpc = 1' only when it is not disabled,
not just supported.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D9277

7 years agovfs: fix LK_RETRY logic braino in r312600
mjg [Sat, 21 Jan 2017 20:34:20 +0000 (20:34 +0000)]
vfs: fix LK_RETRY logic braino in r312600

7 years agoCommit the struture changes for the padding of small packets on if_cpsw.
loos [Sat, 21 Jan 2017 19:56:28 +0000 (19:56 +0000)]
Commit the struture changes for the padding of small packets on if_cpsw.

Should have been committed together with r312604.

MFC with: r312604

7 years agoSimplify the handling of small packets padding in cpsw:
loos [Sat, 21 Jan 2017 19:49:39 +0000 (19:49 +0000)]
Simplify the handling of small packets padding in cpsw:

 - Pad small packets to 60 bytes and not 64 (exclude the CRC bytes);
 - Pad the packet using m_append(9), if the packet has enough space for
   padding, which is usually true, it will not be necessary append a newly
   allocated mbuf to the chain.

Suggested by: yongari
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoAdd initial support for CTL module unloading.
mav [Sat, 21 Jan 2017 19:38:26 +0000 (19:38 +0000)]
Add initial support for CTL module unloading.

It is only a first step and not perfect, but better then nothing.
The main blocker is CAM target frontend, that can not be unloaded,
since CAM does not have mechanism to unregister periph driver now.

MFC after: 2 weeks

7 years agovfs: __predict_false the need to handle F_HASLOCK
mjg [Sat, 21 Jan 2017 19:01:42 +0000 (19:01 +0000)]
vfs: __predict_false the need to handle F_HASLOCK

Also reorder the check with DTYPE_VNODE. Passed files are vnodes vast
majority of the time, so it is typically true.

7 years agovfs: fix whitespace damage in r312600
mjg [Sat, 21 Jan 2017 18:56:58 +0000 (18:56 +0000)]
vfs: fix whitespace damage in r312600

While here wrap the previously overly long line so that it fits 80 chars.

7 years agovfs: refactor _vn_lock
mjg [Sat, 21 Jan 2017 18:38:16 +0000 (18:38 +0000)]
vfs: refactor _vn_lock

Stop testing for LK_RETRY and error multiple times. Also postpone the
VI_DOOMED until after LK_RETRY was seen as it reads from the vnode.

No functional changes.

7 years agoAdd remaining ELF compression definitions and structs
cem [Sat, 21 Jan 2017 17:39:10 +0000 (17:39 +0000)]
Add remaining ELF compression definitions and structs

A follow-up to r300231.

Sponsored by: Dell EMC Isilon

7 years agovfs: hide the getvnode NULL mp message behind DIAGNOSTIC
mjg [Sat, 21 Jan 2017 16:59:50 +0000 (16:59 +0000)]
vfs: hide the getvnode NULL mp message behind DIAGNOSTIC

Since crossmp vnode changes the message was being printed on each boot.

Reported by: trasz
Discussed with: kib

7 years agortwn: enable LDPC support where possible
avos [Sat, 21 Jan 2017 15:03:58 +0000 (15:03 +0000)]
rtwn: enable LDPC support where possible

Tested with RTL8821AU, STA mode.

7 years agonet80211: allow to configure LDPC support
avos [Sat, 21 Jan 2017 14:19:06 +0000 (14:19 +0000)]
net80211: allow to configure LDPC support

Tested with RTL8821AU, STA mode (Tx support only)

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D9268

7 years agoImport mandoc cvs snapshot 20170121 (pre 1.14)
bapt [Sat, 21 Jan 2017 13:17:25 +0000 (13:17 +0000)]
Import mandoc cvs snapshot 20170121 (pre 1.14)

Note that mandoc does not use anymore sqlite3 but a home made database format
An important improvement has been made as well in makewhatis performance:
Tests on my laptop shows makewhatis on the entire system goes from 26s to 12s

7 years agoImport mandoc cvs snapshot 20170121 (pre 1.14)
bapt [Sat, 21 Jan 2017 13:01:39 +0000 (13:01 +0000)]
Import mandoc cvs snapshot 20170121 (pre 1.14)

7 years agoEnable TMPFS on MALTA so we can use it on minimalist disk images without
brooks [Sat, 21 Jan 2017 09:08:27 +0000 (09:08 +0000)]
Enable TMPFS on MALTA so we can use it on minimalist disk images without
modules.

Sponsored by: DARPA, AFRL

7 years agoMention softfloat and hardfloat supports for RISC-V.
kevlo [Sat, 21 Jan 2017 07:07:50 +0000 (07:07 +0000)]
Mention softfloat and hardfloat supports for RISC-V.

Reviewed by: br

7 years ago[ath] ensure both iv_ampdu_limit and iv_ampdu_rxmax is set.
adrian [Sat, 21 Jan 2017 06:53:30 +0000 (06:53 +0000)]
[ath] ensure both iv_ampdu_limit and iv_ampdu_rxmax is set.

A recent change enforced the VAP limit as well as the peer limit.
I now need to actually set iv_ampdu_limit or we don't transmit more
than 8K sized aggregates.

This restores the expected (suboptimal, but still much faster) behaviour.

Tested:

* AR9380, STA mode

7 years agoifconfig(8): fix '-stbc' parameter name.
avos [Fri, 20 Jan 2017 22:41:16 +0000 (22:41 +0000)]
ifconfig(8): fix '-stbc' parameter name.

MFC after: 5 days

7 years agoFix misc Coverity defects in camdd(8)
asomers [Fri, 20 Jan 2017 21:40:04 +0000 (21:40 +0000)]
Fix misc Coverity defects in camdd(8)

CID 1341620 Fix a small memory leak
CID 1341630 Though this is technically a false positive, rearrange the
code for clarity.
CID 1341635 Eliminate dead code
CID 1368663 Fix a double mutex unlock in the error path

Also:
* Use sig_atomic_t for variables accessed from signal handlers
* Don't conditionalize free(3) on its argument being non-null

Reported by: Coverity
CID: 1341620 1341630 1341635 1368663
Reviewed by: ken
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9237

7 years agoMisc Coverity fixes in camcontrol(8)
asomers [Fri, 20 Jan 2017 21:21:41 +0000 (21:21 +0000)]
Misc Coverity fixes in camcontrol(8)

CID 1229913 Fix output of "camcontrol persist -i report_capabilities".
The reported Persistent Reservation Types were wrong in all
cases.
CID 1356029 Annotate the code so Coverity will know that this is a false
positive.
CID 1366830 Fix a memory leak in "camcontrol timestamp -s"
CID 1366832 Fix a segfault that could be caused by bad drive firmware

Also, fix the man page entry for the "camcontrol epc state" command to match
what the code does.

Reviewed by: ken, wblock
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9239

7 years agoUse SFENCE for ordering CLFLUSHOPT.
kib [Fri, 20 Jan 2017 19:08:44 +0000 (19:08 +0000)]
Use SFENCE for ordering CLFLUSHOPT.

SDM states that CLFLUSHOPT instructions can be ordered with other
writes by SFENCE, heavier MFENCE is not required.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoImprove wording around SO_TS_CLOCK documentation.
sobomax [Fri, 20 Jan 2017 18:37:14 +0000 (18:37 +0000)]
Improve wording around SO_TS_CLOCK documentation.

Submitted by: wblock
Differential Revision: https://reviews.freebsd.org/D9171

7 years agoFix "camcontrol timestamp -s" with LTO-7 drives
asomers [Fri, 20 Jan 2017 17:54:24 +0000 (17:54 +0000)]
Fix "camcontrol timestamp -s" with LTO-7 drives

The length of the scsi_set_timestamp_parameters struct was incorrect.  LTO-5
drives don't care, but LTO-7 drives do.

Reviewed by: Sam Klopsch
MFC after: 2 weeks
Sponsored by: Spectra Logic Corp

7 years agoFix build with ICL_KERNEL_PROXY.
mav [Fri, 20 Jan 2017 17:43:36 +0000 (17:43 +0000)]
Fix build with ICL_KERNEL_PROXY.

MFC after: 2 weeks

7 years agoFix for race leading to endless timer interrupts related to
hselasky [Fri, 20 Jan 2017 17:40:31 +0000 (17:40 +0000)]
Fix for race leading to endless timer interrupts related to
configtimer().

During normal operation "state->nextcallopt" will always be less than
or equal to "state->nextcall" and checking only "state->nextcallopt"
before calling "callout_process()" is sufficient. However when
"configtimer()" is called a race might happen requiring both of these
binary times to be checked.

Short description of race:

1) A configtimer() call will reset both "state->nextcall" and
"state->nextcallopt" to the same binary time.

2) If a "callout_reset()" call happens between "configtimer()" and the
next "callout_process()" call, "state->nextcallopt" will get updated
and "state->nextcall" will remain at the current time. Refer to logic
inside cpu_new_callout().

3) getnextcpuevent() only respects "state->nextcall" and returns this
value over and over again, even if it is in the past, until "now >=
state->nextcallopt" becomes true. Then these two time variables are
corrected by a "callout_process()" call and the situation goes back to
normal.

The problem manifests itself in different ways. The common factor is
the timer process(es) consume all CPU on one or more CPU cores for a
long time, blocking other kernel processes from getting execution
time. This can be seen by very high interrupt counts as displayed by
"vmstat -i | grep timer" right after boot.

When EARLY_AP_STARTUP was enabled in r310177 the likelyhood of hitting
this bug apparently increased.

Example output from "vmstat -i" before patch:
cpu0:timer                          7591         69
cpu9:timer                      39031773     358089
cpu4:timer                          9359         85
cpu3:timer                          9100         83
cpu2:timer                          9620         88

Example output from "vmstat -i" after patch:
cpu0:timer                          4242         34
cpu6:timer                          5531         44
cpu3:timer                          6450         52
cpu1:timer                          4545         36
cpu9:timer                          7153         58

Before the patch cpu9 in the example above, was spinning in a loop in
order to reach 39 million interrupts just a few seconds after
bootup. After the patch the timer interrupt counts are more or less
consistent.

Discussed with: mav @
Reported by: several people
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoMention sendfile(2) by popular demand.
wblock [Fri, 20 Jan 2017 17:29:59 +0000 (17:29 +0000)]
Mention sendfile(2) by popular demand.

Submitted by: alc, kib
MFC after: 1 week
Sponsored by: iXsystems
Differential Revision: https://reviews.freebsd.org/D9259

7 years agoFix reference to free memory in ixgbe/if_media.c
rstone [Fri, 20 Jan 2017 17:16:48 +0000 (17:16 +0000)]
Fix reference to free memory in ixgbe/if_media.c

When ixgbe receives an interrupt indicating that a new optical module
may have been inserted, it discards all of its current media types
by calling ifmedia_removeall() and then creates a new set of media
types for the supported media on the new module.  However,
ifmedia_removeall() was maintaining a pointer to whatever the
current media type was before the call to ifmedia_removealL().
The result of this was that any attempt to read the current media
type of the interface (e.g. via ifconfig) would return potentially
garbage data from free memory (or if one were particularly unlucky
on an architecture that does not malloc() from a direct map, page
fault the kernel).

Fix this by NULL'ing out the current media field in if_media.c,
and have ixgbe update the current media type after recreating
them.

Submitted by: Matt Joras <matt.joras AT gmail DOT com>
Reviewed by: sbruno, erj
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9164

7 years agoRemove ISCSI_MAX_DATA_SEGMENT_LENGTH, using negotiated value.
mav [Fri, 20 Jan 2017 17:14:10 +0000 (17:14 +0000)]
Remove ISCSI_MAX_DATA_SEGMENT_LENGTH, using negotiated value.

MFC after: 2 weeks

7 years agoRemove some unused code.
mav [Fri, 20 Jan 2017 16:01:01 +0000 (16:01 +0000)]
Remove some unused code.

MFC after: 2 weeks

7 years agoAddition of clang nullability qualifiers.
pfg [Fri, 20 Jan 2017 15:56:40 +0000 (15:56 +0000)]
Addition of clang nullability qualifiers.

For consistency with the qualifiers added in r310977, define a new
qualifier _Null_unspecified which is also defined in clang 3.7+.

Add two new macros:
__NULLABILITY_PRAGMA_PUSH
__NULLABILITY_PRAGMA_POP

These are for use in headers when we want avoid noisy warnings if
some pointers are left without nullability annotations.

These are added with way ahead of their first use to teach the GCC
ports headers of their existance before their first use.

7 years agoRemove superfluous return statement.
hselasky [Fri, 20 Jan 2017 15:47:29 +0000 (15:47 +0000)]
Remove superfluous return statement.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoAllow transmit packet bufring in software to be disabled.
hselasky [Fri, 20 Jan 2017 15:45:21 +0000 (15:45 +0000)]
Allow transmit packet bufring in software to be disabled.

- Add new sysctl node to control the transmit packet bufring.

- Add optimised version of the transmit routine which output packets
directly to the DMA ring instead of using bufring in case the transmit
lock is congested. This can reduce the number of taskswitches which in
turn influence the overall system CPU usage, depending on the
workload.

- Add " TX" suffix to debug name for transmit mutexes to silence some
witness warnings about aquiring duplicate locks having same name.

MFC after: 1 week
Sponsored by: Mellanox Technologies
Suggested by: gallatin @

7 years agoMFV 312436
jpaetzel [Fri, 20 Jan 2017 15:01:04 +0000 (15:01 +0000)]
MFV 312436

 6569 large file delete can starve out write ops

  illumos/illumos-gate@ff5177ee8bf9a355131ce2cc61ae2da6a5a6fdd6
  https://github.com/illumos/illumos-gate/commit/ff5177ee8bf9a355131ce2cc61ae2da6a5a6fdd6

  https://www.illumos.org/issues/6569
    The core issue I've found is that there is no throttle for how many
    deletes get assigned to one TXG. As a results when deleting large files
    we end up filling consecutive TXGs with deletes/frees, then write
    throttling other (more important) ops.

    There is an easy test case for this problem. Try deleting several
    large files (at least 1/2 TB) while you do write ops on the same
    pool. What we've seen is performance of these write ops (let's
    call it sideload I/O) would drop to zero.

    More specifically the problem is that dmu_free_long_range_impl()
    can/will fill up all of the dirty data in the pool "instantly",
    before many of the sideload ops can get in. So sideload
    performance will be impacted until all the files are freed.

    The solution we have tested at Nexenta (with positive results)
    creates a relatively simple throttle for how many "free" ops we let
    into one TXG.

    However this solution exposes other problems that should also be
    addressed. If we are to slow down freeing of data that means one
    has to wait even longer (assuming vnode ref count of 1) to get shell
    back after an rm or for NFS thread to finish the free-ing op.
    To avoid this the proposed solution is to call zfs_inactive() async
    for "large" files. Async freeing then begs for the reclaimed space
    to be accounted for in the zpool's "freeing" prop.

    The other issue with having a longer delete is the inability to
    export/unmount for a longer period of time. The proposed solution
    is to interrupt freeing of blocks when a fs is unmounted.

  Author: Alek Pinchuk <alek@nexenta.com>
  Reviewed by: Matt Ahrens <mahrens@delphix.com>
  Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
  Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
  Approved by: Dan McDonald <danmcd@omniti.com>

Reviewed by: avg
Differential Revision: D9008

7 years agoANSYfy kern_ktrace.c and remove archaic register keyword
emaste [Fri, 20 Jan 2017 14:59:56 +0000 (14:59 +0000)]
ANSYfy kern_ktrace.c and remove archaic register keyword

Sponsored by: The FreeBSD Foundation

7 years agoReport disk addition errors on `add` or `create` subcommand.
mav [Fri, 20 Jan 2017 13:49:04 +0000 (13:49 +0000)]
Report disk addition errors on `add` or `create` subcommand.

MFC after: 1 week

7 years agodon't abort writing of a core dump after EFAULT
avg [Fri, 20 Jan 2017 13:39:07 +0000 (13:39 +0000)]
don't abort writing of a core dump after EFAULT

It's possible to get EFAULT when writing a segment backed by a file
if the segment extends beyond the file.
The core dump could still be useful if we skip the rest of the segment
and proceed to other segements.
The skipped segment (or a portion of it) will be zero-filled.

While there, use 'const' to signify that core_write() only reads the
buffer and use __DECONST before calling vn_rdwr_inchunks() because it
can be used for both reading and writing.

Before the change:
kernel: Failed to write core file for process mmap_trunc_core (error 14)
kernel: pid 77718 (mmap_trunc_core), uid 1001: exited on signal 6

After the change:
kernel: Failed to fully fault in a core file segment at VA 0x800645000 with size 0x4000 to be written at offset 0x29000 for process mmap_trunc_core
kernel: pid 4901 (mmap_trunc_core), uid 1001: exited on signal 6 (core dumped)

Reviewed by: julian, kib
Obtained from: Panzura (older version of the change)
MFC after: 5 days
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D9233

7 years agovmm_dev: work around a bogus error with gcc 6.3.0
avg [Fri, 20 Jan 2017 13:21:27 +0000 (13:21 +0000)]
vmm_dev: work around a bogus error with gcc 6.3.0

The error is:
vmm_dev.c: In function 'alloc_memseg':
vmm_dev.c:261:11: error: null argument where non-null required (argument 1) [-Werror=nonnull]

Apparently, the gcc is unable to figure out that if a ternary operator
produced a non-NULL value once, then the operator with exactly the same
operands would produce the same value again.

MFC after: 1 week

7 years agoMake draining a sendqueue more robust.
hselasky [Fri, 20 Jan 2017 12:02:40 +0000 (12:02 +0000)]
Make draining a sendqueue more robust.

Add own state variable to track if a sendqueue is stopped or not.
This will prevent traffic from entering the sendqueue while it is
being destroyed.

Update drain function to wait for traffic to be transmitted before
returning when the link state is active.

Add extra checks in transmit path for stopped SQ's.

While at it:
- Use likely() for a mbuf pointer check.
- Remove redundant IFF_DRV_RUNNING check.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoAdd runtime support for modifying the SQ and RQ completion event
hselasky [Fri, 20 Jan 2017 11:11:49 +0000 (11:11 +0000)]
Add runtime support for modifying the SQ and RQ completion event
moderation mode. The presence of this feature is indicated through the
firmware capabilities.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoUpdate firmware interface structures and definitions adding support
hselasky [Fri, 20 Jan 2017 10:47:32 +0000 (10:47 +0000)]
Update firmware interface structures and definitions adding support
for new features and commands.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoAdd some basic -s flag testcases for cut(1)
ngie [Fri, 20 Jan 2017 08:00:36 +0000 (08:00 +0000)]
Add some basic -s flag testcases for cut(1)

The remaining functionality seems to be covered in one form or
another via the NetBSD ATF testcase.

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years ago[net80211] allow for MCS16-23 to be statically configured.
adrian [Fri, 20 Jan 2017 07:43:40 +0000 (07:43 +0000)]
[net80211] allow for MCS16-23 to be statically configured.

Tested:

* AR9380, STA mode

7 years agoAdd testcases for -i with hardlinks and symlinks
ngie [Fri, 20 Jan 2017 07:11:21 +0000 (07:11 +0000)]
Add testcases for -i with hardlinks and symlinks

The symlink testcase is expected to fail, post-r312519 (the revert of
r312404); mark it so.

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoIntegrate contrib/netbsd-tests/usr.bin/sed/t_sed.sh into the FreeBSD test
ngie [Fri, 20 Jan 2017 06:47:02 +0000 (06:47 +0000)]
Integrate contrib/netbsd-tests/usr.bin/sed/t_sed.sh into the FreeBSD test
suite as usr.bin/sed/sed_test

Don't expect :emptybackref to fail -- it succeeds on FreeBSD

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoRevert r312404 as we need to do an exp-run and fix existing ports that
delphij [Fri, 20 Jan 2017 06:45:06 +0000 (06:45 +0000)]
Revert r312404 as we need to do an exp-run and fix existing ports that
rely on the previous behavior.

Requested by: antonie (portmgr)

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 05:51:25 +0000 (05:51 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 05:45:07 +0000 (05:45 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse .CURDIR:H instead of .CURDIR to simplify pathing in output, etc
ngie [Fri, 20 Jan 2017 04:55:14 +0000 (04:55 +0000)]
Use .CURDIR:H instead of .CURDIR to simplify pathing in output, etc

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:54:21 +0000 (04:54 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:54:09 +0000 (04:54 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:53:50 +0000 (04:53 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:53:45 +0000 (04:53 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:53:40 +0000 (04:53 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:53:26 +0000 (04:53 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:53:20 +0000 (04:53 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:53:00 +0000 (04:53 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:52:29 +0000 (04:52 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:52:00 +0000 (04:52 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:51:36 +0000 (04:51 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:50:46 +0000 (04:50 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:50:19 +0000 (04:50 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths and .CURDIR with :H instead of ".." specified paths
ngie [Fri, 20 Jan 2017 04:46:20 +0000 (04:46 +0000)]
Use SRCTOP-relative paths and .CURDIR with :H instead of ".." specified paths

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:45:09 +0000 (04:45 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:43:21 +0000 (04:43 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:42:43 +0000 (04:42 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:42:11 +0000 (04:42 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:41:53 +0000 (04:41 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:40:55 +0000 (04:40 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:40:10 +0000 (04:40 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:39:36 +0000 (04:39 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths and .CURDIR with :H instead of ".." specified paths
ngie [Fri, 20 Jan 2017 04:38:54 +0000 (04:38 +0000)]
Use SRCTOP-relative paths and .CURDIR with :H instead of ".." specified paths

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:37:22 +0000 (04:37 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:37:03 +0000 (04:37 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:36:48 +0000 (04:36 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:36:28 +0000 (04:36 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:36:06 +0000 (04:36 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:35:49 +0000 (04:35 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:35:36 +0000 (04:35 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:35:18 +0000 (04:35 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
ngie [Fri, 20 Jan 2017 04:35:00 +0000 (04:35 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon