]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoUse cross-NM (XNM) in compat32 build
emaste [Fri, 27 Jan 2017 03:43:18 +0000 (03:43 +0000)]
Use cross-NM (XNM) in compat32 build

An attempt to build mips64 using external toolchain failed as it tried
to use the host amd64 nm.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoRename LLD_AS_LD to LLD_IS_LD, for consistency with CLANG_IS_CC
emaste [Fri, 27 Jan 2017 01:59:12 +0000 (01:59 +0000)]
Rename LLD_AS_LD to LLD_IS_LD, for consistency with CLANG_IS_CC

Reported by: Dan McGregor <dan.mcgregor usask.ca>

7 years ago[net80211] prepare configuration checks for VHT, fragment-offload and seqno-offload.
adrian [Fri, 27 Jan 2017 01:24:24 +0000 (01:24 +0000)]
[net80211] prepare configuration checks for VHT, fragment-offload and seqno-offload.

* allocate an ext bit for fragment offload.  Some NICs (like the ath10k
  hardware in native wifi or 802.3 mode) support doing packet fragmentation
  in firmware/hardware, so we don't have to do it here.

* allocate an ext bit for VHT and start using it.

7 years ago[ath] fix "doing stuff before wakeup" warning; add comments for ACK/CTS handling...
adrian [Fri, 27 Jan 2017 01:17:00 +0000 (01:17 +0000)]
[ath] fix "doing stuff before wakeup" warning; add comments for ACK/CTS handling during DFS/PASSIVE channels

* Although the hardware is awake, the power state handling doesn't think so.
  So just explicitly wake it up early in setup so ath_hal calls don't complain.

* We shouldn't be transmitting or ACKing frames during DFS CAC or on passive
  channels before we hear a beacon.  So, start laying down comments in the
  places where this work has to be done.

Note:

* The main bit missing from finishing this particular bit of work is a state
  call to transition a VAP from passive to non-passive when a beacon is heard.
  CAC is easy, it's an interface state.  So, I'll go and add a method to control
  that soon.

7 years agoFix libcam build. It was broken with r312827.
jkim [Fri, 27 Jan 2017 00:17:07 +0000 (00:17 +0000)]
Fix libcam build.  It was broken with r312827.

7 years agoRemove 'options NO_SWAPPING' from ERL configuration file
lidl [Thu, 26 Jan 2017 20:45:04 +0000 (20:45 +0000)]
Remove 'options NO_SWAPPING' from ERL configuration file

7 years agoPull in r278160 from upstream llvm trunk (by Wei Mi):
dim [Thu, 26 Jan 2017 20:39:43 +0000 (20:39 +0000)]
Pull in r278160 from upstream llvm trunk (by Wei Mi):

  Recommit "Use ValueOffsetPair to enhance value reuse during SCEV
  expansion".

  The fix for PR28705 will be committed consecutively.

  In D12090, the ExprValueMap was added to reuse existing value during
  SCEV expansion. However, const folding and sext/zext distribution can
  make the reuse still difficult.

  A simplified case is: suppose we know S1 expands to V1 in
  ExprValueMap, and
    S1 = S2 + C_a
    S3 = S2 + C_b
  where C_a and C_b are different SCEVConstants. Then we'd like to
  expand S3 as V1 - C_a + C_b instead of expanding S2 literally. It is
  helpful when S2 is a complex SCEV expr and S2 has no entry in
  ExprValueMap, which is usually caused by the fact that S3 is
  generated from S1 after const folding.

  In order to do that, we represent ExprValueMap as a mapping from SCEV
  to ValueOffsetPair. We will save both S1->{V1, 0} and S2->{V1, C_a}
  into the ExprValueMap when we create SCEV for V1. When S3 is
  expanded, it will first expand S2 to V1 - C_a because of S2->{V1,
  C_a} in the map, then expand S3 to V1 - C_a + C_b.

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

Pull in r278161 from upstream llvm trunk (by Wei Mi):

  Fix the runtime error caused by "Use ValueOffsetPair to enhance value
  reuse during SCEV expansion".

  The patch is to fix the bug in PR28705. It was caused by setting
  wrong return value for SCEVExpander::findExistingExpansion. The
  return values of findExistingExpansion have different meanings when
  the function is used in different ways so it is easy to make mistake.
  The fix creates two new interfaces to replace
  SCEVExpander::findExistingExpansion, and specifies where each
  interface is expected to be used.

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

Pull in r281439 from upstream llvm trunk (by Wei Mi):

  Create a getelementptr instead of sub expr for ValueOffsetPair if the
  value is a pointer.

  This patch is to fix PR30213. When expanding an expr based on
  ValueOffsetPair, if the value is of pointer type, we can only create
  a getelementptr instead of sub expr.

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

This should fix assertion failures when building OpenCV >= 3.1, and also
allow building lang/spidermonkey24 without any further assertions.

PR: 215649
MFC after: 1 week

7 years agoRevert r312765 for now, since it causes assertions when building
dim [Thu, 26 Jan 2017 20:18:28 +0000 (20:18 +0000)]
Revert r312765 for now, since it causes assertions when building
lang/spidermonkey24.

Reported by: antoine
PR: 215649

7 years agoFix a development mis-merge from r312827
scottl [Thu, 26 Jan 2017 20:18:03 +0000 (20:18 +0000)]
Fix a development mis-merge from r312827

Sponsored by: Netflix

7 years agoRefactor xpt_print_path, xpt_print, and xpt_path_string. Implement
scottl [Thu, 26 Jan 2017 20:08:58 +0000 (20:08 +0000)]
Refactor xpt_print_path, xpt_print, and xpt_path_string.  Implement
all of them in terms of an sbuf-based back-end, xpt_path_sbuf.  This
unifies the implementation, but more importantly it stops the output
fropm being split between 4 or more invocations of printf.  The
multiple invocations cause interleaving of the messages on the
console during boot, making the output of disk discovery often
unintelligible.  This change helps a lot, but more work is needed.

Reviewed by: ken, mav
Sponsored by: Netflix

7 years agoMerge OpenSSL 1.0.2k.
jkim [Thu, 26 Jan 2017 19:10:29 +0000 (19:10 +0000)]
Merge OpenSSL 1.0.2k.

7 years agoEnable modules in the MIPS ERL kernel config
emaste [Thu, 26 Jan 2017 18:18:35 +0000 (18:18 +0000)]
Enable modules in the MIPS ERL kernel config

As reported by cperciva[1], modules are beneficial for typical
Edgerouter Lite use cases.

[1] http://www.daemonology.net/blog/2016-01-10-FreeBSD-EdgeRouter-Lite.html

7 years agomips: exclude modules that fail to build
emaste [Thu, 26 Jan 2017 18:05:31 +0000 (18:05 +0000)]
mips: exclude modules that fail to build

7 years agoDisconnect netfpga10g module from the build
emaste [Thu, 26 Jan 2017 17:59:54 +0000 (17:59 +0000)]
Disconnect netfpga10g module from the build

It only builds with the non-default DEVICE_POLLING option.

Approved by: bz

7 years agoCorrect grammar.
obrien [Thu, 26 Jan 2017 16:36:12 +0000 (16:36 +0000)]
Correct grammar.

7 years agoMinor style annoyance.
sbruno [Thu, 26 Jan 2017 13:50:09 +0000 (13:50 +0000)]
Minor style annoyance.

Submitted by: bde

7 years agoA few more style bugs lying around in here.
sbruno [Thu, 26 Jan 2017 13:48:45 +0000 (13:48 +0000)]
A few more style bugs lying around in here.

Submitted by: bde

7 years agoShoot a couple of style bugs down in the macro declarations.
sbruno [Thu, 26 Jan 2017 13:46:47 +0000 (13:46 +0000)]
Shoot a couple of style bugs down in the macro declarations.

Submitted by: bde

7 years agoMake fdt_pm_mask_table internal to the Marvell code, it's unued anywhere
andrew [Thu, 26 Jan 2017 13:04:14 +0000 (13:04 +0000)]
Make fdt_pm_mask_table internal to the Marvell code, it's unued anywhere
else.

Sponsored by: ABT Systems Ltd

7 years agoAdd dummy functions for Marvell SoC's not equipped with AHCI
wma [Thu, 26 Jan 2017 11:14:23 +0000 (11:14 +0000)]
Add dummy functions for Marvell SoC's not equipped with AHCI

Commit r312747 ("Setup decoding windows for ARMADA38X") resulted
in build failing for Marvell platforms, which don't have AHCI controller.
This patch provides a fix by adding dummy functions for such cases.

On the occasion rename register dump routine to decode_win_ahci_dump,
in order to avoid confusion.

Submitted by:          Marcin Wojtas <mw@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield

7 years agoUpdate the mentor/mentee relationships to add myself.
rezny [Thu, 26 Jan 2017 07:07:09 +0000 (07:07 +0000)]
Update the mentor/mentee relationships to add myself.

Reviewed by: swills
Approved by: swills (mentor)
Differential Revision: https://reviews.freebsd.org/D9343

7 years agoFurther cleanup of per-CPU armv6 pmap data:
jah [Thu, 26 Jan 2017 05:23:33 +0000 (05:23 +0000)]
Further cleanup of per-CPU armv6 pmap data:

- Replace pcpu_find(curcpu) with get_pcpu(), which is much
  more direct.

- Remove armv4 pcpu fields which I added in r286296 but never
  needed to use.

- armv6 pc_qmap_addr was leftover from the old armv6 pmap
  implementation.  Rename it and put it to use in the new one.

Noted by: skra
Reviewed by: skra
MFC after:  1 week
Differential Revision: https://reviews.freebsd.org/D9312

7 years agoUse normal KNF cuddling of elses.
cy [Thu, 26 Jan 2017 04:51:48 +0000 (04:51 +0000)]
Use normal KNF cuddling of elses.

Reported by: bde
MFC after: 2 weeks
X-MFC with: r312777

7 years agoCurrently the fragment info is placed at the top of the linked list
cy [Thu, 26 Jan 2017 01:24:05 +0000 (01:24 +0000)]
Currently the fragment info is placed at the top of the linked list
under a shared read lock. This patch attempts to upgrade the lock to
an exclusive write lock. If the exclusive write lock fails to be
obtained, the current fragment is not placed at the head of the list.

This portion of the patch was inspired by NetBSD ip_frag.c r1.4 (which
effectively removed the section of code that performed the reordering).

The patch to sys/contrib/ipfilter/netinet/ip_compat.h adds the
MUTEX_TRY_UPGRADE macro to support the patch to ip_frag.c.

The patch to contrib/ipfilter/lib/rwlock_emul.c supports this patch
by emulating the mutex in userspace when exercised by ipftest(1).

Inspired by: NetBSD ip_frag.c r1.4
MFC after: 1 month

7 years agoImplement RSS queue tagging for em(4) class devices from a copy and massage
sbruno [Wed, 25 Jan 2017 23:12:03 +0000 (23:12 +0000)]
Implement RSS queue tagging for em(4) class devices from a copy and massage
of functions from igb(4).  This enables 2 queue routing on 82574L class
devices again.

7 years agoBring the ctl headers a bit closer to style(9). No functional changes.
trasz [Wed, 25 Jan 2017 22:52:57 +0000 (22:52 +0000)]
Bring the ctl headers a bit closer to style(9).  No functional changes.

7 years agoFor non-listening AF_UNIX sockets return error code EOPNOTSUPP to match
glebius [Wed, 25 Jan 2017 22:26:45 +0000 (22:26 +0000)]
For non-listening AF_UNIX sockets return error code EOPNOTSUPP to match
documentation and SUS.

7 years agobridge: Release the bridge lock when calling bridge_set_ifcap()
kp [Wed, 25 Jan 2017 21:25:26 +0000 (21:25 +0000)]
bridge: Release the bridge lock when calling bridge_set_ifcap()

This calls ioctl() handlers for the different interfaces in the bridge.
These handlers expect to get called in an ioctl context where it's safe
for them to sleep. We may not sleep with the bridge lock held.

However, we still need to protect the interface list, to ensure it
doesn't get changed while we iterate over it.
Use BRIDGE_XLOCK(), which prevents bridge members from being removed.
Adding bridge members is safe, because it uses LIST_INSERT_HEAD().

This caused panics when adding xen interfaces to a bridge.

PR: 216304
Reviewed by: ae
MFC after: 1 week
Sponsored by: RootBSD
Differential Revision: https://reviews.freebsd.org/D9290

7 years agoRemove extraneous blank line.
cy [Wed, 25 Jan 2017 20:59:23 +0000 (20:59 +0000)]
Remove extraneous blank line.

MFC after: 2 weeks
X-MFC with: r312777

7 years agostrings: avoid unnecessary trip through handle_file for stdin
emaste [Wed, 25 Jan 2017 20:59:06 +0000 (20:59 +0000)]
strings: avoid unnecessary trip through handle_file for stdin

Sponsored by: The FreeBSD Foundation

7 years agoIssue an error message when an incorrect flush argument is
cy [Wed, 25 Jan 2017 20:41:16 +0000 (20:41 +0000)]
Issue an error message when an incorrect flush argument is
encountered.`

MFC after: 2 weeks

7 years agoANSIfy kern_ntptime.c
emaste [Wed, 25 Jan 2017 20:22:32 +0000 (20:22 +0000)]
ANSIfy kern_ntptime.c

7 years agolibthr: coalesce repeated #if blocks
emaste [Wed, 25 Jan 2017 20:19:48 +0000 (20:19 +0000)]
libthr: coalesce repeated #if blocks

7 years agoAfter the in_control() changes in r257692, an existing address is
loos [Wed, 25 Jan 2017 19:04:08 +0000 (19:04 +0000)]
After the in_control() changes in r257692, an existing address is
(intentionally) deleted first and then completely added again (so all the
events, announces and hooks are given a chance to run).

This cause an issue with CARP where the existing CARP data structure is
removed together with the last address for a given VHID, which will cause
a subsequent fail when the address is later re-added.

This change fixes this issue by adding a new flag to keep the CARP data
structure when an address is not being removed.

There was an additional issue with IPv6 CARP addresses, where the CARP data
structure would never be removed after a change and lead to VHIDs which
cannot be destroyed.

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

7 years agoPartially workaround ASMedia HBA error recovery.
mav [Wed, 25 Jan 2017 18:16:17 +0000 (18:16 +0000)]
Partially workaround ASMedia HBA error recovery.

Taking closer look on my ASM1062 I found that it has bunch of issues around
error recovery: reported wrong CCS, failed commands reported as completed,
READ LOG EXT times out after NCQ error.  This patch workarounds first two
problems, that were making ATAPI devices close to unusable on these HBAs.

MFC after: 2 weeks

7 years agoPull in r276136 from upstream llvm trunk (by Wei Mi):
dim [Wed, 25 Jan 2017 17:59:22 +0000 (17:59 +0000)]
Pull in r276136 from upstream llvm trunk (by Wei Mi):

  Use ValueOffsetPair to enhance value reuse during SCEV expansion.

  In D12090, the ExprValueMap was added to reuse existing value during
  SCEV expansion. However, const folding and sext/zext distribution can
  make the reuse still difficult.

  A simplified case is: suppose we know S1 expands to V1 in
  ExprValueMap, and
    S1 = S2 + C_a
    S3 = S2 + C_b
  where C_a and C_b are different SCEVConstants. Then we'd like to
  expand S3 as V1 - C_a + C_b instead of expanding S2 literally. It is
  helpful when S2 is a complex SCEV expr and S2 has no entry in
  ExprValueMap, which is usually caused by the fact that S3 is
  generated from S1 after const folding.

  In order to do that, we represent ExprValueMap as a mapping from SCEV
  to ValueOffsetPair. We will save both S1->{V1, 0} and S2->{V1, C_a}
  into the ExprValueMap when we create SCEV for V1. When S3 is
  expanded, it will first expand S2 to V1 - C_a because of S2->{V1,
  C_a} in the map, then expand S3 to V1 - C_a + C_b.

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

This should fix assertion failures when building OpenCV >= 3.1.

PR: 215649
MFC after: 3 days

7 years agoPull the R_AARCH64_TLSDESC code out into a common function and use them in
andrew [Wed, 25 Jan 2017 17:35:11 +0000 (17:35 +0000)]
Pull the R_AARCH64_TLSDESC code out into a common function and use them in
both the plt and non-plt case.

This fixes an issue where libraries built with LLD can fail with
"Unhandled relocation 1031"

PR: 214971
Obtained from: 1 week
Sponsored by: DARPA, AFRL

7 years agoFix initialization of "p" after r312658.
markj [Wed, 25 Jan 2017 16:35:57 +0000 (16:35 +0000)]
Fix initialization of "p" after r312658.

CID: 1369410

7 years agoReplace overlooked smp_started checks and variable use in a print
sbruno [Wed, 25 Jan 2017 15:54:44 +0000 (15:54 +0000)]
Replace overlooked smp_started checks and variable use in a print
with the now used tqg_smp_started.

Submitted by: bde

7 years agoResolve a non-fatal syntax warning left in by a trailing ;
sbruno [Wed, 25 Jan 2017 15:52:03 +0000 (15:52 +0000)]
Resolve a non-fatal syntax warning left in by a trailing ;

Submitted by: bde

7 years agoAdd sys/capability.h deprecation warning
emaste [Wed, 25 Jan 2017 15:42:29 +0000 (15:42 +0000)]
Add sys/capability.h deprecation warning

In r263232 sys/capability.h was renamed to sys/capsicum.h, to avoid
conflicts with a capability.h header found on other operating systems.

Sponsored by: The FreeBSD Foundation

7 years agoAdd error checking to the pci_find_cap(, PCIY_MSIX,) call that is returns
sbruno [Wed, 25 Jan 2017 14:37:05 +0000 (14:37 +0000)]
Add error checking to the pci_find_cap(, PCIY_MSIX,) call that is returns
success and a good value.  Only then try to use it and set the MSIX_ENABLE
bit.

With the current em(4) driver we have observed failures in this case in a
specific environment when pci_find_cap() would not return the assumed
value, which meant we ended up writing to PCI register 2 (PCI_DEVICE_ID)
which is read-only.

PR: 216456
Submitted by: bz

7 years agoExtend AHCI_Q_BIT_STRING after adding new quirk for soft
wma [Wed, 25 Jan 2017 12:18:21 +0000 (12:18 +0000)]
Extend AHCI_Q_BIT_STRING after adding new quirk for soft
 reset delay

Adding new quirk (AHCI_Q_MRVL_SR_DEL) requires according extention
of AHCI_Q_BIT_STRING.

Submitted by:  Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Stormshield
Reviewed by:   wma

7 years agoAdd Timeout and Protect mode page description from MMC-6.
mav [Wed, 25 Jan 2017 11:47:16 +0000 (11:47 +0000)]
Add Timeout and Protect mode page description from MMC-6.

MFC after: 2 weeks

7 years agoAdd support for AHCI on ARMADA38X
wma [Wed, 25 Jan 2017 10:34:37 +0000 (10:34 +0000)]
Add support for AHCI on ARMADA38X

This file provides support for AHCI mode on Armada38x
and adds new optional AHCI device to arm/mv/files.mv.

Submitted by:          Konrad Adamczyk <ka@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
Reviewed by:           zbb
Differential revision: https://reviews.freebsd.org/D9222

7 years agoEnable optional soft reset in AHCI
wma [Wed, 25 Jan 2017 10:32:57 +0000 (10:32 +0000)]
Enable optional soft reset in AHCI

It occurred that some Marvell integrated controllers
require additional time after soft reset to work properly.
Introduce new quirk (AHCI_Q_MRVL_SR_DEL), that enable
such operation.

Submitted by:          Konrad Adamczyk <ka@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
Reviewed by:           mav
Differential revision: https://reviews.freebsd.org/D9221

7 years agoSetup decoding windows for ARMADA38X
wma [Wed, 25 Jan 2017 10:31:16 +0000 (10:31 +0000)]
Setup decoding windows for ARMADA38X

It is necesarry to open memory windows on internal bus for
AHCI driver to work correctly.

Submitted by:          Konrad Adamczyk <ka@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
Reviewed by:           zbb
Differential revision: https://reviews.freebsd.org/D9220

7 years agoFix node detection for MBUS windows configuration
wma [Wed, 25 Jan 2017 10:29:46 +0000 (10:29 +0000)]
Fix node detection for MBUS windows configuration

Configure decoding windows only for devices with
enabled nodes in FDT.

Submitted by:          Konrad Adamczyk <ka@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
Reviewed by:           zbb
Differential revision: https://reviews.freebsd.org/D9219

7 years agoExpand OpenFirmware API with ofw_bus_node_status_okay
wma [Wed, 25 Jan 2017 10:28:21 +0000 (10:28 +0000)]
Expand OpenFirmware API with ofw_bus_node_status_okay
 method

Method could be used before we can access device_t structure.
As per simple phandle_t handle we can access FDT to check
if specified node has been enabled.
It will be used in Marvell's common configuration code.

Submitted by:          Konrad Adamczyk <ka@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
Reviewed by:           zbb, meloun-miracle-cz
Differential revision: https://reviews.freebsd.org/D9218

7 years agoFix SHA256 usage on older CESA versions
wma [Wed, 25 Jan 2017 10:25:59 +0000 (10:25 +0000)]
Fix SHA256 usage on older CESA versions

Adding SHA256 support to Marvell crypto driver resulted in regression
for older SoC's, not capable of handling this mode in hardware.

Submitted by:          Emeric Poupon <emeric.poupon@stormshield.eu>
Obtained from:         Stormshield
Sponsored by:          Stormshield
Reviewed by:           zbb
Differential revision: https://reviews.freebsd.org/D9215

7 years agoUse SoC ID - based detection in CESA
wma [Wed, 25 Jan 2017 10:22:07 +0000 (10:22 +0000)]
Use SoC ID - based detection in CESA

This commit introduces following changes in order to get rid of
ifdef's from all around the driver.
* Introduce sc_soc_id field in cesa_softc structure - this value is
  obtained in cesa_attach() anyway, so make use of it.
* Replace ifdefs with SoC ID checks.
* Perform PM control status only for relevant SoC's.

Submitted by:          Marcin Wojtas <mw@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
Reviewed by:           zbb
Differential revision: https://reviews.freebsd.org/D9247

7 years agoAdd misssing Armada38x ID's in CESA attach
wma [Wed, 25 Jan 2017 06:11:07 +0000 (06:11 +0000)]
Add misssing Armada38x ID's in CESA attach

Marvell Armada 38x is supported in 3 variants,
so take all into consideration in crypto driver
attach routine.

Submitted by:          Marcin Wojtas <mw@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
Reviewed by:           zbb
Differential revision: https://reviews.freebsd.org/D9248

7 years agoIntroduce armada_thermal driver for Armada family platforms
wma [Wed, 25 Jan 2017 06:08:10 +0000 (06:08 +0000)]
Introduce armada_thermal driver for Armada family platforms

* Currently supports only Armada38X family but other Marvell SoC's
  can be added if needed.
* Provides temperature is C deg.
* To print the temperature one can use:
  sysctl dev.armada_thermal.0.temperature

Submitted by:          Zbigniew Bodek <zbb@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
Differential revision: https://reviews.freebsd.org/D9217

7 years agoPreening pass to fix up trailing white space and other minor style(9)
imp [Wed, 25 Jan 2017 02:05:08 +0000 (02:05 +0000)]
Preening pass to fix up trailing white space and other minor style(9)
nits (though I'm sure others remain).

MFC After: 3 days

7 years agoAdded support for if_transmit and if_qflush
davidcs [Wed, 25 Jan 2017 00:23:38 +0000 (00:23 +0000)]
Added support for if_transmit and if_qflush
Removed if_start
updated version to 3.10.33

MFC after:5 days

7 years ago[ath_hal] note that the CCA configuration setting may be chip-dependent.
adrian [Tue, 24 Jan 2017 22:52:09 +0000 (22:52 +0000)]
[ath_hal] note that the CCA configuration setting may be chip-dependent.

I bet it isn't, but who knows - this is making assumptions about the
layout of AR_DIAG.

7 years agoimgact_elf: refactor et_dyn_addr calculation
emaste [Tue, 24 Jan 2017 22:46:43 +0000 (22:46 +0000)]
imgact_elf: refactor et_dyn_addr calculation

This simplifies the logic somewhat. It is extracted from the change in
review in D5603.

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

7 years agohwpmc: partially depessimize munmap handling if the module is not loaded
mjg [Tue, 24 Jan 2017 22:00:16 +0000 (22:00 +0000)]
hwpmc: partially depessimize munmap handling if the module is not loaded

HWPMC_HOOKS is enabled in GENERIC and triggers some work avoidable in the
common (module not loaded) case.

In particular this avoids permission checks + lock downgrade
singlethreaded and in cases were an executable mapping is found the pmc
sx lock is no longer bounced.

Note this is a band aid.

MFC after: 1 week

7 years agoproc: perform a lockless check in sys_issetugid
mjg [Tue, 24 Jan 2017 21:48:57 +0000 (21:48 +0000)]
proc: perform a lockless check in sys_issetugid

Discussed with: kib
MFC after: 1 week

7 years agoFix a bug where the overhead of the I-DATA chunk was not considered.
tuexen [Tue, 24 Jan 2017 21:30:36 +0000 (21:30 +0000)]
Fix a bug where the overhead of the I-DATA chunk was not considered.

MFC after: 1 week

7 years agoskel: Remove reference to deleted part in previous commit to this file.
jilles [Tue, 24 Jan 2017 21:07:13 +0000 (21:07 +0000)]
skel: Remove reference to deleted part in previous commit to this file.

Reported by: Rodney W. Grimes
MFC after: 1 week

7 years agoFix the error value we write in cerror. __error returns an int *, however
andrew [Tue, 24 Jan 2017 18:56:09 +0000 (18:56 +0000)]
Fix the error value we write in cerror. __error returns an int *, however
we were writing a 64 bit value meaning the 32 bits after this would be
trashed.

MFC after: 3 days
Sponsored by: DARPA, AFRL

7 years agoUse time_t for intermediate values to avoid overflow in clock_ts_to_ct
cem [Tue, 24 Jan 2017 18:05:29 +0000 (18:05 +0000)]
Use time_t for intermediate values to avoid overflow in clock_ts_to_ct

Add additionally safety and overflow checks to clock_ts_to_ct and the
BCD routines while we're here.

Perform a safety check in sys_clock_settime() first to avoid easy local
root panic, without having to propagate an error value back through
dozens of APIs currently lacking error returns.

PR: 211960, 214300
Submitted by: Justin McOmie <justin.mcomie at gmail.com>, kib@
Reported by: Tim Newsham <tim.newsham at nccgroup.trust>
Reviewed by: kib@
Sponsored by: Dell EMC Isilon, FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9279

7 years agoApply r210555 to 64 bit linux support:
tijl [Tue, 24 Jan 2017 16:13:59 +0000 (16:13 +0000)]
Apply r210555 to 64 bit linux support:

The interpreter name should no longer be treated as a buffer that can be
overwritten.

PR: 216346
MFC after: 3 days

7 years agoiflib:
sbruno [Tue, 24 Jan 2017 16:05:42 +0000 (16:05 +0000)]
iflib:
     Add internal tracking of smp startup status to reliably figure out
     what methods are to be used to get gtaskqueue up and running.

e1000:
     Calculating this pointer gives undefined behaviour when (last == -1)
     (it is before the buffer).  The pointer is always followed.  Panics
     occurred when it points to an unmapped page.  Otherwise, the pointed-to
     garbage tends to not have the E1000_TXD_STAT_DD bit set in it, so in the
     broken case the loop was usually null and the function just returned, and
     this was acidentally correct.

Submitted by: bde
Reported by: Matt Macy <mmacy@nextbsd.org>

7 years agoRevert 312696 due to build tests.
sbruno [Tue, 24 Jan 2017 15:55:52 +0000 (15:55 +0000)]
Revert 312696 due to build tests.

7 years agoiflib:
sbruno [Tue, 24 Jan 2017 14:48:32 +0000 (14:48 +0000)]
iflib:
   Add internal tracking of smp startup status to reliably figure out
   what methods are to be used to get gtaskqueue up and running.

e1000:
   Calculating this pointer gives undefined behaviour when (last == -1)
   (it is before the buffer).  The pointer is always followed.  Panics
   occurred when it points to an unmapped page.  Otherwise, the pointed-to
   garbage tends to not have the E1000_TXD_STAT_DD bit set in it, so in the
   broken case the loop was usually null and the function just returned, and
   this was acidentally correct.

Submitted by: bde
Reviewed by: Matt Macy <mmacy@nextbsd.org>

7 years agoMake CTL ramdisk backend a real RAM disk.
mav [Tue, 24 Jan 2017 12:13:41 +0000 (12:13 +0000)]
Make CTL ramdisk backend a real RAM disk.

If "capacity" LU option is set, ramdisk backend now implements featured
thin provisioned disk, storing data in malloc(9) allocated memory blocks
of pblocksize bytes (default PAGE_SIZE or 4KB).  Additionally ~0.2% of LU
size is used for indirection tree (bigger pblocksize reduce the overhead).
Backend supports all unmap and anchor operations.  If configured capacity
is overflowed, proper error conditions are reported.

If "capacity" LU option is not set, the backend operates mostly the same
as before without allocating real storage: writes go to nowhere, reads
return zeroes, reporting that all LBAs are unmapped.

This backend is still mostly oriented on testing and benchmarking (it is
still a volatile RAM disk), but now it should allow to run real FS tests,
not only simple dumb dd.

MFC after: 2 weeks

7 years agoImprove wording when describing -mmin.
sevan [Tue, 24 Jan 2017 10:42:21 +0000 (10:42 +0000)]
Improve wording when describing -mmin.

PR: 215922
Submitted by: danielsh AT apache DOT org
Approved by: bcr (mentor)
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D9313

7 years agoAdd RISC-V support for truss(1)
lwhsu [Tue, 24 Jan 2017 09:41:44 +0000 (09:41 +0000)]
Add RISC-V support for truss(1)

While here, extract NARGREG as a definition.

Reviewed by: br
Differential Revision: https://reviews.freebsd.org/D9249

7 years agohyperv/hn: add devctl_notify for VF_UP/DOWN events
dexuan [Tue, 24 Jan 2017 09:27:13 +0000 (09:27 +0000)]
hyperv/hn: add devctl_notify for VF_UP/DOWN events

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D9102

7 years agohyperv/hn: add a sysctl name for the VF interface
dexuan [Tue, 24 Jan 2017 09:25:42 +0000 (09:25 +0000)]
hyperv/hn: add a sysctl name for the VF interface

This makes it easier for the userland script to find the releated
VF interface.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D9101

7 years agohyperv/hn: add the support for VF drivers (SR-IOV)
dexuan [Tue, 24 Jan 2017 09:24:14 +0000 (09:24 +0000)]
hyperv/hn: add the support for VF drivers (SR-IOV)

Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and
a VF NIC to work together (both NICs have the same MAC address), mainly to
support seamless live migration.

When the VF device becomes UP (or DOWN), the synthetic NIC driver needs
to switch the data path from the synthetic NIC to the VF (or the opposite).

Note: multicast/broadcast packets are still received through the synthetic
NIC and we need to inject the packets through the VF interface (if the VF is
UP), even if the synthetic NIC is DOWN (so we need to force the rxfilter
to be NDIS_PACKET_TYPE_PROMISCUOUS, when the VF is UP).

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8964

7 years agoifnet: introduce event handlers for ifup/ifdown events
dexuan [Tue, 24 Jan 2017 09:19:46 +0000 (09:19 +0000)]
ifnet: introduce event handlers for ifup/ifdown events

Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and
a VF NIC to work together, mainly to support seamless live migration.

When the VF device becomes UP (or DOWN), the synthetic NIC driver needs
to switch the data path from the synthetic NIC to the VF (or the opposite).

So the synthetic NIC driver needs to know when a VF device is becoming
UP or DOWN and hence the patch is made.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8963

7 years agohyperv/hn: remove the MTU and IFF_DRV_RUNNING checking in hn_rxpkt()
dexuan [Tue, 24 Jan 2017 09:15:36 +0000 (09:15 +0000)]
hyperv/hn: remove the MTU and IFF_DRV_RUNNING checking in hn_rxpkt()

It's unnecessary because the upper nework stack does the same checking.

In the case of Hyper-V SR-IOV, we need to remove the checking because
1) multicast/broadcast packets are still received through the synthetic
NIC and we need to inject the packets through the VF interface;
2) we must inject the packets even if the synthetic NIC is down, or has
a different MTU from the VF device.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8962

7 years agohyperv/hn: remember the channel pointer in struct hn_rx_ring
dexuan [Tue, 24 Jan 2017 09:09:53 +0000 (09:09 +0000)]
hyperv/hn: remember the channel pointer in struct hn_rx_ring

This will be used by the coming NIC SR-IOV patch.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8909

7 years agoExtend manual to cover more commands and options.
sevan [Tue, 24 Jan 2017 08:56:54 +0000 (08:56 +0000)]
Extend manual to cover more commands and options.

PR: 203406
Submitted by: Fehmi Noyan Isi (fnoyanisi AT yahoo DOT com)
Approved by: wblock (mentor)
MFC after: 5 days
Differential Revision:  https://reviews.freebsd.org/D8691

7 years agoDon't reference NULL pointer.
delphij [Tue, 24 Jan 2017 07:48:36 +0000 (07:48 +0000)]
Don't reference NULL pointer.

MFC after: 2 weeks

7 years agoSort REALTEK section and remove duplicate entry for RTL8192CU.
kevlo [Tue, 24 Jan 2017 03:00:22 +0000 (03:00 +0000)]
Sort REALTEK section and remove duplicate entry for RTL8192CU.

7 years agoAdd support for the Realtek RTL8192EU chipset.
kevlo [Tue, 24 Jan 2017 02:35:38 +0000 (02:35 +0000)]
Add support for the Realtek RTL8192EU chipset.
Committed over the D-Link DWA-131 rev E1 on amd64 with WPA.

Reviewed by: avos

7 years agoHandle imx6 erratum ERR004346... to reboot, clear the SRS bit twice within
ian [Tue, 24 Jan 2017 02:09:30 +0000 (02:09 +0000)]
Handle imx6 erratum ERR004346... to reboot, clear the SRS bit twice within
the same cycle of the 32khz clock.

I've never actually noticed this error happening, but it's an easy fix.

7 years agoEliminate misleading comments and dead code in lacp_port_create()
rpokala [Tue, 24 Jan 2017 01:39:40 +0000 (01:39 +0000)]
Eliminate misleading comments and dead code in lacp_port_create()

Variables "fast" and "active" are both constant in lacp_port_create(), but
comments mispleadingly suggest that "fast" can be changed via ioctl. The
constant values control the value of "lp->lp_state", so it too is constant,
and the code for assigning different value to it is essentially dead.

Remove both "fast" and "active", and set "lp->lp_state" unconditionally;
that gets rid of the dead code and misleading comments.

CID: 1305692
CID: 1305734

Reported by: asomers
Reviewed by: asomers
MFC after: 1 week
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D9302

7 years agoFix a typo introduced in r306024.
jkim [Mon, 23 Jan 2017 21:09:27 +0000 (21:09 +0000)]
Fix a typo introduced in r306024.

7 years ago[am335x] Use upstream tda19988 framer node from upstream DTS
gonzo [Mon, 23 Jan 2017 19:20:55 +0000 (19:20 +0000)]
[am335x] Use upstream tda19988 framer node from upstream DTS

Remove custom DTS duplicate of tda19988 node and use upstream-provided
one introduced by r295436. This duplication created two tdaX devices
which confused fb driver into using only 640x480 area while setting
display to native resolution.

Reported by: Michael Smith
MFC after: 3 days

7 years agoFix overrun handling issue in r312291.
mav [Mon, 23 Jan 2017 17:44:33 +0000 (17:44 +0000)]
Fix overrun handling issue in r312291.

MFC after: 1 week

7 years agoRemove a static function declaration for a function not implemented.
bz [Mon, 23 Jan 2017 16:40:20 +0000 (16:40 +0000)]
Remove a static function declaration for a function not implemented.

Makes head code compile on 10.3 and cleanup is never wrong.

MFC after: 3 days

7 years agosort - Don't live-loop threads.
pfg [Mon, 23 Jan 2017 15:39:51 +0000 (15:39 +0000)]
sort - Don't live-loop threads.

Worker threads now use a pthread_cond_t to wait for work instead of
burning the cpu up.

Obtained from: DragonflyBSD (07774aea0ccf64a48fcfad8899e3bf7c8f18277a)
MFC after: 2 weeks

7 years agoAlways initialize 'c'.
delphij [Mon, 23 Jan 2017 07:32:47 +0000 (07:32 +0000)]
Always initialize 'c'.

MFC after: 2 weeks

7 years agoWhen creating record file, use umask 077 instead of the default.
delphij [Mon, 23 Jan 2017 06:04:43 +0000 (06:04 +0000)]
When creating record file, use umask 077 instead of the default.

MFC after: 2 weeks

7 years ago[ath] modify cabq and per-node packet usage limits.
adrian [Mon, 23 Jan 2017 04:47:38 +0000 (04:47 +0000)]
[ath] modify cabq and per-node packet usage limits.

* limit cabq to 64 - in practice if this stays at ath_txbuf then
  all buffers can be tied up by a very busy broadcast domain (eg ARP
  storm, way too much MDNS/NETBIOS).  It's been like this in the
  freebsd-wifi-build AP project for the longest time.

* Now that I figured out the hilarity inherent in aggregate forming
  and AR9380 EDMA work, change the per-node to 64 frames by default.
  I'll do some more work to shorten the queue latency introduced when
  doing data so TCP isn't so terrible, but it's now no longer /always/
  tens of milliseconds of extra latency  when doing active iperf tests.

Notes:

The reason for the extra latency is partly tx/rx taskqueue handling and
scheduling, and partly due to a lack of airtime/QoS awareness of per-node
traffic.  Ideally we'd have different limits/priorities on the QoS/TID
levels per node so say, voice/video data got a better share of buffer
allocations over best effort/bulk data, but we currently don't implement
that.  It's not /hard/ to do, I just need to do it.

Tested:

* AR9380 (STA), AR9580 (hostap) - both with the relevant changes.
  TCP is now at around 180mbit with rate control and RTS protection
  enabled.  UDP stays at 355mbit at MCS23, no HT protection.

7 years ago[ath] fix thresholds for deciding to queue to the software queue and populate hardwar...
adrian [Mon, 23 Jan 2017 04:30:08 +0000 (04:30 +0000)]
[ath] fix thresholds for deciding to queue to the software queue and populate hardware frames

This is two fixes, which establishes what I /think/ is pretty close to the
theoretical PHY maximum speed on the AR9380 devices.

* When doing A-MPDU on a TID, don't queue to the hardware directly if
  the hardware queue is busy.  This gives us time to get more packets
  queued up (and the hardware is busy, so there's no point in queuing
  more to the hardware right now) to potentially form an A-MPDU.

  This fixes up the throughput issue I was seeing where a couple hundred
  single frames were being sent a second interspersed between A-MPDU
  frames.  It just happened that the software queue had exactly one
  frame in it at that point.  Queuing it until the hardware finishes
  transmitting isn't exactly costly.

* When determining whether to dequeue from a software node/TID queue into
  the hardware queue, fix up the checks to work right for EDMA chips
  (ar9380 and later.)   Before it was not dispatching anything until
  the FIFO was empty.  Now we allow it to dispatch another aggregate
  up to the hardware aggregate limit, like I intended with the earlier
  work.

This allows a 5GHz HT40, short-GI, "htprotmode off" test at MCS23
to achieve 357 Mbit/sec in a one-way UDP test.  The stars have to be
aligned /just right/ so there are no retries but it can happen.
Just don't expect it to work in an OTA test if your 2yo is running
around the room - MCS23 is very very sensitive to channel conditions.

Tested:

* AR9380 STA (test) -> AR9580 hostap

TODO:

* More thorough testing on pre-AR9380 chips (AR5416, AR9160, AR9280)
* (Finally) teach ath_rate_sample about throughput/latency rather than
  air time, so I can get good transmit rates with a 2yo running around.

7 years ago[ath] [ar9300] ensure the software scheduler is called to form more aggregates for...
adrian [Mon, 23 Jan 2017 04:20:37 +0000 (04:20 +0000)]
[ath] [ar9300] ensure the software scheduler is called to form more aggregates for EDMA chips

When investigating performance on UDP TX on the AR9380 I found that the
following sequence was occuring:

* INTR
* EINPROGRESS - nothing yet
* INTR
* TXSTATUS - process a TX completion for an aggregate
* INTR, INTR
* TXSTATUS - process a TX completion for an aggregate
* TXD, TXD ... populate frames from the hardware queue and submit

What should be happening is a completed TXSTATUS fires off more packets
that are queued on active TIDs.

What /was/ happening was after that first TXSTATUS the TX queue hardware queue
was still empty, so it didn't push anything into the FIFO.  Only after the
second TXSTATUS did any progress get made.

This is one of two commits - it ensures that the software TX queue scheduler
is called /after/ TX completion, otherwise no frames from the software staging
queues will be processed into the hardware queues.

The second commit will fix it so it populates aggregate frames correctly
when the above occurs - right now ath_txq_sched() is called, but it doesn't
populate anything because its pre-check conditions are wrong.

Whilst here, add/tweak debugging.

Tested:

* AR9380 STA (testing device) -> AR9580 hostap

7 years agoAvoid using non-zero argument for __builtin_frame_address().
jhibbits [Mon, 23 Jan 2017 04:03:12 +0000 (04:03 +0000)]
Avoid using non-zero argument for __builtin_frame_address().

Building kernel with devel/powerpc64-gcc (6.2.0) yields the following error:
/usr/src/sys/powerpc/powerpc/db_trace.c:299:20: error: calling
'__builtin_frame_address' with a nonzero argument is unsafe
[-Werror=frame-address]

Work around this by dereferencing the frame address manually instead.

PR: 215600
Reported by: Mark Millard <markmi AT dsl-only DOT net>
MFC after: 2 weeks

7 years agoRemove the DTRACEHIOC_ADD ioctl.
markj [Mon, 23 Jan 2017 02:21:06 +0000 (02:21 +0000)]
Remove the DTRACEHIOC_ADD ioctl.

This ioctl has been considered legacy by upstream since the DTrace code
was first imported, and is unused. The removal also allows some
simplification of dtrace_helper_slurp().

Also remove a bogus copyout in the DTRACEHIOC_ADDDOF handler. Due to a
bug, it would overwrite an in-memory copy of the DOF header rather than
the passed-in DOF helper. Moreover, DTRACEHIOC_ADDDOF already copies the
helper back out automatically since its argument has the IOC_OUT attribute.

7 years agonet80211: fix flags setup for HT40 5GHz channels.
avos [Sun, 22 Jan 2017 23:45:59 +0000 (23:45 +0000)]
net80211: fix flags setup for HT40 5GHz channels.

7 years agoMove values displayed by "iscsictl -v" one character to the right,
trasz [Sun, 22 Jan 2017 20:11:24 +0000 (20:11 +0000)]
Move values displayed by "iscsictl -v" one character to the right,
to line up output from "iscsictl -v" with "ctladm islist -v".

MFC after: 2 weeks

7 years agoRemove max_targets and max_target_id CTL port variables; they were unused.
trasz [Sun, 22 Jan 2017 20:06:15 +0000 (20:06 +0000)]
Remove max_targets and max_target_id CTL port variables; they were unused.

This changes the CTL frontend ABI and thus shouldn't be MFC-ed.

Reviewed by: mav@

7 years agoReally restore the old behaviour for pw usermod -m
bapt [Sun, 22 Jan 2017 20:03:18 +0000 (20:03 +0000)]
Really restore the old behaviour for pw usermod -m

It again reinstall missing skel files without overwriting changed one
Add a regression test about it

Reported by: ae
MFC after: 3 days

7 years agoDocument mount option "nonc" for tmpfs.
kib [Sun, 22 Jan 2017 19:50:23 +0000 (19:50 +0000)]
Document mount option "nonc" for tmpfs.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D9258

7 years agoEditing and clarifications for tmpfs(5).
kib [Sun, 22 Jan 2017 19:46:14 +0000 (19:46 +0000)]
Editing and clarifications for tmpfs(5).

Submitted by: wblock
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D9211