]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoRename kern.icl.drivers to kern.icl.offloads, for consistency.
Edward Tomasz Napierala [Tue, 24 May 2016 08:54:41 +0000 (08:54 +0000)]
Rename kern.icl.drivers to kern.icl.offloads, for consistency.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoAdd mechanism for choosing iSER-capable ICL modules.
Edward Tomasz Napierala [Tue, 24 May 2016 08:44:45 +0000 (08:44 +0000)]
Add mechanism for choosing iSER-capable ICL modules.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoUse the DROP_GIANT() and PICKUP_GIANT() macros instead of making
Hans Petter Selasky [Tue, 24 May 2016 07:52:53 +0000 (07:52 +0000)]
Use the DROP_GIANT() and PICKUP_GIANT() macros instead of making
assumptions about how the Giant mutex is locked.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoSet "current" for all PCI enumeration callbacks.
Hans Petter Selasky [Tue, 24 May 2016 07:46:20 +0000 (07:46 +0000)]
Set "current" for all PCI enumeration callbacks.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agohyperv/vmbus: Free message taskqueue during interrupt teardown
Sepherosa Ziehau [Tue, 24 May 2016 07:07:11 +0000 (07:07 +0000)]
hyperv/vmbus: Free message taskqueue during interrupt teardown

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6506

8 years agoUse make_dev_s() instead of make_dev() to avoid race setting
Hans Petter Selasky [Tue, 24 May 2016 07:06:04 +0000 (07:06 +0000)]
Use make_dev_s() instead of make_dev() to avoid race setting
"si_drv1". Convert panic() into regular error while at it.

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

8 years agohyperv/vmbus: Factor out functions for vmbus interrupt set/teardown
Sepherosa Ziehau [Tue, 24 May 2016 06:42:14 +0000 (06:42 +0000)]
hyperv/vmbus: Factor out functions for vmbus interrupt set/teardown

This paves way for further cleanup and fix.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6505

8 years agohyperv/vmbus: Git rid of sc version of pcpu data extraction macro
Sepherosa Ziehau [Tue, 24 May 2016 06:10:21 +0000 (06:10 +0000)]
hyperv/vmbus: Git rid of sc version of pcpu data extraction macro

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6503

8 years agohyperv/vmbus: Use busdma(9) for messages and event flags
Sepherosa Ziehau [Tue, 24 May 2016 06:01:39 +0000 (06:01 +0000)]
hyperv/vmbus: Use busdma(9) for messages and event flags

And
- Move message and event flags to vmbus_softc per-cpu data.
- Get rid of hv_setup_arg, which serves no purpose now.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6502

8 years agohyperv/vmbus: Move SynIC setup/teardown from hyperv file to vmbus file
Sepherosa Ziehau [Tue, 24 May 2016 05:51:51 +0000 (05:51 +0000)]
hyperv/vmbus: Move SynIC setup/teardown from hyperv file to vmbus file

Avoid unnecessary exposure.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6501

8 years agohyperv/vmbus: Rename local variable and break long lines
Sepherosa Ziehau [Tue, 24 May 2016 05:43:55 +0000 (05:43 +0000)]
hyperv/vmbus: Rename local variable and break long lines

No functional changes.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6500

8 years agoDon't leak fp in case where fo_ioctl() returns an error.
Dmitry Chagin [Tue, 24 May 2016 05:29:41 +0000 (05:29 +0000)]
Don't leak fp in case where fo_ioctl() returns an error.

Reported by: C Turt <ecturt@gmail.com>
MFC after: 1 week

8 years agohyperv/busdma: Take BUS_DMA_ZERO into account
Sepherosa Ziehau [Tue, 24 May 2016 05:26:52 +0000 (05:26 +0000)]
hyperv/busdma: Take BUS_DMA_ZERO into account

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6499

8 years agohyperv/vmbus: Pass vmbus_softc and curcpu to hv_vmbus_isr()
Sepherosa Ziehau [Tue, 24 May 2016 05:18:26 +0000 (05:18 +0000)]
hyperv/vmbus: Pass vmbus_softc and curcpu to hv_vmbus_isr()

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6498

8 years agohyperv/vmbus: Move vmbus interrupt counter into vmbus softc
Sepherosa Ziehau [Tue, 24 May 2016 05:06:01 +0000 (05:06 +0000)]
hyperv/vmbus: Move vmbus interrupt counter into vmbus softc

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6497

8 years agoFix CID 1006692 in /usr/sbin/pw pw_log() function and other fixes
Don Lewis [Tue, 24 May 2016 05:02:24 +0000 (05:02 +0000)]
Fix CID 1006692 in /usr/sbin/pw pw_log() function and other fixes

The length of the name returned from the $LOGNAME and $USER can be
very long and it was being concatenated to a fixed length buffer
with no bounds checking.  Fix this problem by limiting the length
of the name copied.

Additionally, this name is actually used to create a format string
to be used in adding log file entries so embedded % characters in
the name could confuse *printf(), and embedded whitespace could
confuse a log file parser.  Handle the former by escaping each %
with an additional %, and handle the latter by simply stripping it
out.

Clean up the code by moving the variable declarations to the top
of the function, formatting them to conform with style, and moving
intialization elsewhere.

Reduce code indentation by returning early in a couple of places.

Reported by: Coverity
CID: 1006692
Reviewed by: markj (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6490

8 years ago[bwn] begin separating out the attach path from the SIBA specific bits.
Adrian Chadd [Tue, 24 May 2016 04:58:58 +0000 (04:58 +0000)]
[bwn] begin separating out the attach path from the SIBA specific bits.

* convert phy_getinfo() to take a "gmode" flag, rather than the siba
  TGSHIGH flags and then check for 2GHz.  This should ensure that
  gmode is set correctly even on DUALPHY NICs.
* move the siba_powerup() call and the TGSHIGH decoding into a
  call to bwn_is_bus_siba(), and return an error if it's called
  on anything else.  We don't yet do anything else, but when we do..

Tested:

* BCM4322, 11a STA

8 years ago[bwn] add BCM43225 to the BHND device list.
Adrian Chadd [Tue, 24 May 2016 04:55:00 +0000 (04:55 +0000)]
[bwn] add BCM43225 to the BHND device list.

This is all for the bhnd(4) work in progress.  It's enough to probe/attach
all the bhnd internals, but we're missing OTP support and some cleanup
code.  And, well, all the rest of the bhnd(4) migration.

So no, this won't give you BCM43225 support.  Sorry!

8 years agoIt seems <sys/types.h> is a new prerequisite for <bitstring.h> after
Peter Wemm [Tue, 24 May 2016 03:15:46 +0000 (03:15 +0000)]
It seems <sys/types.h> is a new prerequisite for <bitstring.h> after
r300539. Attempt to fix the build for i386.

8 years agoDon't prematurely return short completions on blocking sockets.
John Baldwin [Tue, 24 May 2016 03:13:27 +0000 (03:13 +0000)]
Don't prematurely return short completions on blocking sockets.

Always requeue an AIO job at the head of the socket buffer's queue if
sosend() or soreceive() returns EWOULDBLOCK on a blocking socket.
Previously, requests were only requeued if they returned EWOULDBLOCK
and completed no data.  Now after a partial completion on a blocking
socket the request is queued and the remaining request is retried when
the socket is ready.  This allows writes larger than the currently
available space on a blocking socket to fully complete.  Reads on a
blocking socket that satifsy the low watermark can still return a short
read (same as read()).

In order to track previously completed data, the internal 'status'
field of the AIO job is used to store the amount of previously
computed data.

Non-blocking sockets continue to return short completions for both
reads and writes.

Add a test for a "large" AIO write on a blocking socket that writes
twice the socket buffer size to a UNIX domain socket.

Sponsored by: Chelsio Communications

8 years agoUpdate some of the TBD entries in ciss(4) to match what's in the pci
Sean Bruno [Tue, 24 May 2016 01:42:21 +0000 (01:42 +0000)]
Update some of the TBD entries in ciss(4) to match what's in the pci
IDS data.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

8 years agoMove the OFW iicbus code to dev/iicbus to stop polluting dev/ofw with
Luiz Otavio O Souza [Tue, 24 May 2016 01:33:49 +0000 (01:33 +0000)]
Move the OFW iicbus code to dev/iicbus to stop polluting dev/ofw with
unrelated code.

Discussed with: nwhitehorn (a long time ago)

8 years ago[bwn] add extra debugging for non-SIBA devices.
Adrian Chadd [Tue, 24 May 2016 01:20:30 +0000 (01:20 +0000)]
[bwn] add extra debugging for non-SIBA devices.

This is a no-op at the present moment, but will eventually remind me
where the SIBA specific demons lie.

Tested:

* BCM4322, STA mode

8 years ago[bhnd] Implement pass-through resource management for ChipCommon.
Adrian Chadd [Tue, 24 May 2016 01:12:19 +0000 (01:12 +0000)]
[bhnd] Implement pass-through resource management for ChipCommon.

This patchset adds support to bhnd_chipc for sharing SYS_RES_MEMORY
resources with its children, allowing us to hang devices off of
bhnd_chipc that rely on access to a subset of the device register space
that bhnd_chipc itself must also allocate.

We could avoid most of this heavy lifting if RF_SHAREABLE+SYS_RES_MEMORY
wasn't limited to use with allocations at the same size/offset.

As a work-around, I implemented something similar to vga_pci.c, which
implements similar reference counting of of PCI BAR resources for its
children.

With these changes, chipc will use reference counting of SYS_RES_MEMORY
allocation/activation requests, to decide when to allocate/activate/
deactivate/release resources from the parent bhnd(4) bus.

The requesting child device is allocated a new resource from chipc's
rman, pointing to (possibly a subregion of) the refcounted bhnd resources
allocated by chipc.

Other resource types are just passed directly to the parent bhnd bus;
RF_SHAREABLE works just fine with IRQs.

I also lifted the SPROM device code out into a common driver, since this
now allows me to hang simple subclasses off of a common driver off of both
bhndb_pci and bhnd_chipc.

Tested:

* (landonf) Tested against BCM4331 and BCM4312, confirmed that SPROM still
  attaches and can be queried.

Submitted by: Landon Fuller <landonf@landonf.org>
Reviewed by: mizkha@gmail.com
Differential Revision: https://reviews.freebsd.org/D6471

8 years agoFix multiple Coverity Out-of-bounds access false postive issues in CAM
Don Lewis [Tue, 24 May 2016 00:57:11 +0000 (00:57 +0000)]
Fix multiple Coverity Out-of-bounds access false postive issues in CAM

The currently used idiom for clearing the part of a ccb after its
header generates one or two Coverity errors for each time it is
used.  All instances generate an Out-of-bounds access (ARRAY_VS_SINGLETON)
error because of the treatment of the header as a two element array,
with a pointer to the non-existent second element being passed as
the starting address to bzero().  Some instances also alsp generate
Out-of-bounds access (OVERRUN) errors, probably because the space
being cleared is larger than the sizeofstruct ccb_hdr).

In addition, this idiom is difficult for humans to understand and
it is error prone.  The user has to chose the proper struct ccb_*
type (which does not appear in the surrounding code) for the sizeof()
in the length calculation.  I found several instances where the
length was incorrect, which could cause either an actual out of
bounds write, or incompletely clear the ccb.

A better way is to write the code to clear the ccb itself starting
at sizeof(ccb_hdr) bytes from the start of the ccb, and calculate
the length based on the specific type of struct ccb_* being cleared
as specified by the union ccb member being used.  The latter can
normally be seen in the nearby code.  This is friendlier for Coverity
and other static analysis tools because they will see that the
intent is to clear the trailing part of the ccb.

Wrap all of the boilerplate code in a convenient macro that only
requires a pointer to the desired union ccb member (or a pointer
to the union ccb itself) as an argument.

Reported by: Coverity
CID: 100757810086841009724100977310113041011306
CID: 101130710113081011309101131010113111011312
CID: 101131310113141011315101131610113171011318
CID: 101131910113201011321101132210113241011325
CID: 101132610113271011328101132910113301011374
CID: 101139010113911011392101139310113941011395
CID: 101139610113971011398101139910114001011401
CID: 101140210114031011404101140510114061011408
CID: 101140910114101011411101141210114131011414
CID: 101746110183871086860108687411942571229897
CID: 122996813062291306234133128213312831331294
CID: 133129513315351331536133153913315401341623
CID: 13416241341637134163813552641355324
Reviewed by: scottl, ken, delphij, imp
MFH: 1 month
Differential Revision: https://reviews.freebsd.org/D6496

8 years agoOnly set kern.geom.part.mbr.enforce_chs=0 once, instead of once per disk
Allan Jude [Tue, 24 May 2016 00:23:39 +0000 (00:23 +0000)]
Only set kern.geom.part.mbr.enforce_chs=0 once, instead of once per disk

Sponsored by: ScaleEngine Inc.

8 years agoAdd support for RAID 1+0 (striped mirrors) to bsdinstall/zfsboot
Allan Jude [Tue, 24 May 2016 00:22:29 +0000 (00:22 +0000)]
Add support for RAID 1+0 (striped mirrors) to bsdinstall/zfsboot

Sponsored by: ScaleEngine Inc.

8 years agoFix build of kern/subr_unit.c, broken by r300539
Alan Somers [Tue, 24 May 2016 00:14:58 +0000 (00:14 +0000)]
Fix build of kern/subr_unit.c, broken by r300539

Reported by: peter
Pointyhat to: asomers
Sponsored by: Spectra Logic Corp

8 years agoDocument POPCNT erratum for 6th Generation Intel Core processors.
Jung-uk Kim [Mon, 23 May 2016 23:00:47 +0000 (23:00 +0000)]
Document POPCNT erratum for 6th Generation Intel Core processors.

8 years agoUpdate pci_vendors to 2016.05.23
Baptiste Daroussin [Mon, 23 May 2016 22:01:06 +0000 (22:01 +0000)]
Update pci_vendors to 2016.05.23

8 years agoBe more clear about LOCKLEAF being exclusive and add LOCKSHARED.
Bryan Drewery [Mon, 23 May 2016 21:29:57 +0000 (21:29 +0000)]
Be more clear about LOCKLEAF being exclusive and add LOCKSHARED.

8 years agoAdd bit_count to the bitstring(3) api
Alan Somers [Mon, 23 May 2016 20:29:18 +0000 (20:29 +0000)]
Add bit_count to the bitstring(3) api

Add a bit_count function, which efficiently counts the number of bits set in
a bitstring.

sys/sys/bitstring.h
tests/sys/sys/bitstring_test.c
share/man/man3/bitstring.3
Add bit_alloc

sys/kern/subr_unit.c
Use bit_count instead of a naive counting loop in check_unrhdr, used
when INVARIANTS are enabled. The userland test runs about 6x faster
in a generic build, or 8.5x faster when built for Nehalem, which has
the POPCNT instruction.

sys/sys/param.h
Bump __FreeBSD_version due to the addition of bit_alloc

UPDATING
Add a note about the ABI incompatibility of the bitstring(3)
changes, as suggested by lidl.

Suggested by: gibbs
Reviewed by: gibbs, ngie
MFC after: 9 days
X-MFC-With: 299090, 300538
Relnotes: yes
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6255

8 years agoCommit a missing change from 299090
Alan Somers [Mon, 23 May 2016 20:19:07 +0000 (20:19 +0000)]
Commit a missing change from 299090

tests/sys/kern/Makefile
Reenable a disabled compiler warning, the need for which was
eliminated by r299090.

Reviewed by: ngie
MFC after: 4 weeks
X-MFC-With: 299090
Sponsored by: Spectra Logic Corp

8 years agoMark the prefix and default router list sysctl handlers MPSAFE.
Mark Johnston [Mon, 23 May 2016 20:18:11 +0000 (20:18 +0000)]
Mark the prefix and default router list sysctl handlers MPSAFE.

MFC after: 2 weeks

8 years agoAcquire the nd6 lock in the prefix list sysctl handler.
Mark Johnston [Mon, 23 May 2016 20:15:08 +0000 (20:15 +0000)]
Acquire the nd6 lock in the prefix list sysctl handler.

The nd6 lock will be used to synchronize access to the NDP prefix list.

MFC after: 2 weeks
Tested by: Jason Wolfe (as part of a larger change)

8 years agoSpaces->tab in comment.
Ian Lepore [Mon, 23 May 2016 20:13:17 +0000 (20:13 +0000)]
Spaces->tab in comment.

8 years agoOops, fix a paste-o commited in r300533.
Ian Lepore [Mon, 23 May 2016 20:12:38 +0000 (20:12 +0000)]
Oops, fix a paste-o commited in r300533.

8 years agoUse the new(-ish) CP15_SCTLR macro to generate system control reg accesses
Ian Lepore [Mon, 23 May 2016 20:07:17 +0000 (20:07 +0000)]
Use the new(-ish) CP15_SCTLR macro to generate system control reg accesses
where possible.  In the places that doesn't work (multi-line inline asm,
and places where the old armv4 cpufuncs mechanism is used), annotate the
accesses with a comment that includes SCTLR.  Now a grep -i sctlr can find
all the system control register manipulations.

No functional changes.

8 years agoFix ada(4) trim support quirk setting.
Kenneth D. Merry [Mon, 23 May 2016 19:52:08 +0000 (19:52 +0000)]
Fix ada(4) trim support quirk setting.

I broke broke the quirk in the ada(4) driver disabling NCQ trim support
in revision 300207.  The support flags were set before the quirks were
loaded.

sys/cam/ata/ata_da.c:
Call adasetflags() after loading quirks, so that we'll set the
flags accurately.

Sponsored by: Spectra Logic

8 years agontb_hw(4): Only record the first three MSIX vectors
Conrad Meyer [Mon, 23 May 2016 19:46:58 +0000 (19:46 +0000)]
ntb_hw(4): Only record the first three MSIX vectors

Don't overrun the msix_data array by reading the (unused) link state
interrupt information.

Reported by: mav (earlier version)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6489

8 years agoINTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO
Svatopluk Kraus [Mon, 23 May 2016 18:16:21 +0000 (18:16 +0000)]
INTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO
introduced in r298738.

Reviewed by: ian

8 years agoINTRNG - use gpio generic interrupt modes definitions added in r298738.
Svatopluk Kraus [Mon, 23 May 2016 18:12:52 +0000 (18:12 +0000)]
INTRNG - use gpio generic interrupt modes definitions added in r298738.

Reviewed by: ian

8 years agoProperly allow META_MODE to be set from environment.
Bryan Drewery [Mon, 23 May 2016 17:27:42 +0000 (17:27 +0000)]
Properly allow META_MODE to be set from environment.

Sponsored by: EMC / Isilon Storage Division

8 years agoUse sed(1) to determine cc version rather than tail(1) since it is already in ITOOLS.
Bryan Drewery [Mon, 23 May 2016 17:11:32 +0000 (17:11 +0000)]
Use sed(1) to determine cc version rather than tail(1) since it is already in ITOOLS.

This fixes 'tail: not found' warnings in installworld after r300351.

Sponsored by: EMC / Isilon Storage Division

8 years agoDocument r298998, OpenSSL updated to 1.0.2h.
Steven Kreuzer [Mon, 23 May 2016 17:06:46 +0000 (17:06 +0000)]
Document r298998, OpenSSL updated to  1.0.2h.

Approved by: gjb@ (implicit with re@ hat on)

8 years agoOnly export and re-import the root pool if installing on MBR
Allan Jude [Mon, 23 May 2016 17:04:13 +0000 (17:04 +0000)]
Only export and re-import the root pool if installing on MBR

This step is required in order to dd the boot2 bits into the ZFS partition

Sponsored by: ScaleEngine Inc.

8 years agoCorrect an error in a comment: One of the conditions for page allocation
Alan Cox [Mon, 23 May 2016 16:59:05 +0000 (16:59 +0000)]
Correct an error in a comment: One of the conditions for page allocation
is actually the opposite of that stated in the comment.

Remove an unnecessary assignment.  Use an assertion to document the fact
that no assignment is needed.

Rewrite another comment to clarify that the page is not completely valid.

Reviewed by: kib

8 years agoFix missing pool name in zfs set command
Allan Jude [Mon, 23 May 2016 16:49:26 +0000 (16:49 +0000)]
Fix missing pool name in zfs set command

8 years agoMove binutils handling after src.opts.mk.
Bryan Drewery [Mon, 23 May 2016 16:24:34 +0000 (16:24 +0000)]
Move binutils handling after src.opts.mk.

This fixes the arm64 build after r300348.

Sponsored by: EMC / Isilon Storage Division

8 years agoImplement "atomic_long_add_unless()" in the LinuxKPI and fix the
Hans Petter Selasky [Mon, 23 May 2016 16:19:51 +0000 (16:19 +0000)]
Implement "atomic_long_add_unless()" in the LinuxKPI and fix the
implementation of "atomic_long_inc_not_zero()".

Found by: ngie @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoDocument r296190, openresolv updated to 3.7.3.
Steven Kreuzer [Mon, 23 May 2016 15:44:39 +0000 (15:44 +0000)]
Document r296190, openresolv updated to 3.7.3.

Approved by: gjb@ (implicit with re@ hat on)

8 years agoDocument r298161, sqlite3 updated to 3.12.1.
Steven Kreuzer [Mon, 23 May 2016 15:37:12 +0000 (15:37 +0000)]
Document r298161, sqlite3 updated to 3.12.1.

Approved by: gjb@ (implicit with re@ hat on)

8 years agoDocument r298192, file(1) updated to 5.26.
Steven Kreuzer [Mon, 23 May 2016 15:33:56 +0000 (15:33 +0000)]
Document r298192, file(1) updated to 5.26.

Approved by: gjb@ (implicit with re@ hat on)

8 years agoAdd the needed hwpmc hooks to subr_intr.c. This is needed for the correct
Andrew Turner [Mon, 23 May 2016 15:26:35 +0000 (15:26 +0000)]
Add the needed hwpmc hooks to subr_intr.c. This is needed for the correct
operation of hwpmc on, for example, arm64 with intrng.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoFix error in bsdinstall where additional filesystems cannot be mounted
Allan Jude [Mon, 23 May 2016 15:11:01 +0000 (15:11 +0000)]
Fix error in bsdinstall where additional filesystems cannot be mounted

Do not set canmount=noauto on the boot environment at create time, because
this causes / to not be mounted, and since the chroot is read only, new
mountpoints cannot be created.

The property is set later, when other properties are adjusted

Reported by: HardenedBSD
Sponsored by: ScaleEngine Inc.

8 years agopf: Fix more ICMP mistranslation
Kristof Provost [Mon, 23 May 2016 13:59:48 +0000 (13:59 +0000)]
pf: Fix more ICMP mistranslation

In the default case fix the substitution of the destination address.

PR: 201519
Submitted by: Max <maximos@als.nnov.ru>
MFC after: 1 week

8 years agoA missing definition needed by ktime_to_ms().
Hans Petter Selasky [Mon, 23 May 2016 13:19:20 +0000 (13:19 +0000)]
A missing definition needed by ktime_to_ms().

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoFix some data types and add "inline" keyword for __reg_op() function.
Hans Petter Selasky [Mon, 23 May 2016 13:18:15 +0000 (13:18 +0000)]
Fix some data types and add "inline" keyword for __reg_op() function.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agosfxge(4): cleanup: remove unused EFX preempt macros
Andrew Rybchenko [Mon, 23 May 2016 13:17:37 +0000 (13:17 +0000)]
sfxge(4): cleanup: remove unused EFX preempt macros

The EFSYS_PREEMPT_DISABLE() and EFSYS_PREEMPT_ENABLE() macros
were used to ensure correct timing of I2C operations. The APIs
for I2C operations have been removed, so these macros have no
callers.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agoBuild iscsid(8) with ICL_KERNEL_PROXY defined by default, as required
Edward Tomasz Napierala [Mon, 23 May 2016 12:58:24 +0000 (12:58 +0000)]
Build iscsid(8) with ICL_KERNEL_PROXY defined by default, as required
for iSER.

Obtained from: Mellanox Technologies
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoImplement ror32() in the LinuxKPI.
Hans Petter Selasky [Mon, 23 May 2016 12:53:17 +0000 (12:53 +0000)]
Implement ror32() in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoDefine more copy to/from userspace functions in the LinuxKPI.
Hans Petter Selasky [Mon, 23 May 2016 12:52:22 +0000 (12:52 +0000)]
Define more copy to/from userspace functions in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agopf: Fix ICMP translation
Kristof Provost [Mon, 23 May 2016 12:41:29 +0000 (12:41 +0000)]
pf: Fix ICMP translation

Fix ICMP source address rewriting in rdr scenarios.

PR: 201519
Submitted by: Max <maximos@als.nnov.ru>
MFC after: 1 week

8 years agoAdd more printf() related functions to the LinuxKPI.
Hans Petter Selasky [Mon, 23 May 2016 12:35:07 +0000 (12:35 +0000)]
Add more printf() related functions to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoSet an invalid IRQ number when no PCI IRQ is available in the LinuxKPI.
Hans Petter Selasky [Mon, 23 May 2016 12:13:16 +0000 (12:13 +0000)]
Set an invalid IRQ number when no PCI IRQ is available in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd more ktime related functions to the LinuxKPI.
Hans Petter Selasky [Mon, 23 May 2016 12:10:28 +0000 (12:10 +0000)]
Add more ktime related functions to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoImplement "kref_put_mutex()" for the LinuxKPI.
Hans Petter Selasky [Mon, 23 May 2016 12:06:34 +0000 (12:06 +0000)]
Implement "kref_put_mutex()" for the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd more list_xxx() functions to the LinuxKPI.
Hans Petter Selasky [Mon, 23 May 2016 12:03:40 +0000 (12:03 +0000)]
Add more list_xxx() functions to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoMake header file standalone by including definitions for needed
Hans Petter Selasky [Mon, 23 May 2016 11:57:23 +0000 (11:57 +0000)]
Make header file standalone by including definitions for needed
linux_wait_xxx() functions.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoImplement "_outb()" to the LinuxKPI for i386 and amd64 only.
Hans Petter Selasky [Mon, 23 May 2016 11:53:00 +0000 (11:53 +0000)]
Implement "_outb()" to the LinuxKPI for i386 and amd64 only.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd support for "cdev_add_ext()" to the LinuxKPI.
Hans Petter Selasky [Mon, 23 May 2016 11:50:05 +0000 (11:50 +0000)]
Add support for "cdev_add_ext()" to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd more GFP related defines to the LinuxKPI.
Hans Petter Selasky [Mon, 23 May 2016 11:47:54 +0000 (11:47 +0000)]
Add more GFP related defines to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd support for atomic_long_inc_not_zero() to the LinuxKPI.
Hans Petter Selasky [Mon, 23 May 2016 11:44:46 +0000 (11:44 +0000)]
Add support for atomic_long_inc_not_zero() to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd support for atomic_long_inc_not_zero() to the LinuxKPI.
Hans Petter Selasky [Mon, 23 May 2016 11:41:35 +0000 (11:41 +0000)]
Add support for atomic_long_inc_not_zero() to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoUse DELAY() instead of _sleep() when SCHEDULER_STOPPED() is set inside
Hans Petter Selasky [Mon, 23 May 2016 10:31:54 +0000 (10:31 +0000)]
Use DELAY() instead of _sleep() when SCHEDULER_STOPPED() is set inside
pause_sbt(). This allows pause() to continue working during a panic()
which is not invoking KDB. This is useful when debugging graphics
drivers using the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week

8 years agohyperv/vmbus: Move IDT vector to vmbus_softc
Sepherosa Ziehau [Mon, 23 May 2016 07:32:34 +0000 (07:32 +0000)]
hyperv/vmbus: Move IDT vector to vmbus_softc

Prepare to get rid of the hv_setup_arg.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6449

8 years agohyperv/vmbus: Get rid of vmbus_devp
Sepherosa Ziehau [Mon, 23 May 2016 07:23:19 +0000 (07:23 +0000)]
hyperv/vmbus: Get rid of vmbus_devp

While I'm here, nuke useless print in vmbus_attach().

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6447

8 years agohyperv/vmbus: Declare Synic message and event w/ proper types
Sepherosa Ziehau [Mon, 23 May 2016 07:14:04 +0000 (07:14 +0000)]
hyperv/vmbus: Declare Synic message and event w/ proper types

Avoid ugly casts.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6446

8 years agohyperv: Move Hypercall setup to an early place.
Sepherosa Ziehau [Mon, 23 May 2016 07:06:53 +0000 (07:06 +0000)]
hyperv: Move Hypercall setup to an early place.

It does not belong to the vmbus.

While I'm here rework the Hypercall setup, e.g. use busdma(9)
and avoid bit fields.

Discussed with: Jun Su <junsu microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6445

8 years agohyperv/hn: Use hyperv busdma(9) helper.
Sepherosa Ziehau [Mon, 23 May 2016 06:52:42 +0000 (06:52 +0000)]
hyperv/hn: Use hyperv busdma(9) helper.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6444

8 years agohyperv: Add helpers for busdma(9) operation
Sepherosa Ziehau [Mon, 23 May 2016 06:35:11 +0000 (06:35 +0000)]
hyperv: Add helpers for busdma(9) operation

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6443

8 years ago[siba] update device ids.
Adrian Chadd [Mon, 23 May 2016 05:52:47 +0000 (05:52 +0000)]
[siba] update device ids.

Tested:

* BCM4322 11abgn, STA mode

8 years agohyperv: Move guest id setup to early place
Sepherosa Ziehau [Mon, 23 May 2016 05:11:38 +0000 (05:11 +0000)]
hyperv: Move guest id setup to early place

And
- Rework the guest id composition.
- Nuke useless saved guest_id.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6430

8 years ago[bwn] convert another PHY-N workaround to the freebsd bwn format.
Adrian Chadd [Mon, 23 May 2016 04:17:27 +0000 (04:17 +0000)]
[bwn] convert another PHY-N workaround to the freebsd bwn format.

These were hidden behind an #ifdef that we weren't setting.

I don't have the hardware in question to check.

8 years agoAdd a note on how to update a self-hosted armv6hf system to the entry
Ian Lepore [Mon, 23 May 2016 04:07:41 +0000 (04:07 +0000)]
Add a note on how to update a self-hosted armv6hf system to the entry
describing the armv6hf->armv6 change.

8 years ago[nvram2env] fix nvram2env to scan all of memory, not 1/4th
Adrian Chadd [Mon, 23 May 2016 03:51:15 +0000 (03:51 +0000)]
[nvram2env] fix nvram2env to scan all of memory, not 1/4th

The variable "size" stores number of words (4bytes). But the loop over
memory uses size as number of bytes to scan memory. As result it fetches
only 1/4th of memory.

This patch solves this problem and nvram2env fetches all NVRAM variables.

Test plan:

Pre-requisites: any MIPS board with ASCII-based NVRAM mapped into memory

* Add "device nvram2env" into kernel configuration
* Specify hints: base is mandatory (according to nvram2env(4))

hint.nvram.0.base=0x1c7f8000 (it's valid address for Asus RT-N53 with
flags = 0x4)

* Build & load kernel with bootverbose

Actual result: only part of nvram variables are found
Expected result: all variables are found

Submitted by: Michael Zhilin <mizhka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6466

8 years ago[bhnd] Add support for querying the attachment type of the bhnd bus.
Adrian Chadd [Mon, 23 May 2016 03:47:44 +0000 (03:47 +0000)]
[bhnd] Add support for querying the attachment type of the bhnd bus.

This adds a BHND_BUS_GET_ATTACH_TYPE(); the primary use-case is to let
chipc make a coarse-grained determination as to whether UART, SPI, etc
drivers ought to be attached, and on fullmac devices, whether a real
CPU driver ought to be skipped for the ARM core, etc.

Tested:

* BCM4331 (BHND)
* BCM4312 (SIBA)

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6492

8 years ago[ixl] fix build for RSS.
Adrian Chadd [Mon, 23 May 2016 03:46:36 +0000 (03:46 +0000)]
[ixl] fix build for RSS.

Untested.

8 years ago[bhnd] Fix DEFINE_CLASS_(2|3) multiple inheritance support.
Adrian Chadd [Mon, 23 May 2016 03:29:43 +0000 (03:29 +0000)]
[bhnd] Fix DEFINE_CLASS_(2|3) multiple inheritance support.

This diff updates DEFINE_CLASS_2/_3 to support the specification of class
name separately from the class variable name, bringing them into sync
with their API documentation, as well as the behavior of DEFINE_CLASS_0/_1.

Nothing in the tree currently uses the _2/_3 variants, and I can't
find any references to the API outside of commits to the kobj.h
header itself; given the limitation that currently exists, I'd
be surprised if they've ever been used.

Submitted by: Landon Fuller <landonf@landonf.org>
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D6491

8 years agoHopefully fix Coverity CID 1008328 (Out-of-bounds write) in /bin/sh.
Don Lewis [Mon, 23 May 2016 01:01:23 +0000 (01:01 +0000)]
Hopefully fix Coverity CID 1008328 (Out-of-bounds write) in /bin/sh.

Replace the magic constant 127 in the loop interation count with
"PROMPTLEN - 1".

gethostname() is not guaranteed to NUL terminate the destination
string if it is too short. Decrease the length passed to gethostname()
by one, and add a NUL at the end of the buffer to make sure the
following loop to find the end of the name properly terminates.

The default: case is the likely cause of Coverity CID 1008328.  If
i is 126 at the top of the loop interation where the default case
is triggered, i will be incremented to 127 by the default case,
then incremented to 128 at the top of the loop before being compared
to 127 (PROMPTLENT - 1) and terminating the loop. Then the NUL
termination code after the loop will write to ps[128].  Fix by
checking for overflow before incrementing the index and storing the
second character in the buffer.

These fixes are not guaranteed to satisfy Coverity. The code that
increments i in the 'h'/'H' and 'w'/'W' cases may be beyond its
capability to analyze, but the code appears to be safe.

Reported by: Coverity
CID: 1008328
Reviewed by: jilles, cem
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6482

8 years agoMark swap-related proc sysctls as not requiring Giant.
Konstantin Belousov [Sun, 22 May 2016 23:28:23 +0000 (23:28 +0000)]
Mark swap-related proc sysctls as not requiring Giant.

Reviewed by: alc (as part of larger patch)
Sponsored by: The FreeBSD Foundation

8 years agoReplace hand-made exclusive lock, protecting against parallel
Konstantin Belousov [Sun, 22 May 2016 23:25:01 +0000 (23:25 +0000)]
Replace hand-made exclusive lock, protecting against parallel
swapon/swapoff invocations, with sx.

Reviewed by: alc (as part of larger patch)
Sponsored by: The FreeBSD Foundation

8 years agoRestore the translation of armv6hf->arm when generating MACHINE_CPUARCH.
Ian Lepore [Sun, 22 May 2016 21:31:20 +0000 (21:31 +0000)]
Restore the translation of armv6hf->arm when generating MACHINE_CPUARCH.
It turns out we need to leave this in place for a while so that people
running self-hosting armv6hf systems can do the builds necessary to update
to armv6 (which is now hardfloat by default).

8 years agobsdinstall/zfsboot GPT+BIOS+GELI installs now make use of GELIBOOT
Allan Jude [Sun, 22 May 2016 20:31:52 +0000 (20:31 +0000)]
bsdinstall/zfsboot GPT+BIOS+GELI installs now make use of GELIBOOT

In this configuration, a separate bootpool is not required.
This allows ZFS Boot Environments to be used with GELI encrypted ZFS pools.

Support for GPT+EFI+GELI is planned for the future.

Tested by: Joseph Mingrone, HardenedBSD
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D5869

8 years agognugrep: Update the configuration.
Pedro F. Giffuni [Sun, 22 May 2016 20:17:55 +0000 (20:17 +0000)]
gnugrep: Update the configuration.

The only effect is that it will use our native iconv(3).

Relnotes: yes

8 years agourtwn: cleanup some unused code in urtwn_tx_data().
Andriy Voskoboinyk [Sun, 22 May 2016 20:12:07 +0000 (20:12 +0000)]
urtwn: cleanup some unused code in urtwn_tx_data().

- Drop unused 'subtype' variable.
- Remove obsolete comment (hardware crypto support was added in r292175).

8 years agourtwn: setup per-frame retry limit.
Andriy Voskoboinyk [Sun, 22 May 2016 19:43:40 +0000 (19:43 +0000)]
urtwn: setup per-frame retry limit.

Override global retry limit (which is set in R92C_RL) via per-frame
TX descriptor field. Obsoletes D3840 (should work better with 2+ vaps).

Tested with RTL8188EU and RTL8192CUS in STA mode (maxretry = [3-9]).

8 years agoRemove false claim. Giant is dropped by mi_startup() before passing
Konstantin Belousov [Sun, 22 May 2016 19:25:53 +0000 (19:25 +0000)]
Remove false claim.  Giant is dropped by mi_startup() before passing
the control to swapper.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

8 years agoConvert proto family in both directions. The linux and native values for
Dmitry Chagin [Sun, 22 May 2016 19:08:29 +0000 (19:08 +0000)]
Convert proto family in both directions. The linux and native values for
local and inet are identical, but for inet6 values differ.

PR: 155040
Reported by: Simon Walton
MFC after: 2 week

8 years agoWrap EXPAND(..) macro with a do-while(0) loop and put a single statement on each...
Enji Cooper [Sun, 22 May 2016 19:06:38 +0000 (19:06 +0000)]
Wrap EXPAND(..) macro with a do-while(0) loop and put a single statement on each line

As a positive side-effect, this eliminates the double semicolons reported by Coverity:
the macro contained a trailing semicolon, in addition to the semicolon placed on
each line where EXPAND(..) was called.

MFC after: 1 week
Reported by: Coverity
CID: 1194269
Sponsored by: EMC / Isilon Storage Division