]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoImprove build(7): add missing "buildkernel" and "installkernel"
Edward Tomasz Napierala [Thu, 11 May 2017 08:39:55 +0000 (08:39 +0000)]
Improve build(7): add missing "buildkernel" and "installkernel"
to the example, change the architectures to something more common,
and improve description of defaults for TARGET.

Reviewed by: bdrewery, ngie, imp (older revisions)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10654

7 years agocpio/tests/test_option_lz4: fix a use after free in the failure case
Enji Cooper [Thu, 11 May 2017 08:22:01 +0000 (08:22 +0000)]
cpio/tests/test_option_lz4: fix a use after free in the failure case

This change will be upstreamed to the libarchive project.

MFC after: 6 days
MFC with: r317782
Reported by: Coverity
Sponsored by: Dell EMC Isilon

7 years agoMark all md tests as requiring unsafe AIO in order to function
Enji Cooper [Thu, 11 May 2017 08:06:46 +0000 (08:06 +0000)]
Mark all md tests as requiring unsafe AIO in order to function

These tests have been flapping (failing<->passing) on Jenkins for months.
It passes reliably for me if unsafe AIO is permitted, but it doesn't
pass on Jenkins reliably if unsafe AIO is disabled (the current default).

Mark the tests as requiring unsafe AIO to mitigate the intermittent
failures when unsafe AIO isn't permitted. If the kernel code is changed
to reliably function with md(4) devices using unsafe AIO, this commit can
be reverted.

MFC after: 2 months
PR: 217261
Reported by: Jenkins
Sponsored by: Dell EMC Isilon

7 years agoprocstat(1): also reference icmp(4) and sctp(4)
Enji Cooper [Thu, 11 May 2017 07:58:04 +0000 (07:58 +0000)]
procstat(1): also reference icmp(4) and sctp(4)

This was missed in the previous commit by accident.

MFC after: 3 weeks
MFC with: r318178
Sponsored by: Dell EMC Isilon

7 years agoprocstat(1): document all possible `PRO` (network protocol) values
Enji Cooper [Thu, 11 May 2017 07:55:38 +0000 (07:55 +0000)]
procstat(1): document all possible `PRO` (network protocol) values

Reference the appropriate section 4 manpages for networking
protocols.

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUnconditionally install udp(4) and udplite(4) again
Enji Cooper [Thu, 11 May 2017 06:57:20 +0000 (06:57 +0000)]
Unconditionally install udp(4) and udplite(4) again

I added this to the MK_USB != no block in error in r278202.

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoPersistently store NIC's hardware MAC address, and add a way to retrive it
Ravi Pokala [Thu, 11 May 2017 06:46:39 +0000 (06:46 +0000)]
Persistently store NIC's hardware MAC address, and add a way to retrive it

An earlier version of r318160 allocated if_hw_addr unconditionally; when it
became conditional, I forgot to check for NULL in ether_ifattach().

Reviewed by: kp
MFC after: 1 week
MFC with: r318160
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D10678
Pointy-hat to: rpokala

7 years agoprocstat(1): clarify the Signal Disposition section
Enji Cooper [Thu, 11 May 2017 06:35:23 +0000 (06:35 +0000)]
procstat(1): clarify the Signal Disposition section

- Fix a typo (SIGIGN -> SIG_IGN). Use .Dv when referencing SIG_IGN.
- Use semi-colons as soft breaks when separating sentences for
  the FLAGS section.
- Tweak wording for C slightly to flow better and to be a bit
  more technically correct (signals with handlers installed will
  be caught by the target program).
- Reference signal(3) in the SEE ALSO section.

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoprocstat(1): fix a typo (it's -> its)
Enji Cooper [Thu, 11 May 2017 06:24:57 +0000 (06:24 +0000)]
procstat(1): fix a typo (it's -> its)

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoImplement outputting of IPv6 addresses in the ippool debug list of tree
Cy Schubert [Thu, 11 May 2017 04:39:11 +0000 (04:39 +0000)]
Implement outputting of IPv6 addresses in the ippool debug list of tree
type pools (ippool -l -d -t tree). Currently IPv6 in ippool tree type
pool handling is partially implemented (meaning it doesn't work).
This is the first of a series of commits to remediate ippool.

This will be MFCed with a yet to be committed series of fixes to ippool
after it has been fully remediated.

PR: 218433

7 years agoFix uma_zcreate() align argument, now that the constraint is asserted.
Justin Hibbits [Thu, 11 May 2017 03:47:58 +0000 (03:47 +0000)]
Fix uma_zcreate() align argument, now that the constraint is asserted.

The alignment argument is the mask of low bits to mask off when allocating
items in a zone, not the block-size alignment.

7 years agoFix stack tracing in dtrace for powerpc
Justin Hibbits [Thu, 11 May 2017 00:23:51 +0000 (00:23 +0000)]
Fix stack tracing in dtrace for powerpc

The current method only sort of works, and usually doesn't work reliably.
Also, on Book-E the return address from DEBUG exceptions is not the sentinel
addresses, so it won't exit the loop correctly.

Fix this by better handling trap frames during unwinding, and using the
common trap handler for debug traps, as the code in that segment is
identical between the two.

MFC after: 1 week

7 years agoThere is no good reason for TCP reassembly zone to be UMA_ZONE_NOFREE.
Gleb Smirnoff [Wed, 10 May 2017 23:32:31 +0000 (23:32 +0000)]
There is no good reason for TCP reassembly zone to be UMA_ZONE_NOFREE.

It has strong locking model, doesn't have any timers associated with
entries.  The entries theirselves are referenced only from the tcpcb zone,
which itself is a normal zone, without the UMA_ZONE_NOFREE flag.

7 years agoMerge bmake-20170510
Simon J. Gerraty [Wed, 10 May 2017 22:45:05 +0000 (22:45 +0000)]
Merge bmake-20170510

No-op change other than version update.

7 years agoImport bmake-20170510
Simon J. Gerraty [Wed, 10 May 2017 22:40:27 +0000 (22:40 +0000)]
Import bmake-20170510

7 years agoEnsure buf2 is in scope
Simon J. Gerraty [Wed, 10 May 2017 22:24:09 +0000 (22:24 +0000)]
Ensure buf2 is in scope

7 years agoPersistently store NIC's hardware MAC address, and add a way to retrive it
Ravi Pokala [Wed, 10 May 2017 22:13:47 +0000 (22:13 +0000)]
Persistently store NIC's hardware MAC address, and add a way to retrive it

The MAC address reported by `ifconfig ${nic} ether' does not always match
the address in the hardware, as reported by the driver during attach. In
particular, NICs which are components of a lagg(4) interface all report the
same MAC.

When attaching, the NIC driver passes the MAC address it read from the
hardware as an argument to ether_ifattach(). Keep a second copy of it, and
create ioctl(SIOCGHWADDR) to return it. Teach `ifconfig' to report it along
with the active MAC address.

PR: 194386
Reviewed by: glebius
MFC after: 1 week
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D10609

7 years agoipfw nat and natd support multiple aliasing instances with "nat global" feature
Eugene Grosbein [Wed, 10 May 2017 19:41:52 +0000 (19:41 +0000)]
ipfw nat and natd support multiple aliasing instances with "nat global" feature
that chooses right alias_address for outgoing packets that already have
corresponding state in one of aliasing instances. This feature works just fine
for ICMP, UDP, TCP and SCTP packes but not for others. For example,
outgoing PPtP/GRE packets always get alias_address of latest configured
instance no matter whether such packets have corresponding state or not.

This change unbreaks translation of transit PPtP/GRE connections
for "nat global" case fixing a bug in static ProtoAliasOut() function
that ignores its "create" argument and performs translation
regardless of its value. This static function is called only
by LibAliasOutLocked() function and only for packers other than
ICMP, UDP, TCP and SCTP. LibAliasOutLocked() passes its "create"
argument unmodified.

We have only two consumers of LibAliasOutLocked() in the source tree
calling it with "create" unequal to 1: "ipfw nat global" code and similar
natd code having same problem. All other consumers of LibAliasOutLocked()
call it with create = 1 and the patch is "no-op" for such cases.

PR: 218968
Approved by: ae, vsevolod (mentor)
MFC after: 1 week

7 years agoAdd several new media types to if_media.h
Eric Joyner [Wed, 10 May 2017 18:33:40 +0000 (18:33 +0000)]
Add several new media types to if_media.h

These include several 25G types (for active direct attach cables and LR modules),
and a missing type for 10G active direct attach.

Differential Revision: https://reviews.freebsd.org/D10425
Reviewed by: smh, imp
MFC after: 3 days
Sponsored by: Intel Corporation

7 years agoDon't depend on assert(3) getting evaluated
Alan Somers [Wed, 10 May 2017 16:06:22 +0000 (16:06 +0000)]
Don't depend on assert(3) getting evaluated

Reported by: imp
MFC after: 3 weeks
X-MFC-With: 318141, 318143
Sponsored by: Spectra Logic Corp

7 years agostrcpy => strlcpy
Alan Somers [Wed, 10 May 2017 15:38:06 +0000 (15:38 +0000)]
strcpy => strlcpy

Reported by: Coverity
CID: 1006715
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

7 years agolibstand: NULL pointer dereference in rarp
Toomas Soome [Wed, 10 May 2017 15:35:41 +0000 (15:35 +0000)]
libstand: NULL pointer dereference in rarp

readether argument is missing & operator.

CID: 1374944
Reported by: Coverity, cem
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D10663

7 years agostrcpy => strlcpy
Alan Somers [Wed, 10 May 2017 15:27:36 +0000 (15:27 +0000)]
strcpy => strlcpy

Reported by: Coverity
CID: 1352771
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

7 years agoRevert to pre-r318116 wording to not give the false impression
Edward Tomasz Napierala [Wed, 10 May 2017 14:54:32 +0000 (14:54 +0000)]
Revert to pre-r318116 wording to not give the false impression
that setting the kernels' idea of terminal size is somehow an
alternative to environment variables.

Reported by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agomkimg: Add -C argument to specify maximum capacity
Emmanuel Vadot [Wed, 10 May 2017 09:36:34 +0000 (09:36 +0000)]
mkimg: Add -C argument to specify maximum capacity

Add a -C option to specify a maximum capacity for the final image file.
It is useful to control the size of the generated image for sdcard or
when we will add dynamic size partition.

Add --capacity which is a shorthand to define min and max capacity at
the same time.

Reviewed by: bapt, marcel, wblock (manpages)
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D10509

7 years agohyperv/vmbus: Reorganize vmbus device tree
Sepherosa Ziehau [Wed, 10 May 2017 05:28:14 +0000 (05:28 +0000)]
hyperv/vmbus: Reorganize vmbus device tree

For GEN1 Hyper-V, vmbus is attached to pcib0, which contains the
resources for PCI passthrough and SR-IOV.  There is no
acpi_syscontainer0 on GEN1 Hyper-V.

For GEN2 Hyper-V, vmbus is attached to acpi_syscontainer0, which
contains the resources for PCI passthrough and SR-IOV.  There is
no pcib0 on GEN2 Hyper-V.

The ACPI VMBUS device now only holds its _CRS, which is empty as
of this commit; its existence is mainly for upward compatibility.

Device tree structure is suggested by jhb@.

Tested-by: dexuan@
Collabrated-wth: dexuan@
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D10565

7 years agoFix parsing of 'vmov Q<n>.F32,Q<n>.F32' instruction.
Michal Meloun [Wed, 10 May 2017 05:07:41 +0000 (05:07 +0000)]
Fix parsing of 'vmov Q<n>.F32,Q<n>.F32' instruction.

parse_qfloat_immediate() accidentaly parses register with size
qualifier as immediate constant (It takes '<n>.' substring as
valid floating point constant).

Due to this, slightly reorder cases in parse_neon_mov() and move parsing of
vmov with immediate constant to last place.

MFC after: 2 weeks

7 years agoFix the encoded instruction for FBT traps on powerpc
Justin Hibbits [Wed, 10 May 2017 03:47:22 +0000 (03:47 +0000)]
Fix the encoded instruction for FBT traps on powerpc

r314370 changed EXC_DTRACE to a different instruction, but neglected to
make the same change to fbt, so dtrace didn't actually pick it up,
resulting in entering KDB instead of trapping for dtrace.

MFC after: 1 week

7 years agoFix check for fbt_excluded() in powerpc
Justin Hibbits [Wed, 10 May 2017 03:20:20 +0000 (03:20 +0000)]
Fix check for fbt_excluded() in powerpc

fbt_excluded() returns 1 if the symbol is to be excluded.  Every other
arch has this correct, powerpc was the only broken one

MFC after: 1 week

7 years agollh_func_filter needs to be configured for 100G
David C Somayajulu [Wed, 10 May 2017 01:01:20 +0000 (01:01 +0000)]
llh_func_filter needs to be configured for 100G

MFC after:3 days

7 years agoAdjust whitespace and fix a comment. No functional change.
Navdeep Parhar [Wed, 10 May 2017 00:42:28 +0000 (00:42 +0000)]
Adjust whitespace and fix a comment.  No functional change.

MFC after: 3 days

7 years agoip6_output runs with the inp lock held, just like ip_output.
Navdeep Parhar [Wed, 10 May 2017 00:14:55 +0000 (00:14 +0000)]
ip6_output runs with the inp lock held, just like ip_output.

7 years agoSUBDIR_OVERRIDE: Note how to restore historical behavior pre-r289725.
Bryan Drewery [Wed, 10 May 2017 00:02:24 +0000 (00:02 +0000)]
SUBDIR_OVERRIDE: Note how to restore historical behavior pre-r289725.

Sponsored by: Dell EMC Isilon

7 years agoAdd a -DNO_LIBS to skip building the libraries phase as well.
Bryan Drewery [Tue, 9 May 2017 23:58:07 +0000 (23:58 +0000)]
Add a -DNO_LIBS to skip building the libraries phase as well.

This is useful for cases where -DWORLDFAST is useful.

Sponsored by: Dell EMC Isilon

7 years agoRandom updates to resizewin(1) man page.
Edward Tomasz Napierala [Tue, 9 May 2017 20:45:21 +0000 (20:45 +0000)]
Random updates to resizewin(1) man page.

Reviewed by: cem, Daniel O'Connor <darius@dons.net.au>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10640

7 years agoCorrect "first appeared in" entries for various drivers that
Glen Barber [Tue, 9 May 2017 20:39:57 +0000 (20:39 +0000)]
Correct "first appeared in" entries for various drivers that
exist in stable/11.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoRemove unused constant (PATH_TEMPLATE)
Enji Cooper [Tue, 9 May 2017 20:26:43 +0000 (20:26 +0000)]
Remove unused constant (PATH_TEMPLATE)

It was made unnecessary in r312913.

MFC after: 3 weeks
MFC with: r312913
Sponsored by: Dell EMC Isilon

7 years agoSupport -DWORLDFAST to skip all build steps up to 'libraries' and 'everything'.
Bryan Drewery [Tue, 9 May 2017 20:21:58 +0000 (20:21 +0000)]
Support -DWORLDFAST to skip all build steps up to 'libraries' and 'everything'.

This allows for building the world against the already-created
host/sysroot environment.  It is not overly useful outside of cases of
large-impact changes such as a testing a new compiler.  It will
allow quickly getting back to an error in the target-phases of the
build where a new compiler is being used.

Sponsored by: Dell EMC Isilon

7 years agoSupport skipping 'make obj' tree-walk.
Bryan Drewery [Tue, 9 May 2017 20:21:38 +0000 (20:21 +0000)]
Support skipping 'make obj' tree-walk.

This is part of a larger effort for WITH_AUTO_OBJ and a WORLDFAST
option.

Sponsored by: Dell EMC Isilon

7 years agostyle(9): move function definition curly braces to column 0
Enji Cooper [Tue, 9 May 2017 19:23:14 +0000 (19:23 +0000)]
style(9): move function definition curly braces to column 0

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoPrint out when unsafe AIO is enabled to debugging purposes
Enji Cooper [Tue, 9 May 2017 19:20:02 +0000 (19:20 +0000)]
Print out when unsafe AIO is enabled to debugging purposes

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoRefactor ATF_REQUIRE_UNSAFE_AIO and PLAIN_REQUIRE_UNSAFE_AIO
Enji Cooper [Tue, 9 May 2017 19:16:18 +0000 (19:16 +0000)]
Refactor ATF_REQUIRE_UNSAFE_AIO and PLAIN_REQUIRE_UNSAFE_AIO

This is being done to reduce duplication between the two macros.

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoAdd a new SDHCI quirk, SDHCI_QUIRK_BROKEN_AUTO_STOP, to workaround
Luiz Otavio O Souza [Tue, 9 May 2017 19:01:57 +0000 (19:01 +0000)]
Add a new SDHCI quirk, SDHCI_QUIRK_BROKEN_AUTO_STOP, to workaround
controllers that do not support or have broken ACMD12 implementations.

Reviewed by: jmcneill
Obtained from: NetBSD
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D10602

7 years agostyle(9): clean up trailing whitespace
Enji Cooper [Tue, 9 May 2017 18:54:35 +0000 (18:54 +0000)]
style(9): clean up trailing whitespace

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoPROGS+META_MODE: Avoid rebuilding common sources when recursing.
Bryan Drewery [Tue, 9 May 2017 18:45:34 +0000 (18:45 +0000)]
PROGS+META_MODE: Avoid rebuilding common sources when recursing.

This could be seen in lib/libkvm/tests where kvm_test_common.o was
a common dependency, but one of the recursed progs had a special
CFLAGS+= -I that changed the build command.  This would cause
all recursed builds to rebuild while fighting over the meta file
and object file.

Reported by: Mark Millard
MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agocxgbe(4): Do not assume that if_qflush is always followed by inteface-down.
Navdeep Parhar [Tue, 9 May 2017 18:33:41 +0000 (18:33 +0000)]
cxgbe(4): Do not assume that if_qflush is always followed by inteface-down.

MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agoUse const with some read-only buffers in opencrypto APIs.
John Baldwin [Tue, 9 May 2017 18:28:42 +0000 (18:28 +0000)]
Use const with some read-only buffers in opencrypto APIs.

- Mark the source buffer for a copyback operation as const in the kernel
  API.
- Use const with input-only buffers in crypto ioctl structures used with
  /dev/crypto.

MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D10517

7 years agoDisable the build of the static/embedded DTB for the ARMADA38X kernel.
Luiz Otavio O Souza [Tue, 9 May 2017 18:12:05 +0000 (18:12 +0000)]
Disable the build of the static/embedded DTB for the ARMADA38X kernel.

Build the supported DTBs as part of modules build.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoAdd initial support for the floating point implementation register.
John Baldwin [Tue, 9 May 2017 17:35:16 +0000 (17:35 +0000)]
Add initial support for the floating point implementation register.

- Save the current FIR in the global 'cpuinfo' structure in a new
  'fpu_id' member.
- Decode flags in the FIR when displaying other CPU flags during boot.
- Use the existing "dummy" slot in the floating point register structure
  to export the FIR in process core dumps and via ptrace().  Note that
  while the FIR register is not volatile, this practice of storing the FIR
  in the floating-point register set is used in other OS's.

Reviewed by: kan
MFC after: 1 month
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D10617

7 years agoFix init order in the LinuxKPI for RCU support.
Hans Petter Selasky [Tue, 9 May 2017 12:51:42 +0000 (12:51 +0000)]
Fix init order in the LinuxKPI for RCU support.

CPU_FOREACH() is not available until SI_SUB_CPU at SI_ORDER_ANY
when the LinuxKPI is loaded as part of the kernel.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoRevert accidentally changed std.armv6 in r318024.
Michal Meloun [Tue, 9 May 2017 12:32:31 +0000 (12:32 +0000)]
Revert accidentally changed std.armv6 in r318024.

MFC with: r318024
MFC after: 2 weeks

7 years agoFix _Unwind_Backtrace symbol version for ARM.
Michal Meloun [Tue, 9 May 2017 12:14:00 +0000 (12:14 +0000)]
Fix _Unwind_Backtrace symbol version for ARM.

In real GNU libgcc, _Unwind_Backtrace is published with GCC_3.3 version
for all architectures but ARM. For ARM it's publishes with GCC_4.3.0
version.
This exception is not implement in your version of libggc, thus we
export _Unwind_Backtrace with bad version. To maintain backward
compatibility, publish _Unwind_Backtrace twice, once as compatible
symbol with GCC_3.3 version, and once as default symbol with
GCC_4.3.0 version.

While I'm in, fix typo in GCC_4.2.0 to GCC_4.3.0 inheritance declaration.

MFC after: 2 weeks

7 years agoIntroduce pmap_remap_vm_attr(),
Michal Meloun [Tue, 9 May 2017 11:05:32 +0000 (11:05 +0000)]
Introduce pmap_remap_vm_attr(),
it allows to remap one VM memattr class to another.

This function is intent to be used as workaround for various SoC bugs,
mainly access ordering/sequencing related bugs in crossbar fabric.

Inspired by: https://reviews.freebsd.org/D10218
MFC after: 2 weeks

7 years agoFix device paths for USB serial adapters: the formatting strings
Edward Tomasz Napierala [Tue, 9 May 2017 08:36:09 +0000 (08:36 +0000)]
Fix device paths for USB serial adapters: the formatting strings
contain "%u", differently from eg uart(4) which uses "%r".

Suggested by: bde@
MFC after: 2 weeks

7 years agoFix mistake introduced to uart(4) man page in r317463.
Edward Tomasz Napierala [Tue, 9 May 2017 08:31:34 +0000 (08:31 +0000)]
Fix mistake introduced to uart(4) man page in r317463.

MFC after: 2 weeks

7 years agoAdjust a comment.
Bjoern A. Zeeb [Tue, 9 May 2017 08:29:55 +0000 (08:29 +0000)]
Adjust a comment.

MFC after: 3 days

7 years agocxgbe(4): Fixes related to the knob that controls link autonegotiation.
Navdeep Parhar [Tue, 9 May 2017 08:08:28 +0000 (08:08 +0000)]
cxgbe(4): Fixes related to the knob that controls link autonegotiation.

- Do not leak the adapter lock in sysctl_autoneg.
- Accept only 0 or 1 as valid settings for autonegotiation.
- A fixed speed must be requested by the driver when autonegotiation is
  disabled otherwise the firmware will reject the l1cfg command.  Use
  the top speed supported by the port for now.

MFC after: 3 days
Sponsored by: Chelsio Communications

7 years ago[iwm] Move in_phyctxt from struct iwm_node to phy_ctxt in struct iwm_vap.
Adrian Chadd [Tue, 9 May 2017 05:32:35 +0000 (05:32 +0000)]
[iwm] Move in_phyctxt from struct iwm_node to phy_ctxt in struct iwm_vap.

* This better matches how things are organized in Linux's iwlwifi.

Obtained from: dragonflybsd.git 0cf16dd2e0e09a3e5140e50222ac2e69bcdb19a2

7 years ago[iwm] Allow listening on both chains/atennas to get diversity.
Adrian Chadd [Tue, 9 May 2017 05:31:38 +0000 (05:31 +0000)]
[iwm] Allow listening on both chains/atennas to get diversity.

This might improve throughput slightly when far from the accesspoint,
apparently by allowing the firmware to listen on either of the two
antennas (if there are two, i.e. on 7260/7265/8260), whichever has
a better reception.

Obtained from: dragonflybsd.git 3b7fc5aac51f81062da0a2c8fdac23e683fbd548

7 years agoMark this Makefile SUBDIR_PARALLEL
Enji Cooper [Tue, 9 May 2017 05:22:51 +0000 (05:22 +0000)]
Mark this Makefile SUBDIR_PARALLEL

I inserted the necessary SUBDIR+= .WAIT in the previous commit

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agostyle(9): sort headers
Enji Cooper [Tue, 9 May 2017 05:08:47 +0000 (05:08 +0000)]
style(9): sort headers

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoAdd MK_TESTS to kern.opts.mk to support r31800
Enji Cooper [Tue, 9 May 2017 05:03:35 +0000 (05:03 +0000)]
Add MK_TESTS to kern.opts.mk to support r31800

MFC after: 3 weeks
MFC with: r318008
Pointyhat to: ngie
Sponsored by: Dell EMC Isilon

7 years agoOnly compile tests/ if MK_TESTS != no or ALL_MODULES is defined
Enji Cooper [Tue, 9 May 2017 04:59:05 +0000 (04:59 +0000)]
Only compile tests/ if MK_TESTS != no or ALL_MODULES is defined

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoAdd intermediary Makefile for compiling all items in the directory
Enji Cooper [Tue, 9 May 2017 04:56:14 +0000 (04:56 +0000)]
Add intermediary Makefile for compiling all items in the directory

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agostyle(9): sort headers and remove duplicates
Enji Cooper [Tue, 9 May 2017 04:54:29 +0000 (04:54 +0000)]
style(9): sort headers and remove duplicates

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years ago[iwm] Add basic powermanagement support via ifconfig wlan0 powersave.
Adrian Chadd [Tue, 9 May 2017 04:15:07 +0000 (04:15 +0000)]
[iwm] Add basic powermanagement support via ifconfig wlan0 powersave.

* The DEVICE_POWER_FLAGS_CAM_MSK flag was removed in the upstream iwlwifi
  in Linux commit ceef91c89480dd18bb3ac51e91280a233d0ca41f.

* Add sc_ps_disabled flag to struct iwm_softc, which corresponds to
  mvm->ps_disabled in struct iwl_mvm in Linux iwlwifi.

* Adds a hw.iwm.power_scheme tunable which corresponds to the power_scheme
  module parameter in Linux iwlwifi. Set this to 1 for completely
  disabling power management, 2 (default) for balanced powermanagement,
  and 3 for lowerpower mode (which does dtim period skipping).

* Imports the constants.h file from iwlwifi as if_iwm_constants.h.

* This doesn't allow changing the powermanagement setting while connected,
  also one can only choose between enabled and disabled powersaving with
  ifconfig (so switching between balanced and low-power mode requires
  rebooting to change the tunable).

* After any changes to powermanagement (i.e. "ifconfig wlan0 powersave" to
  enable powermanagement, or "ifconfig wlan0 -powersave" for disabling
  powermanagement), one has to disconnect and reconnect to the accespoint
  for the change to take effect.

Obtained from: dragonflybsd.git d7002a7990d077c92585978ea998474af50f91e0

7 years agoRemove expected failure that no longer fails with gnu grep in base
Enji Cooper [Tue, 9 May 2017 04:11:53 +0000 (04:11 +0000)]
Remove expected failure that no longer fails with gnu grep in base

Reported by: Jenkins
Submitted by: Kyle Evans <kevans91@ksu.edu>
Sponsored by: Dell EMC Isilon

7 years ago[iwm] Add iwm_nic_unlock() calls missing from previous commit.
Adrian Chadd [Tue, 9 May 2017 02:42:53 +0000 (02:42 +0000)]
[iwm] Add iwm_nic_unlock() calls missing from previous commit.

Obtained from: dragonflybsd.git f88ab372284e63c4c13da93e9026a203b9b4cdc5

7 years ago[iwm] iwm_{read,write}_prph() don't grab the nic lock in iwm themselves.
Adrian Chadd [Tue, 9 May 2017 02:41:33 +0000 (02:41 +0000)]
[iwm] iwm_{read,write}_prph() don't grab the nic lock in iwm themselves.

* Fix a couple of cases where the nic lock ended up not being grabbed
  during an iwm_read_prph() or iwm_write_prph().

Obtained from: dragonflybsd.git 6c5470f2db219c61e362c981fea969d97e1b8293

7 years ago[iwm] include opt_iwm.h and opt_wlan.h consistently in all files.
Adrian Chadd [Tue, 9 May 2017 02:38:23 +0000 (02:38 +0000)]
[iwm] include opt_iwm.h and opt_wlan.h consistently in all files.

7 years agoDIRDEPS_BUILD: Update dependencies.
Bryan Drewery [Tue, 9 May 2017 01:48:23 +0000 (01:48 +0000)]
DIRDEPS_BUILD: Update dependencies.

Sponsored by: Dell EMC Isilon

7 years agoDIRDEPS_BUILD: Connect new directories.
Bryan Drewery [Tue, 9 May 2017 01:48:14 +0000 (01:48 +0000)]
DIRDEPS_BUILD: Connect new directories.

Sponsored by: Dell EMC Isilon

7 years agoFix invalid .o SRCS from r314527.
Bryan Drewery [Tue, 9 May 2017 01:48:02 +0000 (01:48 +0000)]
Fix invalid .o SRCS from r314527.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoFix bug where MTX_DEF lock was held while taskqueue_drain() was invoked.
David C Somayajulu [Tue, 9 May 2017 01:01:41 +0000 (01:01 +0000)]
Fix bug where MTX_DEF lock was held while taskqueue_drain() was invoked.
Check IFF_DRV_RUNNING flag is set prior to calling ql_hw_set_multi()

MFC after:3 days

7 years ago- Also outside of the KOBJOPLOOKUP macro - which in turn is used by
Marius Strobl [Mon, 8 May 2017 21:08:39 +0000 (21:08 +0000)]
- Also outside of the KOBJOPLOOKUP macro - which in turn is used by
  the code auto-generated for *.m - kobj_lookup_method(9) is useful;
  for example in back-ends or base class device drivers in order to
  determine whether a default method has been overridden. Thus, allow
  for the kobj_method_t pointer argument - used by KOBJOPLOOKUP in
  order to update the cache entry - of kobj_lookup_method(9), to be
  NULL. Actually, that pointer is redundant as it's just set to the
  same kobj_method_t that the kobj_lookup_method(9) function returns
  in the first place, but probably it serves to reduce the number of
  instructions generated for KOBJOPLOOKUP.
- For the same reason, move updating kobj_lookup_{hits,misses} (if
  KOBJ_STATS is defined) from kobj_lookup_method(9) to KOBJOPLOOKUP.
  As a side-effect, this gets rid of the convoluted approach of always
  incrementing kobj_lookup_hits in KOBJOPLOOKUP and then in case of
  a cache miss, decrementing it in kobj_lookup_method(9) again.

7 years agoRevise r315430; there's no need to build mmc_subr.c into both mmc.ko
Marius Strobl [Mon, 8 May 2017 20:58:32 +0000 (20:58 +0000)]
Revise r315430; there's no need to build mmc_subr.c into both mmc.ko
and mmcsd.ko.

7 years agoFix syntax error in parse_path after r316952.
Bryan Drewery [Mon, 8 May 2017 20:44:21 +0000 (20:44 +0000)]
Fix syntax error in parse_path after r316952.

Also fix bad whitespace in sort_unique after r314809.

The parse_path syntax error came up in DIRDEPS_BUILD as the following
and emptied out all Makefile.depend files due to it:

# python share/mk/meta2deps.py
  File "share/mk/meta2deps.py", line 538
    rdir = os.path.realpath(dir)
    ^
IndentationError: unexpected indent

Sponsored by: Dell EMC Isilon

7 years agoRemove MK_MANDOCDB option missed in r315057
Bryan Drewery [Mon, 8 May 2017 20:44:12 +0000 (20:44 +0000)]
Remove MK_MANDOCDB option missed in r315057

7 years agoHonor WITHOUT_LIB32 on mips64.
John Baldwin [Mon, 8 May 2017 18:51:13 +0000 (18:51 +0000)]
Honor WITHOUT_LIB32 on mips64.

The closing paren for the list of architectures that should enable LIB32
by default was in the wrong place resulting in LIB32 always be enabled on
mips64 regardless of WITH_LIB32/WITHOUT_LIB32.

Submitted by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Obtained from: CheriBSD
Sponsored by: DARPA / AFRL

7 years agoRestore `sectorsize` global to unbreak makefs after r317744
Enji Cooper [Mon, 8 May 2017 18:42:38 +0000 (18:42 +0000)]
Restore `sectorsize` global to unbreak makefs after r317744

This also unbreaks the fstyp tests.

Reported by: Alastair Hogge <agh@fastmail.fm>, Jenkins
Sponsored by: Dell EMC Isilon

7 years agoFix the build after r317942 by adding usr.bin/csplit to BSD.tests.dist
Enji Cooper [Mon, 8 May 2017 17:13:00 +0000 (17:13 +0000)]
Fix the build after r317942 by adding usr.bin/csplit to BSD.tests.dist

Pointyhat to: cem
MFC with: r317942
Sponsored by: Dell EMC Isilon

7 years agomakefs: further size_t warning cleanup (missing from r317944)
Ed Maste [Mon, 8 May 2017 16:57:33 +0000 (16:57 +0000)]
makefs: further size_t warning cleanup (missing from r317944)

Sponsored by: The FreeBSD Foundation

7 years agomakefs: cast snprintf return value to size_t to clear warning
Ed Maste [Mon, 8 May 2017 16:34:39 +0000 (16:34 +0000)]
makefs: cast snprintf return value to size_t to clear warning

Sponsored by: The FreeBSD Foundation

7 years agocsplit(1): Fix extraneous output in edge case
Conrad Meyer [Mon, 8 May 2017 15:51:29 +0000 (15:51 +0000)]
csplit(1): Fix extraneous output in edge case

When the input to csplit contains fewer lines than the number of matches
specified, extra output was mistakenly included in some output files.

Fix the bug and add a simple ATF regression test.

PR: 219024
Submitted by: J.R. Oldroyd <fbsd at opal.com>

7 years agoAdd myself (dbaio) as a new ports committer
Danilo G. Baio [Mon, 8 May 2017 14:33:38 +0000 (14:33 +0000)]
Add myself (dbaio) as a new ports committer

Approved by: garga (mentor)
Differential Revision: https://reviews.freebsd.org/D10633

7 years agoarch(7): correct initial versions for alpha and pc98
Ed Maste [Mon, 8 May 2017 14:17:10 +0000 (14:17 +0000)]
arch(7): correct initial versions for alpha and pc98

Submitted by: imp

7 years agomakefs: use size_t as appropriate to clean up warnings
Ed Maste [Mon, 8 May 2017 13:09:27 +0000 (13:09 +0000)]
makefs: use size_t as appropriate to clean up warnings

Sponsored by: The FreeBSD Foundation

7 years agoSort variable declarations; no functional changes.
Edward Tomasz Napierala [Mon, 8 May 2017 09:14:41 +0000 (09:14 +0000)]
Sort variable declarations; no functional changes.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoAdd resizewin -z. It makes resizewin not do anything if the terminal
Edward Tomasz Napierala [Mon, 8 May 2017 08:58:51 +0000 (08:58 +0000)]
Add resizewin -z. It makes resizewin not do anything if the terminal
size is already set to something other than zero. It's supposed to be
called from eg /etc/profile - it's not neccessary to query terminal
size when logging in over the network, because the protocol used already
takes care of this, but it's neccessary when logging over a serial line.

Reviewed by: cem, Daniel O'Connor <darius@dons.net.au>
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10637

7 years agoUse tcflush(3) instead of (nonstandard) TIOCFLUSH.
Edward Tomasz Napierala [Mon, 8 May 2017 08:34:50 +0000 (08:34 +0000)]
Use tcflush(3) instead of (nonstandard) TIOCFLUSH.

Reported by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoFix mount_nfs so that it doesn't create mounttab entries for NFSv4 mounts.
Rick Macklem [Mon, 8 May 2017 00:45:05 +0000 (00:45 +0000)]
Fix mount_nfs so that it doesn't create mounttab entries for NFSv4 mounts.

The NFSv4 protocol doesn't use the Mount protocol, so it doesn't make sense
to add an entry for an NFSv4 mount to /var/db/mounttab. Also, r308871
modified umount so that it doesn't remove any entry created by mount_nfs.
Reported on freebsd-current@.

Reported by: clbuisson@orange.fr
MFC after: 2 weeks

7 years agoAdd necessary bits to get FreeBSD booting on the Unifi Security Gateway
Justin Hibbits [Sun, 7 May 2017 22:04:12 +0000 (22:04 +0000)]
Add necessary bits to get FreeBSD booting on the Unifi Security Gateway

Summary:
The Ubiquiti Unifi Security Gateway is virtually identical to the
EdgeRouter Lite, with a smaller PCB and apparently a different board identifier.
Simply adding the new board identifier alongside the ERL identifier, FreeBSD
boots successfully, and can access the needed peripherals (tested with USB
booting, and basic pings on one ethernet interface)

Reviewed By: adrian
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10639

7 years agoFix the output of very large rebind, renew and lease time options in
Nick Hibma [Sun, 7 May 2017 21:11:28 +0000 (21:11 +0000)]
Fix the output of very large rebind, renew and lease time options in
lease file.

Some routers set very large values for rebind time (Netgear) and these
are erroneously reported as negative in the leasefile. This was due to a
wrong printf format specification of %ld for an unsigned long on 32-bit
platforms.

7 years agoFix handling of large DHCP expiry values.
Nick Hibma [Sun, 7 May 2017 19:59:37 +0000 (19:59 +0000)]
Fix handling of large DHCP expiry values.

They would overflow a signed 32-bit time_t on 32 bit architectures. This
was taken care of, but a compiler optimisation makes this behave
erratically. This could be resolved by adding a -fwrapv flag, but
instead we can check the value before adding the current timestamp to
it.

In the lease file values are still wrong though:

  option dhcp-rebinding-time -644245096;

PR: 218980
Reported by: Bob Eager
MFC after: 2 weeks

7 years agoglob: Fix comment about collapsing asterisks after r317749.
Jilles Tjoelker [Sun, 7 May 2017 19:52:56 +0000 (19:52 +0000)]
glob: Fix comment about collapsing asterisks after r317749.

After r317749, collapsing adjacent asterisks is still required, but for a
different reason.

7 years agosh: Fix INTOFF leak after a builtin with different locale settings.
Jilles Tjoelker [Sun, 7 May 2017 19:49:46 +0000 (19:49 +0000)]
sh: Fix INTOFF leak after a builtin with different locale settings.

After executing a builtin with different locale settings such as
  LC_ALL=C true
SIGINT handling was left disabled indefinitely.

MFC after: 1 week

7 years agoBring VOP_GETPAGES.9 more up-to-date
Benjamin Kaduk [Sun, 7 May 2017 19:01:08 +0000 (19:01 +0000)]
Bring VOP_GETPAGES.9 more up-to-date

Attempt to catch up to the KPI changes from r292373, and perform
some other tidying while in the area.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D10579

7 years agoMake resizewin(1) discard the terminal queues, to lower the chance
Edward Tomasz Napierala [Sun, 7 May 2017 17:21:22 +0000 (17:21 +0000)]
Make resizewin(1) discard the terminal queues, to lower the chance
for "unable to parse response" error which happens when youre typing
too fast for the machine you're running it on.

Reviewed by: cem, Daniel O'Connor <darius@dons.net.au>
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10624

7 years agoRemove spl() calls from UFS code.
Konstantin Belousov [Sun, 7 May 2017 14:59:45 +0000 (14:59 +0000)]
Remove spl() calls from UFS code.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agopf: Fix vnet initialisation
Kristof Provost [Sun, 7 May 2017 14:33:58 +0000 (14:33 +0000)]
pf: Fix vnet initialisation

When running the vnet init code (pf_load_vnet()) we used to iterate over
all vnets, marking them as unhooked.
This is incorrect and leads to panics if pf is unloaded, as the unload
code does not unregister the pfil hooks (because the vnet is marked as
unhooked).

There's no need or reason to touch other vnets during initialisation.
Their pf_load_vnet() function will be triggered, which handles all
required initialisation.

Reviewed by: zec, gnn
Differential Revision: https://reviews.freebsd.org/D10592