]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoFix the resource leak of a 'FILE *' which could happen in routine
gad [Mon, 12 Mar 2018 01:41:16 +0000 (01:41 +0000)]
Fix the resource leak of a 'FILE *' which could happen in routine
ctl_readcf() if a call to malloc failed.

PR: 204955
Reported by: David Binderman

6 years agoarm: Remove SoC Specific -MMCCAM kernelconfig
manu [Sun, 11 Mar 2018 23:14:50 +0000 (23:14 +0000)]
arm: Remove SoC Specific -MMCCAM kernelconfig

One should use the GENERIC-MMCCAM for this.

6 years agoRevert r330780, it was improperly tested and results in taking a spin
ian [Sun, 11 Mar 2018 20:13:15 +0000 (20:13 +0000)]
Revert r330780, it was improperly tested and results in taking a spin
mutex before acquiring sleep mutexes.

Reported by: kib@

6 years agoRemove MTX_NOPROFILE from atrtc_lock, it was inappropriately copy/pasted
ian [Sun, 11 Mar 2018 19:56:07 +0000 (19:56 +0000)]
Remove MTX_NOPROFILE from atrtc_lock, it was inappropriately copy/pasted
from the i8254 driver when I created separate mutexes for each.  The i8254
driver could be the active timecounter, leading to recursion during mutex
profiling, but the atrtc driver cannot be a timecounter, so it isn't needed.

6 years agoUpdate pfkey_open() function to set socket's write buffer size to
ae [Sun, 11 Mar 2018 19:26:34 +0000 (19:26 +0000)]
Update pfkey_open() function to set socket's write buffer size to
128k and receive buffer size to 2MB. In case if system has bigger
default values, do not lower them.

This should partially solve the problem, when setkey(8) returns
EAGAIN error on systems with many SAs or SPs.

PR: 88336
Obtained from: NetBSD/ipsec-tools
MFC after: 2 weeks

6 years agoEliminate atrtc_time_lock, and use atrtc_lock for efirtc locking.
ian [Sun, 11 Mar 2018 19:22:58 +0000 (19:22 +0000)]
Eliminate atrtc_time_lock, and use atrtc_lock for efirtc locking.

6 years agoRework key_sendup_mbuf() a bit:
ae [Sun, 11 Mar 2018 19:14:01 +0000 (19:14 +0000)]
Rework key_sendup_mbuf() a bit:

o count in_nomem counter when we have failed to allocate mbuf for
  promisc socket;
o count in_msgtarget counter when we have secussfully sent data to socket;
o Since we are sending messages in a loop, returning error on first fail
  interrupts the loop, and all remaining sockets will not receive this
  message. So, do not return error when we have failed to send data to ALL
  or REGISTERED target. Return error only for KEY_SENDUP_ONE case. Now,
  when some socket has overfilled its receive buffer, this will not break
  other sockets.

MFC after: 2 weeks

6 years agoEverywhere that multiple registers are accessed in sequence, lock/unlock
ian [Sun, 11 Mar 2018 18:54:45 +0000 (18:54 +0000)]
Everywhere that multiple registers are accessed in sequence, lock/unlock
just once around the whole group of accesses.

6 years agoAdd KASSERT to check that proper targed was used.
ae [Sun, 11 Mar 2018 18:46:40 +0000 (18:46 +0000)]
Add KASSERT to check that proper targed was used.

MFC after: 2 weeks

6 years agoReplace panic() with KASSERTs.
ae [Sun, 11 Mar 2018 18:37:55 +0000 (18:37 +0000)]
Replace panic() with KASSERTs.

MFC after: 2 weeks

6 years agoUse separate mutexes for atrtc and i8254 locking. Change all the strange
ian [Sun, 11 Mar 2018 18:20:49 +0000 (18:20 +0000)]
Use separate mutexes for atrtc and i8254 locking.  Change all the strange
un-function-like RTC_LOCK/UNLOCK macro usage into normal function calls.
Since there is no longer any need to handle register access from a debugger
context, those function calls can just be regular mutex lock/unlock calls.

Requested by:  bde

6 years agoCheck that we have PF_KEY sockets before iterating over all RAW sockets.
ae [Sun, 11 Mar 2018 18:10:59 +0000 (18:10 +0000)]
Check that we have PF_KEY sockets before iterating over all RAW sockets.

MFC after: 2 weeks

6 years agoRemove obsoleted and unused key_sendup() function.
ae [Sun, 11 Mar 2018 18:03:55 +0000 (18:03 +0000)]
Remove obsoleted and unused key_sendup() function.
Also remove declaration for nonexistend key_usrreq() function.

MFC after: 2 weeks

6 years agoAdd myself (fernape) to calendar.freebsd
fernape [Sun, 11 Mar 2018 17:21:48 +0000 (17:21 +0000)]
Add myself (fernape) to calendar.freebsd

As indicated in Committers guide Chapter 6, point 9
"Optional: Update Ports with Personal Information"

Approved by: tcberner
Differential Revision: https://reviews.freebsd.org/D14653

6 years agoConvert atrtc the new style rtc debugging output. Remove the db show
ian [Sun, 11 Mar 2018 16:57:14 +0000 (16:57 +0000)]
Convert atrtc the new style rtc debugging output.  Remove the db show
command handler which provided much the same information.  Removing the
possibility of accessing the hardware regs from the debugger context
paves the way for simplifying the locking code in the driver.

6 years agoRemove obsolete pcaudioio.h.
brooks [Sun, 11 Mar 2018 16:17:53 +0000 (16:17 +0000)]
Remove obsolete pcaudioio.h.

Nothing uses the #define's values or the types.  (Some NTP code does use
an audio_info_t, but it is in #ifdef'd support for Solaris and is not
this audio_info_t).

Sponsored by: DARPA, AFRL

6 years agoAdd myself (fernape) to commiters-port.dot
fernape [Sun, 11 Mar 2018 10:47:40 +0000 (10:47 +0000)]
Add myself (fernape) to commiters-port.dot

Approved by: tcberner (mentor)
Differential Revision: https://reviews.freebsd.org/D14639

6 years agoAdd CR2 get/set support.
grehan [Sun, 11 Mar 2018 08:27:11 +0000 (08:27 +0000)]
Add CR2 get/set support.

Reported/Tested by:  Fabian Freyer
Reviewed by: araujo
Differential Revision: https://reviews.freebsd.org/D14648
MFC after: 3 weeks

6 years agosorry for that. Fix next typo
joneum [Sun, 11 Mar 2018 08:07:40 +0000 (08:07 +0000)]
sorry for that. Fix next typo

Pointy hat to: joneum

6 years agoFix typo
joneum [Sun, 11 Mar 2018 08:02:14 +0000 (08:02 +0000)]
Fix typo

Reported by: tcberner

6 years agoAdd myself to committers-ports.dot
joneum [Sun, 11 Mar 2018 07:33:49 +0000 (07:33 +0000)]
Add myself to committers-ports.dot

6 years agoAdd new opcodes and statuses from NVMe 1.3a.
mav [Sun, 11 Mar 2018 06:30:09 +0000 (06:30 +0000)]
Add new opcodes and statuses from NVMe 1.3a.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

6 years agoAdd new identify data structures fields from NVMe 1.3a.
mav [Sun, 11 Mar 2018 05:09:02 +0000 (05:09 +0000)]
Add new identify data structures fields from NVMe 1.3a.

Some of them are already supported by existing hardware, so reporting
them `nvmecontrol identify` can be useful.

6 years agoextres/regulators: Add sysctls for regulators
manu [Sun, 11 Mar 2018 04:37:05 +0000 (04:37 +0000)]
extres/regulators: Add sysctls for regulators

For each regulators create an hw.regulator.<regname>. :
uvolt: Current value
always_on: 1 If the reg is always on
boot_on: 1 If the reg is set at boot time
enable_cnt: Number of consumer(s)
enable_delay: Delay before enabling the regulator
ramp_delay: The Ramp delay
max_uamp: The maximum value of the regulator in uAmps
min_uamp: The minimal value of the regulator in uAmps
max_uvolt: The maximum value of the regulator in uVolts
min_uvolt: The minimal value of the regulator in uVolts

Reviewed by: ian
Differential Revision: https://reviews.freebsd.org/D14578

6 years agostand/interp_lua: correct errorr => error
kevans [Sun, 11 Mar 2018 04:10:18 +0000 (04:10 +0000)]
stand/interp_lua: correct errorr => error

6 years agoallwinner: Add IR clock to sun8i
manu [Sun, 11 Mar 2018 04:01:23 +0000 (04:01 +0000)]
allwinner: Add IR clock to sun8i

Add ir clock definition to sun8i-r-ccu.
No idea if it's working but aw_cir seems happy now and the frequency
is set to 3Mhz as it should.

6 years agoMake FDT-using parts of ofw_machdep.c condition on options FDT. This fixes
nwhitehorn [Sun, 11 Mar 2018 01:09:31 +0000 (01:09 +0000)]
Make FDT-using parts of ofw_machdep.c condition on options FDT. This fixes
the kernel build when options FDT is absent.

6 years agootus(4): check mcast / mgt / ucast rates during Tx descriptor setup
avos [Sun, 11 Mar 2018 00:38:08 +0000 (00:38 +0000)]
otus(4): check mcast / mgt / ucast rates during Tx descriptor setup

These parameters may be changed via ifconfig(8); by default,
mgt / mcast rates are lowest possible and ucast rate is not set
(matches previous configuration).

While here, store some variables locally for better readability.

6 years agortwn(4): reset Tx power values before calling get_txpower()
avos [Sat, 10 Mar 2018 23:47:03 +0000 (23:47 +0000)]
rtwn(4): reset Tx power values before calling get_txpower()
for RTL8192C / RTL8188E (like it is done for other chipsets).

6 years agousb/wlan/*: properly include "opt_wlan.h" into all drivers
avos [Sat, 10 Mar 2018 23:16:24 +0000 (23:16 +0000)]
usb/wlan/*: properly include "opt_wlan.h" into all drivers

Without it driver cannot be loaded when wlan(4) module is built with
'options IEEE80211_DEBUG_REFCNT'.

6 years agorun(4): drop few unused variables.
avos [Sat, 10 Mar 2018 22:52:39 +0000 (22:52 +0000)]
run(4): drop few unused variables.

Found by: Clang static analyzer

6 years agoMake root mount timeout logic work for filesystems other than ufs.
ian [Sat, 10 Mar 2018 22:07:57 +0000 (22:07 +0000)]
Make root mount timeout logic work for filesystems other than ufs.

The vfs.mountroot.timeout tunable and .timeout directive in a mount.conf(5)
file allow specifying a wait timeout for the device(s) hosting the root
filesystem to become usable.  The current mechanism for waiting for devices
and detecting their availability can't be used for zfs-hosted filesystems.
See the comment #20 in the PR for some expanded detail on these points.

This change adds retry logic to the actual root filesystem mount.  That is,
insted of relying on device availability using device name lookups, it uses
the kernel_mount() call itself to detect whether the filesystem can be
mounted, and loops until it succeeds or the configured timeout is exceeded.

These changes are based on the patch attached to the PR, but it's rewritten
enough that all mistakes belong to me.

PR: 208882
X-MFC after: sufficient testing, and hopefully in time for 11.1

6 years agoDon't warn when the "hostname" rc variable is unset, but the hostname
jamie [Sat, 10 Mar 2018 20:13:07 +0000 (20:13 +0000)]
Don't warn when the "hostname" rc variable is unset, but the hostname
is already non-empty (common in jails).

6 years agotftpd: fix the build of tests on i386 after 330696
asomers [Sat, 10 Mar 2018 18:07:31 +0000 (18:07 +0000)]
tftpd: fix the build of tests on i386 after 330696

It's those darn printf format specifiers again

Reported by: cy, kibab
MFC after: 20 days
X-MFC-With: 330696

6 years agoMake iscsictl(1) display "Disabled" status for disabled sessions.
trasz [Sat, 10 Mar 2018 14:33:00 +0000 (14:33 +0000)]
Make iscsictl(1) display "Disabled" status for disabled sessions.

MFC after: 2 weeks

6 years agoCheck for duplicates when modifying an iSCSI session. Previously we did
trasz [Sat, 10 Mar 2018 14:21:37 +0000 (14:21 +0000)]
Check for duplicates when modifying an iSCSI session.  Previously we did
this check on open, but "iscsictl -M", or an iSCSI redirect received by
iscsid(8) could end up with two sessions with the same target name and
portal.

MFC after: 2 weeks

6 years ago[rpi] remove IRQ support for BCM233x RNG
gonzo [Sat, 10 Mar 2018 02:49:58 +0000 (02:49 +0000)]
[rpi] remove IRQ support for BCM233x RNG

Upstream DTBs don't provide IRQ lines for the RNG. Moreover, harvesting
bytes as often as the RNG interrupt is triggered (87 times per sec) is an
overkill.

For these reasons, get rid of the interrupt mode and make callout mode the
default, with random bits harvested every 4 seconds.

Submitted by: Sylvain Garrigues <sylgar@gmail.com>
Reviewed by: ian, imp, manu, mmel
Approved by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D14541

6 years agoFix rebase mismerge in r330724.
bdrewery [Sat, 10 Mar 2018 02:13:48 +0000 (02:13 +0000)]
Fix rebase mismerge in r330724.

X-MFC-With: r330724
MFC after: 2 weeks
Sponsored by: Dell EMC

6 years agoDon't skip reading depend for 'make obj' unless it is alone.
bdrewery [Sat, 10 Mar 2018 02:10:26 +0000 (02:10 +0000)]
Don't skip reading depend for 'make obj' unless it is alone.

This was effectively done in bsd.dep.mk quite some time ago.

MFC after: 2 weeks
Sponsored by: Dell EMC

6 years agoSkip reading depend files with -V unless looking up a depend variable.
bdrewery [Sat, 10 Mar 2018 02:10:19 +0000 (02:10 +0000)]
Skip reading depend files with -V unless looking up a depend variable.

This speeds up some simple -V lookups significantly.

Reported by: bde
MFC after: 2 weeks
Sponsored by: Dell EMC

6 years agoReduce overhead for simple 'make -V' lookups by avoiding 'find sys/'.
bdrewery [Sat, 10 Mar 2018 02:09:36 +0000 (02:09 +0000)]
Reduce overhead for simple 'make -V' lookups by avoiding 'find sys/'.

Setting -DNO_SKIP_MPATH can be used for debugging.

Reported by: bde
MFC after: 2 weeks
Sponsored by: Dell EMC

6 years agosubr_gtaskqueue: Fix braino from r330715
cem [Sat, 10 Mar 2018 01:53:42 +0000 (01:53 +0000)]
subr_gtaskqueue: Fix braino from r330715

Submitted by: markj
Sponsored by: Dell EMC Isilon

6 years agotftpd: reject unknown opcodes
asomers [Sat, 10 Mar 2018 01:50:43 +0000 (01:50 +0000)]
tftpd: reject unknown opcodes

If tftpd receives a command with an unknown opcode, it simply exits 1.  It
doesn't send an ERROR packet, and the client will hang waiting for one.  Fix
it.

PR: 226005
MFC after: 3 weeks

6 years agotftpd: Abort on an WRQ access violation
asomers [Sat, 10 Mar 2018 01:43:55 +0000 (01:43 +0000)]
tftpd: Abort on an WRQ access violation

On a WRQ (write request) tftpd checks whether the client has access
permission for the file in question.  If not, then the write is prevented.
However, tftpd doesn't reply with an ERROR packet, nor does it abort.
Instead, it tries to receive the packet anyway.

The symptom is slightly different depending on the nature of the error.  If
the target file is nonexistent and tftpd lacks permission to create it, then
tftpd will willingly receive the file, but not write it anywhere.  If the
file exists but is not writable, then tftpd will fail to ACK to WRQ.

PR: 225996
MFC after: 3 weeks

6 years agotftpd: Verify world-writability for WRQ when using relative paths
asomers [Sat, 10 Mar 2018 01:35:26 +0000 (01:35 +0000)]
tftpd: Verify world-writability for WRQ when using relative paths

tftpd(8) says that files may only be written if they already exist and are
publicly writable.  tftpd.c verifies that a file is publicly writable if it
uses an absolute pathname.  However, if the pathname is relative, that check
is skipped.  Fix it.

Note that this is not a security vulnerability, because the transfer
ultimately doesn't work unless the file already exists and is owned by user
nobody.  Also, this bug does not affect the default configuration, because
the default uses the "-s" option which makes all pathnames absolute.

PR: 226004
MFC after: 3 weeks

6 years agonvme_da: Fix minor memory leak in error case
cem [Sat, 10 Mar 2018 01:28:55 +0000 (01:28 +0000)]
nvme_da: Fix minor memory leak in error case

Reported by: cppcheck
Sponsored by: Dell EMC Isilon

6 years agoRemove obsolete dataacq.h.
brooks [Sat, 10 Mar 2018 01:07:30 +0000 (01:07 +0000)]
Remove obsolete dataacq.h.

Nothing includes this file, lists it in a Makefile, or uses any of the
ioctl definitions.

6 years agosubr_gtaskqueue: Fix minor leak of tq_name in error case
cem [Sat, 10 Mar 2018 01:01:01 +0000 (01:01 +0000)]
subr_gtaskqueue: Fix minor leak of tq_name in error case

Reported by: cppcheck
Sponsored by: Dell EMC Isilon

6 years agomlx5(4): Remove redundant declaration of mlx5_enter_error_state
cem [Sat, 10 Mar 2018 00:59:48 +0000 (00:59 +0000)]
mlx5(4): Remove redundant declaration of mlx5_enter_error_state

Broken in r330644.

Sponsored by: Dell EMC Isilon

6 years agoChange ps(1) output width to unlimited if not interactive
karels [Sat, 10 Mar 2018 00:10:47 +0000 (00:10 +0000)]
Change ps(1) output width to unlimited if not interactive

Apply patch submitted with PR 217159 to make ps use unlimited
width when not associated with a terminal (i.e., none of stdout, stdin,
or stderr is a tty). Update comments and man page correspondingly.
This change was requested to work around lack of -ww in scripts from
third-party packages, including Hadoop, and adds a small measure of
Linux compatibility. Hopefully few if any non-interactive scripts
depend on the old default of 79.

PR: 217159
Submitted by: n.deepak at gmail.com
Reviewed by: vangyzen jhb
Differential Revision: https://reviews.freebsd.org/D14614

6 years agoPermit sysctl(8) to set an array of numeric values for a single node.
jhb [Fri, 9 Mar 2018 23:37:19 +0000 (23:37 +0000)]
Permit sysctl(8) to set an array of numeric values for a single node.

Most sysctl nodes only return a single value, but some nodes return an
array of values (e.g. kern.cp_time).  sysctl(8) understand how to display
the values of a node that returns multiple values (it prints out each
numeric value separated by spaces).  However, until now sysctl(8) has
only been able to set sysctl nodes to a single value.  This change
allows sysctl to accept a new value for a numeric sysctl node that contains
multiple values separated by either spaces or commas.  sysctl(8) parses
this list into an array of values and passes the array as the "new" value
to sysctl(2).

Reviewed by: rpokala
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D14569

6 years agotftpd: Flush files as soon as they are fully received
asomers [Fri, 9 Mar 2018 23:25:18 +0000 (23:25 +0000)]
tftpd: Flush files as soon as they are fully received

On an RRQ, tftpd doesn't exit as soon as it's finished receiving a file.
Instead, it waits five seconds just in case the client didn't receive the
server's last ACK and decides to resend the final DATA packet.
Unfortunately, this created a 5 second delay from when the client thinks
it's done sending the file, and when the file is available for other
processes.

Fix this bug by closing the file as soon as receipt is finished.

PR: 157700
Reported by: Barry Mishler <barry_mishler@yahoo.com>
MFC after: 3 weeks

6 years agoCommit missing file from r330696
asomers [Fri, 9 Mar 2018 23:17:29 +0000 (23:17 +0000)]
Commit missing file from r330696

MFC after: 3 weeks
X-MFC-With: 330696

6 years agoUse the trapframe unwinder for "fast_syscall_common".
jhb [Fri, 9 Mar 2018 22:58:05 +0000 (22:58 +0000)]
Use the trapframe unwinder for "fast_syscall_common".

MFC after: 3 days

6 years agoRemove decade's old whine about msdos vs msdosfs.
imp [Fri, 9 Mar 2018 21:32:07 +0000 (21:32 +0000)]
Remove decade's old whine about msdos vs msdosfs.

Retain the compatibility silently though.

Reviewed by: cem@, kevans@, emaste@ (and many others in the past)

6 years agolualoader: Cache kernel list
kevans [Fri, 9 Mar 2018 19:04:06 +0000 (19:04 +0000)]
lualoader: Cache kernel list

With autodetection turned on, hitting the filesystem everytime we need to
calculate choices for the kernel carousel is kind of slow. Cache once on the
first listing and reload it anytime the config is reloaded in case any of
the loader.conf(5) changes that affect this (kernel, kernels,
kernels_autodetect) have changed. This also picks up the case where we've
changed currdev and the autodetected kernels could change.

6 years agoLIB32: Avoid linking in unneeded (and invalid lib32) libz for libmagic build tool.
bdrewery [Fri, 9 Mar 2018 18:51:24 +0000 (18:51 +0000)]
LIB32: Avoid linking in unneeded (and invalid lib32) libz for libmagic build tool.

Usually this is just ignored:
  /usr/bin/ld: skipping incompatible /scratch/obj/root/git/freebsd/amd64.amd64/obj-lib32/lib/libz/libz.so when searching for -lz
  /usr/bin/ld: skipping incompatible /scratch/obj/root/git/freebsd/amd64.amd64/obj-lib32/lib/libz/libz.a when searching for -lz

However some combination of newer toolchains simply fail here instead:
  /usr/bin/ld: error: /home/dstolfa/obj/home/dstolfa/cadets/amd64.amd64/obj-lib32/lib/libz/libz.so is incompatible with /usr/lib/crt1.o

Libz is not needed for mkmagic so just exclude it.

Reported by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC after: 2 weeks
Sponsored by: Dell EMC

6 years agolualoader: Don't redraw the autoboot message every .05s
kevans [Fri, 9 Mar 2018 18:45:13 +0000 (18:45 +0000)]
lualoader: Don't redraw the autoboot message every .05s

6 years agoRemove K&R stuff: never use it in new code.
imp [Fri, 9 Mar 2018 17:54:14 +0000 (17:54 +0000)]
Remove K&R stuff: never use it in new code.

Remove how to format K&R stuff. The project hasn't been using it in
new code for a long time. It's so obsolete, we don't need a statement
to never use it. Add a statement requesting that comments about
parameters be preserved when converting to ASNI style, per Kirk.

Differential Revision: https://reviews.freebsd.org/D14051

6 years agoAdd some functional tests for tftpd(8)
asomers [Fri, 9 Mar 2018 15:30:20 +0000 (15:30 +0000)]
Add some functional tests for tftpd(8)

tftpd(8) is difficult to test in isolation due to its relationship with
inetd.  Create a test program that mimics the behavior of tftp(1) and
inetd(8) and verifies tftpd's response in several different scenarios.

These test cases cover all of the basic TFTP protocol, but not the optional
parts.

PR: 157700
PR: 225996
PR: 226004
PR: 226005
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D14310

6 years agostand: Fix copy-paste-o, unbreaks libi386 lualoader build
kevans [Fri, 9 Mar 2018 14:16:33 +0000 (14:16 +0000)]
stand: Fix copy-paste-o, unbreaks libi386 lualoader build

The 32-bit version of liblua is, in fact, NOT libficl. =)

Reported by: emaste

6 years agoImplement proper support for complete_all() in the LinuxKPI.
hselasky [Fri, 9 Mar 2018 12:16:55 +0000 (12:16 +0000)]
Implement proper support for complete_all() in the LinuxKPI.

When complete_all() is called there might be multiple waiters. The
current implementation could only handle one waiter. Make sure the
completion is sticky when complete_all() is called to be compatible
with Linux.

Found by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agonet80211: wrap protection frame allocation into ieee80211_alloc_prot()
avos [Fri, 9 Mar 2018 11:33:56 +0000 (11:33 +0000)]
net80211: wrap protection frame allocation into ieee80211_alloc_prot()

Move copy-pasted code for RTS/CTS frame allocation into net80211.
While here, add stat / debug message for allocation failures
(copied from run(4)) + return error here in bwn(4).

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

6 years agoUse the correct address to write back to memory in the GICv3 ITS driver.
andrew [Fri, 9 Mar 2018 10:34:44 +0000 (10:34 +0000)]
Use the correct address to write back to memory in the GICv3 ITS driver.
This seems to no be needed on supported hardware as they are cache-coherent,
however this may not be the case on all platforms.

Sponsored by: DARPA, AFRL

6 years agoPull in r326882 from upstream llvm trunk (by Sjoerd Meijer):
dim [Fri, 9 Mar 2018 09:21:22 +0000 (09:21 +0000)]
Pull in r326882 from upstream llvm trunk (by Sjoerd Meijer):

  [ARM] Fix for PR36577

  Don't PerformSHLSimplify if the given node is used by a node that
  also uses a constant because we may get stuck in an infinite combine
  loop.

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

  Patch by Sam Parker.

  Differential Revision: https://reviews.llvm.org/D44097

This fixes a hang when compiling one particular file in java/openjdk8
for armv6 and armv7.

Reported by: swills
PR: 226388

6 years agoFix Bad file descriptor error.
ume [Fri, 9 Mar 2018 04:45:24 +0000 (04:45 +0000)]
Fix Bad file descriptor error.

MFC after: 1 week

6 years agoCopyout a whole int to cpuset_domain's policy pointer.
brooks [Fri, 9 Mar 2018 00:50:40 +0000 (00:50 +0000)]
Copyout a whole int to cpuset_domain's policy pointer.

The previous code only copied 16-bits and corrupted the target int.

Reviewed by: kib, markj
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14611

6 years agoUpdate tcp_lro with tested bugfixes from Netflix and LLNW:
sbruno [Fri, 9 Mar 2018 00:08:43 +0000 (00:08 +0000)]
Update tcp_lro with tested bugfixes from Netflix and LLNW:

    rrs - Lets make the LRO code look for true dup-acks and window update acks
          fly on through and combine.
    rrs - Make the LRO engine a bit more aware of ack-only seq space. Lets not
          have it incorrectly wipe out newer acks for older acks when we have
          out-of-order acks (common in wifi environments).
    jeggleston - LRO eating window updates

Based on all of the above I think we are RFC compliant doing it this way:

https://tools.ietf.org/html/rfc1122

section 4.2.2.16

"Note that TCP has a heuristic to select the latest window update despite
possible datagram reordering; as a result, it may ignore a window update with
a smaller window than previously offered if neither the sequence number nor the
acknowledgment number is increased."

Submitted by: Kevin Bowling <kevin.bowling@kev009.com>
Reviewed by: rstone gallatin
Sponsored by: NetFlix and Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14540

6 years agoarm: Add GENERIC-MMCCAM kernel config
manu [Thu, 8 Mar 2018 22:54:50 +0000 (22:54 +0000)]
arm: Add GENERIC-MMCCAM kernel config

MMCCAM is the new mmc stack currently developped by kibab@, add a kernel
configuration file that include GENERIC so it's easier to test for people.

6 years agoFix build when option MMCCAM is defined.
manu [Thu, 8 Mar 2018 22:49:36 +0000 (22:49 +0000)]
Fix build when option MMCCAM is defined.

6 years agoFix display of wrong pid from dtrace_sched(4)
dteske [Thu, 8 Mar 2018 22:32:18 +0000 (22:32 +0000)]
Fix display of wrong pid from dtrace_sched(4)

Fix a comment while here.

Sponsored by: Smule, Inc.

6 years agoRemove unused variable.
kib [Thu, 8 Mar 2018 22:04:54 +0000 (22:04 +0000)]
Remove unused variable.

Sponsored by: The FreeBSD Foundation

6 years agoMake mlx5 compilable on ILP32 arches.
kib [Thu, 8 Mar 2018 22:03:43 +0000 (22:03 +0000)]
Make mlx5 compilable on ILP32 arches.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agobktr: correct Japan IF frequency
emaste [Thu, 8 Mar 2018 19:24:10 +0000 (19:24 +0000)]
bktr: correct Japan IF frequency

PR: 36451
Submitted by: Hijiri Umemoto <hijiri at umemoto.org>
MFC after: 2 weeks

6 years agoasmc: update temperature sensor name/description
emaste [Thu, 8 Mar 2018 18:52:47 +0000 (18:52 +0000)]
asmc: update temperature sensor name/description

PR: 225911
Submitted by: Trev <fbsdbugs4 at sentry.org>
MFC after: 1 week

6 years agoiwi(4): factor out rateset setup into iwi_set_rateset().
avos [Thu, 8 Mar 2018 18:42:23 +0000 (18:42 +0000)]
iwi(4): factor out rateset setup into iwi_set_rateset().

No functional change intended.

6 years agoipfw(8): Fix endianness for Legacy and Ipv4 table hostname values
cem [Thu, 8 Mar 2018 17:23:18 +0000 (17:23 +0000)]
ipfw(8): Fix endianness for Legacy and Ipv4 table hostname values

The lookup_host() helper subroutine emits a struct in_addr value in network
byte order via caller passed pointer.  However, the table value is expected
to be stored in host byte order.  On little-endian machines, this produced a
reversed endian table value for Legacy or IPv4 table types when the value
was a hostname (instead of a plain IP address).

Fix by using ntohl() on the output 32-bit address.

While here, avoid some aliasing violations by storing the lookup_host()
output in an intermediate object of the correct type.

PR: 226429
Reported by: bugs.freebsd.org AT mx.zzux.com (also: Tested by)
Security: ipfw hostname table rules could potentially not act as admin intended
Sponsored by: Dell EMC Isilon

6 years agoReturn E2BIG if we run out of space writing a compressed kernel dump.
markj [Thu, 8 Mar 2018 17:04:36 +0000 (17:04 +0000)]
Return E2BIG if we run out of space writing a compressed kernel dump.

ENOSPC causes the MD kernel dump code to retry the dump, but this is
undesirable in the case where we legitimately ran out of space.

6 years agoSet correct SL in completion for RoCE in mlx5ib(4).
hselasky [Thu, 8 Mar 2018 16:27:31 +0000 (16:27 +0000)]
Set correct SL in completion for RoCE in mlx5ib(4).

There is a difference when parsing a completion entry between Ethernet
and IB ports. When link layer is Ethernet the bits describe the type of
L3 header in the packet. In the case when link layer is Ethernet and VLAN
header is present the value of SL is equal to the 3 UP bits in the VLAN
header. If VLAN header is not present then the SL is undefined and consumer
of the completion should check if IB_WC_WITH_VLAN is set.

While that, this patch also fills the vlan_id field in the completion if
present.

linux commit 12f8fedef2ec94c783f929126b20440a01512c14

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd call to setup firmware data dump structure during device load in
hselasky [Thu, 8 Mar 2018 16:19:01 +0000 (16:19 +0000)]
Add call to setup firmware data dump structure during device load in
mlx5core.

Do not consider the inability to create a firmware dump fatal, but
inform about the situation and allow the driver to attach. The device
might not implement the needed VSC, or we might not know the layout of
the registers map. In either case, only firmware dump functionality is
limited, the network operations should be fine.

Submitted by: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAvoid more LFENCE/SFENCe on x86 in mlx5en(4),
hselasky [Thu, 8 Mar 2018 15:58:30 +0000 (15:58 +0000)]
Avoid more LFENCE/SFENCe on x86 in mlx5en(4),
by using the FreeBSD native fences.

Submitted by: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoFix mlx5en(4) driver to properly call m_defrag().
hselasky [Thu, 8 Mar 2018 15:53:04 +0000 (15:53 +0000)]
Fix mlx5en(4) driver to properly call m_defrag().

When the mlx5en(4) driver was converted to using BUSDMA(9) the call to
m_defrag() was moved after the part of the TX routine that strips the
header from the mbuf chain. Before it called m_defrag it first trimmed
off the now-empty mbufs from the start of the chain. This has the side
effect of also removing the head of the chain that has M_PKTHDR set.
m_defrag() will not defrag a chain that does not have M_PKTHDR set,
thus it was effectively never defragging the mbuf chains.

As it turns out, trimming the mbufs in this fashion is unnecessary since
the call to bus_dmamap_load_mbuf_sg doesn't map empty mbufs anyway, so
remove it.

Differential Revision: https://reviews.freebsd.org/D12050
Submitted by: mjoras@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoUse vport rather than physical-port MTU in mlx5en(4).
hselasky [Thu, 8 Mar 2018 15:47:17 +0000 (15:47 +0000)]
Use vport rather than physical-port MTU in mlx5en(4).

Set and report vport MTU rather than physical MTU,
The driver will set both vport and physical port mtu
and will rely on the query of vport mtu.

SRIOV VFs have to report their MTU to their vport manager (PF),
and this will allow them to work with any MTU they need
without failing the request.

Also for some cases where the PF is not a port owner, PF can
work with MTU less than the physical port mtu if set physical
port mtu didn't take effect.

Based on Linux upstream commit:
cd255efff9baadd654d6160e52d17ae7c568c9d3

Submitted by: Meny Yossefi <menyy@mellanox.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoUse the device unit number for naming the ifnet interface in mlx5en(4).
hselasky [Thu, 8 Mar 2018 15:43:41 +0000 (15:43 +0000)]
Use the device unit number for naming the ifnet interface in mlx5en(4).

Currently the ifnet interface is named mceX, where X is a monotonically
incremented value. If the device is reset due to a fatal error, then the
interface name will change.  Using the device unit number will keep the
naming consistent across the reset logic.

Submitted by: Matthew Finlay <matt@mellanox.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoRemove duplicate prototypes.
hselasky [Thu, 8 Mar 2018 15:37:09 +0000 (15:37 +0000)]
Remove duplicate prototypes.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoCheck that the address is specified in mlx5tool(8).
hselasky [Thu, 8 Mar 2018 15:28:13 +0000 (15:28 +0000)]
Check that the address is specified in mlx5tool(8).

Submitted by: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd kernel and userspace code to dump the firmware state of supported
hselasky [Thu, 8 Mar 2018 15:21:56 +0000 (15:21 +0000)]
Add kernel and userspace code to dump the firmware state of supported
ConnectX-4/5 devices in mlx5core.

The dump is obtained by reading a predefined register map from the
non-destructive crspace, accessible by the vendor-specific PCIe
capability (VSC). The dump is stored in preallocated kernel memory and
managed by the mlx5tool(8), which communicates with the driver using a
character device node.

The utility allows to store the dump in format
    <address> <value>
into a file, to reset the dump content, and to manually initiate the
dump.

A call to mlx5_fwdump() should be added at the places where a dump
must be fetched automatically. The most likely place is right before a
firmware reset request.

Submitted by: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd myself and Hans Petter Selasky
slavash [Thu, 8 Mar 2018 14:33:59 +0000 (14:33 +0000)]
Add myself and Hans Petter Selasky

Approved by:    hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

6 years agoAdd vendor specific capability interface support in mlx5core.
hselasky [Thu, 8 Mar 2018 11:59:47 +0000 (11:59 +0000)]
Add vendor specific capability interface support in mlx5core.

Add the ability to access the vendor specific space gateway in order
to support reading and writing data into the different configuration
domains.

Submitted by: Matthew Finlay <matt@mellanox.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoUse device_printf() instead of printf() when printing warnings and errors
hselasky [Thu, 8 Mar 2018 11:58:27 +0000 (11:58 +0000)]
Use device_printf() instead of printf() when printing warnings and errors
to dmesg(8) in mlx5core.

Submitted by: Matthew Finlay <matt@mellanox.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd support for per priority flow control, PFC, to mlx5en(4).
hselasky [Thu, 8 Mar 2018 11:40:39 +0000 (11:40 +0000)]
Add support for per priority flow control, PFC, to mlx5en(4).

Add support for PFC and implement reading the per priority statistics
using the sysctl(8) interface. PFC is used together with VLAN priority
and can be enabled and disabled on a per priority basis.

Global pause frames and PFC are incompatible features and surrounding
logic has been added to warn the user about misconfiguration.

Update relevant mlx5core APIs for PFC configuration.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd support for explicit congestion notification, ECN, to mlx5ib(4).
hselasky [Thu, 8 Mar 2018 11:23:14 +0000 (11:23 +0000)]
Add support for explicit congestion notification, ECN, to mlx5ib(4).

ECN configuration and statistics is available through a set of sysctl(8)
nodes under sys.class.infiniband.mlx5_X.cong . The ECN configuration
nodes can also be used as loader tunables.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoUse the autogenerated interface file for all commands in mlx5core.
hselasky [Thu, 8 Mar 2018 10:43:42 +0000 (10:43 +0000)]
Use the autogenerated interface file for all commands in mlx5core.

This patch accumulates the following Linux commits:
90b3e38d048f09b22fb50bcd460cea65fd00b2d7
  mlx5_core: Modify CQ moderation parameters
09a7d9eca1a6cf5eb4f9abfdf8914db9dbd96f08
  mlx5_core: QP/XRCD commands via mlx5 ifc
1a412fb1caa2c1b77719ccb5ed8b0c3c2bc65da7
  mlx5_core: Modify QP commands via mlx5 ifc
ec22eb53106be1472ba6573dc900943f52f8fd1e
  mlx5_core: MKey/PSV commands via mlx5 ifc
73b626c182dff06867ceba996a819e8372c9b2ce
  mlx5_core: EQ commands via mlx5 ifc
20ed51c643b6296789a48adc3bc2cc875a1612cf
  mlx5_core: Access register and MAD IFC commands via mlx5 ifc
a533ed5e179cd15512d40282617909d3482a771c
  mlx5_core: Pages management commands via mlx5 ifc
b8a4ddb2e8f44f872fb93bbda2d541b27079fd2b
  mlx5_core: Add MLX5_ARRAY_SET64 to fix BUILD_BUG_ON
af1ba291c5e498973cc325c501dd8da80b234571
  mlx5_core: Refactor internal SRQ API
b06e7de8a9d8d1d540ec122bbdf2face2a211634
  mlx5_core: Refactor device capability function
c4f287c4a6ac489c18afc4acc4353141a8c53070
  mlx5_core: Unify and improve command interface

Submitted by: Matthew Finlay <matt@mellanox.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoFix race between PCI error handlers and health work in mlx5core.
hselasky [Thu, 8 Mar 2018 09:58:41 +0000 (09:58 +0000)]
Fix race between PCI error handlers and health work in mlx5core.

linux commit 05ac2c0b7438ea08c5d54b48797acf9b22cb2f6f

Submitted by: Matthew Finlay <matt@mellanox.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAvoid calling sleeping function from the health poll thread in mlx5core.
hselasky [Thu, 8 Mar 2018 09:51:33 +0000 (09:51 +0000)]
Avoid calling sleeping function from the health poll thread in mlx5core.

linux commit c1d4d2e92ad670168a17a57dfa182a5a5baa72d4

Submitted by: Matthew Finlay <matt@mellanox.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoUpdates for PCI and health monitor recovery in mlx5core.
hselasky [Thu, 8 Mar 2018 09:47:09 +0000 (09:47 +0000)]
Updates for PCI and health monitor recovery in mlx5core.
This patch accumulates the following Linux commits:

mlx5_health.c
78ccb25861d76a8fc5c678d762180e6918834200
  mlx5_core: Fix wrong name in struct
171bb2c560f45c0427ca3776a4c8f4e26e559400
  mlx5_core: Update health syndromes
0144a95e2ad53a40c62148f44fb0c1f9d2a0d1e9
  mlx5_core: Use accessor functions to read from device memory
ac6ea6e81a80172612e0c9ef93720f371b198918
  mlx5_core: Use private health thread for each device
fd76ee4da55abb21babfc69310d321b9cb9a32e0
  mlx5_core: Fix internal error detection conditions
2241007b3d783cbdbaa78c30bdb1994278b6f9b9
  mlx5: Clear health sick bit when starting health poll
712bfef60912d91033cb25739f7444d5b8d8c59f
  mlx5: Fix version printout in case of health issue
89d44f0a6c732db23b219be708e2fe1e03ee4842
  mlx5_core: Add pci error handlers to mlx5_core driver

mlx5_cmd.c
be87544de8df2b1eb34bcb5e32691287d96f9ec4
  mlx5_core: Fix async commands return code
a31208b1e11df334d443ec8cace7636150bb8ce2
  mlx5_core: New init and exit flow for mlx5_core
020446e01eebc9dbe7eda038e570ab9c7ab13586
  mlx5_core: Prepare cmd interface to system errors handling
89d44f0a6c732db23b219be708e2fe1e03ee4842
  mlx5_core: Add pci error handlers to mlx5_core driver
0d834442cc247c7b3f3bd6019512ae03e96dd99a
  mlx5: Fix teardown errors that happen in pci error handler

mlx5_main.c
5fc7197d3a256d9c5de3134870304b24892a4908
  mlx5: Add pci shutdown callback

Submitted by: Matthew Finlay <matt@mellanox.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoChase rename of rwho script in r290252
eadler [Thu, 8 Mar 2018 07:15:14 +0000 (07:15 +0000)]
Chase rename of rwho script in r290252

The script and associated variable was changed in r290252. Now just
chase it.

MFC With: r290252
Reported by: Aaron LI <aly@aaronly.me>

6 years agocalendars: update Judaic calendar to 2018+
eadler [Thu, 8 Mar 2018 05:28:43 +0000 (05:28 +0000)]
calendars: update Judaic calendar to 2018+

This was generated by

∴hebcal --years 10 -r 2018 | awk -F '[/\t]' '{print $3 "/" $1 "/" $2
"*\t" $4}'

MFC After: 1 week

6 years agog_bio(9): fix a documentation oversight from r163870
asomers [Thu, 8 Mar 2018 03:19:04 +0000 (03:19 +0000)]
g_bio(9): fix a documentation oversight from r163870

MFC after: 3 weeks

6 years agolualoader: Return status in cli_execute_unparsed properly
kevans [Wed, 7 Mar 2018 22:05:23 +0000 (22:05 +0000)]
lualoader: Return status in cli_execute_unparsed properly

cli_execute was changed to return the status, cascade that to
cli_execute_unparsed.

This fixes a lot of false "Failed to execute" errors following r330620; no
failures actually occurred, but [module]_error would've then promptly
executed (and also "failed")