]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoSome more defines and polishing for INIT_FIRMWARE.
Alexander Motin [Wed, 21 Oct 2015 08:23:19 +0000 (08:23 +0000)]
Some more defines and polishing for INIT_FIRMWARE.

8 years agoReimplement header file, remove all comments deriving from Linux and
Hans Petter Selasky [Wed, 21 Oct 2015 07:59:46 +0000 (07:59 +0000)]
Reimplement header file, remove all comments deriving from Linux and
update copyright to 2-clause BSD.

Suggested by: emaste @
Sponsored by: Mellanox Technologies

8 years agoRemove BUS_DMA_NOWAIT from bus_dma_tag_create() invocations as it's
Kevin Lo [Wed, 21 Oct 2015 06:23:57 +0000 (06:23 +0000)]
Remove BUS_DMA_NOWAIT from bus_dma_tag_create() invocations as it's
no valid flag there.

8 years agoarge: Remove the debugging printf that snuck in.
Adrian Chadd [Wed, 21 Oct 2015 05:52:04 +0000 (05:52 +0000)]
arge: Remove the debugging printf that snuck in.

This was triggering when using it as an AP bridge rather than an ethernet
bridge.

The code is unclear but it works; I'll fix it to be clearer and test
performance at a later stage.

8 years agoFix a ton of speelling errors
Eitan Adler [Wed, 21 Oct 2015 05:37:09 +0000 (05:37 +0000)]
Fix a ton of speelling errors

arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337

8 years agoAdd some missing '+', .MAKE, and .PHONY modifiers.
Bryan Drewery [Wed, 21 Oct 2015 05:33:48 +0000 (05:33 +0000)]
Add some missing '+', .MAKE, and .PHONY modifiers.

Some of these targets were lacking both .MAKE and a '+'.  Others were just
inconsistent.

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

8 years agoUse pmap_quick* for out-of-context bounce buffers and (limited) cache maintenance...
Jason A. Harmening [Wed, 21 Oct 2015 04:53:34 +0000 (04:53 +0000)]
Use pmap_quick* for out-of-context bounce buffers and (limited) cache maintenance of unmapped buffers in armv5 busdma.

Tested by: Mattia Rossi <mattia.rossi.mailinglists@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3522

8 years agoSwitch PCI register reads from using magic numbers to using the names
Kevin Lo [Wed, 21 Oct 2015 02:50:22 +0000 (02:50 +0000)]
Switch PCI register reads from using magic numbers to using the names
defined in pcireg.h

8 years agoarge: don't do the rx fixup copy and just offset the mbuf by 2 bytes
Adrian Chadd [Wed, 21 Oct 2015 01:41:18 +0000 (01:41 +0000)]
arge: don't do the rx fixup copy and just offset the mbuf by 2 bytes

The existing code meets the "alignment" requirement for the l3 payload
by offsetting the mbuf by uint64_t and then calling an rx fixup routine
to copy the frame backwards by 2 bytes.  This DWORD aligns the
L3 payload so tcp, etc doesn't panic on unaligned access.

This is .. slow.

For arge MACs that support 1 byte TX/RX address alignment, we can do
the "other" hack: offset the RX address of the mbuf so the L3 payload
again is hopefully DWORD aligned.

This is much cheaper - since TX/RX is both 1 byte align ready (thanks
to the previous commit) there's no bounce buffering going on and there
is no rx fixup copying.

This gets bridging performance up from 180mbit/sec -> 410mbit/sec.
There's around 10% of CPU cycles spent in _bus_dmamap_sync(); I'll
investigate that later.

Tested:

* QCA955x SoC (AP135 reference board), bridging arge0/arge1
  by programming the switch to have two vlangroups in dot1q mode:

# ifconfig bridge0 inet 192.168.2.20/24
# etherswitchcfg config vlan_mode dot1q
# etherswitchcfg vlangroup0 members 0,1,2,3,4
# etherswitchcfg vlangroup1 vlan 2 members 5,6
# etherswitchcfg port5 pvid 2
# etherswitchcfg port6 pvid 2
# ifconfig arge1 up
# ifconfig bridge0 addm arge1

8 years agoRemove disconnected xditview.
Bryan Drewery [Wed, 21 Oct 2015 01:34:51 +0000 (01:34 +0000)]
Remove disconnected xditview.

8 years agoFix building in a directory with SUBDIRs and SUBDIR_PARALLEL.
Bryan Drewery [Wed, 21 Oct 2015 00:25:18 +0000 (00:25 +0000)]
Fix building in a directory with SUBDIRs and SUBDIR_PARALLEL.

The SUBDIR_PARALLEL feature uses a .for dir in ${SUBDIR} loop.  The old code
here for recursing was setting SUBDIR= as a make *argument*.  The SUBDIR=
replacement was not actually handled until after the .for loop was unrolled.
This could be seen with a '.info ${SUBDIR} ${dir}' inside of the loop which
showed an empty ${SUBDIR} and a set ${dir}.  Setting NO_SUBIDR= before calling
${MAKE} as an *environment* variable handles the case fine and is a more
proper mechanism for disabling subdir handling.

This could be seen with 'make -C tests/sys/kern -j15 SUBDIR_PARALLEL=yes'.

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

8 years agocpuset.9: Link to/from the new page
Conrad Meyer [Tue, 20 Oct 2015 23:52:37 +0000 (23:52 +0000)]
cpuset.9: Link to/from the new page

A follow-up to r289667.

Sponsored by: EMC / Isilon Storage Division

8 years agoDocument cpuset(9)
Conrad Meyer [Tue, 20 Oct 2015 23:48:14 +0000 (23:48 +0000)]
Document cpuset(9)

A follow-up to r289467.

Coerced by: jhb
Sponsored by: EMC / Isilon Storage Division

8 years agoAR8327: Fix up the ability to configure the vlangroup configuration for the CPU port
Adrian Chadd [Tue, 20 Oct 2015 21:18:02 +0000 (21:18 +0000)]
AR8327: Fix up the ability to configure the vlangroup configuration for the CPU port

I messed up when doing the reset_vlans method - setting vid[0] = 1 here
was making it 'hidden' from configuration (as it needed ETHERSWITCH_VID_VALID
as well) and so there was no way to configure vlangroup0.

In per-port VLAN mode, vlangroup0 is for the CPU port (port0).
Now, it normally wouldn't really matter - the CPU port thus sees
all other ports. However there are two CPU ports on the AR8327 and
so port0 (arge0) was seeing all traffic on port6 (arge1).
If you thus tried to use arge1/port6 for anything (eg a WAN port)
in a bridge group then things would very upset very quickly.

Whilst here, add a comment to remind myself that yes, it'd be nice
if we could specify a boot-time switch config.

Tested:

* AP135 reference platform w/ AR8327N switch

8 years agoTrim spaces at end of line to record the proper commit message for
Konstantin Belousov [Tue, 20 Oct 2015 20:38:20 +0000 (20:38 +0000)]
Trim spaces at end of line to record the proper commit message for
r289660:

Do not allow to execute ptrace(PT_TRACE_ME) when the process is
already traced.

Do not allow to execute ptrace(PT_TRACE_ME) when there is no parent
which can trace the process, i.e. when the parent is already init.
Note that after the PT_TRACE_ME request the process is unkillable and
non-continuable until a debugger is attached, or parent is killed, the
later clears P_TRACED state.  Since init clearly would not debug the
caller, and cannot be killed, disallow creation of unkillable
processes.

Reviewed by: jhb, pho
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D3908

8 years agoImprove safety of caching from r289659 by only importing of none of the
Bryan Drewery [Tue, 20 Oct 2015 20:37:00 +0000 (20:37 +0000)]
Improve safety of caching from r289659 by only importing of none of the
variables are already set.  This should cover odd cases such as the
COMPILER_TYPE override in lib/csu/powerpc64.

X-MFC-With: r289659
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoHandle lib32 files during delete-old* when MK_LIB32=no.
Julio Merino [Tue, 20 Oct 2015 20:35:34 +0000 (20:35 +0000)]
Handle lib32 files during delete-old* when MK_LIB32=no.

Extend OptionalObsoleteFiles.inc to delete all lib32 files when MK_LIB32 is
set to no on a system that previously had lib32 libraries installed.

Also, to prevent "make delete-old-dirs" from always deleting lib32 directories
after an installworld, move the lib32 subtree to its own mtree file that only
gets applied when MK_LIB32=yes.

Test: Ran "make delete-old" and "make delete-old-libs" on a system that never
had MK_LIB32 enabled, and on a system where MK_LIB32 was enabled and later
disabled.  Did this both on amd64 and powerpc64.

Test: Ran "make tinderbox" without errors.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D3923

8 years agoMark struct thread zone as type-stable.
Konstantin Belousov [Tue, 20 Oct 2015 20:29:21 +0000 (20:29 +0000)]
Mark struct thread zone as type-stable.

When establishing the locking state for several lock types (including
blockable mutexes and sx) failed, locking primitives try to spin while
the owner thread is running.  The spinning loop performs the test for
running condition by dereferencing the owner->td_state field of the
owner thread.  If the owner thread exited while spinner was put off
the processor, it is harmless to access reused struct thread owner,
since in some near future the current processor would notice the owner
change and make appropriate progress.  But it could be that the page
which carried the freed struct thread was unmapped, then we fault
(this cannot happen on amd64).

For now, disallowing free of the struct thread seems to be good
enough, and tests which create a lot of threads once, did not
demonstrated regressions.

Reviewed by: jhb, pho
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D3908

8 years agoReviewed by: jhb, pho
Konstantin Belousov [Tue, 20 Oct 2015 20:22:57 +0000 (20:22 +0000)]
Reviewed by: jhb, pho
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D3908

8 years agoPass COMPILER_TYPE and COMPILER_VERSION to sub-makes to avoid redundant
Bryan Drewery [Tue, 20 Oct 2015 20:15:25 +0000 (20:15 +0000)]
Pass COMPILER_TYPE and COMPILER_VERSION to sub-makes to avoid redundant
lookups.

This uses a special variable name based on a hash of ${CC}, ${PATH}, and
${MACHINE} to ensure that a cached value is not used if any of these
values changes to use a new compiler.

Before this there were 34,620 fork/exec from bsd.compiler.mk during a buildworld.
After this there are 608.  More improvement is needed to cache a value from
the top-level before descending into subdirs in the various build phases.

Reviewed by: brooks (earlier version)
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3898

8 years agoNo need to dereference struct proc to pids when comparing processes
Konstantin Belousov [Tue, 20 Oct 2015 20:12:42 +0000 (20:12 +0000)]
No need to dereference struct proc to pids when comparing processes
for equality.

Reviewed by: jhb, pho
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoiicbus: Use device_delete_children() instead of explicit child removal
Jean-Sébastien Pédron [Tue, 20 Oct 2015 19:52:59 +0000 (19:52 +0000)]
iicbus: Use device_delete_children() instead of explicit child removal

If the bus is detached and deleted by a call to device_delete_child() or
device_delete_children() on a device higher in the tree, I²C children
were already detached and deleted. So the device_t pointer stored in sc
points to freed memory: we must not try to delete it again.

By using device_delete_children(), we let subr_bus.c figure out if there
are children to take care of.

While here, make sure iicbus_detach() and iicoc_detach() call
device_delete_children() too, to be safe.

Reviewed by: jhb, imp
Approved by: jhb, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3926

8 years agoiicbus: Remove trailing whitespaces
Jean-Sébastien Pédron [Tue, 20 Oct 2015 19:47:08 +0000 (19:47 +0000)]
iicbus: Remove trailing whitespaces

MFC after: 1 week

8 years agoDisable SWAPPING as we don't do it on this board.
Sean Bruno [Tue, 20 Oct 2015 19:32:26 +0000 (19:32 +0000)]
Disable SWAPPING as we don't do it on this board.

8 years agoNTB: Revert r289645
Conrad Meyer [Tue, 20 Oct 2015 19:32:16 +0000 (19:32 +0000)]
NTB: Revert r289645

Per Benno, this is a Linuxism we do not need in FreeBSD.

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

8 years agoif_ntb: Diff-reduce with Linux; add queue index type
Conrad Meyer [Tue, 20 Oct 2015 19:21:01 +0000 (19:21 +0000)]
if_ntb: Diff-reduce with Linux; add queue index type

Add ntb_q_idx_t so it is more clear which struct members are of the same
type (some bogus uint64_ts snuck in that should have been unsigned int).

Add tx_err_no_buf and s/ENOMEM/EBUSY/ in tx_enqueue to match Linux.

Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: MFV 8c9edf63: Fix zero size or integer overflow in ntb_set_mw
Conrad Meyer [Tue, 20 Oct 2015 19:20:52 +0000 (19:20 +0000)]
NTB: MFV 8c9edf63: Fix zero size or integer overflow in ntb_set_mw

A plain 32 bit integer will overflow for values over 4GiB.

Change the plain integer size to the appropriate size type in
ntb_set_mw.  Change the type of the size parameter and two local
variables used for size.

Even if there is no overflow, a size of zero is invalid here.

Authored by: Allen Hubbe
Reported by: Juyoung Jung
Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: MFV da2e5ae5: Fix ntb_transport out-of-order RX update
Conrad Meyer [Tue, 20 Oct 2015 19:20:42 +0000 (19:20 +0000)]
NTB: MFV da2e5ae5: Fix ntb_transport out-of-order RX update

It was possible for a synchronous update of the RX index in the error
case to get ahead of the asynchronous RX index update in the normal
case.  Change the RX processing to preserve an RX completion order.

There were two error cases.  First, if a buffer is not present to
receive data, there would be no queue entry to preserve the RX
completion order.  Instead of dropping the RX frame, leave the RX frame
in the ring.  Schedule RX processing when RX entries are enqueued, in
case there are RX frames waiting in the ring to be received.

Second, if a buffer is too small to receive data, drop the frame in the
ring, mark the RX entry as done, and indicate the error in the RX entry
length.  Check for a negative length in the receive callback in
ntb_netdev, and count occurrences as rx_length_errors.

Authored by: Allen Hubbe
Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoif_ntb: Correct over-long lines, use qmin()
Conrad Meyer [Tue, 20 Oct 2015 19:20:33 +0000 (19:20 +0000)]
if_ntb: Correct over-long lines, use qmin()

Sponsored by: EMC / Isilon Storage Division

8 years agoif_ntb: Use if_printf instead of device_printf
Conrad Meyer [Tue, 20 Oct 2015 19:20:24 +0000 (19:20 +0000)]
if_ntb: Use if_printf instead of device_printf

Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: MFV 2f887b9a: Rename Intel code names to platform names
Conrad Meyer [Tue, 20 Oct 2015 19:20:15 +0000 (19:20 +0000)]
NTB: MFV 2f887b9a: Rename Intel code names to platform names

Mechanically replace "SOC" with "ATOM" to match Linux.  No functional
change.  Original Linux commit log follows:

Instead of using the platform code names, use the correct platform names
to identify the respective Intel NTB hardware.

Authored by: Dave Jiang
Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: Don't abort if setting a MW write-combine fails
Conrad Meyer [Tue, 20 Oct 2015 19:20:06 +0000 (19:20 +0000)]
NTB: Don't abort if setting a MW write-combine fails

Also log BAR mapping results more verbosely.

Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: Fix typo in bar5 tunables
Conrad Meyer [Tue, 20 Oct 2015 19:19:57 +0000 (19:19 +0000)]
NTB: Fix typo in bar5 tunables

Typo introduced in r289614.

Pointy-hat: cem
Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: MFV 7eb38781: Print driver name in module init
Conrad Meyer [Tue, 20 Oct 2015 19:19:48 +0000 (19:19 +0000)]
NTB: MFV 7eb38781: Print driver name in module init

Prints driver name to indicate what is being loaded.

Authored by: Dave Jiang
Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoMove location of RCS keyword according to style.
Hans Petter Selasky [Tue, 20 Oct 2015 19:08:26 +0000 (19:08 +0000)]
Move location of RCS keyword according to style.

Suggested by: jhb @
Sponsored by: Mellanox Technologies

8 years agoDocument isp_*_multi firmware kernel modules removal at r289626.
Alexander Motin [Tue, 20 Oct 2015 19:04:13 +0000 (19:04 +0000)]
Document isp_*_multi firmware kernel modules removal at r289626.

8 years agocheck boundaries while parsing SDP responses
Maksim Yevmenkin [Tue, 20 Oct 2015 18:01:08 +0000 (18:01 +0000)]
check boundaries while parsing SDP responses

Reported by: hps
Reviewed by: hps
MFC after: 1 week

8 years agoSwitch pl_child_pid from int to pid_t.
John Baldwin [Tue, 20 Oct 2015 17:58:21 +0000 (17:58 +0000)]
Switch pl_child_pid from int to pid_t.

Reviewed by: emaste, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3857

8 years agoql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE
David C Somayajulu [Tue, 20 Oct 2015 17:27:11 +0000 (17:27 +0000)]
ql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE
ql_os.c: removed unnecessary debug printf
ql_ver.h: updated version number
MFC after:5 days

8 years agoEnable all callin ttys if the tty is an available console.
Glen Barber [Tue, 20 Oct 2015 16:10:46 +0000 (16:10 +0000)]
Enable all callin ttys if the tty is an available console.

Discussed on: -arch@ (no objections)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoAdd missing FreeBSD RCS keyword and SVN properties.
Hans Petter Selasky [Tue, 20 Oct 2015 16:02:11 +0000 (16:02 +0000)]
Add missing FreeBSD RCS keyword and SVN properties.

Sponsored by: Mellanox Technologies

8 years agoAdd missing FreeBSD RCS keyword and SVN properties.
Hans Petter Selasky [Tue, 20 Oct 2015 15:28:02 +0000 (15:28 +0000)]
Add missing FreeBSD RCS keyword and SVN properties.

Sponsored by: Mellanox Technologies

8 years agoUncomment some rather important code that was commented out for benchmarking.
Ian Lepore [Tue, 20 Oct 2015 15:15:30 +0000 (15:15 +0000)]
Uncomment some rather important code that was commented out for benchmarking.
Normally this routine is supposed to loop until the PIC returns a "no more
interrupts pending" indication.  I had commented that out to do just one
interrupt per invokation to do some timing tests.

Spotted by:    Svata Kraus
Pointy Hat: ian

8 years agoInclude "opt_platform.h" to fix kernel build for amlogic devices.
Ganbold Tsagaankhuu [Tue, 20 Oct 2015 13:47:36 +0000 (13:47 +0000)]
Include "opt_platform.h" to fix kernel build for amlogic devices.

8 years agonewfs_msdos: use NetBSD's mkfs_msdos.h verbatim for makefs compatibility
Ed Maste [Tue, 20 Oct 2015 13:32:09 +0000 (13:32 +0000)]
newfs_msdos: use NetBSD's mkfs_msdos.h verbatim for makefs compatibility

Sponsored by: The FreeBSD Foundation

8 years agoAllow osreldate and osrelease to be set per jail
Poul-Henning Kamp [Tue, 20 Oct 2015 12:49:38 +0000 (12:49 +0000)]
Allow osreldate and osrelease to be set per jail

8 years agoUpdate firmware images for Qlogic 24xx/25xx from 5.5.0 to 7.3.0.
Alexander Motin [Tue, 20 Oct 2015 12:27:59 +0000 (12:27 +0000)]
Update firmware images for Qlogic 24xx/25xx from 5.5.0 to 7.3.0.

This also removes separate "_multi" images, since this funcationality is
now in base, and there is simply no new images without it for years.

8 years agoAdd missing dash to copyright clause.
Hans Petter Selasky [Tue, 20 Oct 2015 11:42:00 +0000 (11:42 +0000)]
Add missing dash to copyright clause.

Sponsored by: Mellanox Technologies

8 years agoAdd missing FreeBSD RCS keyword and SVN properties.
Hans Petter Selasky [Tue, 20 Oct 2015 11:40:04 +0000 (11:40 +0000)]
Add missing FreeBSD RCS keyword and SVN properties.

Sponsored by: Mellanox Technologies

8 years agoo NetBSD 7.0, OpenBSD 5.8, FreeBSD 10.2, OS X 10.11 added.
Sergey Kandaurov [Tue, 20 Oct 2015 11:37:16 +0000 (11:37 +0000)]
o NetBSD 7.0, OpenBSD 5.8, FreeBSD 10.2, OS X 10.11 added.

8 years agoZero mbox[0] for INIT_FIRMWARE to fix version 7.3 firmware.
Alexander Motin [Tue, 20 Oct 2015 10:16:03 +0000 (10:16 +0000)]
Zero mbox[0] for INIT_FIRMWARE to fix version 7.3 firmware.

While there, add new fields to isp_icb_2400_t structure.

8 years agoMerge LinuxKPI changes from DragonflyBSD:
Hans Petter Selasky [Tue, 20 Oct 2015 09:13:35 +0000 (09:13 +0000)]
Merge LinuxKPI changes from DragonflyBSD:
- Remove redundant NBLONG macro and use BIT_WORD()
  and BIT_MASK() instead.
- Correctly define BIT_MASK() according to Linux and
  update all users of this macro.
- Add missing GENMASK() macro.
- Remove all comments deriving from Linux.

Sponsored by: Mellanox Technologies

8 years agoDecode more firmware attributes.
Alexander Motin [Tue, 20 Oct 2015 08:29:30 +0000 (08:29 +0000)]
Decode more firmware attributes.

8 years agoFollow the advice of the misplaced comment and don't access the map struct
Ian Lepore [Tue, 20 Oct 2015 03:27:59 +0000 (03:27 +0000)]
Follow the advice of the misplaced comment and don't access the map struct
after freeing it.  Remove the comment whose uselessness has been revealed.

8 years agoFix printf format to allow for bus_size_t not being u_long on all platforms.
Ian Lepore [Tue, 20 Oct 2015 03:25:17 +0000 (03:25 +0000)]
Fix printf format to allow for bus_size_t not being u_long on all platforms.

8 years agoNTB: Clean up safely if attach fails early
Conrad Meyer [Tue, 20 Oct 2015 01:54:52 +0000 (01:54 +0000)]
NTB: Clean up safely if attach fails early

Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: MFV 9891417d: Increase transport MTU to 64k from 16k
Conrad Meyer [Tue, 20 Oct 2015 01:54:43 +0000 (01:54 +0000)]
NTB: MFV 9891417d: Increase transport MTU to 64k from 16k

Benchmarking showed a significant performance increase with the MTU size
to 64k instead of 16k.  Change the driver default to 64k.

Authored by: Dave Jiang
Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoif_ntb: Fix typo in qp_link_work to match Linux
Conrad Meyer [Tue, 20 Oct 2015 01:54:34 +0000 (01:54 +0000)]
if_ntb: Fix typo in qp_link_work to match Linux

Throw away the result of the peer SPAD read.  The peer will write our
local SPAD and we need to keep the locally read SPAD value to check if
the remote side is up.

Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: MFV 42fefc86: Add parameters for Intel SNB B2B addresses
Conrad Meyer [Tue, 20 Oct 2015 01:54:25 +0000 (01:54 +0000)]
NTB: MFV 42fefc86: Add parameters for Intel SNB B2B addresses

Add module parameters for the addresses to be used in B2B topology.

Authored by: Allen Hubbe
Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoif_ntb: MFV 2849b5d7: Reset transport QP link stats on down
Conrad Meyer [Tue, 20 Oct 2015 01:54:16 +0000 (01:54 +0000)]
if_ntb: MFV 2849b5d7: Reset transport QP link stats on down

Reset the link stats when the link goes down.  In particular, the TX and
RX index and count must be reset, or else the TX side will be sending
packets to the RX side where the RX side is not expecting them.  Reset
all the stats, to be consistent.

Authored by: Allen Hubbe
Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: Change Atom (BWD/SoC) pci_id name to match others
Conrad Meyer [Tue, 20 Oct 2015 01:54:08 +0000 (01:54 +0000)]
NTB: Change Atom (BWD/SoC) pci_id name to match others

Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: MFV 5ae0beb6: Enable link for Intel root port mode in probe
Conrad Meyer [Tue, 20 Oct 2015 01:46:14 +0000 (01:46 +0000)]
NTB: MFV 5ae0beb6: Enable link for Intel root port mode in probe

We skip actually bringing up Rootport/Transparent configurations, so
most of this doesn't apply.  Original Linux commit log:

Link training should be enabled in the driver probe for root port mode.
We should not have to wait for transport to be loaded for this to
happen.  Otherwise the ntb device will not show up on the transparent
bridge side of the link.

Authored by: Dave Jiang
Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: enum-ify some HW constants
Conrad Meyer [Tue, 20 Oct 2015 01:46:05 +0000 (01:46 +0000)]
NTB: enum-ify some HW constants

Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: Pull copy of soc_link_is_err out of recover_soc_link
Conrad Meyer [Tue, 20 Oct 2015 01:45:57 +0000 (01:45 +0000)]
NTB: Pull copy of soc_link_is_err out of recover_soc_link

Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: Drop some dead softc members
Conrad Meyer [Tue, 20 Oct 2015 01:45:48 +0000 (01:45 +0000)]
NTB: Drop some dead softc members

Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: Replace last reg_ofs with self_reg
Conrad Meyer [Tue, 20 Oct 2015 01:45:38 +0000 (01:45 +0000)]
NTB: Replace last reg_ofs with self_reg

Diff reduce with Linux driver.  No functional change.

Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoReplace all of the duplicated logic for recursing into a subdir with one
Bryan Drewery [Mon, 19 Oct 2015 23:34:35 +0000 (23:34 +0000)]
Replace all of the duplicated logic for recursing into a subdir with one
implementation.  It is duplicated at run-time but is more easily
maintainable now.

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd missing .PHONY for parallel subdir target.
Bryan Drewery [Mon, 19 Oct 2015 22:27:32 +0000 (22:27 +0000)]
Add missing .PHONY for parallel subdir target.

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

8 years agogetconf(1): Fix typo. _POSIX_V6_LP64_OFFBIG -> _POSIX_V6_LPBIG_OFFBIG.
Baptiste Daroussin [Mon, 19 Oct 2015 21:06:30 +0000 (21:06 +0000)]
getconf(1): Fix typo. _POSIX_V6_LP64_OFFBIG -> _POSIX_V6_LPBIG_OFFBIG.

Submitted by: Sascha Wildner <saw@online.de>
Obtained from: DragonflyBSD
MFC after: 3 days

8 years agoAdd tests for the copyin(9) handling of illegal buffers.
Konstantin Belousov [Mon, 19 Oct 2015 20:22:17 +0000 (20:22 +0000)]
Add tests for the copyin(9) handling of illegal buffers.

Reviewed by: emaste, ngie
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D3925

8 years agoSet the correct values in the arm aux control register, based on chip type.
Ian Lepore [Mon, 19 Oct 2015 19:18:02 +0000 (19:18 +0000)]
Set the correct values in the arm aux control register, based on chip type.

The bits in the aux control register vary based on the processor type.  In
the past we've always just set the 'smp' and "broadcast tlb/cache ops' bits,
which worked fine for the first few SoCs we supported.  Now that we support
most of the cortex-a series processors, it's important to get the right bits
set based on the processor type.

Submitted by: Svatopluk Kraus <onwahe@gmail.com>

8 years agoDon't check if `val` is NULL before calling free; free(3) already
Enji Cooper [Mon, 19 Oct 2015 18:45:14 +0000 (18:45 +0000)]
Don't check if `val` is NULL before calling free; free(3) already
handles this

MFC after: 1 week
PR: 203649
Submitted by: Thomas Schmitt <scdbackup@gmx.net>
Coverity CID: 1305659
Sponsored by: EMC / Isilon Storage Division

8 years agoInitialize `quiet` to false so `pw groupnext` again prints out the next gid
Enji Cooper [Mon, 19 Oct 2015 18:29:32 +0000 (18:29 +0000)]
Initialize `quiet` to false so `pw groupnext` again prints out the next gid
by default

Reported by: Florian Degner <f.degner@gmx.de>
MFC after: 1 week
PR: 203876
Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: Add ntb_db_vector_mask() missed in r289546
Conrad Meyer [Mon, 19 Oct 2015 18:06:35 +0000 (18:06 +0000)]
NTB: Add ntb_db_vector_mask() missed in r289546

This is the last one.

Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: Add ntb_db_valid_mask() missed in r289546
Conrad Meyer [Mon, 19 Oct 2015 17:53:20 +0000 (17:53 +0000)]
NTB: Add ntb_db_valid_mask() missed in r289546

Another trivial one.

Pointy-hat: cem
Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoNTB: Add ntb_mw_clear_trans() missed in r289546
Conrad Meyer [Mon, 19 Oct 2015 17:41:22 +0000 (17:41 +0000)]
NTB: Add ntb_mw_clear_trans() missed in r289546

It is just a trivial wrapper around ntb_mw_set_trans().

Authored by: Allen Hubbe
Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd more obsolete files
Antoine Brodin [Mon, 19 Oct 2015 17:31:51 +0000 (17:31 +0000)]
Add more obsolete files

8 years agoBump the __FreeBSD_version to reflect the recent Linux KPI updates.
Hans Petter Selasky [Mon, 19 Oct 2015 16:25:41 +0000 (16:25 +0000)]
Bump the __FreeBSD_version to reflect the recent Linux KPI updates.

Sponsored by: Mellanox Technologies

8 years agoThe returned value from vm_fault_disable_pagefaults() must be stored
Hans Petter Selasky [Mon, 19 Oct 2015 16:03:08 +0000 (16:03 +0000)]
The returned value from vm_fault_disable_pagefaults() must be stored
and passed to vm_fault_enable_pagefaults(). Else possible recursion on
the state can be lost.

Sponsored by: Mellanox Technologies
Suggested by: kib @

8 years agoAfter starting Unbound, wait for up to five seconds until unbound-control
Dag-Erling Smørgrav [Mon, 19 Oct 2015 15:56:59 +0000 (15:56 +0000)]
After starting Unbound, wait for up to five seconds until unbound-control
indicates that it is up and running.

PR: 184047
MFC after: 3 weeks

8 years agoxen-netfront: use "netfront" in lock description
Roger Pau Monné [Mon, 19 Oct 2015 15:34:24 +0000 (15:34 +0000)]
xen-netfront: use "netfront" in lock description

Missed from r289585.

Submitted by: Wei Liu <wei.liu2@citrix.com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D3937
Sponsored by: Citrix Systems R&D

8 years agoxen-netfront: fix netfront create_dev error path
Roger Pau Monné [Mon, 19 Oct 2015 14:47:37 +0000 (14:47 +0000)]
xen-netfront: fix netfront create_dev error path

The failure path for allocating rx grant refs should not try to free tx
grant refs because tx grant refs were allocated after that. Also fix the
error path for xen_net_read_mac.

Submitted by: Wei Liu <wei.liu2@citrix.com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D3891
Sponsored by: Citrix Systems R&D

8 years agoxen-netfront: no need to set if_output
Roger Pau Monné [Mon, 19 Oct 2015 14:37:17 +0000 (14:37 +0000)]
xen-netfront: no need to set if_output

This is redundant because ether_ifattach will set that field.

Submitted by: Wei Liu <wei.liu2@citrix.com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D3918
Sponsored by: Citrix Systems R&D

8 years agoxen-netfront: remove a bunch of FreeBSD version check
Roger Pau Monné [Mon, 19 Oct 2015 14:34:45 +0000 (14:34 +0000)]
xen-netfront: remove a bunch of FreeBSD version check

We're way beyond FreeBSD 7 at this point.

Submitted by: Wei Liu <wei.liu2@citrix.com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D3892
Sponsored by: Citrix Systems R&D

8 years agoxen-netfront: remove XN_LOCK_{INIT,DESTROY}
Roger Pau Monné [Mon, 19 Oct 2015 14:26:40 +0000 (14:26 +0000)]
xen-netfront: remove XN_LOCK_{INIT,DESTROY}

Multiqueue feature will make the number of queues dynamic, so XN_LOCK_INIT
won't be that useful. Remove the macro and call mtx_init directly.

XN_LOCK_DESTROY is just dead code.

Submitted by: Wei Liu <wei.liu2@citrix.com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D3890
Sponsored by: Citrix Systems R&D

8 years agoxen-netfront: clean up netfront stats structure
Roger Pau Monné [Mon, 19 Oct 2015 14:22:57 +0000 (14:22 +0000)]
xen-netfront: clean up netfront stats structure

Rename it with netfront_ prefix and purge a bunch of unused fields.

Submitted by: Wei Liu <wei.liu2@citrix.com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D3889
Sponsored by: Citrix Systems R&D

8 years agoxen-netfront: purge page flipping support
Roger Pau Monné [Mon, 19 Oct 2015 14:20:06 +0000 (14:20 +0000)]
xen-netfront: purge page flipping support

Currently neither Linux nor FreeBSD netback supports page flipping. NetBSD
still supports that. It is not sure how many people actually use page
flipping, but page flipping is supposed to be slower than copying nowadays.
It will also shatter frontend / backend address space.

Overall this feature is more of a burden than a benefit.

Submitted by: Wei Liu <wei.liu2@citrix.com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D3888
Sponsored by: Citrix Systems R&D

8 years agoxen-netfront: delete all trailing white spaces
Roger Pau Monné [Mon, 19 Oct 2015 14:12:15 +0000 (14:12 +0000)]
xen-netfront: delete all trailing white spaces

Submitted by: Wei Liu <wei.liu2@citrix.com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D3886
Sponsored by: Citrix Systems R&D

8 years agoUse 4 levels of page tables when enabling the MMU. This will allow us to
Andrew Turner [Mon, 19 Oct 2015 13:20:23 +0000 (13:20 +0000)]
Use 4 levels of page tables when enabling the MMU. This will allow us to
boot on an SoC that places physical memory at an address past where three
levels of page tables can access in an identity mapping.

Submitted by:   Wojciech Macek <wma@semihalf.com>,
                Patrick Wildt <patrick@bitrig.org>
Differential Revision: https://reviews.freebsd.org/D3885 (partial)
Differential Revision: https://reviews.freebsd.org/D3744

8 years agoMerge LinuxKPI changes from DragonflyBSD:
Hans Petter Selasky [Mon, 19 Oct 2015 12:44:41 +0000 (12:44 +0000)]
Merge LinuxKPI changes from DragonflyBSD:
- Redefine DIV_ROUND_UP as a function macro taking two arguments
  instead of none.
- Implement more Linux kernel functions related to various forms
  of DELAY() and basic mathematical operations.

Sponsored by: Mellanox Technologies

8 years agoMerge LinuxKPI changes from DragonflyBSD:
Hans Petter Selasky [Mon, 19 Oct 2015 12:33:09 +0000 (12:33 +0000)]
Merge LinuxKPI changes from DragonflyBSD:
- Implement more Linux kernel functions.

Sponsored by: Mellanox Technologies

8 years agoMerge LinuxKPI changes from DragonflyBSD:
Hans Petter Selasky [Mon, 19 Oct 2015 12:26:38 +0000 (12:26 +0000)]
Merge LinuxKPI changes from DragonflyBSD:
- Define the kref structure identical to the one found in Linux.
- Update clients referring inside the kref structure.
- Implement kref_sub() for FreeBSD.

Reviewed by: np @
Sponsored by: Mellanox Technologies

8 years agoMerge LinuxKPI changes from DragonflyBSD:
Hans Petter Selasky [Mon, 19 Oct 2015 12:08:06 +0000 (12:08 +0000)]
Merge LinuxKPI changes from DragonflyBSD:
- Map more Linux compiler related defines to FreeBSD ones.

Sponsored by: Mellanox Technologies

8 years agoMap two more Linux error return codes to FreeBSD ones.
Hans Petter Selasky [Mon, 19 Oct 2015 12:04:20 +0000 (12:04 +0000)]
Map two more Linux error return codes to FreeBSD ones.

Sponsored by: Mellanox Technologies

8 years agoImplement IS_ERR_OR_NULL() function.
Hans Petter Selasky [Mon, 19 Oct 2015 12:00:52 +0000 (12:00 +0000)]
Implement IS_ERR_OR_NULL() function.

Sponsored by: Mellanox Technologies

8 years agoMerge LinuxKPI changes from DragonflyBSD:
Hans Petter Selasky [Mon, 19 Oct 2015 11:57:33 +0000 (11:57 +0000)]
Merge LinuxKPI changes from DragonflyBSD:
- Add more list related functions and macros.
- Update the hlist_for_each_entry() macro to take one less argument.

Sponsored by: Mellanox Technologies

8 years agoMerge LinuxKPI changes from DragonflyBSD:
Hans Petter Selasky [Mon, 19 Oct 2015 11:46:48 +0000 (11:46 +0000)]
Merge LinuxKPI changes from DragonflyBSD:
- Reimplement ktime header file to distinguish more from Linux.
- Add new time header file to handle time related Linux functions.

Sponsored by: Mellanox Technologies

8 years agoFix compile warning.
Hans Petter Selasky [Mon, 19 Oct 2015 11:29:50 +0000 (11:29 +0000)]
Fix compile warning.

Sponsored by: Mellanox Technologies

8 years agoUse __func__ instead of __FUNCTION__.
Michael Tuexen [Mon, 19 Oct 2015 11:17:54 +0000 (11:17 +0000)]
Use __func__ instead of __FUNCTION__.

This allows to compile the userland stack without errors using gcc5.
Thanks to saghul for makeing me aware and providing the patch.

MFC after: 1 week

8 years agoMerge LinuxKPI changes from DragonflyBSD:
Hans Petter Selasky [Mon, 19 Oct 2015 11:16:38 +0000 (11:16 +0000)]
Merge LinuxKPI changes from DragonflyBSD:
- Reimplement math64 header file to distinguish more from Linux.

Sponsored by: Mellanox Technologies