]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agotimed(8): Use strlcpy() for bounds checking.
pfg [Sat, 14 May 2016 02:42:09 +0000 (02:42 +0000)]
timed(8): Use strlcpy() for bounds checking.

Prevent some theorical buffer overruns reported by Coverity.
Cleanup a use of gethostname() while here.

CID: 1006713101116610111671011168,

8 years agotimed(8): Use stronger random number generator.
pfg [Sat, 14 May 2016 01:12:23 +0000 (01:12 +0000)]
timed(8): Use stronger random number generator.

Using arc4random simplifies the code by not having to worry about
seeds which ironically depend on the time.

CID: 1300004

8 years agotimed(8): use NULL instead of zero for pointers.
pfg [Sat, 14 May 2016 00:46:38 +0000 (00:46 +0000)]
timed(8): use NULL instead of zero for pointers.

8 years agoiconvctl(3): remove superfluous NULL pointer tests
vangyzen [Sat, 14 May 2016 00:35:35 +0000 (00:35 +0000)]
iconvctl(3): remove superfluous NULL pointer tests

convname and dst are guaranteed to be non-NULL by iconv_open(3).
src is an array. Remove these tests for NULL pointers.
While I'm here, eliminate a strlcpy with a correct but suspicious-looking
calculation for the third parameter (i.e. not a simple sizeof).
Compare the strings in-place instead of copying.

Found by: bdrewery
Found by: Coverity
CID: 11300501130056
MFC after: 3 days
Sponsored by: Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D6338

8 years agoUse OF_prop_free instead of direct call to free(9)
gonzo [Fri, 13 May 2016 22:28:02 +0000 (22:28 +0000)]
Use OF_prop_free instead of direct call to free(9)

Approved by: jmcneill

8 years agoUse OF_prop_free instead of direct call to free(9)
gonzo [Fri, 13 May 2016 22:05:16 +0000 (22:05 +0000)]
Use OF_prop_free instead of direct call to free(9)

8 years agoMove _bsnmptools_debug extern from bsnmpmap.c to bsnmptools.h
ngie [Fri, 13 May 2016 21:26:12 +0000 (21:26 +0000)]
Move _bsnmptools_debug extern from bsnmpmap.c to bsnmptools.h

It was used in bsnmpmap.c but was stored in bsnmptools.c; moving the extern
to the header allows us to cover all of our bases for the variable, and allows
_bsnmptools_debug to be used in the future elsewhere -- not just bsnmpmap.c.

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoWork around invalid gcc warning (explicit cast apparently lost).
jasone [Fri, 13 May 2016 21:18:10 +0000 (21:18 +0000)]
Work around invalid gcc warning (explicit cast apparently lost).

8 years agoRemove NO_WERROR from libbsnmp/Makefile.inc
ngie [Fri, 13 May 2016 21:17:49 +0000 (21:17 +0000)]
Remove NO_WERROR from libbsnmp/Makefile.inc

This has been compiling without warnings with clang/gcc for a while now

Tested with: clang 3.8.0, gcc 4.2.x, gcc 5.x
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoFix a bug in r298340: "sim" was referenced after being unset.
markj [Fri, 13 May 2016 20:54:54 +0000 (20:54 +0000)]
Fix a bug in r298340: "sim" was referenced after being unset.

8 years agoEliminate an unused #include. For a brief period of time, _unrhdr.h was
alc [Fri, 13 May 2016 20:14:41 +0000 (20:14 +0000)]
Eliminate an unused #include.  For a brief period of time, _unrhdr.h was
used to implement PCID support on amd64.

Reviewed by: kib

8 years agoUse awk to run bhnd's awk script, to allow noexec src dir
emaste [Fri, 13 May 2016 18:56:56 +0000 (18:56 +0000)]
Use awk to run bhnd's awk script, to allow noexec src dir

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

8 years agoFix FCP_CMD LENGTH mask in ATIO7 IOCB.
mav [Fri, 13 May 2016 18:55:03 +0000 (18:55 +0000)]
Fix FCP_CMD LENGTH mask in ATIO7 IOCB.

This caused "long IU length (16384) ignored" errors following by others.

MFC after: 2 weeks

8 years agoRemove sh accidentally added to dependency lines in r299684
emaste [Fri, 13 May 2016 18:54:48 +0000 (18:54 +0000)]
Remove sh accidentally added to dependency lines in r299684

Submitted by: Landon Fuller <landonf@landonf.org>

8 years ago[bwn] add N-PHY related register defintions.
adrian [Fri, 13 May 2016 18:41:36 +0000 (18:41 +0000)]
[bwn] add N-PHY related register defintions.

* Add the siba bus phy/mac/bandwidth clock definitions (TGSLOW*)
* Add the PHY-N register gateway (BWN_PHY_N())
* Add the PHY-N TX phystat1 register - we need to actually fill out
  more of the PHY encoding information when we assemble a frame.
* Various ancillary stuff

Nothing uses this yet, but I do have CCK/OFDM somewhat working
in 2GHz mode on a PHY-N device.

Obtained from: b43 (definitions)

8 years agoAdd support for Allwinner H3 SoC.
manu [Fri, 13 May 2016 18:20:54 +0000 (18:20 +0000)]
Add support for Allwinner H3 SoC.
For now clocks, GPIO, Pinmux, UART, MMC, EHCI is supported.
Tested on OrangePi-One

Reviewed by: jmcneill
Approved by: cognet (mentor)
Differential Revision: https://reviews.freebsd.org/D6311

8 years agoAnother attempt at resolving CID 1305629. The test of cmd == -1
truckman [Fri, 13 May 2016 17:48:04 +0000 (17:48 +0000)]
Another attempt at resolving CID 1305629.  The test of cmd == -1
may make Coverity think that other negative values of cmd (used
as an index) are possible.  Testing < 0 is a more common idiom
in any case.

Reported by: Coverity
CID: 1305629

8 years agoSupport libsoft for restage.
bdrewery [Fri, 13 May 2016 17:44:20 +0000 (17:44 +0000)]
Support libsoft for restage.

This is essentially fixing a merge conflict.

8 years agocxgbe(4): Update T5 and T4 firmwares to 1.15.37.0.
np [Fri, 13 May 2016 17:38:59 +0000 (17:38 +0000)]
cxgbe(4): Update T5 and T4 firmwares to 1.15.37.0.

These firmwares were obtained from the "Chelsio T5/T4 Unified Wire
v2.12.0.3 for Linux" release.  Changes since 1.14.4.0 (which is the
firmware in -STABLE branches) are in the "Release Notes" accompanying
the Unified Wire release and are copy-pasted here as well.

22.1. T5 Firmware
+++++++++++++++++++++++++++++++++

Version : 1.15.37.0
Date    : 04/27/2016
================================================================================

FIXES
-----

BASE:
 - Fixed an issue in FW_RSS_VI_CONFIG_CMD handling where the default ingress
   queue was ignored.
 - Fixed an issue where adapter failed to load fw by adjusting DRAM frequency.
 - Fixed an issue in watchdog which was causing VM bring-up failure after reboot.
 - Fixed 40G link failures with some switches when auto-negotiation enabled.
 - Fixed to improve on link bring-up time.
 - Per port buffer groups size doubled to improve performance.
 - Fixed an issue where bogus d3hot bits were set causing traffic stall.
 - Fixed an issue where sometimes adapter was not seen after reboot.
 - Fixed an issue where iWARP was crashing in conjunction with traffic management.
 - Fixed an issue where link failed to come up after removing twinax cable and
   inserting optical module.

ETH
 - Fixed a link flap issue on T580-CR.

OFLD
 - Fixed a potential iSCSI data corruption issue by disabling RxFragEn flag.

FOiSCSI
 - Fixed an issue in recovery path where connection was getting closed before
   recovery processing was done.
 - Fixed an issue in TCP port reuse.
 - Fixed an issue in recovery path when large number (>64) of iSCSI connections
   were in use.
 - Returned ENETUNREACH if IP was not been provisioned yet and driver tried to
   use given inerface.
 - Fixed an issue where fw was sending ENETUNREACH event for normal tcp
   disconnection.

DCBX
 - Fixed an issue where iscsi tlv is sent incorrectly to host. (DCBX CEE)
 - Fixed an issue where apply bit set for APP id was affecting the ETS and PFC
  settings.(DCBX IEEE)
 - Fixed an issue where app priority values are not handled correctly in fw.
  (DCBX IEEE)
 - Fixed an issue where enable/disable dcbx can cause crash. (DCBX CEE,DCBX IEEE)

FOFCoE
 - Removed BB6 support.

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

BASE:
 - Added new interface to program DCA settings in SGE contexts; allow 32-byte
   IQE size
 - Added PTP interface fw_ptp_ts to support PTP Frequeny and Offset adjustment.
 - Added MPS raw interface.

ETH:
 - New mailbox command FW_DCB_IEEE_CMD api added for IEEE dcbx.

OFLD:
 - WR opcode is returned to host in cqe error response.

22.2. T4 Firmware
+++++++++++++++++

Version : 1.15.37.0
Date    : 04/27/2016
================================================================================

FIXES
-----

BASE:
 - Fixed an issue in FW_RSS_VI_CONFIG_CMD handling where default ingress queue
   was ignored.
 - Fixed an issue in watchdog which was causing VM bring-up failure after reboot.
 - Per port buffer groups size doubled to improve performance.
 - Fixed an issue where iWARP was crashing in conjunction with traffic management.

FOiSCSI:
 - Fixed an issue in recovery path where connection was getting closed before
   recovery processing was done.
 - Fixed an issue in TCP port reuse.
 - Fixed an issue in recovery path when large number (>64) of iSCSI connections
   were in use.
 - Returned ENETUNREACH if IP had not been provisioned yet and driver tried to
   use given inerface.

DCBX
 - Fixed an issue where iscsi tlv is sent incorrectly to host.(DCBX CEE)
 - Fixed an issue where enable/disable dcbx can cause crash in firmware.(DCBX CEE)

FOiSCSI
 - Fixes an issue where fw was sending ENETUNREACH event for normal tcp
   disconnection.

FOFCoE
 - Removed BB6 support.

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

BASE:
 - Added MPS raw interface.

ETH:
 - New mailbox command FW_DCB_IEEE_CMD api added for IEEE dcbx.
================================================================================

Obtained from: Chelsio Communications
MFC after: 6 weeks
Relnotes: yes
Sponsored by: Chelsio Communications

8 years agoAfter r299241, which added bhnd(4), use sh to run the shell scripts for
dim [Fri, 13 May 2016 16:35:37 +0000 (16:35 +0000)]
After r299241, which added bhnd(4), use sh to run the shell scripts for
generating nvram maps, to allow a noexec-mounted source directory.

Reported by: Johan Hendriks <joh.hendriks@gmail.com>
PR: 209435

8 years agoAdd support to the arm64 busdma to handle the cache. For now this is
andrew [Fri, 13 May 2016 16:03:50 +0000 (16:03 +0000)]
Add support to the arm64 busdma to handle the cache. For now this is
disabled, however when we enable it it will default to assume memory is
not cache-coherent, unless either the tag was created or the parent was
marked as cache-coherent.

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

8 years agoi2c(8): uninitialized variable (UNINIT).
pfg [Fri, 13 May 2016 15:57:55 +0000 (15:57 +0000)]
i2c(8): uninitialized variable (UNINIT).

If i2c_opt.width is somehow zero, buf will be left uninitialized and may
cause trouble later on. This is a followup to r299586.

CID: 1331548

8 years agohunt_ev.c was deleted with r299596. Remove it from the files list to
bz [Fri, 13 May 2016 15:32:16 +0000 (15:32 +0000)]
hunt_ev.c was deleted with r299596.  Remove it from the files list to
(hopefully) unbreak amd64 LINT kernels.

MFC after: 1 week

8 years agoRemove the extra _RD as _RDTUN already includes it.
bz [Fri, 13 May 2016 15:29:40 +0000 (15:29 +0000)]
Remove the extra _RD as _RDTUN already includes it.

Submitted by: emaste
MFC after: 2 weeks

8 years agoAdd DMA sync operations around accessing the dwmmc descriptor ring. Even
andrew [Fri, 13 May 2016 15:15:54 +0000 (15:15 +0000)]
Add DMA sync operations around accessing the dwmmc descriptor ring. Even
with it maps as cache-coherent we still need to call bus_dmamap_sync.

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

8 years agoWe already turn the AMD erratum383 workaround on for certain VM_GUEST_VM
bz [Fri, 13 May 2016 15:11:17 +0000 (15:11 +0000)]
We already turn the AMD erratum383 workaround on for certain VM_GUEST_VM
if specific CPU features are not present.
Some simulation environments, e.g. gem5, have been found to require more
TLB management from the kernel in certain setups. It is currently unclear why.
Turning on the workaround_erratum383 seems to help and make problems (panics)
go away.
Given this is a fairly uncommon environment so far, allowing the workaround
to be manually enabled from loader in order to make debugging and comparing
traces easier, but also to allow gem5 run FreeBSD in X86 timing mode, seems
to be the least intrusive option for now until the issue if fully understood.

Sponsored by: DARPA/AFRL
Reviewed by: kib, alc (earlier)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6206

8 years agobhyve: consider the bogus case of a negative bar idx.
pfg [Fri, 13 May 2016 14:59:02 +0000 (14:59 +0000)]
bhyve: consider the bogus case of a negative bar idx.

This is a followup to r297472 to squelch Coverity.

CID: 1194319

8 years agobhyve: replace uninitialized variable "offset".
pfg [Fri, 13 May 2016 14:38:04 +0000 (14:38 +0000)]
bhyve: replace uninitialized variable "offset".

Use io->io_req.br_offset instead.

Suggested by: grehan
CID: 1288937

8 years agoHandle case of class being set, but not parent when calling
hselasky [Fri, 13 May 2016 13:01:02 +0000 (13:01 +0000)]
Handle case of class being set, but not parent when calling
device_register() in the LinuxKPI.

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

8 years agoAdd more PAGE related defines to the LinuxKPI. Move the definition of
hselasky [Fri, 13 May 2016 12:41:21 +0000 (12:41 +0000)]
Add more PAGE related defines to the LinuxKPI. Move the definition of
"pgprot_t" to "linux/page.h" similar to what Linux does.

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

8 years agoVersion update patch.
kadesai [Fri, 13 May 2016 12:24:39 +0000 (12:24 +0000)]
Version update patch.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   AVAGO Technologies

8 years agoFollowing bugs fixed as part of this patch:
kadesai [Fri, 13 May 2016 12:21:50 +0000 (12:21 +0000)]
Following bugs fixed as part of this patch:
.Kernel panic while collecting kdump (reported by Doug A.)
.NULL pointer dereference at sertain places
.Removed dead codes

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   AVAGO Technologies

8 years agoAdded supprot for Avago Intruder controller.
kadesai [Fri, 13 May 2016 12:18:12 +0000 (12:18 +0000)]
Added supprot for Avago Intruder controller.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   AVAGO Technologies

8 years agoImplemented interrupt Config Hook in mrsas(4) to defer some of the tasks, like:
kadesai [Fri, 13 May 2016 12:15:20 +0000 (12:15 +0000)]
Implemented interrupt Config Hook in mrsas(4) to defer some of the tasks, like:
riegistering AEN, creating cdev.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   AVAGO Technologies

8 years agoThis patch implements driver support for 1MB IO size.
kadesai [Fri, 13 May 2016 12:12:09 +0000 (12:12 +0000)]
This patch implements driver support for 1MB IO size.

NOTE:
The FreeBSD system currently restricts the MAX IO size to MAXPHYS which
in turn is 128KB. We tested the 1MB IO by converting the MAXPHYS to 1MB.

Following is the mail reference:
http://lists.freebsd.org/pipermail/freebsd-scsi/2015-January/006568.html

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   AVAGO Technologies

8 years agoSimilar to RAID map for Logical Drives, now JBOD map has been introduced for
kadesai [Fri, 13 May 2016 12:05:02 +0000 (12:05 +0000)]
Similar to RAID map for Logical Drives, now JBOD map has been introduced for
JBODs. Driver has to sync the JBOD map with firmware and use sequence number
as a reference for JBOD FastPath I/O's.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   AVAGO Technologies

8 years agoThere was no ERROR handling for firmware command TIMEOUT. This patch
kadesai [Fri, 13 May 2016 12:00:46 +0000 (12:00 +0000)]
There was no ERROR handling for firmware command TIMEOUT. This patch
takes care of any firmware command timeout scenarios by initiating OCR.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   AVAGO Technologies

8 years agoImplement "old_encode_dev()" for the LinuxKPI.
hselasky [Fri, 13 May 2016 11:51:43 +0000 (11:51 +0000)]
Implement "old_encode_dev()" for the LinuxKPI.

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

8 years agoDefine _IOC_SIZE() in the LinuxKPI.
hselasky [Fri, 13 May 2016 11:42:36 +0000 (11:42 +0000)]
Define _IOC_SIZE() in the LinuxKPI.

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

8 years agoAdd unlikely() statement to optimise the IS_ERR_VALUE() macro.
hselasky [Fri, 13 May 2016 11:30:56 +0000 (11:30 +0000)]
Add unlikely() statement to optimise the IS_ERR_VALUE() macro.

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

8 years agoFix a -Wformat warning by using %d, not %ld for md_iterations
ngie [Fri, 13 May 2016 11:27:49 +0000 (11:27 +0000)]
Fix a -Wformat warning by using %d, not %ld for md_iterations

md_iterations is int32_t, not long.

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

8 years agoAdd geliboot_crypt(..) definition to geliboot.h to mute a -Wimplicit-function-declaration
ngie [Fri, 13 May 2016 11:24:55 +0000 (11:24 +0000)]
Add geliboot_crypt(..) definition to geliboot.h to mute a -Wimplicit-function-declaration
warning

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

8 years agoPut slba and elba under LOADER_GELI_SUPPORT ifdef to mute warning about them being
ngie [Fri, 13 May 2016 11:20:21 +0000 (11:20 +0000)]
Put slba and elba under LOADER_GELI_SUPPORT ifdef to mute warning about them being
unused in the non-GELI case

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

8 years agoRemove unused const variable
ngie [Fri, 13 May 2016 11:18:29 +0000 (11:18 +0000)]
Remove unused const variable

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

8 years agoWhen using IOPORT with pci_host_generic we are missing setting the rman_end()
bz [Fri, 13 May 2016 11:18:27 +0000 (11:18 +0000)]
When using IOPORT with pci_host_generic we are missing setting the rman_end()
which leads to end being before start and thus a signed extended very large
number of size later on, which kva_alloc() will fail upon and we will panic.
Add the missing call.

Debugged with: andrew
Reviewed by: br, andrew
Sponsored by: DARPA/AFRL
Found: while using virtio with gem5
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6337

8 years agoInclude arpa/inet.h to get the htonl(3) definition
ngie [Fri, 13 May 2016 11:15:33 +0000 (11:15 +0000)]
Include arpa/inet.h to get the htonl(3) definition

MFC after: 2 weeks
Reported by: clang
Sponsored by: EMC / Isilon Storage Division

8 years agoImplement nsecs_to_jiffies() in the LinuxKPI and while at it
hselasky [Fri, 13 May 2016 11:02:02 +0000 (11:02 +0000)]
Implement nsecs_to_jiffies() in the LinuxKPI and while at it
streamline the rest of the xxx_to_jiffies() functions to have a
constant 64-bit argument and use identical range checks for the
result.

Specifically preserve msecs_to_jiffies(0) returning 0. See r282743 for
further details.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd missing prototype for getchar(..)
ngie [Fri, 13 May 2016 10:59:46 +0000 (10:59 +0000)]
Add missing prototype for getchar(..)

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

8 years agoRead the contents of the snapshot files properly
ngie [Fri, 13 May 2016 10:52:02 +0000 (10:52 +0000)]
Read the contents of the snapshot files properly

- Use fgetln instead of fgets; localize complexity related to fgetln(3)
  inside the loop.
- Skip over blank lines.
- Skip over lines (properly) that start with a "#"

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

8 years agoAdd more Linux defines. Improve some existing ones.
hselasky [Fri, 13 May 2016 10:10:43 +0000 (10:10 +0000)]
Add more Linux defines. Improve some existing ones.

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

8 years agoThe Linux error defines should all be positive, else frequently used
hselasky [Fri, 13 May 2016 09:21:22 +0000 (09:21 +0000)]
The Linux error defines should all be positive, else frequently used
error code checks might fail. ERESTART is in the BSD world defined as
-1. While at it add more Linux error codes.

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

8 years agoFix a bug introduced by the implementation of I-DATA support.
tuexen [Fri, 13 May 2016 09:11:41 +0000 (09:11 +0000)]
Fix a bug introduced by the implementation of I-DATA support.
There was the requirement that two structures are in sync,
which is not valid anymore. Therefore don't rely on this
in the code anymore.
Thanks to Radek Malcic for reporting the issue. He found this
when using the userland stack.

MFC after: 1 week

8 years agosfxge(4): rename falconsiena_filter_*
arybchik [Fri, 13 May 2016 07:17:38 +0000 (07:17 +0000)]
sfxge(4): rename falconsiena_filter_*

Falcon support has been removed, so this code only supports Siena.

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

8 years agosfxge(4): rename falconsiena_tx_*
arybchik [Fri, 13 May 2016 07:16:29 +0000 (07:16 +0000)]
sfxge(4): rename falconsiena_tx_*

Falcon support has been removed, so this code only supports Siena.

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

8 years agosfxge(4): rename falconsiena_rx_*
arybchik [Fri, 13 May 2016 07:15:51 +0000 (07:15 +0000)]
sfxge(4): rename falconsiena_rx_*

Falcon support has been removed, so this code only supports Siena.

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

8 years agosfxge(4): rename falconsiena_mac_*
arybchik [Fri, 13 May 2016 07:15:02 +0000 (07:15 +0000)]
sfxge(4): rename falconsiena_mac_*

Falcon support has been removed, so this code only supports Siena.

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

8 years agosfxge(4): rename falconsiena_intr_*
arybchik [Fri, 13 May 2016 07:12:14 +0000 (07:12 +0000)]
sfxge(4): rename falconsiena_intr_*

falcon support has been removed, so this code only supports Siena.

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

8 years agosfxge(4): rename falconsiena_ev_*
arybchik [Fri, 13 May 2016 07:11:36 +0000 (07:11 +0000)]
sfxge(4): rename falconsiena_ev_*

Falcon support has been removed, so this code only supports Siena.

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

8 years agosfxge(4): move ef10_vpd_* to ef10_vpd.c
arybchik [Fri, 13 May 2016 07:10:07 +0000 (07:10 +0000)]
sfxge(4): move ef10_vpd_* to ef10_vpd.c

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

8 years agosfxge(4): move ef10_tx_* to ef10_tx.c
arybchik [Fri, 13 May 2016 07:08:33 +0000 (07:08 +0000)]
sfxge(4): move ef10_tx_* to ef10_tx.c

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

8 years agosfxge(4): move ef10_rx_* to ef10_rx.c
arybchik [Fri, 13 May 2016 07:06:57 +0000 (07:06 +0000)]
sfxge(4): move ef10_rx_* to ef10_rx.c

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

8 years agosfxge(4): move ef10_phy_* to ef10_phy.c
arybchik [Fri, 13 May 2016 07:05:40 +0000 (07:05 +0000)]
sfxge(4): move ef10_phy_* to ef10_phy.c

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

8 years agosfxge(4): move ef10_nvram_* to ef10_nvram.c
arybchik [Fri, 13 May 2016 07:04:28 +0000 (07:04 +0000)]
sfxge(4): move ef10_nvram_* to ef10_nvram.c

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

8 years agosfxge(4): move ef10_nic_* to ef10_nic.c
arybchik [Fri, 13 May 2016 07:03:04 +0000 (07:03 +0000)]
sfxge(4): move ef10_nic_* to ef10_nic.c

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

8 years agosfxge(4): move ef10_mcdi_* to ef10_mcdi.c
arybchik [Fri, 13 May 2016 07:00:46 +0000 (07:00 +0000)]
sfxge(4): move ef10_mcdi_* to ef10_mcdi.c

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

8 years agosfxge(4): move ef10_mac_* to ef10_mac.c
arybchik [Fri, 13 May 2016 06:59:20 +0000 (06:59 +0000)]
sfxge(4): move ef10_mac_* to ef10_mac.c

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

8 years agosfxge(4): move ef10_intr_* to ef10_intr.c
arybchik [Fri, 13 May 2016 06:58:20 +0000 (06:58 +0000)]
sfxge(4): move ef10_intr_* to ef10_intr.c

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

8 years agosfxge(4): move ef10_filter_* to ef10_filter.c
arybchik [Fri, 13 May 2016 06:57:08 +0000 (06:57 +0000)]
sfxge(4): move ef10_filter_* to ef10_filter.c

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

8 years agosfxge(4): move ef10_ev_* to ef10_ev.c
arybchik [Fri, 13 May 2016 06:54:18 +0000 (06:54 +0000)]
sfxge(4): move ef10_ev_* to ef10_ev.c

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

8 years agosfxge(4): comment on when we assume multicast chaining is available
arybchik [Fri, 13 May 2016 06:47:47 +0000 (06:47 +0000)]
sfxge(4): comment on when we assume multicast chaining is available

It's the same on Medford as Huntington.

Multicast chaining is not always on, even with Medford, as it's not
supported by low latency firmware.

Unlike the Linux driver, we don't need to support virtulization with
firmware released before support for multicast chaining was added.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6319

8 years agosfxge(4): avoid duplicate delivery of packets when changing multicast mode with multi...
arybchik [Fri, 13 May 2016 06:47:07 +0000 (06:47 +0000)]
sfxge(4): avoid duplicate delivery of packets when changing multicast mode with multicast chaining enabled

With multicast chaining, if e.g. a specific multicast filter is
inserted and the multicast mis-match filter is then inserted, both may
match a packet and cause it to be delivered.

Copy the behaviour of the Linux driver, which is to remove the old filters
first, on the basis that customers are more likely to be able to handle
drops than duplicates (see bug49178 comment 4).

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6331

8 years agoProperly compute the size argument to pass to malloc().
truckman [Fri, 13 May 2016 06:45:16 +0000 (06:45 +0000)]
Properly compute the size argument to pass to malloc().

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

8 years agoMove a call to cam_freeccb() to avoid a use after free error and
truckman [Fri, 13 May 2016 06:26:42 +0000 (06:26 +0000)]
Move a call to cam_freeccb() to avoid a use after free error and
a later double free.

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

8 years agoAlways return either a dynamically allocated string or NULL from
truckman [Fri, 13 May 2016 06:15:05 +0000 (06:15 +0000)]
Always return either a dynamically allocated string or NULL from
expand().  Never return the name parameter, which could be a the buf[]
buffer which is allocated on the stack by getdeadletter() and which
would then be used after getdeadletter() has returned.

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

8 years agoDon't jam the softc in the device_probe routine. The softc isn't owned by
scottl [Fri, 13 May 2016 05:57:21 +0000 (05:57 +0000)]
Don't jam the softc in the device_probe routine.  The softc isn't owned by
the driver here, so it shouldn't be accessed, let alone written to.  Remove
the nearby debug line, it's the only thing that depended on the softc, and
it depended on it in a way that couldn't work in this part of the code.

This fixes some reports of use-after-free and system instability with
DEBUG_MEMGUARD enabled.

Submitted by: Matthew Macy
MFC after: 3 days

8 years agoInstead of ignoring the EEXIST from link(), unconditionally unlink
truckman [Fri, 13 May 2016 05:49:02 +0000 (05:49 +0000)]
Instead of ignoring the EEXIST from link(), unconditionally unlink
the terget before calling link().  This should prevent links to an
old copy of the file from being retained.

8 years agoRevert r299584:
truckman [Fri, 13 May 2016 05:39:29 +0000 (05:39 +0000)]
Revert r299584:
  Mark usage() as __dead2 so that Coverity doesn't think that execution
  continues after the call and uses a negative array subscript.

Requested by: bde

8 years agoUpdate jemalloc to 4.2.0.
jasone [Fri, 13 May 2016 04:03:20 +0000 (04:03 +0000)]
Update jemalloc to 4.2.0.

8 years agoi2c(8): uninitialized variable (UNINIT).
pfg [Fri, 13 May 2016 02:58:11 +0000 (02:58 +0000)]
i2c(8): uninitialized variable (UNINIT).

If i2c_opt.width is somehow zero, the bufsize will be left uninitialized
and make cause trouble later on.

CID: 1331549

8 years agoDeclare line[] in the outermost scope of retrieve() instead of
truckman [Fri, 13 May 2016 01:52:41 +0000 (01:52 +0000)]
Declare line[] in the outermost scope of retrieve() instead of
declaring it in an inner scope and then using it via a pointer
in the outer scope.

Reported by:    Coverity
CID:            605895

8 years agoMark usage() as __dead2 so that Coverity doesn't think that execution
truckman [Fri, 13 May 2016 01:14:38 +0000 (01:14 +0000)]
Mark usage() as __dead2 so that Coverity doesn't think that execution
continues after the call and uses a negative array subscript.

Reported by: Coverity
CID: 1305629

8 years agoAvoid indexing an array with a negative value.
truckman [Fri, 13 May 2016 00:58:05 +0000 (00:58 +0000)]
Avoid indexing an array with a negative value.

Reported by: Coverity
CID: 971121

8 years agoSimplify some overly complex code so that both humans and Coverity
truckman [Fri, 13 May 2016 00:50:53 +0000 (00:50 +0000)]
Simplify some overly complex code so that both humans and Coverity
have a better chance of understanding it.

Reported by: Coverity
CID: 10096841006931

8 years agoUse strlcpy() instead of strncpy() to ensure that qf->fsname is NUL
truckman [Fri, 13 May 2016 00:26:14 +0000 (00:26 +0000)]
Use strlcpy() instead of strncpy() to ensure that qf->fsname is NUL
terminated.  Don't bother checking for truncation since the subsequent
stat() call should detect that and fail.

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

8 years agoUse strlcpy() instead of strncpy() to ensure that ret->name is
truckman [Fri, 13 May 2016 00:17:57 +0000 (00:17 +0000)]
Use strlcpy() instead of strncpy() to ensure that ret->name is
NUL terminated.  The source and destination buffers are the same
size and the source *should* be NUL terminated, but be paranoid.

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

8 years agoUse strlcpy() instead of strncpy() to ensure that qup->fsname is NUL
truckman [Fri, 13 May 2016 00:02:03 +0000 (00:02 +0000)]
Use strlcpy() instead of strncpy() to ensure that qup->fsname is NUL
terminated.  Don't bother checking for truncation since the subsequent
quota_read() should detect that and fail.

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

8 years agoIf fchdir() fails, call err() instead of warn().
truckman [Thu, 12 May 2016 23:37:58 +0000 (23:37 +0000)]
If fchdir() fails, call err() instead of warn().

8 years agoAvoid Coverity NUL termination warning about strncpy() by using
truckman [Thu, 12 May 2016 23:14:31 +0000 (23:14 +0000)]
Avoid Coverity NUL termination warning about strncpy() by using
memcpy() instead.  It's probably a bit more optimal in this case
anyway. [1]

The program logic leading up to the creation of the strncpy/memcpy
destination buffer is a bit hairy.  Add a call to assert() to make
it clear what is happening here and detect any potential buffer
overruns in the future.

Check a couple syscall error returns.  Ignore the EEXIST error from
link() to preserve existing behavior. [2] [3]

Reported by: Coverity
CID: 1009659 [1], 1009349 [2], 1009350 [3]

8 years agoFix broken cpio behavior.
mm [Thu, 12 May 2016 22:51:04 +0000 (22:51 +0000)]
Fix broken cpio behavior.
Suggested upstream as PR #704.

MFC: 1 month (together with libarchive 3.2.0)

8 years agonet80211: drop some unused variables / local macros
avos [Thu, 12 May 2016 22:17:00 +0000 (22:17 +0000)]
net80211: drop some unused variables / local macros

Most of them left after some commits (r178354, r191544, r287197 etc.);
some were never used.

Found by: Clang Static Analyzer

8 years agostdio.h: Fix function-type typedef style and use _types.h __ssize_t
cem [Thu, 12 May 2016 22:13:12 +0000 (22:13 +0000)]
stdio.h: Fix function-type typedef style and use _types.h __ssize_t

I'm still not sure why only Pypy runs into the error with the function
typedefs.  Fix it anyway.

Use __ssize_t instead of ssize_t for the types; it's possible for the size_t
type to not be visible if at the wrong POSIX_VISIBLE level.

A final (crossing my fingers) follow-up to r299456.

Sponsored by: EMC / Isilon Storage Division

8 years agoUse strlcpy() instead of strncpy() when copying to dom_domain to
truckman [Thu, 12 May 2016 21:35:40 +0000 (21:35 +0000)]
Use strlcpy() instead of strncpy() when copying to dom_domain to
ensure that the latter is NUL terminated since it is passed
as an argument to *printf().

Warn about NIS domains that are too long.

Reported by: Coverity
CID: 10096201009621
MFH: 1 week

8 years agolibc: Actually export fopencookie(3)
cem [Thu, 12 May 2016 21:30:22 +0000 (21:30 +0000)]
libc: Actually export fopencookie(3)

A follow-up to r299456.

Sponsored by: EMC / Isilon Storage Division

8 years agoPollute more places with off64_t and add __off64_t
cem [Thu, 12 May 2016 21:18:17 +0000 (21:18 +0000)]
Pollute more places with off64_t and add __off64_t

Despite the private namespace, several broken ports depend on the __off64_t
name for the type.  Export it exactly the same way off_t and __off_t are
exported.

A follow-up to r299456.

Suggested by: php56
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd loadable module for gpiokeys
gonzo [Thu, 12 May 2016 20:20:54 +0000 (20:20 +0000)]
Add loadable module for gpiokeys

8 years agoFix detach routine for gpiokeys
gonzo [Thu, 12 May 2016 20:15:23 +0000 (20:15 +0000)]
Fix detach routine for gpiokeys

- Release pin only when all per=key callouts are stopped
- Unregister keyboard when detaching device node

8 years agoProperly release mapped pin in gpio_pin_release
gonzo [Thu, 12 May 2016 20:13:16 +0000 (20:13 +0000)]
Properly release mapped pin in gpio_pin_release

8 years agoAdd gpiobus_release_pin function to release mapped pin
gonzo [Thu, 12 May 2016 20:12:45 +0000 (20:12 +0000)]
Add gpiobus_release_pin function to release mapped pin

Add gpiobus_release_pin as a counterpart for gpiobus_map_pin. Without it
it's impossible to properly release pin so if kernel module is reloaded
it can't re-use pins again

8 years agoAdd myself to the list of src committers. I've never been added it
n_hibma [Thu, 12 May 2016 20:04:09 +0000 (20:04 +0000)]
Add myself to the list of src committers. I've never been added it
seems.

8 years agoAllow silencing of 'promiscuous mode enabled/disabled' messages.
n_hibma [Thu, 12 May 2016 19:42:13 +0000 (19:42 +0000)]
Allow silencing of 'promiscuous mode enabled/disabled' messages.

PR: 166255
Submitted by: eugen.grosbein.net
Obtained from: eugen.grosbein.net
MFC after: 1 week