]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agofix zfs set canmount=off on an unmounted filesystem
avg [Sun, 3 Apr 2016 07:42:13 +0000 (07:42 +0000)]
fix zfs set canmount=off on an unmounted filesystem

Previously this operation tried to unmount and remount children.
Also see https://www.illumos.org/issues/6428.

MFC after: 2 weeks
X-Needs-Upstreaming: illumos

8 years agozfs receive: -u can be ignored sometimes
avg [Sun, 3 Apr 2016 07:40:33 +0000 (07:40 +0000)]
zfs receive: -u can be ignored sometimes

When force-receiving a filesystem that was already mounted the re-created
filesystem is mounted despite -u flag.

Also see https://www.illumos.org/issues/6412.

PR: 204705
Tested by: Vladimir Krstulja <vlad-fbsd@acheronmedia.com>
MFC after: 2 weeks
X-Needs-Upstreaming: illumos

8 years agoMove Linux specific times tests up to guarantee the values are defined.
dchagin [Sun, 3 Apr 2016 06:33:16 +0000 (06:33 +0000)]
Move Linux specific times tests up to guarantee the values are defined.

CID: 1305178
Submitted by: pfg@
MFC after: 1 week

8 years agoImprove HDMI display detection by searching the CEA-861 extension block for
jmcneill [Sat, 2 Apr 2016 16:53:12 +0000 (16:53 +0000)]
Improve HDMI display detection by searching the CEA-861 extension block for
an HDMI vendor-specific data block (VSDB) containing the HDMI 24-bit IEEE
registration ID (0x000C03).

Approved by: gonzo (mentor)

8 years agoremove emulation of VFS_HOLD and VFS_RELE from opensolaris compat
avg [Sat, 2 Apr 2016 16:25:46 +0000 (16:25 +0000)]
remove emulation of VFS_HOLD and VFS_RELE from opensolaris compat

On FreeBSD VFS_HOLD/VN_RELE were mapped to MNT_REF/MNT_REL that
manipulate mnt_ref.  But the job of properly maintaining the reference
count is already automatically performed by insmntque(9) and
delmntque(9).  So, in effect all ZFS vnodes referenced the corresponding
mountpoint twice.

That was completely harmless, but we want to be very explicit about what
FreeBSD VFS APIs are used, because illumos VFS_HOLD and FreeBSD MNT_REF
provide quite different guarantees with respect to the held vfs_t /
mountpoint.  On illumos VFS_HOLD is sufficient to guarantee that
vfs_t.vfs_data stays valid.  On the other hand, on FreeBSD MNT_REF does
*not* provide the same guarantee about mnt_data.  We have to use
vfs_busy() to get that guarantee.

Thus, the calls to VFS_HOLD/VFS_RELE on vnode init and fini are removed.
VFS_HOLD calls are replaced with vfs_busy in the ioctl handlers.

And because vfs_busy has a richer interface that can not be dumbed down
in all cases it's better to explicitly use it rather than trying to mask
it behind VFS_HOLD.

This change fixes a panic that could result from a race between
zfs_umount() and zfs_ioc_rollback().  We observed a case where
zfsvfs_free() tried to destroy data that zfsvfs_teardown() was still
using.  That happened because there was nothing to prevent unmounting of
a ZFS filesystem that was in between zfs_suspend_fs() and
zfs_resume_fs().

Reviewed by: kib, smh
MFC after: 3 weeks
Sponsored by: ClusterHQ
Differential Revision: https://reviews.freebsd.org/D2794

8 years agoAdd configurable rate limit for "log" and "devctl" actions.
trasz [Sat, 2 Apr 2016 09:11:52 +0000 (09:11 +0000)]
Add configurable rate limit for "log" and "devctl" actions.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoMFV r297506: 6738 zfs send stream padding needs documentation
mav [Sat, 2 Apr 2016 08:36:24 +0000 (08:36 +0000)]
MFV r297506: 6738 zfs send stream padding needs documentation

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Eli Rosenthal <eli.rosenthal@delphix.com>

illumos/illumos-gate@c20404ff77119516354b0d112d28b7ea0dadd303

8 years agoMFV r297505:
mav [Sat, 2 Apr 2016 08:34:15 +0000 (08:34 +0000)]
MFV r297505:
6739 userland version of cv_timedwait_hires() always assumes absolute time

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>

illumos/illumos-gate@41c6413cb54bf338d7a59ed789ec2e0e44c35e6f

8 years agoMFV r297504: 6681 zfs list burning lots of time in dodefault() via dsl_prop_*
mav [Sat, 2 Apr 2016 08:28:46 +0000 (08:28 +0000)]
MFV r297504: 6681 zfs list burning lots of time in dodefault() via dsl_prop_*

Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Alex Wilson <alex.wilson@joyent.com>

illumos/illumos-gate@d09e4475f635b6f66ee68d8c17a32bba7be17c96

8 years agoOutput information about PCI-e devices with slots.
jhb [Sat, 2 Apr 2016 01:59:53 +0000 (01:59 +0000)]
Output information about PCI-e devices with slots.

In particular this includes additional information on HotPlug capable
slots.

8 years agoVarious updates to the PCI-express capability output.
jhb [Sat, 2 Apr 2016 01:55:43 +0000 (01:55 +0000)]
Various updates to the PCI-express capability output.

- Group the output so that it follows the capability register set more
  closely.  The first line now contains device information and the
  second line contains link information.  As a result, ARI status is now
  output on the first line, and the link width is moved down to the second
  line of link information.
- Only read the DEVICE_CAP2 register to check for ARI if the capability
  version is >= 2.
- Don't output any link information if the link capability and status
  registers are zero.
- Label the MSI interrupt index value as "MSI" instead of "IRQ".

8 years agoSmall typo.
pfg [Sat, 2 Apr 2016 01:14:51 +0000 (01:14 +0000)]
Small typo.

8 years agoFollow-up r297282: Make the COPTS warning more useful.
bdrewery [Fri, 1 Apr 2016 23:31:57 +0000 (23:31 +0000)]
Follow-up r297282: Make the COPTS warning more useful.

Sponsored by: EMC / Isilon Storage Division

8 years agoSet the chunk id for ERROR chunks.
tuexen [Fri, 1 Apr 2016 20:38:15 +0000 (20:38 +0000)]
Set the chunk id for ERROR chunks.
This is work with rrs@.
MFC after: 1 week

8 years agoMove support for Synopsys Designware APB UART out of ns8250 and into a
jmcneill [Fri, 1 Apr 2016 20:26:45 +0000 (20:26 +0000)]
Move support for Synopsys Designware APB UART out of ns8250 and into a
separate driver. Add support for activating clock and hwreset resources
for these devices when the EXT_RESOURCES option is present.

Reviewed by: andrew, mmel, Emmanuel Vadot <manu@bidouilliste.com>
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5749

8 years agoFix mismerge.
trasz [Fri, 1 Apr 2016 18:45:04 +0000 (18:45 +0000)]
Fix mismerge.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoDrop the 'resource' argument to racct_decay(); it wouldn't make sense
trasz [Fri, 1 Apr 2016 18:36:10 +0000 (18:36 +0000)]
Drop the 'resource' argument to racct_decay(); it wouldn't make sense
to iterate separately for each resource.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoCap IOSIZE_MAX to INT_MAX for 32-bit processes.
jhb [Fri, 1 Apr 2016 18:29:38 +0000 (18:29 +0000)]
Cap IOSIZE_MAX to INT_MAX for 32-bit processes.

Previously, freebsd32 binaries could submit read/write requests with lengths
greater than INT_MAX that a native kernel would have rejected.

Reviewed by: kib
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D5788

8 years agoCall rctl_enforce() in all cases the resource usage goes up, even when called
trasz [Fri, 1 Apr 2016 17:28:55 +0000 (17:28 +0000)]
Call rctl_enforce() in all cases the resource usage goes up, even when called
from racct_*_force() functions.  It makes the "log" and "devctl" actions work
in those cases.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoReorder the functions; no functional changes.
trasz [Fri, 1 Apr 2016 17:21:55 +0000 (17:21 +0000)]
Reorder the functions; no functional changes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoReduce code duplication.
trasz [Fri, 1 Apr 2016 17:17:32 +0000 (17:17 +0000)]
Reduce code duplication.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoReduce code duplication. There should be no (intended) functional changes.
trasz [Fri, 1 Apr 2016 17:05:46 +0000 (17:05 +0000)]
Reduce code duplication.  There should be no (intended) functional changes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRepair a overflow condition where a user could submit a string that was
sbruno [Fri, 1 Apr 2016 16:16:26 +0000 (16:16 +0000)]
Repair a overflow condition where a user could submit a string that was
not getting a proper bounds check.

Thanks to CTurt for pointing at this with a big red blinking neon sign.

PR: 206761
Submitted by: sson
Reviewed by: cturt@hardenedbsd.org
MFC after: 3 days

8 years agoFix PowerPC LINT build after r297392
zbb [Fri, 1 Apr 2016 09:07:18 +0000 (09:07 +0000)]
Fix PowerPC LINT build after r297392

PowerPC has real Open Firmware and does not necessarily need FDT.
Make ofwpci.c only PCI dependent.

Pointed out by: emaste
Reviewed by: nwhitehorn
Obtained from: Semihalf

8 years agoStyle(9), use tabs for the #define LOOPS line.
kib [Fri, 1 Apr 2016 08:47:23 +0000 (08:47 +0000)]
Style(9), use tabs for the #define LOOPS line.
Print unsigned values with %u.
Make code slightly more compact by inlining loop limit.

Noted by: bde
Sponsored by: The FreeBSD Foundation

8 years agotcp/lro: Change SLIST to LIST, so that removing an entry is O(1)
sephe [Fri, 1 Apr 2016 06:43:05 +0000 (06:43 +0000)]
tcp/lro: Change SLIST to LIST, so that removing an entry is O(1)

This is kinda critical to the performance when the CPU is slow and
network bandwidth is high, e.g. in the hypervisor.

Reviewed by: rrs, gallatin, Dexuan Cui <decui microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5765

8 years agotcp/lro: Use tcp_lro_flush_all in device drivers to avoid code duplication
sephe [Fri, 1 Apr 2016 06:28:33 +0000 (06:28 +0000)]
tcp/lro: Use tcp_lro_flush_all in device drivers to avoid code duplication

And factor out tcp_lro_rx_done, which deduplicates the same logic with
netinet/tcp_lro.c

Reviewed by: gallatin (1st version), hps, zbb, np, Dexuan Cui <decui microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5725

8 years agohyperv: Register Hyper-V timer early enough for TSC freq calibration
sephe [Fri, 1 Apr 2016 06:17:57 +0000 (06:17 +0000)]
hyperv: Register Hyper-V timer early enough for TSC freq calibration

The i8254 simulation in Hyper-V is kinda broken and is not available
in Generation 2 Hyper-V VMs, so Hyper-V timer must be registered early
enough so that it can be used to do the TSC freq calibration.

This fixes the notorious warning like this:
calcru: runtime went backwards from 50 usec to 25 usec for pid 0 (kernel)

Submitted by: Dexuan Cui <decui microsoft com>
Reviewed by: kib, sephe
Tested by: kib, sephe
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5778

8 years agoUpdate comment: Linux does set a randomized generation number of an inode
kevlo [Fri, 1 Apr 2016 03:21:01 +0000 (03:21 +0000)]
Update comment: Linux does set a randomized generation number of an inode
on ext2/3/4.

While here use arc4random() instead of random().

Reviewed by: pfg
MFC after: 3 days

8 years agomtest: Prevent access to uninitialized value.
pfg [Fri, 1 Apr 2016 01:35:52 +0000 (01:35 +0000)]
mtest: Prevent access to uninitialized value.

case 'g' makes use of value n, which is initialized for case 'b'
and passe through to case 'g'. If case 'g' is called directly
value 'n' is not initialized.

Avoid the issue by initializing n before entering the switch.

CID: 1006375
Reviewed by: bms

8 years agoAdd a cross reference to ktrace(2).
brooks [Thu, 31 Mar 2016 23:57:03 +0000 (23:57 +0000)]
Add a cross reference to ktrace(2).

Obtained from: CheriBSD (9cb420d6b7f04c1b7d2006180b80932e5d3fe50e)
MFC after: 1 week
Sponsored by: DARPA, AFRL

8 years agoDocument KTRFAC_FAULT and KTRFAC_FAULTEND.
brooks [Thu, 31 Mar 2016 23:55:19 +0000 (23:55 +0000)]
Document KTRFAC_FAULT and KTRFAC_FAULTEND.

Obtained from: CheriBSD (9d70f563f1b033e6a9b51eaf3b145a8cbbc6617c)
MFC after: 1 week
Sponsored by: DARPA, AFRL

8 years agoCorrect error messages in recently added test.
jhb [Thu, 31 Mar 2016 21:25:40 +0000 (21:25 +0000)]
Correct error messages in recently added test.

The large read test uses an empty file created via mkstemp() rather than
/dev/null as character devices are subject to two different clamping
sysctls.  However, I forgot to update some of the error messages after
changing to mkstemp() that were still referring to /dev/null.

8 years agoFix an error in r292373. Use proper count to update "pages in" counter.
glebius [Thu, 31 Mar 2016 21:15:00 +0000 (21:15 +0000)]
Fix an error in r292373. Use proper count to update "pages in" counter.

Noticed by: pfg via Coverity

8 years agopci_emul_dior(): fix uninitialized scalar variable.
pfg [Thu, 31 Mar 2016 19:07:03 +0000 (19:07 +0000)]
pci_emul_dior(): fix uninitialized scalar variable.

Prevent from returning an unitialized value in case the
ior size is unknown.

CID: 1194319
Reviewed by: grehan

8 years agoCatch up with some more fields. I needed the bpf one lately.
bz [Thu, 31 Mar 2016 18:53:13 +0000 (18:53 +0000)]
Catch up with some more fields. I needed the bpf one lately.

Sponsored by: The FreeBSD Foundation

8 years agoMake Position Independent Executables work for CloudABI.
ed [Thu, 31 Mar 2016 18:52:00 +0000 (18:52 +0000)]
Make Position Independent Executables work for CloudABI.

- Set BI_CAN_EXEC_DYN, so we can execute ET_DYN ELF files in addition to
  regular ET_EXECs.
- Provide an AT_BASE entry in the auxiliary vector, so the executable
  knows at which address it got loaded and can apply relocations.

8 years agoRegenerate system call table after r297468.
ed [Thu, 31 Mar 2016 18:50:52 +0000 (18:50 +0000)]
Regenerate system call table after r297468.

8 years agoSync in the latest CloudABI system call definitions.
ed [Thu, 31 Mar 2016 18:50:06 +0000 (18:50 +0000)]
Sync in the latest CloudABI system call definitions.

Some time ago I made a change to merge together the memory scope
definitions used by mmap (MAP_{PRIVATE,SHARED}) and lock objects
(PTHREAD_PROCESS_{PRIVATE,SHARED}). Though that sounded pretty smart
back then, it's backfiring. In the case of mmap it's used with other
flags in a bitmask, but for locking it's an enumeration. As our plan is
to automatically generate bindings for other languages, that looks a bit
sloppy.

Change all of the locking functions to use separate flags instead.

Obtained from: https://github.com/NuxiNL/cloudabi

8 years agoRemove #ifdef's from various structures used in the cxgbe/cxl driver.
jhb [Thu, 31 Mar 2016 18:36:50 +0000 (18:36 +0000)]
Remove #ifdef's from various structures used in the cxgbe/cxl driver.

This provides a constant ABI and layout for these structures (especially
struct adapter) avoiding some foot shooting.

Discussed with: np
Sponsored by: Chelsio Communications

8 years agoRework handling of thread sleeps before timers are working.
jhb [Thu, 31 Mar 2016 18:10:29 +0000 (18:10 +0000)]
Rework handling of thread sleeps before timers are working.

Previously, calls to *sleep() and cv_*wait*() immediately returned during
early boot.  Instead, permit threads that request a sleep without a
timeout to sleep as wakeup() works during early boot.  Sleeps with
timeouts are harder to emulate without working timers, so just punt and
panic explicitly if any thread tries to use those before timers are
working.  Any threads that depend on timeouts should either wait until
SI_SUB_KICK_SCHEDULER to start or they should use DELAY() until timers
are available.

Until APs are started earlier this should be a no-op as other kthreads
shouldn't get a chance to start running until after timers are working
regardless of when they were created.

Reviewed by: kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D5724

8 years agoRefactor; no functional changes.
trasz [Thu, 31 Mar 2016 17:32:28 +0000 (17:32 +0000)]
Refactor; no functional changes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoTidy up the unmapped I/O code in qphysio.
jhb [Thu, 31 Mar 2016 17:27:30 +0000 (17:27 +0000)]
Tidy up the unmapped I/O code in qphysio.

- Move some blocks around to reduce the number of 'if (unmap)' checks.
- Use 'pbuf == NULL' instead of 'unmap'.
- Use nitems.
- Pull an assignment out of an if expression.

Reviewed by: kib
Sponsored by: Chelsio Communications

8 years agoWITHOUT_TOOLCHAIN: Skip building of h_raw.
bdrewery [Thu, 31 Mar 2016 17:27:17 +0000 (17:27 +0000)]
WITHOUT_TOOLCHAIN: Skip building of h_raw.

-fsanitize does not seem to work when a --sysroot is specified and there
is no <sysroot>/usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.ubsan_standalone-*.a.

Sponsored by: EMC / Isilon Storage Division

8 years agoLIB32+WITHOUT_TOOLCHAIN: Fix build by staging includes.
bdrewery [Thu, 31 Mar 2016 17:27:14 +0000 (17:27 +0000)]
LIB32+WITHOUT_TOOLCHAIN: Fix build by staging includes.

This is the same fix as r297281 for the normal build.

Sponsored by: EMC / Isilon Storage Division

8 years agoWITHOUT_TOOLCHAIN: Fix build of rtld.
bdrewery [Thu, 31 Mar 2016 17:27:01 +0000 (17:27 +0000)]
WITHOUT_TOOLCHAIN: Fix build of rtld.

MK_TOOLCHAIN==no disables building and installing of pic archives.
c_pic.a is still needed for rtld though so force it to build in lib/libc
and link directly to the objdir version of it for rtld.

Somehow this has been broken since r148725.

Sponsored by: EMC / Isilon Storage Division

8 years agoImprove comments.
trasz [Thu, 31 Mar 2016 17:15:03 +0000 (17:15 +0000)]
Improve comments.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoAdd wait_event_interruptible_timeout to linuxkpi.
np [Thu, 31 Mar 2016 17:11:58 +0000 (17:11 +0000)]
Add wait_event_interruptible_timeout to linuxkpi.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Reviewed by: hselasky@
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D5776

8 years agoFix overflows, making it impossible to add negative amounts using rctl(8).
trasz [Thu, 31 Mar 2016 17:00:47 +0000 (17:00 +0000)]
Fix overflows, making it impossible to add negative amounts using rctl(8).

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix number of the enabled VFs in VNIC
zbb [Thu, 31 Mar 2016 16:44:32 +0000 (16:44 +0000)]
Fix number of the enabled VFs in VNIC

nic->num_vf_en is set based on the number of the enabled LMACs.
This number should not be overwritten later by any routine.
Instead it should fail PCI_IOV_ADD_VF() so that available VFs
with the corresponding LMACs will attach whereas other, disabled
VFs will fail with the proper error code.
Error signaling (due to improper number of VFs requested) is also moved
from PCI_IOV_INIT() to PCI_IOV_ADD_VF().

This will be reworked when multiple queue sets are enabled but for
now this is the correct behavior of the driver.

Obtained from: Semihalf
Sponsored by:  Cavium

8 years agoWe don't support DPLIBS.
bdrewery [Thu, 31 Mar 2016 16:09:59 +0000 (16:09 +0000)]
We don't support DPLIBS.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix minor problems caught by mandoc -Tlint.
brueffer [Thu, 31 Mar 2016 15:16:22 +0000 (15:16 +0000)]
Fix minor problems caught by mandoc -Tlint.

8 years agoDefine OBJTOP earlier if possible for use in targets.
bdrewery [Thu, 31 Mar 2016 14:48:17 +0000 (14:48 +0000)]
Define OBJTOP earlier if possible for use in targets.

Sponsored by: EMC / Isilon Storage Division

8 years agoDon't omit m_dup() for non-writeable mbufs that need checksum calculation
zbb [Thu, 31 Mar 2016 13:23:43 +0000 (13:23 +0000)]
Don't omit m_dup() for non-writeable mbufs that need checksum calculation

If the driver is not active or link is down the packet could remain
non-writeable. This commit makes all mbufs enqueued to the driver's
ring buffer to have correct attributes.

Pointed out by: wma
Reviewed by:    wma
Obtained from:  Semihalf
Sponsored by:   Cavium
Differential Revision: https://reviews.freebsd.org/D5800

8 years agoRemove NULL checks after M_WAITOK allocations, which - by definition - can
trasz [Thu, 31 Mar 2016 13:20:02 +0000 (13:20 +0000)]
Remove NULL checks after M_WAITOK allocations, which - by definition - can
never return NULL.

Reviewed by: arybchik@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5773

8 years agoFix MAC address configuration for VNIC
zbb [Thu, 31 Mar 2016 13:13:38 +0000 (13:13 +0000)]
Fix MAC address configuration for VNIC

The FDT description is as follows:
- phy-handle, reg, qlm-mode, mac-address are under nodes in bgx0/1 node
- phy nodes (pointed by phy-handle) are under MDIO even though they may
  not be connected through to MDIO. In those nodes they do not contain
  MAC address or etc.

This commit changes parsing of the FDT nodes for BGX so that it can
obtain correct MAC address for a given PHY.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5781

8 years agoImprove TX path of the VNIC driver
zbb [Thu, 31 Mar 2016 13:10:29 +0000 (13:10 +0000)]
Improve TX path of the VNIC driver

- Avoid memory leak when nicvf_tx_mbuf_locked() fails
- Introduce nicvf_xmit_locked() routine that uses drbr_peek(),
  drbr_advance() or drbr_putback() for a specific ifnet.
  This gives more clear and efficient design as well as
  prevents from dropping mbufs that where not sent due to temporary
  lack of descriptors.
- Add missing ETHER_BPF_MTAP() hook

Pointed out by: yongari
Reviewed by:    wma
Obtained from:  Semihalf
Sponsored by:   Cavium
Differential Revision: https://reviews.freebsd.org/D5534

8 years agoFix whois queries for ARIN AS numbers.
fanf [Thu, 31 Mar 2016 12:13:01 +0000 (12:13 +0000)]
Fix whois queries for ARIN AS numbers.

The ARIN whois server likes AS number queries to be in the form
"a 8075" rather than "as7085".

8 years agoFix typo in the VNIC's PF function name
zbb [Thu, 31 Mar 2016 12:10:17 +0000 (12:10 +0000)]
Fix typo in the VNIC's PF function name

Should be add_vf not addr_vf.

8 years agoDisable MSI-x for AHCI on Alpine plattform
zbb [Thu, 31 Mar 2016 11:18:52 +0000 (11:18 +0000)]
Disable MSI-x for AHCI on Alpine plattform

Changes introduced to AHCI code adding support for MSI-x
caused interrupt storm on Alpine boards.
This is unintended behaviour so added quirk to omit this functionality.

Reviewed by:   mav
Submitted by:  Marcin Mazurek <mma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Annapurna Labs
Differential Revision: https://reviews.freebsd.org/D4301

8 years agoAdd support for 4 level pagetables. The userland address space has been
andrew [Thu, 31 Mar 2016 11:07:24 +0000 (11:07 +0000)]
Add support for 4 level pagetables. The userland address space has been
increased to 256TiB. The kernel address space can also be increased to be
the same size, but this will be performed in a later change.

To help work with an extra level of page tables two new functions have
been added, one to file the lowest level table entry, and one to find the
block/page level. Both of these find the entry for a given pmap and virtual
address.

This has been tested with a combination of buildworld, stress2 tests, and
by using sort to consume a large amount of memory by sorting /dev/zero. No
new issues are known to be present from this change.

Reviewed by: kib
Obtained from: ABT Systems Ltd
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5720

8 years agoFix bugs in currently unused bit searching loop.
hselasky [Thu, 31 Mar 2016 06:19:15 +0000 (06:19 +0000)]
Fix bugs in currently unused bit searching loop.

MFC after: 3 days
Sponsored by: Mellanox Technologies

8 years agoAdd support for the Nuvoton NCT5104D.
adrian [Thu, 31 Mar 2016 04:57:38 +0000 (04:57 +0000)]
Add support for the Nuvoton NCT5104D.

Make it compile only for i386/amd64 for now as it's been tested there.
It's quite possible it'll show up elsewhere and we can enable it
for other architectures later.

Tested:

* PC Engines APU1C4

Submitted by: Daniel Wyatt <daniel@dewyatt.com>
Reviewed by: adrian, loos
Differential Revision: https://reviews.freebsd.org/D5389

8 years agohosttools: Trim unneeded directories.
bdrewery [Thu, 31 Mar 2016 03:04:26 +0000 (03:04 +0000)]
hosttools: Trim unneeded directories.

These should only be build tools that are in various Makefile.depend
as host dependencies.  Anything toolchain related is handled by
toolchain and bootstrap-tools currently.

Sponsored by: EMC / Isilon Storage Division

8 years agorestore(8): fix use of uninitialized value.
pfg [Thu, 31 Mar 2016 02:01:11 +0000 (02:01 +0000)]
restore(8): fix use of uninitialized value.

Prevent uninitialized use of scalar newvol when jumping to gethdr.

CID: 1006491

8 years agoUnbreak the RSS/PCBGROUp build.
gnn [Thu, 31 Mar 2016 00:53:23 +0000 (00:53 +0000)]
Unbreak the RSS/PCBGROUp build.

8 years agoDIRDEPS_BUILD: Don't reset OBJROOT in sub-makes.
bdrewery [Thu, 31 Mar 2016 00:26:40 +0000 (00:26 +0000)]
DIRDEPS_BUILD: Don't reset OBJROOT in sub-makes.

MAKEOBJDIRPREFIX is set to blank and exported from MAKELEVEL0 along
with OBJROOT exported.  In sub-makes OBJROOT is recalculated with
an empty MAKEOBJDIRPREFIX though.

Sponsored by: EMC / Isilon Storage Division

8 years agoRegenerate
bdrewery [Wed, 30 Mar 2016 23:56:43 +0000 (23:56 +0000)]
Regenerate

8 years agoRemove FAST_DEPEND reference missed in r297434.
bdrewery [Wed, 30 Mar 2016 23:53:12 +0000 (23:53 +0000)]
Remove FAST_DEPEND reference missed in r297434.

8 years agoFix the external GCC build after r297271 by setting -L <sysroot>/usr/lib.
bdrewery [Wed, 30 Mar 2016 23:50:29 +0000 (23:50 +0000)]
Fix the external GCC build after r297271 by setting -L <sysroot>/usr/lib.

GCC does add <sysroot>/usr/lib to the library search path but it comes after
/usr/local/lib which can find ports libraries such as libedit.so.  The
bad path comes in as /usr/local/lib/gcc/x86_64-portbld-freebsd11.0/5.3.0/../../../
which corresponds to <prefix>/lib.

This partially reverts r297271.

Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove the old depend (mkdep) code and make FAST_DEPEND the one true way.
bdrewery [Wed, 30 Mar 2016 23:50:23 +0000 (23:50 +0000)]
Remove the old depend (mkdep) code and make FAST_DEPEND the one true way.

Reviewed by: emaste, hselasky (partial), brooks (brief)
Discussed on: arch@
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5742

8 years agoshow-valid-targets: Indent each target 2 spaces.
bdrewery [Wed, 30 Mar 2016 22:26:14 +0000 (22:26 +0000)]
show-valid-targets: Indent each target 2 spaces.

Sponsored by: EMC / Isilon Storage Division

8 years agoRemove redundant code imported into dirdeps.mk in r290956.
bdrewery [Wed, 30 Mar 2016 21:31:34 +0000 (21:31 +0000)]
Remove redundant code imported into dirdeps.mk in r290956.

Sponsored by: EMC / Isilon Storage Division

8 years agoshow-valid-targets: Organize all targets by the all_machine_list.
bdrewery [Wed, 30 Mar 2016 18:55:58 +0000 (18:55 +0000)]
show-valid-targets: Organize all targets by the all_machine_list.

Sponsored by: EMC / Isilon Storage Division

8 years agoMove hosttools to Makefile.depend.host so it shows under host targets in show-valid...
bdrewery [Wed, 30 Mar 2016 18:40:09 +0000 (18:40 +0000)]
Move hosttools to Makefile.depend.host so it shows under host targets in show-valid-targets.

Sponsored by: EMC / Isilon Storage Division

8 years agoshow-valid-targets: Show host targets and also order all of the targets.
bdrewery [Wed, 30 Mar 2016 18:39:41 +0000 (18:39 +0000)]
show-valid-targets: Show host targets and also order all of the targets.

Sponsored by: EMC / Isilon Storage Division

8 years agoEnable SPI1 on Beaglebone Black.
loos [Wed, 30 Mar 2016 17:32:14 +0000 (17:32 +0000)]
Enable SPI1 on Beaglebone Black.

SPI1 was chosen because SPI0 shares the gpio pins with I2C1.

Sponsored by: Rubicon Communications (Netgate)

8 years agoUse the AM33XX_IOPAD() MACRO which is easier to read (uses the same offset
loos [Wed, 30 Mar 2016 17:18:49 +0000 (17:18 +0000)]
Use the AM33XX_IOPAD() MACRO which is easier to read (uses the same offset
of TRM).

While here remove i2c2_pins, it is already defined in
am335x-bone-common.dtsi.

Sponsored by: Rubicon Communications (Netgate)

8 years agoUse osd_reserve / osd_jail_set_reserved, which is known to succeed.
jamie [Wed, 30 Mar 2016 17:05:04 +0000 (17:05 +0000)]
Use osd_reserve / osd_jail_set_reserved, which is known to succeed.
Also don't work around nonexistent osd_register failure.

8 years agoAdd basic FDT support for the mx25l SPI flash.
loos [Wed, 30 Mar 2016 17:00:33 +0000 (17:00 +0000)]
Add basic FDT support for the mx25l SPI flash.

Sponsored by: Rubicon Communications (Netgate)

8 years agoAdd osd_reserve() and osd_set_reserved(), which allow M_WAITOK allocation
jamie [Wed, 30 Mar 2016 16:57:28 +0000 (16:57 +0000)]
Add osd_reserve() and osd_set_reserved(), which allow M_WAITOK allocation
of an OSD array,

8 years agoPlug open count leak on zvol rename.
mav [Wed, 30 Mar 2016 16:54:18 +0000 (16:54 +0000)]
Plug open count leak on zvol rename.

MFC after: 2 weeks

8 years agoSwitch from using make_dev_p() to make_dev_s() to close races.
mav [Wed, 30 Mar 2016 16:48:57 +0000 (16:48 +0000)]
Switch from using make_dev_p() to make_dev_s() to close races.

8 years agoBump up the read and write timeouts. The old value was too small for low
loos [Wed, 30 Mar 2016 16:26:00 +0000 (16:26 +0000)]
Bump up the read and write timeouts.  The old value was too small for low
speed transfers.

Sponsored by: Rubicon Communications (Netgate)

8 years agolibc: stop exporting cerror
emaste [Wed, 30 Mar 2016 14:42:09 +0000 (14:42 +0000)]
libc: stop exporting cerror

i386 stopped exporting .cerror in r240152, and likewise for amd64 in
r240178. It is not used by other libraries on any platform, so apply
the same change to the remaining architectures.

Reviewed by: jhibbits, jilles
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5774

8 years agofreopen(3): prevent uninitialized errno.
pfg [Wed, 30 Mar 2016 13:26:35 +0000 (13:26 +0000)]
freopen(3): prevent uninitialized errno.

Revert completley r297408 (and r297407): this ends up touching errno,
which we are not allowed to do.

Pointed out by: ache, bde

8 years agoAdd new USB ID to UDL driver.
hselasky [Wed, 30 Mar 2016 10:05:52 +0000 (10:05 +0000)]
Add new USB ID to UDL driver.

Submitted by: Matthias Petermann <matthias@petermann-it.de>
PR: 201084

8 years ago[bwn] fix time_before -> ieee80211_time_before()
adrian [Wed, 30 Mar 2016 06:48:09 +0000 (06:48 +0000)]
[bwn] fix time_before -> ieee80211_time_before()

Noticed by: Jia-Shiun Li <jiashiun@gmail.com>

8 years agofreopen(3): prevent uninitialized errno.
pfg [Wed, 30 Mar 2016 06:13:58 +0000 (06:13 +0000)]
freopen(3): prevent uninitialized errno.

Revert r297407 and redo it cleanly.

Pointed out by: Jukka A. Ukkonen
CID: 1018720
MFC after: 1 week

8 years agofreopen(3): prevent uninitialized errno.
pfg [Wed, 30 Mar 2016 01:32:08 +0000 (01:32 +0000)]
freopen(3): prevent uninitialized errno.

The case doesn't look very likely but clean the possibility nevertheless

CID: 1018720
MFC after: 1 week

8 years agoRemove unnecessary dequeue_mutex (added in r294610) from the iWARP
np [Wed, 30 Mar 2016 01:08:08 +0000 (01:08 +0000)]
Remove unnecessary dequeue_mutex (added in r294610) from the iWARP
connection manager.  Examining so_comp without synchronization with
iw_so_event_handler is a harmless race.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Reviewed by: Steve Wise @ Open Grid Computing
Sponsored by: Chelsio Communications

8 years ago[net80211] migrate the time_* macros to ieee80211_* namespace.
adrian [Wed, 30 Mar 2016 00:44:10 +0000 (00:44 +0000)]
[net80211] migrate the time_* macros to ieee80211_* namespace.

It turns out that these will clash very annoyingly with the linux
macros in the linuxkpi layer, so let the wookie^Wlinux win.

The only user that I can find is ath(4), so fix it there too.

8 years ago[net80211] Add fields to decode uAPSD fields.
adrian [Wed, 30 Mar 2016 00:42:18 +0000 (00:42 +0000)]
[net80211] Add fields to decode uAPSD fields.

It turns out that madwifi actually has the basics for uAPSD implemented
but it was never ported to FreeBSD.  I may eventually port most of the
pieces; I'll see how it goes!

Obtained from: Madwifi

8 years agoFix the lladdr copy in in6_lltable_dump_entry() after r292978.
markj [Wed, 30 Mar 2016 00:03:59 +0000 (00:03 +0000)]
Fix the lladdr copy in in6_lltable_dump_entry() after r292978.

This bug caused "ndp -a" to show the wrong link layer address for neighbour
cache entries.

PR: 208067

8 years agoSmall typo.
pfg [Tue, 29 Mar 2016 23:33:44 +0000 (23:33 +0000)]
Small typo.

8 years agoDo not access buffer if bread(9) or cluster_read(9) failed. On error,
kib [Tue, 29 Mar 2016 19:59:44 +0000 (19:59 +0000)]
Do not access buffer if bread(9) or cluster_read(9) failed.  On error,
the functions free the buffer and set the pointer to NULL.  Also
remove useless call to brelse(9) on the error path.

PR: 208275
Submitted by: Fabian Keil <fk@fabiankeil.de>
MFC after: 2 weeks

8 years agoThe sendfile(2) allows to send extra data from userspace before the file
glebius [Tue, 29 Mar 2016 19:57:11 +0000 (19:57 +0000)]
The sendfile(2) allows to send extra data from userspace before the file
data (headers).  Historically the size of the headers was not checked
against the socket buffer space.  Application could easily overcommit the
socket buffer space.

With the new sendfile (r293439) the problem remained, but a KASSERT was
inserted that checked that amount of data written to the socket matches
its space.  In case when size of headers is bigger that socket space,
KASSERT fires.  Without INVARIANTS the new sendfile won't panic, but
would report incorrect amount of bytes sent.

o With this change, the headers copyin is moved down into the cycle, after
  the sbspace() check.  The uio size is trimmed by socket space there,
  which fixes the overcommit problem and its consequences.
o The compatibility handling for FreeBSD 4 sendfile headers API is pushed
  up the stack to syscall wrappers.  This required a copy and paste of the
  code, but in turn this allowed to remove extra stack carried parameter
  from fo_sendfile_t, and embrace entire compat code into #ifdef.  If in
  future we got more fo_sendfile_t function, the copy and paste level would
  even reduce.

Reviewed by: emax, gallatin, Maxim Dounin <mdounin mdounin.ru>
Tested by: Vitalij Satanivskij <satan ukr.net>
Sponsored by: Netflix

8 years agoType of the interrupt handlers on x86 cannot be expressed in C.
kib [Tue, 29 Mar 2016 19:56:48 +0000 (19:56 +0000)]
Type of the interrupt handlers on x86 cannot be expressed in C.
Simplify and unify placeholder type definitions.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D5771

8 years agoFix several bugs in r297374:
kib [Tue, 29 Mar 2016 19:54:13 +0000 (19:54 +0000)]
Fix several bugs in r297374:
- fix UP build [1]
- do not obliterate initial reading of rdtsc by the loop counter [2]
- restore the meaning of the argument -1 to native_lapic_ipi_wait()
  as wait until LAPIC acknowledge without timeout
- correct formula for calculating loop iteration count for 1us, it was
  inverted, and ensure that even on unlikely slow CPUs at least one
  check for ack is performed.

Reported by: Michael Butler <imb@protected-networks.net> [1], rpokala[2],
jhb[3]
Tested by: Michael Butler
Pointy hat to: kib
Sponsored by: The FreeBSD Foundation

8 years agoModify nd6_llinfo_timer() to acquire the nd6 lock before the LLE lock.
markj [Tue, 29 Mar 2016 19:23:00 +0000 (19:23 +0000)]
Modify nd6_llinfo_timer() to acquire the nd6 lock before the LLE lock.

When expiring a neighbour cache entry we may need to look up the associated
default router, which requires the nd6 read lock. To avoid an LOR, the nd6
lock should be acquired first.

X-MFC-With: r296063
Tested by: Larry Rosenman <ler@lerctr.org> (previous revision)