]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoTreat mbufs as cacheline-aligned. Even when the transfer begins at an
ian [Wed, 21 Oct 2015 19:24:20 +0000 (19:24 +0000)]
Treat mbufs as cacheline-aligned.  Even when the transfer begins at an
offset within the buffer to align the L3 headers we know the buffer itself
was allocated and sized on cacheline boundaries and we don't need to
preserve partitial cachelines at the start and end of the buffer when
doing busdma sync operations.

8 years agoarm64: Enable CTF for DTrace support
emaste [Wed, 21 Oct 2015 19:08:16 +0000 (19:08 +0000)]
arm64: Enable CTF for DTrace support

Sponsored by: The FreeBSD Foundation

8 years agoFix my change in r289435 causing 'etc' to be added to SUBDIR when using
bdrewery [Wed, 21 Oct 2015 18:58:46 +0000 (18:58 +0000)]
Fix my change in r289435 causing 'etc' to be added to SUBDIR when using
SUBDIR_OVERRIDE.

MFC after: 2 weeks
X-MFC-With: r289435
Sponsored by: EMC / Isilon Storage Division

8 years agoBuild ofw_bus_if.h for modules that need it on arm64
emaste [Wed, 21 Oct 2015 18:30:42 +0000 (18:30 +0000)]
Build ofw_bus_if.h for modules that need it on arm64

8 years agoFree memory back into the categories it was allocated from.
ian [Wed, 21 Oct 2015 17:41:20 +0000 (17:41 +0000)]
Free memory back into the categories it was allocated from.

Noticed by: sbruno
Pointy hat: ian

8 years agoPass proper device to pci_read_config().
mav [Wed, 21 Oct 2015 17:27:43 +0000 (17:27 +0000)]
Pass proper device to pci_read_config().

For some reason JMicron driver was different from others at this point.

8 years agoAdd missing forward declaration of struct image_params.
ed [Wed, 21 Oct 2015 16:32:01 +0000 (16:32 +0000)]
Add missing forward declaration of struct image_params.

8 years agoRemove indirection of _sub target for using _SUBDIR.
bdrewery [Wed, 21 Oct 2015 16:24:44 +0000 (16:24 +0000)]
Remove indirection of _sub target for using _SUBDIR.

This reverts r266473 as the need for it, working around .MAKE and '+'
issues, is no longer needed after r289460.  This avoids extra log
output in -j builds of '-- _sub.TARGET --' that are redundant with the
'-- TARGET --' and '-- TARGET_subdir_DIR --' entries already showing.

r266473 also made a subtle change in the ordering of _SUBDIR handling.  Before
the change, SUBDIRS were recursed into after building the TARGET due to the
.USE of _SUBDIR *appending* the commands onto the TARGET.  After the change
though the indirection caused TARGET to depend on _sub.TARGET which had the
_SUBDIR handling in it.  This TARGET would run after recursing.  However, the
SUBDIR_PARALLEL handling from r263778 has this ordering as well.  Since
this has so far not been a problem, for now make this behavior for
non-SUBDIR_PARALLEL use of _SUBDIR explicit by using .USEBEFORE.
Further research may change this back to .USE as well as the
SUBDIR_PARALLEL handling and bsd.progs.mk recursing.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix parsing of I2C addresses properties in fdt data. I2C address is
ian [Wed, 21 Oct 2015 15:41:16 +0000 (15:41 +0000)]
Fix parsing of I2C addresses properties in fdt data.  I2C address is
represented in 7-bits format in DT files, but system expect it in 8-bit
format.  Also, fix two drivers that locally hack around this bug.

Submitted by: Michal Meloun <meloun@miracle.cz>

8 years agoMake some panic strings mode informative.
mav [Wed, 21 Oct 2015 15:31:26 +0000 (15:31 +0000)]
Make some panic strings mode informative.

8 years agoSwitch mips busdma to using the common busdma_buffalloc code. This amounts
ian [Wed, 21 Oct 2015 15:06:48 +0000 (15:06 +0000)]
Switch mips busdma to using the common busdma_buffalloc code.  This amounts
to copying in some code from the armv4 busdma, and adapting a few variable
and flag names to match the surrounding mips code.

Instead of keeping a local cache of prealloced busdma_map structs on a
mutex-protected list, set up an uma zone to cache them.

Instead of all memory allocations using M_DEVBUF, use new categories
M_BUSDMA for allocations of metadata (tags, maps, segment tracking lists),
and M_BOUNCE for bounce pages.

When buffers are allocated out of the busdma_bufalloc zones the alignment
and size of the buffers is known, and the code can skip doing any "partial
cacheline flush" logic to preserve data that may be adjacent to the DMA
buffer but contain non-DMA data.

Reviewed by: adrian, imp

8 years agoSwitch from a stub to a real implementation of pmap_page_set_attr() for mips,
ian [Wed, 21 Oct 2015 14:57:59 +0000 (14:57 +0000)]
Switch from a stub to a real implementation of pmap_page_set_attr() for mips,
and implement support for VM_MEMATTR_UNCACHEABLE.  This will be used in
upcoming changes to support BUS_DMA_COHERENT in bus_dmamem_alloc().

Reviewed by: adrian, imp

8 years agoMove arm_gic_bind() out of the #ifdef SMP block to fix compile errors in
ian [Wed, 21 Oct 2015 13:59:00 +0000 (13:59 +0000)]
Move arm_gic_bind() out of the #ifdef SMP block to fix compile errors in
the not-SMP case.  This is safe because arm_irq_next_cpu() will return
the cpuid of the current/only core in the not-SMP case.

Submitted by:  Bartosz Szczepanek @ semihalf

8 years agonetfront: fix LINT-NOIP
royger [Wed, 21 Oct 2015 13:53:07 +0000 (13:53 +0000)]
netfront: fix LINT-NOIP

r289587 broke LINT-NOIP kernels because the lro and queued local variables
are defined but not used. Add preprocessor guards around them.

Reported by: emaste
Sponsored by: Citrix Systems R&D

8 years agoRevert lib/libc/gen/dirname.3@r289695
ngie [Wed, 21 Oct 2015 13:16:03 +0000 (13:16 +0000)]
Revert lib/libc/gen/dirname.3@r289695

This is why I use branches usually, not commit directly to head

8 years agoRevert r289694
ngie [Wed, 21 Oct 2015 13:15:04 +0000 (13:15 +0000)]
Revert r289694

I committed some other undesirable local changes by accident

8 years agoAdd some rudimentary [smoke] testcases for makefs
ngie [Wed, 21 Oct 2015 13:13:38 +0000 (13:13 +0000)]
Add some rudimentary [smoke] testcases for makefs

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

8 years agoUnbreak makefs -t cd9660 after r289687
ngie [Wed, 21 Oct 2015 12:54:15 +0000 (12:54 +0000)]
Unbreak makefs -t cd9660 after r289687

buffer_head needs to be freed -- not buffer

Detected by jemalloc, i.e. running makefs failed the arena assert
because my copy of malloc on CURRENT is compiled with the default
!MALLOC_PRODUCTION asserts on

Pointyhat to: ngie
PR: 203647
X-MFC with: r289687
Sponsored by: EMC / Isilon Storage Division

8 years agoFree buffer before returning from cd9660_write_path_table to avoid
ngie [Wed, 21 Oct 2015 11:38:48 +0000 (11:38 +0000)]
Free buffer before returning from cd9660_write_path_table to avoid
leaking it after returning from the function

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

8 years agoxen: Code cleanup and small bug fixes
royger [Wed, 21 Oct 2015 10:44:07 +0000 (10:44 +0000)]
xen: Code cleanup and small bug fixes

xen/hypervisor.h:
 - Remove unused helpers: MULTI_update_va_mapping, is_initial_xendomain,
   is_running_on_xen
 - Remove unused define CONFIG_X86_PAE
 - Remove unused variable xen_start_info: note that it's used inpcifront
   which is not built at all
 - Remove forward declaration of HYPERVISOR_crash

xen/xen-os.h:
 - Remove unused define CONFIG_X86_PAE
 - Drop unused helpers: test_and_clear_bit, clear_bit,
   force_evtchn_callback
 - Implement a generic version (based on ofed/include/linux/bitops.h) of
   set_bit and test_bit and prefix them by xen_ to avoid any use by other
   code than Xen. Note that It would be worth to investigate a generic
   implementation in FreeBSD.
 - Replace barrier() by __compiler_membar()
 - Replace cpu_relax() by cpu_spinwait(): it's exactly the same as rep;nop
   = pause

xen/xen_intr.h:
 - Move the prototype of xen_intr_handle_upcall in it: Use by all the
   platform

x86/xen/xen_intr.c:
 - Use BITSET* for the enabledbits: Avoid to use custom helpers
 - test_bit/set_bit has been renamed to xen_test_bit/xen_set_bit
 - Don't export the variable xen_intr_pcpu

dev/xen/blkback/blkback.c:
 - Fix the string format when XBB_DEBUG is enabled: host_addr is typed
   uint64_t

dev/xen/balloon/balloon.c:
 - Remove set but not used variable
 - Use the correct type for frame_list: xen_pfn_t represents the frame
   number on any architecture

dev/xen/control/control.c:
 - Return BUS_PROBE_WILDCARD in xs_probe: Returning 0 in a probe callback
   means the driver can handle this device. If by any chance xenstore is the
   first driver, every new device with the driver is unset will use
   xenstore.

dev/xen/grant-table/grant_table.c:
 - Remove unused cmpxchg
 - Drop unused include opt_pmap.h: Doesn't exist on ARM64 and it doesn't
   contain anything required for the code on x86

dev/xen/netfront/netfront.c:
 - Use the correct type for rx_pfn_array: xen_pfn_t represents the frame
   number on any architecture

dev/xen/netback/netback.c:
 - Use the correct type for gmfn: xen_pfn_t represents the frame number on
   any architecture

dev/xen/xenstore/xenstore.c:
 - Return BUS_PROBE_WILDCARD in xctrl_probe: Returning 0 in a probe callback
   means the driver can handle this device. If by any chance xenstore is the
  first driver, every new device with the driver is unset will use xenstore.

Note that with the changes, x86/include/xen/xen-os.h doesn't contain anymore
arch-specific code. Although, a new series will add some helpers that differ
between x86 and ARM64, so I've kept the headers for now.

Submitted by: Julien Grall <julien.grall@citrix.com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D3921
Sponsored by: Citrix Systems R&D

8 years agox86/xen: Consolidate xen-os.h in a single place
royger [Wed, 21 Oct 2015 10:04:35 +0000 (10:04 +0000)]
x86/xen: Consolidate xen-os.h in a single place

amd64 and i386 platform code contain very similar xen/xen-os.h

The only differences are:
 - Functions/variables/types which were unused in i386/xen/xen-os.h:
    * xen_xchg
    * __xchg_dummy
    * __xg
    * __xchg
    * atomic_t
    * atomic_inc
    * rdtscll

The functions/variables/types unused in xen-os.h can be dropped and there
is no more differences betwen amd64 and i386.

The new header is placed in x86/include/xen and each platform will have
dummy headers include x86/xen/*.h. This is to be able to include
machine/xen/*.h in the PV drivers.

Submitted by: Julien Grall <julien.grall@citrix.com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D3880
Sponsored by: Citrix Systems R&D

8 years agoRemove all comments deriving from Linux.
hselasky [Wed, 21 Oct 2015 09:37:34 +0000 (09:37 +0000)]
Remove all comments deriving from Linux.
Minor rework of ilog2() function.

Suggested by: emaste @
Sponsored by: Mellanox Technologies

8 years agoRemove all comments deriving from Linux. Style file for FreeBSD.
hselasky [Wed, 21 Oct 2015 08:51:49 +0000 (08:51 +0000)]
Remove all comments deriving from Linux. Style file for FreeBSD.

Suggested by: emaste @
Sponsored by: Mellanox Technologies

8 years agoSome more defines and polishing for INIT_FIRMWARE.
mav [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
hselasky [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
kevlo [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 [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
eadler [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.
bdrewery [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...
jah [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
kevlo [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 [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.
bdrewery [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.
bdrewery [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
cem [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)
cem [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 [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
kib [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
bdrewery [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.
jmmv [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.
kib [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
kib [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
bdrewery [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
kib [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
dumbbell [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
dumbbell [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.
sbruno [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
cem [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
cem [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
cem [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
cem [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()
cem [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
cem [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
cem [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
cem [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
cem [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
cem [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.
hselasky [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.
mav [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
emax [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.
jhb [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
davidcs [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.
gjb [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.
hselasky [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.
hselasky [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 [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 [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
emaste [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
phk [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.
mav [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.
hselasky [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.
hselasky [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.
pluknet [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.
mav [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:
hselasky [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.
mav [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 [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 [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
cem [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
cem [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
cem [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
cem [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
cem [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
cem [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
cem [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
cem [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
cem [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
cem [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
cem [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
bdrewery [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.
bdrewery [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.
bapt [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.
kib [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 [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
ngie [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
ngie [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
cem [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
cem [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
cem [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 [Mon, 19 Oct 2015 17:31:51 +0000 (17:31 +0000)]
Add more obsolete files