]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMerge ^/head r311132 through r311305.
Dimitry Andric [Wed, 4 Jan 2017 20:41:43 +0000 (20:41 +0000)]
Merge ^/head r311132 through r311305.

7 years agoAlways null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)
Alan Somers [Wed, 4 Jan 2017 20:26:42 +0000 (20:26 +0000)]
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR: 215474
Reported by: Coverity
CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID: 1010035 1010036 1010042 1010041 1010040 1010039
Reviewed by: imp, sephe, slm
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9037
Differential Revision: https://reviews.freebsd.org/D9038

7 years agoUpdate lldb Makefile, and disable some functionality for Windows and
Dimitry Andric [Wed, 4 Jan 2017 19:53:04 +0000 (19:53 +0000)]
Update lldb Makefile, and disable some functionality for Windows and
Darwin.

7 years agoUpdate lld Version.inc and libllvm/Makefile to match.
Dimitry Andric [Wed, 4 Jan 2017 18:54:20 +0000 (18:54 +0000)]
Update lld Version.inc and libllvm/Makefile to match.

7 years agoUpdate lld Makefile.
Dimitry Andric [Wed, 4 Jan 2017 18:53:35 +0000 (18:53 +0000)]
Update lld Makefile.

7 years agoUpdate llvm-cov and llvm-pdbdump Makefiles.
Dimitry Andric [Wed, 4 Jan 2017 18:53:25 +0000 (18:53 +0000)]
Update llvm-cov and llvm-pdbdump Makefiles.

7 years agoRemove duplicate iic and iicbus devices from JZ4780 kernel
Alexander Kabaev [Wed, 4 Jan 2017 18:36:30 +0000 (18:36 +0000)]
Remove duplicate iic and iicbus devices from JZ4780 kernel

7 years agoRemove dead code in dhclient(8)
Alan Somers [Wed, 4 Jan 2017 18:13:05 +0000 (18:13 +0000)]
Remove dead code in dhclient(8)

The offending code has been dead ever since the import from OpenBSD in
r195805.  OpenBSD later deleted that entire function.

Reported by: Coverity
CID: 500059
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

7 years agostyle cleanup
Enji Cooper [Wed, 4 Jan 2017 17:54:44 +0000 (17:54 +0000)]
style cleanup

- bridge_pf_dump: use nitems instead of spelling it out longhand
- bridge_do_pfctl: sort variables by alignment for type

MFC after: 1 week

7 years agobridge_do_pfctl: allocate mib_name dynamically using asprintf
Enji Cooper [Wed, 4 Jan 2017 17:50:52 +0000 (17:50 +0000)]
bridge_do_pfctl: allocate mib_name dynamically using asprintf

This is being done to reduce wasted space, simplify complexity in
the code, and to quell a Coverity warning about buffer overruns.
warning about buffer overruns.

MFC after: 1 week
Reported by: Coverity
CID: 1006736

7 years agoRemove dead code in rpc_parse.c
Alan Somers [Wed, 4 Jan 2017 17:39:20 +0000 (17:39 +0000)]
Remove dead code in rpc_parse.c

It's been dead ever since it was imported from TI-RPC in 1995.  The dead
code is still present in Illumos today, but was removed from NetBSD in 2006.

Reported by: Coverity
CID: 270097
Obtained from: NetBSD
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

7 years agobridge_get_pfval: use nitems instead of spelling it out longhand
Enji Cooper [Wed, 4 Jan 2017 17:38:18 +0000 (17:38 +0000)]
bridge_get_pfval: use nitems instead of spelling it out longhand

MFC after: 3 days

7 years agoUse strlcpy instead of strcpy when copying the bridge name to ifr.ifr_name
Enji Cooper [Wed, 4 Jan 2017 17:33:18 +0000 (17:33 +0000)]
Use strlcpy instead of strcpy when copying the bridge name to ifr.ifr_name
to avoid buffer overflows

MFC after: 1 week
Reported by: Coverity
CID: 100673510067371006738

7 years agoDelete dead code in chat(8)
Alan Somers [Wed, 4 Jan 2017 16:24:40 +0000 (16:24 +0000)]
Delete dead code in chat(8)

It's always been dead, ever since first import in 1994.  It's still dead in
OpenBSD's version, too.

Reported by: Coverity
CID: 270586
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

7 years ago__vdso_gettc(): be extra careful with /dev/hpet mappings, never unmap
Konstantin Belousov [Wed, 4 Jan 2017 16:10:52 +0000 (16:10 +0000)]
__vdso_gettc(): be extra careful with /dev/hpet mappings, never unmap
the mapping which might be accessed by other threads.

If a pointer to the /dev/hpet register page mapping was stored into
the hpet_dev_map, other threads might access the page at any time.
Never unmap it, instead, keep track of mappings for all hpet units in
smal array.  Store pointer to the newly mapped registers page using
CAS, to detect parallel mappings.

It appeared relatively easy to demonstrate the problem by arranging
two threads which perform gettimeofday(2) concurently, first time in
the process address space, when HPET is used for timecounter.

PR: 215715
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoThe callers of kern_getfsstat(UIO_SYSSPACE) expect that *buf always
Konstantin Belousov [Wed, 4 Jan 2017 16:09:45 +0000 (16:09 +0000)]
The callers of kern_getfsstat(UIO_SYSSPACE) expect that *buf always
returns memory which must be freed, regardless of the error.  Assign
NULL to *buf in case we are not going to allocate any memory due to
invalid mode.

Reported and tested by: pho
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks (together with r310638)
Differential revision: https://reviews.freebsd.org/D9042

7 years agoMFV r311279: zlib 1.2.10.
Xin LI [Wed, 4 Jan 2017 16:09:08 +0000 (16:09 +0000)]
MFV r311279: zlib 1.2.10.

MFC after: 1 month

7 years agoFix bug that would result in a kernel crash in some cases involving
Edward Tomasz Napierala [Wed, 4 Jan 2017 14:43:57 +0000 (14:43 +0000)]
Fix bug that would result in a kernel crash in some cases involving
a symlink and an autofs mount request.  The crash was caused by namei()
calling bcopy() with a negative length, caused by numeric underflow:
in lookup(), in the relookup path, the ni_pathlen was decremented too
many times.  The bug was introduced in r296715.

Big thanks to Alex Deiter for his help with debugging this.

Reviewed by: kib@
Tested by: Alex Deiter <alex.deiter at gmail.com>
MFC after: 1 month

7 years agoDon't release the cfiscsi session refcount too early. It wasn't
Edward Tomasz Napierala [Wed, 4 Jan 2017 12:50:44 +0000 (12:50 +0000)]
Don't release the cfiscsi session refcount too early.  It wasn't
observed to fix any actual error, but it's the right thing to do
from the correctness point of view.

Tested by: Eugene M. Zheganin <emz at norma.perm.ru>
MFC after: 1 month

7 years agosnmp_mibII(3) requires net/if.h and net/if_mib.h
Enji Cooper [Wed, 4 Jan 2017 10:08:18 +0000 (10:08 +0000)]
snmp_mibII(3) requires net/if.h and net/if_mib.h

Document that requirement

MFC after: 1 week

7 years agoVendor import of zlib 1.2.10.
Xin LI [Wed, 4 Jan 2017 09:37:45 +0000 (09:37 +0000)]
Vendor import of zlib 1.2.10.

7 years agoRestructure libz, place vendor files in contrib/zlib like other third
Xin LI [Wed, 4 Jan 2017 09:30:47 +0000 (09:30 +0000)]
Restructure libz, place vendor files in contrib/zlib like other third
party software, this provides more standarized import workflow and
makes future upgrades easier.

The following files are new with this commit:

zconf.h.in
zlib.map
zlib.pc.in

They are not connected to build, but were kept in tree for reference
for future maintenance.

All our local trivial changes were applied to contrib/zlib, and the
contrib/zlib vendor source code is intended to 100% match lib/libz
before this commit.

MFC after: 2 weeks

7 years agorun: ensure pthread_condattr_{init,setclock} is successful
Enji Cooper [Wed, 4 Jan 2017 09:06:49 +0000 (09:06 +0000)]
run: ensure pthread_condattr_{init,setclock} is successful

MFC after: 1 week
Reported by: Coverity
CID: 12686311268633

7 years agosetrlimit_basic: don't leak buf; free it on completion
Enji Cooper [Wed, 4 Jan 2017 09:00:16 +0000 (09:00 +0000)]
setrlimit_basic: don't leak buf; free it on completion

MFC after: 3 days
Reported by: Coverity
CID: 978311

7 years agorevoke_perm: don't leak fd at the end of the test; close it
Enji Cooper [Wed, 4 Jan 2017 08:59:06 +0000 (08:59 +0000)]
revoke_perm: don't leak fd at the end of the test; close it

This code is unused on FreeBSD, but it mutes a valid Coverity warning
which would be true on NetBSD

MFC after: 3 days
Reported by: Coverity
CID: 978311

7 years agostat_symlink: don't leak fd; close the file descriptor when done
Enji Cooper [Wed, 4 Jan 2017 08:49:07 +0000 (08:49 +0000)]
stat_symlink: don't leak fd; close the file descriptor when done

MFC after: 3 days
Reported by: Coverity
CID: 978314

7 years agopipe_restart: free f on function exit to quell complaint from Coverity
Enji Cooper [Wed, 4 Jan 2017 08:43:27 +0000 (08:43 +0000)]
pipe_restart: free f on function exit to quell complaint from Coverity

MFC after: 3 days
Reported by: Coverity
CID: 978307

7 years agoswapcontext1: test for getcontext(3) and swapcontext(3) success properly
Enji Cooper [Wed, 4 Jan 2017 08:35:46 +0000 (08:35 +0000)]
swapcontext1: test for getcontext(3) and swapcontext(3) success properly

The beforementioned libcalls both succeed if the return codes aren't -1

MFC after: 3 days
Reported by: Coverity
CID: 976790, 976791

7 years agoClarify lifetime of child(..) function
Enji Cooper [Wed, 4 Jan 2017 08:25:31 +0000 (08:25 +0000)]
Clarify lifetime of child(..) function

Ensure child exits when complete as it's always run in a forked
process.

Add a missing break statement in :pselect_sigmask when calling
child(..) for clarity and to avoid weird domino effects if the
child process somehow does something it's not supposed to do
with the logfiles, file descriptors, etc

MFC after: 1 week
Reported by: Coverity
CID: 122336912233701300301

7 years agoAdd missing files in zlib 1.2.8.
Xin LI [Wed, 4 Jan 2017 08:12:31 +0000 (08:12 +0000)]
Add missing files in zlib 1.2.8.

7 years ago[net80211] Add VHT flags for printf/debugging.
Adrian Chadd [Wed, 4 Jan 2017 08:08:50 +0000 (08:08 +0000)]
[net80211] Add VHT flags for printf/debugging.

Whilst here, note that the last bit is currently used by ifconfig (_CHAN_HT)
so don't use it without fixing that first.

7 years agofpu: ensure calls to pthread_create succeed and test sched_yield to make
Enji Cooper [Wed, 4 Jan 2017 08:07:48 +0000 (08:07 +0000)]
fpu: ensure calls to pthread_create succeed and test sched_yield to make
sure it returns 0

sched_yield tests for values returning 0 of type int and sched_yield is
of type long, so the test is a mismatch

MFC after: 1 week
Reported by: Coverity
CID: 1254953125495412549651254966

7 years agoUse calloc instead of malloc with buffers in snmp_{recv,send}_packet
Enji Cooper [Wed, 4 Jan 2017 07:53:01 +0000 (07:53 +0000)]
Use calloc instead of malloc with buffers in snmp_{recv,send}_packet

This doesn't fix the issue noted in the PR, but at the very least it
cleans up the error so it looks a bit more sane, and in the event
that bsnmp did wander off into the weeds, the likelihood of it
crashing with more sensible output is greater, in my opinion

MFC counter set high so I have enough time to resolve the real
underlying bug in bsnmpwalk

MFC after: 1 month
PR: 215721

7 years agomincore_resid: free buf after use
Enji Cooper [Wed, 4 Jan 2017 04:55:33 +0000 (04:55 +0000)]
mincore_resid: free buf after use

MFC after: 3 days
Reported by: Coverity
CID: 978304

7 years ago{strchr,strlen}_basic: don't leak the dlopen'ed handle; close after use
Enji Cooper [Wed, 4 Jan 2017 04:50:03 +0000 (04:50 +0000)]
{strchr,strlen}_basic: don't leak the dlopen'ed handle; close after use

MFC after: 3 days
Reported by: Coverity
CID: 978299, 978300

7 years agomknodat_fd: close dfd after use to avoid leaking it
Enji Cooper [Wed, 4 Jan 2017 04:32:00 +0000 (04:32 +0000)]
mknodat_fd: close dfd after use to avoid leaking it

MFC after: 3 days
Reported by: Coverity
CID: 978287

7 years agomkfifoat_fd: close dfd after use to avoid leaking it
Enji Cooper [Wed, 4 Jan 2017 04:29:53 +0000 (04:29 +0000)]
mkfifoat_fd: close dfd after use to avoid leaking it

MFC after: 3 days
Reported by: Coverity
CID: 978286

7 years agofexecve: don't leak fd on fexecve(2) failure; close before calling err
Enji Cooper [Wed, 4 Jan 2017 04:27:13 +0000 (04:27 +0000)]
fexecve: don't leak fd on fexecve(2) failure; close before calling err

MFC after: 3 days
Reported by: Coverity
CID: 978285

7 years agotty: don't leak s after opening it with openpty
Enji Cooper [Wed, 4 Jan 2017 04:19:05 +0000 (04:19 +0000)]
tty: don't leak s after opening it with openpty

MFC after: 3 days
Reported by: Coverity
CID: 978321

7 years agommap_prot_3, mmap_truncate, mmap_truncate_signal: don't leak fd and map
Enji Cooper [Wed, 4 Jan 2017 04:10:36 +0000 (04:10 +0000)]
mmap_prot_3, mmap_truncate, mmap_truncate_signal: don't leak fd and map

Reported by: Coverity
CID: 978306, 125140612881961300541

7 years agoFollowup to mtod removal in main stack (r311225). Continued removal
George V. Neville-Neil [Wed, 4 Jan 2017 04:00:28 +0000 (04:00 +0000)]
Followup to mtod removal in main stack (r311225).  Continued removal
of mtod() calls from TCP_PROBE macros.

MFC after: 1 week
Sponsored by: Limelight Networks

7 years agolisten_low_port: check for errors from socket(2) before continuing
Enji Cooper [Wed, 4 Jan 2017 03:59:50 +0000 (03:59 +0000)]
listen_low_port: check for errors from socket(2) before continuing

MFC after: 3 days
Reported by: Coverity
CID: 976778

7 years agokqueue_desc_passing: initialize m.msg_flags to 0
Enji Cooper [Wed, 4 Jan 2017 03:54:54 +0000 (03:54 +0000)]
kqueue_desc_passing: initialize m.msg_flags to 0

This mutes an uninitialized scalar warning from Coverity

MFC after: 3 days
Reported by: Coverity
CID: 979620

7 years agoumask_open: don't leak fd on success
Enji Cooper [Wed, 4 Jan 2017 03:41:16 +0000 (03:41 +0000)]
umask_open: don't leak fd on success

MFC after: 3 days
Reported by: Coverity
CID: 978315

7 years agoARM GENERIC: Add support for Allwinner A33 SoC
Emmanuel Vadot [Wed, 4 Jan 2017 03:37:00 +0000 (03:37 +0000)]
ARM GENERIC: Add support for Allwinner A33 SoC

7 years agoAllwinner: Add A33 support
Emmanuel Vadot [Wed, 4 Jan 2017 03:35:39 +0000 (03:35 +0000)]
Allwinner: Add A33 support

Add basic support for A33/R16 that is enough to boot a kernel.
This adds the platform code, padconf data and the new clocks strings.

MFC after: 2 weeks

7 years agounlink_fifo: don't leak the file descriptors opened with mkfifo and open
Enji Cooper [Wed, 4 Jan 2017 03:35:23 +0000 (03:35 +0000)]
unlink_fifo: don't leak the file descriptors opened with mkfifo and open

MFC fater: 3 days
Reported by: Coverity
CID: 978316, 978317

7 years agottyname_err: close fd if it was opened successfully
Enji Cooper [Wed, 4 Jan 2017 02:52:39 +0000 (02:52 +0000)]
ttyname_err: close fd if it was opened successfully

MFC after: 3 days
Reported by: Coverity
CID: 978292

7 years agoFix Coverity issues
Enji Cooper [Wed, 4 Jan 2017 02:46:36 +0000 (02:46 +0000)]
Fix Coverity issues

- Initialize .sun_len before passing it to strlcpy and bind.
- Close fd on error

MFC after: 3 days
Reported by: Coverity
CID: 978283, 979581

7 years agohumanize_number_basic: don't leak buf
Enji Cooper [Wed, 4 Jan 2017 02:38:14 +0000 (02:38 +0000)]
humanize_number_basic: don't leak buf

MFC after: 3 days
Reported by: Coverity
CID: 1251407

7 years agoftok_link: don't leak fd
Enji Cooper [Wed, 4 Jan 2017 02:34:30 +0000 (02:34 +0000)]
ftok_link: don't leak fd

MFC after: 3 days
Reported by: Coverity
CID: 978291

7 years agoseekdir_basic: fix various Coverity issues
Enji Cooper [Wed, 4 Jan 2017 02:31:05 +0000 (02:31 +0000)]
seekdir_basic: fix various Coverity issues

Address..
- .. resource leaks of file descriptors and memory
- .. unchecked return values from creat(2), mkdir(2), and telldir(3)
- .. potential NULL derefs after calling readdir(3)

MFC after: 1 week
Reported by: Coverity
CID: 975255, 975256, 976989, 978989, 978990

7 years agomtx: plug open-coded mtx_lock access missed in r311172
Mateusz Guzik [Wed, 4 Jan 2017 02:25:31 +0000 (02:25 +0000)]
mtx: plug open-coded mtx_lock access missed in r311172

7 years agoFix DTrace TCP tracepoints to not use mtod() as it is both unnecessary and
George V. Neville-Neil [Wed, 4 Jan 2017 02:19:13 +0000 (02:19 +0000)]
Fix DTrace TCP tracepoints to not use mtod() as it is both unnecessary and
dangerous.  Those wanting data from an mbuf should use DTrace itself to get
the data.

PR: 203409
Reviewed by: hiren
MFC after: 1 week
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D9035

7 years agoFix PMC architecture check to handle later IPAs including Skylake
George V. Neville-Neil [Wed, 4 Jan 2017 02:15:03 +0000 (02:15 +0000)]
Fix PMC architecture check to handle later IPAs including Skylake
Tested with tools/test/hwpmc/pmctest.py

Obtained from: Oliver Pinter
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9036

7 years agoFix logical inversion when checking result from calloc
Enji Cooper [Wed, 4 Jan 2017 01:44:45 +0000 (01:44 +0000)]
Fix logical inversion when checking result from calloc
in snmp_output_err_resp(..)

X-MFC with: r310987
MFC after: 3 days
Reported by: Coverity
CID: 1368195

7 years agoInitialize msg.msg_flags to 0
Enji Cooper [Wed, 4 Jan 2017 01:38:07 +0000 (01:38 +0000)]
Initialize msg.msg_flags to 0

This mutes a valid coverity warning about it being uninitialized
when passed in to sendmsg(2).

MFC after: 2 weeks
Reported by: Coverity
CID: 1368202

7 years agoQuell Coverity for diskinfo(8)
Alan Somers [Wed, 4 Jan 2017 00:39:06 +0000 (00:39 +0000)]
Quell Coverity for diskinfo(8)

* CID 1198994: Don't run the speed disk on a disk with no sectors
* CID 1011442: Don't call close(2) if open(2) fails
* CID 1011161: Use snprintf instead of sprintf
* CID 1009825: Check the return value of lseek

Reported by: Coverity
CID: 1198994 1011442 1011161 1009825
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

7 years agortwn: fix possible buffer overrun.
Andriy Voskoboinyk [Wed, 4 Jan 2017 00:26:41 +0000 (00:26 +0000)]
rtwn: fix possible buffer overrun.

r297596 was not merged properly into new code; restore lost part.

7 years agoAdd some missing atomic_*_ptr #defines for arm.
Mark Johnston [Wed, 4 Jan 2017 00:18:51 +0000 (00:18 +0000)]
Add some missing atomic_*_ptr #defines for arm.

MFC after: 1 week

7 years agoReduce lock accesses in thread lock similarly to r311172.
Mateusz Guzik [Tue, 3 Jan 2017 23:08:11 +0000 (23:08 +0000)]
Reduce lock accesses in thread lock similarly to r311172.

7 years agoSwap parameters around with parse_syntax_strval(..) for consistency with
Enji Cooper [Tue, 3 Jan 2017 22:33:07 +0000 (22:33 +0000)]
Swap parameters around with parse_syntax_strval(..) for consistency with
other parse_* APIs in bsnmp*

MFC after: 3 days
Noted by: bz

7 years agoMake /usr/lib/libbsnmptools.so.0 into an INTERRNALLIB
Enji Cooper [Tue, 3 Jan 2017 22:31:05 +0000 (22:31 +0000)]
Make /usr/lib/libbsnmptools.so.0 into an INTERRNALLIB

Although it increases the size of the bsnmp{get,set,walk} binaries by
four on my [amd64] system, it removes the need for producing .debug
files, profiled libraries, and for installing the library itself,
reducing the overall size use on disk by the utilities noted
previously.

Plus, it guards against ABI/API compatibility issues with the library
as it's only used internal to the tools themselves.

MFC after: 3 weeks

7 years agocxgbe(4): Update T4, T5 and T6 firmwares to 1.16.26.0. Changelog for
Navdeep Parhar [Tue, 3 Jan 2017 22:05:07 +0000 (22:05 +0000)]
cxgbe(4):  Update T4, T5 and T6 firmwares to 1.16.26.0.  Changelog for
all public firmwares for all chips since the last release (1.15.37.0)
follows (it's a straight copy-paste from the Release Notes for the
12/30/2016 Unified Wire release on Chelsio's website).

T6 Firmware
++++++++++++

Version : 1.16.26.0
Date    : 12/28/2016

Fixes
-----

BASE:
- Max number of egress and control queues adjusted to accomodate
  co-processor mode queues.
- Fixed intermittent DDR3/4 ECC errors.
- Fixed a traffic stall when ETS BW is configured as 0%.
- Max number of ethctrl queue in VF set to 1.

ETH:
- Added a new config file option 'speed' under port section to set the
  port speed.  Use only when auto negotiation is off.
- FEC option removed from firmware config file. cxgbtool can be used to
  change the fec setting.
- CPL_TX_TNL_LSO cpl handling added in ETH_TX_PKT_VM handler. This fixes
  large tunnel tcp packet support for VxLAN.

Version : 1.16.22.0
Date    : 12/05/2016

Fixes
-----

BASE:
- fw_port_type updated in fw API to match kernel.org definitions.
- Saved power by disaling unused MAC lanes.
- Configures correct power bin.
- Enhanced DDR4 performance.
- Enabled interrupts.
- Fixed an issue where filter rule for 'unicast hash' is not working.

ETH:
- Disabled auto negotiation by default because most of 100G switches do
  not support AN as of today.
- Fixed flow control not getting disabled problem.
- Fixed an issue where port0 doesn't come up sometimes.
- Fixed 10G link not coming up issue.
- Fixed an issue with promiscuous mode when dcbx disabled.

OFLD:
- Fixed a connection stuck issue when abort is received during out of tx
  pages backpressure.

ENHANCEMENTS
------------

BASE:
- Added inline TLS mode support.

Version : 1.16.12.0
Date    : 11/11/2016

ENHANCEMENTS
------------

BASE:
- Added T6 support.
- Added T6 1G/10G/25G/40G/100G link speeds.
- Added T6 co-processor mode crypto support.
- Added facility to increase link AN+AEC timeout.

OFLD:
- Added support for all T5 offload protocols except FCoE.

iSCSI:
- iscsi completion moderation enabled.

=======================================================================

T5 Firmware
++++++++++++

Version : 1.16.26.0
Date    : 12/28/2016

FIXES
-----

BASE:
- Max number of ethctrl queue in VF set to 1.

Version : 1.16.22.0
Date    : 12/05/2016

FIXES
-----

BASE:
- Fixed an issue where filter rule for 'unicast hash' is not working.

ETH:
- Fixed an issue with promiscuous mode when dcbx disabled.

ENHANCEMENTS
------------

ETH:
- Added 40G-KR support.

Version : 1.16.12.0
Date    : 11/11/2016

FIXES
-----

BASE:
- Fixed multiple issues related with VFs FLR processing.
- Fixed channel assignment based on number of ports in adapter.
- Fixed a crash when VM having PF assigned as passthrough mode is
  rebooted.
- Handled 2nd HELLO command from the same PF without seeing BYE from the
  same PF and if that is the only PF.
- A warning is printed in firmware log if PCI-E cookie generation is
  enabled in serial initialization file.
- Fixed multiple issues related with Filtering.
- Enabled DSGL memory write for iscsi and rdma.
- Added new FW_PARAMS_CMD[DEV] options to retrieve Serial Configuration
  and VPD version numbers.
- Fixed an issue where LVDS output was not getting enabled using vpd.

DCBX:
- Fixed DCBX CEE Incorrect class to pririty mapping.
- Fixed incorrect interpretation of DCBX IEEE PFC.

ETH:
- Adjusted the link related delay timings according to the QSFP spec.
- Improved 40G link bringup time with few switches.

OFLD:
- Do not reserve qp/cq if rdma capability is not enabled.
- Fixed an issue where approx 1600+ TOE connections were causing a
  firmware fatal error.

FOiSCSI:
- Fixed an issue where unloading foiscsi driver causes mailbox timeout.

ENHANCEMENTS
------------

BASE:
- Added 10G KR/KX support.
- Added T540-BT adapter support.
- Added 4 new rss key modes for PFs and VFs.

OFLD:
- Added new WR FW_RI_FR_NSMR_TPTE_WR to improve fast MR write
  performance in RDMA.

Version : 1.16.5.0
Date    : 10/26/2016

FIXES
-----

BASE:
- Fixed multiple issues where FLR from multiple VFs can cause firmware
  crash.
- Fixed channel assignment based on number of ports in adapter.
- Fixed the HELLO command master force api to handle the 2nd HELLO
  correctly without getting BYE from the PF driver.
- Added facility to retrieve Serial configuration and VPD version. Two
  new FW_PARAMS_CMD[DEV] options added to retrieve these values.
- Fixed multiple issues where FLR from multiple VFs are not completing.
- Added new RSS hash secret key modes.
- Fixed an issue where LVDS output was not getting enabled using vpd.

DCBX:
- Fixed an issue where iscsi tlv is sent incorrectly to host (DCBX CEE).
- Fixed an issue where app priority values are not handled correctly
  in fw (DCBX IEEE).

ETH:
- Adjusts the link related delay timings according to the QSFP spec.
- Changed 2.5G mac speed bit to 25G mac speed bit in fw API.
- Improvement in 40G link bringup time with few switches.

OFLD:
- Do not reserve qp/cq if rdma capability is not enabled.
- Fixed an issue where approx 1600+ TOE connections were causing a
  firmware fatal error.
- Fixed DSGL memory write in T5. Now iwarp and iscsi can use DSGL to do
  memory write.
- Fixed multiple issues in hash filter mode where incorrect protocol
  mask was getting used and affecting hash filter functionality.
- New fastpath WR FW_RI_FR_NSMR_TPTE_WR (with fully populated TPTE) is
  added for small REG_MR operations.

FOiSCSI:
- Fixed an issue in foiscsi recovery path.
- Fixed an issue where foiscsi (in VM in PCIE passthrough mode) didn't
  come up after VM FLR.

ENHANCEMENTS
------------

ETH:
- Implemented 1G/10G KR/KX ability.
- Implemented T540-BT adapter support.

=======================================================================

T4 Firmware
+++++++++++

Version : 1.16.12.0
Date    : 11/11/2016

FIXES
-----

BASE:
- Fixed an issue where reading temperature sesors using ldst command
  causes mailbox timeout.
- Added new FW_PARAMS_CMD[DEV] options to retrieve Serial Configuration
  and VPD version numbers.

ETH:
- Fixed DCBX CEE Incorrect class to pririty mapping.

FOiSCSI:
- Fixed an issue where unloading foiscsi driver causes mailbox timeout.

MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agomtx: reduce lock accesses
Mateusz Guzik [Tue, 3 Jan 2017 21:36:15 +0000 (21:36 +0000)]
mtx: reduce lock accesses

Instead of spuriously re-reading the lock value, read it once.

This change also has a side effect of fixing a performance bug:
on failed _mtx_obtain_lock, it was possible that re-read would find
the lock is unowned, but in this case the primitive would make a trip
through turnstile code.

This is diff reduction to a variant which uses atomic_fcmpset.

Discussed with: jhb (previous version)
Tested by: pho (previous version)

7 years agoFix typo
Benjamin Kaduk [Tue, 3 Jan 2017 21:11:30 +0000 (21:11 +0000)]
Fix typo

7 years agoRevert r309619 "ifndef atomic_cas_* in cddl code"
Mateusz Guzik [Tue, 3 Jan 2017 21:02:30 +0000 (21:02 +0000)]
Revert r309619 "ifndef atomic_cas_* in cddl code"

It was a temporary change to ease an import of native atomic_cas primitives.
Instead, atomic_fcmpset was devised with different semantics. See r311168.

7 years agoamd64: add atomic_fcmpset
Mateusz Guzik [Tue, 3 Jan 2017 21:00:24 +0000 (21:00 +0000)]
amd64: add atomic_fcmpset

Reviewed by: kib, jhb

7 years agoAdd the upcoming atomic_fcmpset family to the atomic(9) man page.
Mateusz Guzik [Tue, 3 Jan 2017 20:59:50 +0000 (20:59 +0000)]
Add the upcoming atomic_fcmpset family to the atomic(9) man page.

These primitives give the caller the read value if the exchange attempt
failed which saves an explicit reload for cmpset loops.

The man page was partially submitted by kib.

Reviewed by: kib (previous version), jhb (previous version)

7 years agoUpdate OptionalObsoleteFiles.inc.
Dimitry Andric [Tue, 3 Jan 2017 20:28:48 +0000 (20:28 +0000)]
Update OptionalObsoleteFiles.inc.

7 years agoInitial updates to llvm/clang build glue.
Dimitry Andric [Tue, 3 Jan 2017 20:28:09 +0000 (20:28 +0000)]
Initial updates to llvm/clang build glue.

7 years agoDisable PDB support in LLVMSymbolizer for now, to avoid llvm-objdump
Dimitry Andric [Tue, 3 Jan 2017 20:19:37 +0000 (20:19 +0000)]
Disable PDB support in LLVMSymbolizer for now, to avoid llvm-objdump
pulling in all the PDB handling code.

7 years agoFix printf format warning on i386.
Dimitry Andric [Tue, 3 Jan 2017 18:10:23 +0000 (18:10 +0000)]
Fix printf format warning on i386.

7 years agoComment out more unused functionality.
Dimitry Andric [Tue, 3 Jan 2017 18:09:54 +0000 (18:09 +0000)]
Comment out more unused functionality.

7 years agoRemove incorrectly merged code fragment.
Dimitry Andric [Tue, 3 Jan 2017 18:09:16 +0000 (18:09 +0000)]
Remove incorrectly merged code fragment.

7 years agomisc minor fixes in mpr(4)
Alan Somers [Tue, 3 Jan 2017 17:35:16 +0000 (17:35 +0000)]
misc minor fixes in mpr(4)

sys/dev/mpr/mpr_sas.c
* Fix a potential null pointer dereference (CID 1305731)
* Check for overrun of the ccb_scsiio.cdb_io.cdb_bytes buffer (CID
  1211934)

sys/dev/mpr/mpr_sas_lsi.c
* Nullify a dangling pointer in mprsas_get_sata_identify
* Fix a memory leak in mprsas_SSU_to_SATA_devices (CID 1211935)

Reported by: Coverity (partially)
CID: 1305731 1211934 1211935
Reviewed by: slm
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8880

7 years agoIn the netfront_rxq struct, we should use NET_RX_RING_SIZE, not
Olivier Houchard [Tue, 3 Jan 2017 17:24:56 +0000 (17:24 +0000)]
In the netfront_rxq struct, we should use NET_RX_RING_SIZE, not
NET_TX_RING_SIZE.

Reviewed by: royger

7 years agoRemove a GPL licensed DTS.
Luiz Otavio O Souza [Tue, 3 Jan 2017 16:46:51 +0000 (16:46 +0000)]
Remove a GPL licensed DTS.

The micro-Firewall DTS is now a single BSD licensed file.

Reported by: manu
Obtained from: pfSense
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoRestore r302384 that was dropped when r303816 updated the driver to 1.6.6.-k
Sean Bruno [Tue, 3 Jan 2017 14:52:39 +0000 (14:52 +0000)]
Restore r302384 that was dropped when r303816 updated the driver to 1.6.6.-k

Original log:
Do not initialize the adapter on MTU change when adapter status is down.
This fixes long-standing problems when changing settings of the adapter.

Discussed in:
https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html

Reported by: Franco Fichtner <franco@opnsense.org>
MFH: 2 days

7 years agoUpdate libsysdecode for getfsstat() 'flags' argument changing to 'mode'.
John Baldwin [Tue, 3 Jan 2017 01:39:05 +0000 (01:39 +0000)]
Update libsysdecode for getfsstat() 'flags' argument changing to 'mode'.

As a followup to r310638, update libsysdecode (and kdump) to decode the
'mode' argument to getfsstat().  sysdecode_getfsstat_flags() has been
renamed to sysdecode_getfsstat_mode() and now treats the argument as an
enumerated value rather than a mask of flags.

7 years agoRemove the "unused" DIF subroutine index left after r308582.
Mark Johnston [Tue, 3 Jan 2017 00:24:12 +0000 (00:24 +0000)]
Remove the "unused" DIF subroutine index left after r308582.

These indices are input to a build-time script that generates code to
validate subroutine names.

7 years agoAdd a page queue for holding dirty anonymous unswappable pages.
Mark Johnston [Tue, 3 Jan 2017 00:05:44 +0000 (00:05 +0000)]
Add a page queue for holding dirty anonymous unswappable pages.

On systems without a configured swap device, an attempt to launder pages
from a swap object will always fail and result in the page being
reactivated. This means that the page daemon will continuously scan pages
that can never be evicted. With this change, anonymous pages are instead
moved to PQ_UNSWAPPABLE after a failed laundering attempt when no swap
devices are configured. PQ_UNSWAPPABLE is not scanned unless a swap device
is configured, so unreferenced unswappable pages are excluded from the page
daemon's workload.

Reviewed by: alc

7 years agoFix line endings (upstream file has CRLF ones).
Dimitry Andric [Mon, 2 Jan 2017 22:05:05 +0000 (22:05 +0000)]
Fix line endings (upstream file has CRLF ones).

7 years agoUpdate lldb to trunk r290819 and resolve conflicts.
Dimitry Andric [Mon, 2 Jan 2017 21:59:52 +0000 (21:59 +0000)]
Update lldb to trunk r290819 and resolve conflicts.

7 years agoUpdate lld to trunk r290819 and resolve conflicts.
Dimitry Andric [Mon, 2 Jan 2017 21:32:52 +0000 (21:32 +0000)]
Update lld to trunk r290819 and resolve conflicts.

7 years agoUpdate clang to trunk r290819 and resolve conflicts.
Dimitry Andric [Mon, 2 Jan 2017 21:29:30 +0000 (21:29 +0000)]
Update clang to trunk r290819 and resolve conflicts.

7 years agoUpdate llvm to trunk r290819 and resolve conflicts.
Dimitry Andric [Mon, 2 Jan 2017 21:25:48 +0000 (21:25 +0000)]
Update llvm to trunk r290819 and resolve conflicts.

7 years agoindent(1): add a piece missed in r311138.
Piotr Pawel Stefaniak [Mon, 2 Jan 2017 20:49:24 +0000 (20:49 +0000)]
indent(1): add a piece missed in r311138.

7 years agoOnly bake krb5_config.h support in to ssh(3), etc if both MK_GSSAPI and
Enji Cooper [Mon, 2 Jan 2017 20:29:50 +0000 (20:29 +0000)]
Only bake krb5_config.h support in to ssh(3), etc if both MK_GSSAPI and
MK_KERBEROS_SUPPORT != no

This fixes the odd case where someone specified MK_GSSAPI=no and
MK_KERBEROS_SUPPORT=yes (which admittedly, probably doesn't make sense,
but the build system doesn't prevent this case today, and it didn't when
I filed the bug back in 2011 either).

MFC after: 2 weeks
PR: 159745

7 years agoindent(1): add option -P for loading user-provided files as profiles
Piotr Pawel Stefaniak [Mon, 2 Jan 2017 20:23:46 +0000 (20:23 +0000)]
indent(1): add option -P for loading user-provided files as profiles

Without this change, indent(1) would only look to load options from ~/.indent.pro if it's there and -npro wasn't used on the command line. This option lets the user set their own path to the file.

Approved by: pfg (mentor)
Differential Revision: https://reviews.freebsd.org/D9010

7 years agoRegen src.conf after recent changes to tools/build/options/... and
Enji Cooper [Mon, 2 Jan 2017 20:14:06 +0000 (20:14 +0000)]
Regen src.conf after recent changes to tools/build/options/... and
src.opts.mk

7 years agoAdd WITH_SSP to silence complaints from mkman about there not being a file
Enji Cooper [Mon, 2 Jan 2017 20:09:09 +0000 (20:09 +0000)]
Add WITH_SSP to silence complaints from mkman about there not being a file

MFC after: 3 days

7 years agoAdd documentation for MK_EFI added in r307243
Enji Cooper [Mon, 2 Jan 2017 20:07:56 +0000 (20:07 +0000)]
Add documentation for MK_EFI added in r307243

7 years agorcs was removed in r307351; kill off WITH*_RCS
Enji Cooper [Mon, 2 Jan 2017 20:01:07 +0000 (20:01 +0000)]
rcs was removed in r307351; kill off WITH*_RCS

MFC after: never

7 years agoMove the "MK_* options..." section before the "... MK_*_SUPPORT..." section
Enji Cooper [Mon, 2 Jan 2017 19:55:18 +0000 (19:55 +0000)]
Move the "MK_* options..." section before the "... MK_*_SUPPORT..." section

For the case that someone set WITHOUT_GSSAPI=, now WITHOUT_KERBEROS_SUPPORT
will be properly set.

This will likely fix the issue for the default case noted in the PR I filed
back in 2011. I am trying to fix the less obvious case documented in the PR
still.

MFC after: 2 weeks
PR: 159745

7 years agoMake native-xtools build correctly after clang/llvm 3.9.0 import
Dimitry Andric [Mon, 2 Jan 2017 19:33:22 +0000 (19:33 +0000)]
Make native-xtools build correctly after clang/llvm 3.9.0 import

During the clang/llvm 3.9.0 import, the build structure for it was
completely revamped.  This broke the native-xtools target.

It first attempts to build libllvmminimal, then the llvm-tblgen and
clang-tblgen executables, but these fail to link because they are linked
to the 'full' libllvm by default, as they normally are during the
'world' stage.

To make these link against libllvmminimal instead, define TOOLS_PREFIX,
similarly as during the bootstrap-tools phase.  The value itself is
empty, as we don't really want to use a prefix.

Reviewed by: imp
PR: 215684
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9026

7 years agoVendor import of lldb trunk r290819:
Dimitry Andric [Mon, 2 Jan 2017 19:26:05 +0000 (19:26 +0000)]
Vendor import of lldb trunk r290819:
https://llvm.org/svn/llvm-project/lldb/trunk@290819

7 years agoVendor import of lld trunk r290819:
Dimitry Andric [Mon, 2 Jan 2017 19:19:15 +0000 (19:19 +0000)]
Vendor import of lld trunk r290819:
https://llvm.org/svn/llvm-project/lld/trunk@290819

7 years agoWorkaround NFS bug with readdirplus when there are greater than 1 billion files in...
Josh Paetzel [Mon, 2 Jan 2017 19:18:56 +0000 (19:18 +0000)]
Workaround NFS bug with readdirplus when there are greater than 1 billion files in a filesystem.

Reviewed by kib
MFC after: 2 weeks
Sponsored by: iXsystems
Differential Revision: D9009

7 years agoVendor import of clang trunk r290819:
Dimitry Andric [Mon, 2 Jan 2017 19:18:08 +0000 (19:18 +0000)]
Vendor import of clang trunk r290819:
https://llvm.org/svn/llvm-project/cfe/trunk@290819