]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoDisks can go missing until a reboot is done in some cases.
slm [Mon, 9 May 2016 16:36:40 +0000 (16:36 +0000)]
Disks can go missing until a reboot is done in some cases.

This is due to the DevHandle not being released, which causes the Firmware to
not allow that disk to be re-added.

Reviewed by:    ken, scottl, ambrisko, asomers
Approved by: ken, scottl, ambrisko
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D6102

8 years agoCleanup a comment.
tuexen [Mon, 9 May 2016 16:35:05 +0000 (16:35 +0000)]
Cleanup a comment.

MFC after: 1 week

8 years agodone_ccb pointer can be used if it is NULL.
slm [Mon, 9 May 2016 16:34:06 +0000 (16:34 +0000)]
done_ccb pointer can be used if it is NULL.

To prevent this, move check for done_ccb == NULL to before done_ccb is used in
mprsas_stop_unit_done().

Reviewed by:    ken, scottl, ambrisko, asomers
Approved by: ken, scottl, ambrisko
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D6099

8 years agoUse callout_reset_sbt() instead of callout_reset() if FreeBSD ver is >= 1000029
slm [Mon, 9 May 2016 16:31:43 +0000 (16:31 +0000)]
Use callout_reset_sbt() instead of callout_reset() if FreeBSD ver is >= 1000029

Reviewed by:    ken, scottl, ambrisko, asomers
Approved by: ken, scottl, ambrisko
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D6101

8 years agoNo need to set the MPRSAS_SHUTDOWN flag because it's never used.
slm [Mon, 9 May 2016 16:29:25 +0000 (16:29 +0000)]
No need to set the MPRSAS_SHUTDOWN flag because it's never used.

Approved by: ken, scottl, ambrisko
MFC after:      1 week

8 years agoFix possible use of invalid pointer.
slm [Mon, 9 May 2016 16:26:34 +0000 (16:26 +0000)]
Fix possible use of invalid pointer.

It was possible to use an invalid pointer to get the target ID value. To fix
this, initialize a local Target ID variable to an invalid value and change that
variable to a valid value only if the pointer to the Target ID is not NULL.

Reviewed by:    ken, scottl, ambrisko, asomers
Approved by: ken, scottl, ambrisko
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D6100

8 years agoChange logging level for a debug string to use MPR_LOG instead of MPR_INFO.
slm [Mon, 9 May 2016 16:24:16 +0000 (16:24 +0000)]
Change logging level for a debug string to use MPR_LOG instead of MPR_INFO.

Approved by: ken, scottl, ambrisko
MFC after:      1 week

8 years agoNo log bit in IOCStatus and endian-safe changes.
slm [Mon, 9 May 2016 16:21:14 +0000 (16:21 +0000)]
No log bit in IOCStatus and endian-safe changes.

Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and
make a few more things endian-safe.

Reviewed by:    ken, scottl, ambrisko, asomers
Approved by: ken, scottl, ambrisko
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D6097

8 years agoAdd support for the Broadcom (Avago/LSI) 9305 16 and 24 port HBA's.
slm [Mon, 9 May 2016 16:19:13 +0000 (16:19 +0000)]
Add support for the Broadcom (Avago/LSI) 9305 16 and 24 port HBA's.

Reviewed by:    ken, scottl, ambrisko, asomers
Approved by: ken, scottl, ambrisko
MFC after:      1 week
Relnotes:       yes
Differential Revision: https://reviews.freebsd.org/D6098

8 years agoSeveral style changes and add copyrights for 2016.
slm [Mon, 9 May 2016 16:16:00 +0000 (16:16 +0000)]
Several style changes and add copyrights for 2016.

Reviewed by:    ken, scottl, ambrisko, asomers
Approved by: ken, scottl, ambrisko
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D6103

8 years agoifconfig: fix check for 40 MHz channels while applying country/regdomain.
avos [Mon, 9 May 2016 16:15:52 +0000 (16:15 +0000)]
ifconfig: fix check for 40 MHz channels while applying country/regdomain.

Do not use 20 MHz channel list while checking 40 MHz channels;
it may be different. Just use the corresponding list instead.

Tested by: Masachika ISHIZUKA <ish@amail.plala.or.jp>

PR: 209328

8 years agoUpdate MPI headers to version 42.
slm [Mon, 9 May 2016 16:12:32 +0000 (16:12 +0000)]
Update MPI headers to version 42.

Reviewed by:    ken, scottl, ambrisko, asomers
Approved by: ken, scottl, ambrisko
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D6096

8 years agoCheck malloc succeeded in pic_create, with M_NOWAIT it may return NULL.
andrew [Mon, 9 May 2016 12:24:39 +0000 (12:24 +0000)]
Check malloc succeeded in pic_create, with M_NOWAIT it may return NULL.

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

8 years agoFix file polling bug.
hselasky [Mon, 9 May 2016 11:52:57 +0000 (11:52 +0000)]
Fix file polling bug.

Ensure the actual poll result is returned by the "linux_file_poll()"
function instead of zero which means no data is available.

MFC after: 3 days
Sponsored by: Mellanox Technologies

8 years agoo Stop to mention the slowstart_flightsize sysctl in the tuning(7).
maxim [Mon, 9 May 2016 11:48:09 +0000 (11:48 +0000)]
o Stop to mention the slowstart_flightsize sysctl in the tuning(7).

The slowstart_flightsize and local_slowstart_flightsize sysctl's
were removed from the TCP code in 226447 several years ago.

PR: 209376
MFC after: 1 week

8 years agosfxge(4): remove EFSYS_OPT_PCIE_TUNE
arybchik [Mon, 9 May 2016 08:38:56 +0000 (08:38 +0000)]
sfxge(4): remove EFSYS_OPT_PCIE_TUNE

With the removal of Falcon support, this is now dead code.

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

8 years agosfxge(4): disable common code support for Falcon
arybchik [Mon, 9 May 2016 08:37:42 +0000 (08:37 +0000)]
sfxge(4): disable common code support for Falcon

This patch ensures that client code will fail to build
with Falcon support. Following patches remove Falcon
support code entirely.

sfxge(4) has never supported Falcon.

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

8 years agosfxge(4): cleanup: fix obsolete EFSYS_OPT_PHY_BIST option
arybchik [Mon, 9 May 2016 08:35:08 +0000 (08:35 +0000)]
sfxge(4): cleanup: fix obsolete EFSYS_OPT_PHY_BIST option

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

8 years agosfxge(4): Siena no longer supports EFSYS_OPT_PCIE_TUNE
arybchik [Mon, 9 May 2016 08:32:49 +0000 (08:32 +0000)]
sfxge(4): Siena no longer supports EFSYS_OPT_PCIE_TUNE

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

8 years agosfxge(4): remove unused efx_nic_pcie_extended_sync()
arybchik [Mon, 9 May 2016 08:28:52 +0000 (08:28 +0000)]
sfxge(4): remove unused efx_nic_pcie_extended_sync()

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

8 years agoAdd a forgotten in r283424 .eh_frame section with CFI & FDE records to allow
dchagin [Mon, 9 May 2016 07:38:47 +0000 (07:38 +0000)]
Add a forgotten in r283424 .eh_frame section with CFI & FDE records to allow
stack unwinding through signal handler.

Reported by: Dmitry Sivachenko
MFC after: 2 weeks

8 years ago[siba] add 2GHz/5GHz FEM parameter fetching and accessor methods.
adrian [Mon, 9 May 2016 06:30:00 +0000 (06:30 +0000)]
[siba] add 2GHz/5GHz FEM parameter fetching and accessor methods.

This is used by the bwn(4) PHY-N code that I'm working on.

8 years ago[siba] add FEM variables from the r8 SPROM layout.
adrian [Mon, 9 May 2016 06:05:23 +0000 (06:05 +0000)]
[siba] add FEM variables from the r8 SPROM layout.

This will eventually be used the bwn(4) N-PHY code that I'm (slowly)
writing.

Obtained from: Linux b43

8 years ago[bwn] oops. typo.
adrian [Mon, 9 May 2016 06:02:57 +0000 (06:02 +0000)]
[bwn] oops.  typo.

8 years ago[bwn] add opt_bwi.h and BWN_DEBUG.
adrian [Mon, 9 May 2016 05:59:21 +0000 (05:59 +0000)]
[bwn] add opt_bwi.h and BWN_DEBUG.

It isn't used yet in the bwn(4) code; that'll come next.

8 years agoinstall: Add some tests.
jilles [Sun, 8 May 2016 21:11:24 +0000 (21:11 +0000)]
install: Add some tests.

8 years agoMake "-S" a default option for mountd.
rmacklem [Sun, 8 May 2016 20:10:22 +0000 (20:10 +0000)]
Make "-S" a default option for mountd.

After a discussion on freebsd-fs@ there seemed to be a consensus that
the "-S" option for mountd should become the default.
Since the only known issue w.r.t. using "-S" was fixed by r299201,
this commit adds "-S" to the default mountd_flags.

Discussed on: freebsd-fs
PR: 9619, 131342, 206855
MFC after: 2 weeks
Relnotes: yes

8 years ago[bhnd] Initial bhnd(4) SPROM/NVRAM support.
adrian [Sun, 8 May 2016 19:14:05 +0000 (19:14 +0000)]
[bhnd] Initial bhnd(4) SPROM/NVRAM support.

This adds support for the NVRAM handling and the basic SPROM
hardware used on siba(4) and bcma(4) devices, including:

* SPROM directly attached to the PCI core, accessible via PCI configuration
  space.
* SPROM attached to later ChipCommon cores.
* SPROM variables vended from the parent SoC bus (e.g. via a directly-attached
  flash device).

Additional improvements to the NVRAM/SPROM interface will
be required, but this changeset stands alone as working
checkpoint.

Submitted by: Landon Fuller <landonf@landonf.org>
Reviewed by: Michael Zhilin <mizkha@gmail.com> (Broadcom MIPS support)
Differential Revision: https://reviews.freebsd.org/D6196

8 years ago[bhnd] Add support for matching on chip identifiers.
adrian [Sun, 8 May 2016 18:30:08 +0000 (18:30 +0000)]
[bhnd] Add support for matching on chip identifiers.

This is used by the upcoming SPROM code to match on chipsets
that require special handling of muxed SPROM pins.

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

8 years ago[bhnd] Add bhnd_resource support for the bus_(read|write)(_multi_)stream_* functions.
adrian [Sun, 8 May 2016 18:20:01 +0000 (18:20 +0000)]
[bhnd] Add bhnd_resource support for the bus_(read|write)(_multi_)stream_* functions.

This adds additional bhnd_resource shims used by the upcoming SPROM deltas.

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

8 years agoMFV r299237: apply two upstream revisions to address upstream bug PR/540.
delphij [Sun, 8 May 2016 18:18:35 +0000 (18:18 +0000)]
MFV r299237: apply two upstream revisions to address upstream bug PR/540.

PR: 209211
MFC after: 2 weeks
X-MFC: if there is no new file release

8 years ago[bhnd] Replace is_hostb_device() with a more general find_hostb_device()
adrian [Sun, 8 May 2016 17:52:12 +0000 (17:52 +0000)]
[bhnd] Replace is_hostb_device() with a more general find_hostb_device()

This allows bus children to query for the host bridge device, rather
than having to iterate over all attached devices.

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

8 years agoMFV r299233: Apply upstream fix 11edb37a71851b5bcbd4e51ca6ad3dcbf57e9761:
delphij [Sun, 8 May 2016 09:30:36 +0000 (09:30 +0000)]
MFV r299233: Apply upstream fix 11edb37a71851b5bcbd4e51ca6ad3dcbf57e9761:

Revert: Don't close stdin...

This have been observed by portupgrade in its interaction with file(1),
as reported as a regression in bin/209211.

PR: 209211
MFC after: 3 days

8 years agoINTRNG - update gpio pin capabilities according to r299198.
skra [Sun, 8 May 2016 09:01:30 +0000 (09:01 +0000)]
INTRNG - update gpio pin capabilities according to r299198.

8 years agoINTRNG - update gpio pin capabilities according to r299166.
skra [Sun, 8 May 2016 08:57:50 +0000 (08:57 +0000)]
INTRNG - update gpio pin capabilities according to r299166.

Note that the updated comment is valid only for INTRNG. This should not
be a problem as not INTRNG code is left in place for debugging reasons
only and should not be used anymore. It's anticipated that this old
code will be removed soon.

8 years agofd: assert dropped filedesc lock in fdcloseexec
mjg [Sun, 8 May 2016 03:26:12 +0000 (03:26 +0000)]
fd: assert dropped filedesc lock in fdcloseexec

8 years agoDon't increment srvrpccnt[] for the NFSv4.1 operations.
rmacklem [Sat, 7 May 2016 22:45:08 +0000 (22:45 +0000)]
Don't increment srvrpccnt[] for the NFSv4.1 operations.

When support for NFSv4.1 was added to the NFS server, it broke
the server rpc count stats, since newnfsstats.srvrpccnt[] doesn't
have entries for the new NFSv4.1 operations.
Without this patch, the code was incrementing bogus entries in
newnfsstats for the new NFSv4.1 operations.
This patch is an interim fix. The nfsstats structure needs to be
updated and that will come in a future commit.

Reported by: cem
MFC after: 2 weeks

8 years agoOnly one program is build in usr.bin/sdiff use the right include
bapt [Sat, 7 May 2016 20:23:26 +0000 (20:23 +0000)]
Only one program is build in usr.bin/sdiff use the right include

8 years agoRevert r299218 VISUAL is actually a perfecly valid env to specify an editor
bapt [Sat, 7 May 2016 18:58:07 +0000 (18:58 +0000)]
Revert r299218 VISUAL is actually a perfecly valid env to specify an editor

8 years agoOnly use EDITOR as a variable to specify which text editor to use
bapt [Sat, 7 May 2016 18:48:48 +0000 (18:48 +0000)]
Only use EDITOR as a variable to specify which text editor to use

8 years agoDirectly call the editor if needed instead of spawning /bin/sh
bapt [Sat, 7 May 2016 18:44:30 +0000 (18:44 +0000)]
Directly call the editor if needed instead of spawning /bin/sh

8 years agoReplace fparseln(3) with getline(3)
bapt [Sat, 7 May 2016 18:21:58 +0000 (18:21 +0000)]
Replace fparseln(3) with getline(3)

It removes a dependency on libutil.

8 years agoClean up callers of nd6_prelist_add().
markj [Sat, 7 May 2016 03:41:29 +0000 (03:41 +0000)]
Clean up callers of nd6_prelist_add().

nd6_prelist_add() sets *newp if and only if it is successful, so there's no
need for code that handles the case where the return value is 0 and
*newp == NULL. Fix some style bugs in nd6_prelist_add() while here.

MFC after: 1 week

8 years agoRemove two useless local variables from prelist_update().
markj [Sat, 7 May 2016 03:32:29 +0000 (03:32 +0000)]
Remove two useless local variables from prelist_update().

MFC after: 1 week

8 years agosed: rewrite the main loop.
pfg [Sat, 7 May 2016 01:44:22 +0000 (01:44 +0000)]
sed: rewrite the main loop.

Rewrite the main loop of the "sed s/..." command, shortening it by ten
lines and simplifying it by removing the switch statement implementing
/g, /1, and /2 separately and repetitively.

This will be needed to bring a fix from OpenBSD later.

Obtained from: OpenBSD (schwarze CVS Rev. 1.18)
MFC after: 3 weeks

8 years agoUse DDP to implement zerocopy TCP receive with aio_read().
jhb [Sat, 7 May 2016 00:33:35 +0000 (00:33 +0000)]
Use DDP to implement zerocopy TCP receive with aio_read().

Chelsio's TCP offload engine supports direct DMA of received TCP payload
into wired user buffers.  This feature is known as Direct-Data Placement.
However, to scale well the adapter needs to prepare buffers for DDP
before data arrives.  aio_read() is more amenable to this requirement than
read() as applications often call read() only after data is available in
the socket buffer.

When DDP is enabled, TOE sockets use the recently added pru_aio_queue
protocol hook to claim aio_read(2) requests instead of letting them use
the default AIO socket logic.  The DDP feature supports scheduling DMA
to two buffers at a time so that the second buffer is ready for use
after the first buffer is filled.  The aio/DDP code optimizes the case
of an application ping-ponging between two buffers (similar to the
zero-copy bpf(4) code) by keeping the two most recently used AIO buffers
wired.  If a buffer is reused, the aio/DDP code is able to reuse the
vm_page_t array as well as page pod mappings (a kind of MMU mapping the
Chelsio NIC uses to describe user buffers).  The generation of the
vmspace of the calling process is used in conjunction with the user
buffer's address and length to determine if a user buffer matches a
previously used buffer.  If an application queues a buffer for AIO that
does not match a previously used buffer then the least recently used
buffer is unwired before the new buffer is wired.  This ensures that no
more than two user buffers per socket are ever wired.

Note that this feature is best suited to applications sending a steady
stream of data vs short bursts of traffic.

Discussed with: np
Relnotes: yes
Sponsored by: Chelsio Communications

8 years agoSet the correct vnet in TOE event handlers.
jhb [Fri, 6 May 2016 23:49:10 +0000 (23:49 +0000)]
Set the correct vnet in TOE event handlers.

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

8 years agoRestore name=value format of PCI location strings.
jhb [Fri, 6 May 2016 23:46:35 +0000 (23:46 +0000)]
Restore name=value format of PCI location strings.

When devctl was added, the location string for PCI devices was changed to
use the PCI "selector" that pciconf and devctl accept.  However, devd
assumes that location strings are formatted as a list of name=value pairs.
As a result, devd is no longer parsing any of the values out of PCI
device events.  Restore the previous format of the PCI location strings
to restore the location and slot keywords in case any devd scripts are
using this.  Add the "selector" as a new 'dbsf' location variable.

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

8 years agonfsserver: minor spelling fix in comment.
pfg [Fri, 6 May 2016 23:40:37 +0000 (23:40 +0000)]
nfsserver: minor spelling fix in comment.

No functional change.

8 years agosys/opencrypto: minor spelling fixes.
pfg [Fri, 6 May 2016 23:37:19 +0000 (23:37 +0000)]
sys/opencrypto: minor spelling fixes.

No functional change.

Reviewed by: jmg

8 years agoGive mountd -S priority over outstanding RPC requests when suspending the nfsd.
rmacklem [Fri, 6 May 2016 23:26:17 +0000 (23:26 +0000)]
Give mountd -S priority over outstanding RPC requests when suspending the nfsd.

It was reported via email that under certain heavy RPC loads
long delays before the exports would be updated was observed
when using "mountd -S". This patch reverses the priority between
the exclusive lock request to suspend the nfsd threads and the
shared lock request for performing RPCs.
As such, when mountd attempts to suspend the nfsd threads, it
gets priority over outstanding RPC requests to do this.
I suspect that the case reported was an artificial test load,
but this patch did fix the problem for the reporter.

Reported and Tested by: josephlai@qnap.com
MFC after: 2 weeks

8 years agodev/e1000,ixgbe: minor spelling fixes.
pfg [Fri, 6 May 2016 22:54:56 +0000 (22:54 +0000)]
dev/e1000,ixgbe: minor spelling fixes.

No functional change.

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

8 years agoAdd nid_namelen bounds check to nfssvc system call
emaste [Fri, 6 May 2016 21:19:28 +0000 (21:19 +0000)]
Add nid_namelen bounds check to nfssvc system call

This is only allowed by root and only used by the nfs daemon, which
should not provide an incorrect value. However, it's still good
practice to validate data provided by userland.

PR: 206626
Reported by: CTurt <cturt@hardenedbsd.org>
Reviewed by: rmacklem
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D6201

8 years agoINTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO
skra [Fri, 6 May 2016 20:57:41 +0000 (20:57 +0000)]
INTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO
introduced in r298738.

8 years agoINTRNG - use gpio interrupt modes definitions added in r298738 and
skra [Fri, 6 May 2016 20:55:14 +0000 (20:55 +0000)]
INTRNG - use gpio interrupt modes definitions added in r298738 and
implement also GPIO_INTR_EDGE_BOTH mode. All reasonable interrupt
modes are supported now.

8 years agoAdd missing parameters -N and -l to reroot and halt usage()
garga [Fri, 6 May 2016 20:49:14 +0000 (20:49 +0000)]
Add missing parameters -N and -l to reroot and halt usage()

Approved by: bapt
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D6173

8 years agoAdd missing include "opt_geom.h" to make GEOM_UZIP_DEBUG option working,
sobomax [Fri, 6 May 2016 20:32:39 +0000 (20:32 +0000)]
Add missing include "opt_geom.h" to make GEOM_UZIP_DEBUG option working,
also rename enum member so it does not conflict with GEOM_UZIP option
name.

Submitted by: mizhka@gmail.com
Differential Revision: https://reviews.freebsd.org/D6207

8 years agoRevert r298938: Change x/a to work similar to gdb.
pfg [Fri, 6 May 2016 20:28:28 +0000 (20:28 +0000)]
Revert r298938: Change x/a to work similar to gdb.

This badly breaks x/ia: ddb and gdb syntax are quite different and it is
unclear if they can be reconciled.

8 years agoiwn: fix comments for iwn_read_eeprom_channels().
avos [Fri, 6 May 2016 17:39:12 +0000 (17:39 +0000)]
iwn: fix comments for iwn_read_eeprom_channels().

It's used for all channels (20MHz and 40MHz).

8 years agoSince igb_detach() cleans up all the data structures that will be
sbruno [Fri, 6 May 2016 17:00:45 +0000 (17:00 +0000)]
Since igb_detach() cleans up all the data structures that will be
free'd by the functions following its call, we can simply return instead
of crashing and burning in the event of igb_detach() failing.

PR: 197139
Submitted by: rupavath@juniper.net
MFC after: 2 weeks

8 years agosys/security: minor spelling fixes.
pfg [Fri, 6 May 2016 16:59:04 +0000 (16:59 +0000)]
sys/security: minor spelling fixes.

No functional change.

8 years agocam/scsi: Remove mostly unused scsi_quirk_table_size.
pfg [Fri, 6 May 2016 16:51:56 +0000 (16:51 +0000)]
cam/scsi: Remove mostly unused scsi_quirk_table_size.

It was only being used only once and it can be directly replaced
instead.

8 years agoxen/privcmd: fix integer truncation in IOCTL_PRIVCMD_MMAPBATCH
royger [Fri, 6 May 2016 16:44:46 +0000 (16:44 +0000)]
xen/privcmd: fix integer truncation in IOCTL_PRIVCMD_MMAPBATCH

The size field in the XENMEM_add_to_physmap_range is an uint16_t, and the
privcmd driver was doing an implicit truncation of an int into an uint16_t
when filling the hypercall parameters.

Fix this by adding a loop and making sure privcmd splits ioctl request into
2^16 chunks when issuing the hypercalls.

Reported and tested by: Marcin Cieslak <saper@saper.info>
Sponsored by: Citrix Systems R&D

8 years agobitset: introduce helpers to allocate a bitset at runtime
royger [Fri, 6 May 2016 16:41:23 +0000 (16:41 +0000)]
bitset: introduce helpers to allocate a bitset at runtime

Introduce some new helpers to declare and allocate a dynamic bitset, whose
size is not a constant.

Sponsored by: Citrix Systems R&D
Reviewed by: kib jhb
Differential revision: https://reviews.freebsd.org/D6226

8 years agolibc/xdr: unsign some loop indexes.
pfg [Fri, 6 May 2016 16:03:40 +0000 (16:03 +0000)]
libc/xdr: unsign some loop indexes.

Although usually small, values produced by nitems() are unsigned.
Unsign inxdeing variables related to nitems() macros to avoid
signed vs. unsigned comparisons.

8 years agoIf ALTQ is defined in the kern conf, switch to Legacy Mode.
sbruno [Fri, 6 May 2016 15:41:38 +0000 (15:41 +0000)]
If ALTQ is defined in the kern conf, switch to Legacy Mode.

PR: 208409
Submitted by: freebsd@mcwest.org
MFC after: 2 weeks

8 years agosys/ofed: minor spelling fix.
pfg [Fri, 6 May 2016 15:37:06 +0000 (15:37 +0000)]
sys/ofed: minor spelling fix.

No functional change.

Reviewed by: hselasky

8 years agosys/cam/scsi: unsigned some loop indexes.
pfg [Fri, 6 May 2016 15:36:25 +0000 (15:36 +0000)]
sys/cam/scsi: unsigned some loop indexes.

Although usually small, values produced by nitems() are unsigned.
One more case where unsgining the index may be useful.

8 years agoofed/drivers: minor spelling fixes.
pfg [Fri, 6 May 2016 15:16:13 +0000 (15:16 +0000)]
ofed/drivers: minor spelling fixes.

No functional change.

Reviewed by: hselasky

8 years agosys/cam/scsi: unsigned some loop indexes.
pfg [Fri, 6 May 2016 15:13:44 +0000 (15:13 +0000)]
sys/cam/scsi: unsigned some loop indexes.

Although usually small, values produced by nitems() are unsigned.
By unsigning the corresponding indexes we avoid signed vs unsigned
comparisons. This may have some effect on performance, although given the
small sizes the effect will not be perceivable and it makes the code
clearer.

8 years agodev/usb: unsigned some loop indexes.
pfg [Fri, 6 May 2016 15:09:21 +0000 (15:09 +0000)]
dev/usb: unsigned some loop indexes.

Although usually small, values produced by nitems() are unsigned.
By unsigning the corresponding indexes we avoid signed vs unsigned
comparisons. This may have some effect on performance, although given the
small sizes the effect will not be perceivable, and it makes the code
clearer.

Respect the style of the changed files: one uses u_int while the other
uses "unsigned int".

Reviewed by: hselasky

8 years agoAdd the "-r" flag to iscsictl(8).
trasz [Fri, 6 May 2016 13:45:42 +0000 (13:45 +0000)]
Add the "-r" flag to iscsictl(8).

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoDocument the "Protocol" field of iscsi.conf(5).
trasz [Fri, 6 May 2016 13:44:56 +0000 (13:44 +0000)]
Document the "Protocol" field of iscsi.conf(5).

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRevert r299139: these are generated files
emaste [Fri, 6 May 2016 13:04:45 +0000 (13:04 +0000)]
Revert r299139: these are generated files

We'll need to properly generate PIC/non-PIC from the source .pl files.

Reported by: jkim

8 years agonet80211: restore 'iflladdr_event' event handler.
avos [Fri, 6 May 2016 11:41:49 +0000 (11:41 +0000)]
net80211: restore 'iflladdr_event' event handler.

Now 'ether' argument to ifconfig can be used as an alias to 'wlanaddr'.

PR: 208933

8 years agoOnly install etc/rc.d/{rfcomm_pppd_server,sdpd} if MK_BLUETOOTH != no
ngie [Fri, 6 May 2016 09:18:09 +0000 (09:18 +0000)]
Only install etc/rc.d/{rfcomm_pppd_server,sdpd} if MK_BLUETOOTH != no

These are bluetooth specific services

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoINTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO
skra [Fri, 6 May 2016 08:59:25 +0000 (08:59 +0000)]
INTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO
introduced in r298738.

8 years agoINTRNG - use gpio interrupt modes definitions added in r298738 and
skra [Fri, 6 May 2016 08:56:46 +0000 (08:56 +0000)]
INTRNG - use gpio interrupt modes definitions added in r298738 and
implement also GPIO_INTR_EDGE_BOTH mode. All reasonable interrupt
modes are supported now.

8 years agoSet correct size to the size member of struct intr_map_data when
skra [Fri, 6 May 2016 08:54:00 +0000 (08:54 +0000)]
Set correct size to the size member of struct intr_map_data when
initialized. As the size member is not used at the present,
it did not break anything.

8 years agoFix r299162
ngie [Fri, 6 May 2016 08:53:24 +0000 (08:53 +0000)]
Fix r299162

share/man/man8/Makefile:
- Add src.opts.mk so MK_NIS can be tested
- Fix typo in MK_NIS conditional

tools/build/mk/OptionalObsoleteFiles.inc:
- Remove WIP diff from ^/user/ngie/detangle-rc

MFC after: 1 week
X-MFC with: r299162
Sponsored by: EMC / Isilon Storage Division

8 years agoOnly install NIS section 8 manpages if MK_NIS != no
ngie [Fri, 6 May 2016 08:42:33 +0000 (08:42 +0000)]
Only install NIS section 8 manpages if MK_NIS != no

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agomtk_spi cleanup commented printfs
sgalabov [Fri, 6 May 2016 05:24:10 +0000 (05:24 +0000)]
mtk_spi cleanup commented printfs

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D6223

8 years agomtk_gpio fixes
sgalabov [Fri, 6 May 2016 05:22:25 +0000 (05:22 +0000)]
mtk_gpio fixes

Allow output pins to be read and input pins to be set.
Fix bugs where we were trying to access the gpio softc before doing
device_get_softc.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D6222

8 years agoChange the type of objhash_cb_t callback function to be able return an
ae [Fri, 6 May 2016 03:18:51 +0000 (03:18 +0000)]
Change the type of objhash_cb_t callback function to be able return an
error code. Use it to interrupt the loop in ipfw_objhash_foreach().

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

8 years agonvmecontrol.8: minor spelling fix.
pfg [Fri, 6 May 2016 03:11:34 +0000 (03:11 +0000)]
nvmecontrol.8: minor spelling fix.

No functional change.

8 years agosys/rpc: minor spelling fixes.
pfg [Fri, 6 May 2016 01:49:46 +0000 (01:49 +0000)]
sys/rpc: minor spelling fixes.

No functional change.

8 years agoImport libcxxrt master 516a65c109eb0a01e5e95fbef455eb3215135cef.
dim [Thu, 5 May 2016 22:40:07 +0000 (22:40 +0000)]
Import libcxxrt master 516a65c109eb0a01e5e95fbef455eb3215135cef.

Interesting fixes:
3adaa2e Fix _Unwind_Exception cleanup functions
286776c Check exception cleanup function ptr before calling
edda626 Correct exception specifications on new and delete operators

8 years agoSince contrib/libcxxrt's ancestry was never correct, subversion 1.8 and
dim [Thu, 5 May 2016 22:30:00 +0000 (22:30 +0000)]
Since contrib/libcxxrt's ancestry was never correct, subversion 1.8 and
higher cannot merge to it from the vendor area.

Re-bootstrap the ancestry by doing (apologies to your retinas):
* svn pg svn:mergeinfo contrib/libcxxrt > mergeinfo.txt
* svn rm contrib/libcxxrt
* svn cp ^/vendor/libcxxrt/dist@297299 contrib/libcxxrt
* svn rm CMakeLists.txt doxygen_config
* svn cp ^/head/contrib/libcxxrt/FREEBSD-upgrade@297299 contrib/libcxxrt
* svn cp ^/head/contrib/libcxxrt/exception.cc@297299 contrib/libcxxrt
* svn cp ^/head/contrib/libcxxrt/unwind-arm.h@297299 contrib/libcxxrt
* svn pd -R svn:mergeinfo contrib/libcxxrt
* svn ps -F mergeinfo.txt svn:mergeinfo contrib/libcxxrt

8 years agoNative PCI-express HotPlug support.
jhb [Thu, 5 May 2016 22:26:23 +0000 (22:26 +0000)]
Native PCI-express HotPlug support.

PCI-express HotPlug support is implemented via bits in the slot
registers of the PCI-express capability of the downstream port along
with an interrupt that triggers when bits in the slot status register
change.

This is implemented for FreeBSD by adding HotPlug support to the
PCI-PCI bridge driver which attaches to the virtual PCI-PCI bridges
representing downstream ports on HotPlug slots. The PCI-PCI bridge
driver registers an interrupt handler to receive HotPlug events. It
also uses the slot registers to determine the current HotPlug state
and drive an internal HotPlug state machine. For simplicty of
implementation, the PCI-PCI bridge device detaches and deletes the
child PCI device when a card is removed from a slot and creates and
attaches a PCI child device when a card is inserted into the slot.

The PCI-PCI bridge driver provides a bus_child_present which claims
that child devices are present on HotPlug-capable slots only when a
card is inserted. Rather than requiring a timeout in the RC for
config accesses to not-present children, the pcib_read/write_config
methods fail all requests when a card is not present (or not yet
ready).

These changes include support for various optional HotPlug
capabilities such as a power controller, mechanical latch,
electro-mechanical interlock, indicators, and an attention button.
It also includes support for devices which require waiting for
command completion events before initiating a subsequent HotPlug
command. However, it has only been tested on ExpressCard systems
which support surprise removal and have none of these optional
capabilities.

PCI-express HotPlug support is conditional on the PCI_HP option
which is enabled by default on arm64, x86, and powerpc.

Reviewed by: adrian, imp, vangyzen (older versions)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D6136

8 years agoMake libcrypto position independent on i386
emaste [Thu, 5 May 2016 21:25:41 +0000 (21:25 +0000)]
Make libcrypto position independent on i386

Prior to this change libcrypto ended up with a .text relocation.

Submitted by: Rafael EspĂ­ndola (earlier version)
Reviewed by: kib
Approved by: so (glebius)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6164

8 years agoLimit Options.inc generation to desired targets
emaste [Thu, 5 May 2016 21:20:09 +0000 (21:20 +0000)]
Limit Options.inc generation to desired targets

As mentioned in the Makefile there's an "atrocious" hack to generate a
different version of Options.inc.h, depending on the library being
built.

Remove the catch-all else case and limit it to specific libraries, so
that we don't accidentally use the Options.inc.h from clangdriver if a
future libary also uses Options.inc.h.

Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6209

8 years ago.. delete this; I don't know why this was here. oops!
adrian [Thu, 5 May 2016 20:16:58 +0000 (20:16 +0000)]
.. delete this; I don't know why this was here. oops!

8 years agoRename find_name_tlv_type() to ipfw_find_name_tlv_type() and make it
ae [Thu, 5 May 2016 20:15:46 +0000 (20:15 +0000)]
Rename find_name_tlv_type() to ipfw_find_name_tlv_type() and make it
global. Use it in ip_fw_table.c instead of find_name_tlv() to reduce
duplicated code.

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

8 years ago[bhnd] don't use anonymous unions.
adrian [Thu, 5 May 2016 19:56:18 +0000 (19:56 +0000)]
[bhnd] don't use anonymous unions.

Found by: gcc-4.2

8 years ago[bhnd] default to BUS_PROBE_DEFAULT for unknown BHND classes.
adrian [Thu, 5 May 2016 19:55:16 +0000 (19:55 +0000)]
[bhnd] default to BUS_PROBE_DEFAULT for unknown BHND classes.

Found by: gcc-4.2

8 years ago[bhnd] handle unknown bhnd port type.
adrian [Thu, 5 May 2016 19:54:17 +0000 (19:54 +0000)]
[bhnd] handle unknown bhnd port type.

8 years ago[bwn] fix signed-ness of the rssi parameter.
adrian [Thu, 5 May 2016 19:40:26 +0000 (19:40 +0000)]
[bwn] fix signed-ness of the rssi parameter.

It's a uint8_t from the hardware.

Found by: gcc

8 years ago[bhnd] quieten gcc warning.
adrian [Thu, 5 May 2016 19:38:53 +0000 (19:38 +0000)]
[bhnd] quieten gcc warning.

8 years ago[bhnd] handle unknown port type.
adrian [Thu, 5 May 2016 19:30:14 +0000 (19:30 +0000)]
[bhnd] handle unknown port type.

Reported by: emaste

8 years agoFix intmax_t to uintptr_t casting on 32-bit platforms. Found by GCC.
jkim [Thu, 5 May 2016 18:43:31 +0000 (18:43 +0000)]
Fix intmax_t to uintptr_t casting on 32-bit platforms.  Found by GCC.

Submitted by: bde