]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r304721:
cy [Sat, 27 Aug 2016 02:27:29 +0000 (02:27 +0000)]
MFC r304721:

Fixup man page formatting.

Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>
Discussed with: bjk@

7 years agoBump __FreeBSD_version after LC_*_MASK fix
ache [Fri, 26 Aug 2016 21:28:24 +0000 (21:28 +0000)]
Bump __FreeBSD_version after LC_*_MASK fix

7 years agoMFC r304703, r304755
ache [Fri, 26 Aug 2016 21:23:38 +0000 (21:23 +0000)]
MFC r304703, r304755

1) _locale.h
LC_*_MASK bit shifting order was partially broken from the initial commit
time at year 2012. Only LC_COLLATE_MASK and LC_CTYPE_MASK are in the
right order.

The order here should match XLC_* from "xlocale_private.h" which, in turn,
match LC_* publicly visible order from <locale.h> which determines how
locale components are stored in the structure.
LC_*_MASK -> XLC_* translation done as "ffs(mask) - 1" in the querylocale()
and equivalent shift loop in the newlocale(), so mapped to some wrong
components (excluding two mentioned above).

Formally the fix is ABI breakage, but old code using those masks
never works properly in any case.
Only newlocale() and querylocale() are affected.

2) msgcat.c
Use current locale (f.e. set by thread). It was global locale always
previously.

PR:     211743

7 years agoMFC r304342:
hselasky [Fri, 26 Aug 2016 12:04:31 +0000 (12:04 +0000)]
MFC r304342:
Add support for setting blocking and non-blocking mode on /dev/rdma_cm
by returning success on FIONBIO and FIOASYNC IOCTLs. The actual flags
handling is done by the kern_ioctl() function.

Reported by: Alex Bowden <alex.bowden@outlook.com>
Sponsored by: Mellanox Technologies

7 years agoMFC r303388:
kib [Fri, 26 Aug 2016 10:06:24 +0000 (10:06 +0000)]
MFC r303388:
Remove Giant from settime().

7 years agoMFC r303382:
kib [Fri, 26 Aug 2016 10:04:10 +0000 (10:04 +0000)]
MFC r303382:
Provide the getboottime(9) and getboottimebin(9) KPI.

MFC r303387:
Prevent parallel tc_windup() calls.  Keep boottime in timehands,
and adjust it from tc_windup().

MFC notes:

The boottime and boottimebin globals are still exported from
the kernel dyn symbol table in stable/11, but their declarations are
removed from sys/time.h.  This preserves KBI but not KPI, while all
in-tree consumers are converted to getboottime().

The variables are updated after tc_setclock_mtx is dropped, which gives
approximately same unlocked bugs as before.

The boottime and boottimebin locals in several sys/kern_tc.c functions
were renamed by adding the '_x' suffix to avoid name conficts.

7 years agoMFC r303386:
kib [Fri, 26 Aug 2016 09:42:51 +0000 (09:42 +0000)]
MFC r303386:
Change ntpadj_lock to spinlock always.
Add missed lock to ntp_update_second().

7 years agoMFC r303385:
kib [Fri, 26 Aug 2016 09:40:34 +0000 (09:40 +0000)]
MFC r303385:
Reduce the resettodr_lock scope to only CLOCK_SETTIME() call.

7 years agoMFC r303384:
kib [Fri, 26 Aug 2016 09:38:25 +0000 (09:38 +0000)]
MFC r303384:
Style.

7 years agoMFC r303383:
kib [Fri, 26 Aug 2016 09:36:45 +0000 (09:36 +0000)]
MFC r303383:
Reduce number of timehands to just two.

7 years agoMFC 303766
sephe [Fri, 26 Aug 2016 05:37:44 +0000 (05:37 +0000)]
MFC 303766
    tcp/lro: If timestamps mismatch or it's a FIN, force flush.

    This keeps the segments/ACK/FIN delivery order.

    Before this patch, it was observed: if A sent FIN immediately after
    an ACK, B would deliver FIN first to the TCP stack, then the ACK.
    This out-of-order delivery causes one unnecessary ACK sent from B.

    Reviewed by:    gallatin, hps
    Obtained from:  rrs, gallatin
    Sponsored by:   Netflix (rrs, gallatin), Microsoft (sephe)
    Differential Revision:  https://reviews.freebsd.org/D7415

7 years agoMFC r304543:
tuexen [Thu, 25 Aug 2016 09:16:25 +0000 (09:16 +0000)]
MFC r304543:
Unbreak sctp_connectx().

MFC r304573:
Remove duplicate code, which is not protected by the appropriate locks.

MFC r304579:
Improve the locking when sending user messages.

First, keep a ref count on the stcb after looking it up, as
done in the other lookup cases.
Second, before looking again at sp, ensure that it is not
freed, because the assoc is about to be freed.

7 years agoMFC r304286:
kib [Wed, 24 Aug 2016 09:18:38 +0000 (09:18 +0000)]
MFC r304286:
Remove duplicated code.

7 years agoMFC r304697:
bdrewery [Wed, 24 Aug 2016 02:23:03 +0000 (02:23 +0000)]
MFC r304697:

  FAST_DEPEND: Fix 'make all install' not properly rebuilding based on
  .depend.* files.

7 years agoMFC r304322:
bdrewery [Wed, 24 Aug 2016 01:44:53 +0000 (01:44 +0000)]
MFC r304322:

  [net80211] correctly lock the ifp before accessing the lladdr.

7 years agoMFC r304643:
bdrewery [Wed, 24 Aug 2016 01:34:22 +0000 (01:34 +0000)]
MFC r304643:

  Fix building on read-only source trees.

PR: 211952

7 years agoMFC r304021: Update iflib to support more NIC designs
shurd [Tue, 23 Aug 2016 21:21:56 +0000 (21:21 +0000)]
MFC r304021: Update iflib to support more NIC designs

- Move group task queue into kern/subr_gtaskqueue.c
- Change intr_enable to return an int so it can be detected if it's not
  implemented
- Allow different TX/RX queues per set to be different sizes
- Don't split up TX mbufs before transmit
- Allow a completion queue for TX as well as RX
- Pass the RX budget to isc_rxd_available() to allow an earlier return
  and avoid multiple calls

Approved by: sbruno

7 years agoMFC r304232:
kib [Tue, 23 Aug 2016 07:32:12 +0000 (07:32 +0000)]
MFC r304232:
In UFS_BALLOC(), invalidate pages of indirect buffers on failed block
allocation unwinding.

7 years agoMFC r304231:
kib [Tue, 23 Aug 2016 07:30:20 +0000 (07:30 +0000)]
MFC r304231:
On unwind after failed block allocation in ffs_balloc_ufs{1,2}, assert
that recorded allocated blocks numbers match the physical block numbers
of dandling buffers which are released.
When finally freeing the blocks during unwind, assert that dandling
buffers where not re-allocated.

7 years agoMFC r304229:
kib [Tue, 23 Aug 2016 07:27:38 +0000 (07:27 +0000)]
MFC r304229:
When looking up dandling buffers for unwing after failing block
allocation in UFS_BALLOC(), there is no need to map them.

7 years agoMFC r304228:
kib [Tue, 23 Aug 2016 07:25:39 +0000 (07:25 +0000)]
MFC r304228:
When block allocation fails in UFS_BALLOC(), and the volume does not
have SU enabled, there is no point in calling softdep_request_cleanup().

7 years agoMFC r304227:
kib [Tue, 23 Aug 2016 07:23:50 +0000 (07:23 +0000)]
MFC r304227:
In ffs_balloc_ufs{1,2} routines, assert that unwind records do not
overflow local arrays.

7 years agoMFC r304521: JMicron JMB361 has only a single SATA port
avg [Tue, 23 Aug 2016 07:02:50 +0000 (07:02 +0000)]
MFC r304521: JMicron JMB361 has only a single SATA port

7 years agoMFC r304530:
dim [Tue, 23 Aug 2016 05:22:03 +0000 (05:22 +0000)]
MFC r304530:

Pull in r265122 from upstream llvm trunk (by James Molloy):

  Fix for pr24346: arm asm label calculation error in sub

  Some ARM instructions encode 32-bit immediates as a 8-bit integer
  (0-255) and a 4-bit rotation (0-30, even) in its least significant 12
  bits. The original fixup, FK_Data_4, patches the instruction by the
  value bit-to-bit, regardless of the encoding. For example, assuming
  the label L1 and L2 are 0x0 and 0x104 respectively, the following
  instruction:

    add r0, r0, #(L2 - L1) ; expects 0x104, i.e., 260

  would be assembled to the following, which adds 1 to r0, instead of
  260:

    e2800104 add r0, r0, #4, 2 ; equivalently 1

  The new fixup kind fixup_arm_mod_imm takes care of the encoding:

    e2800f41 add r0, r0, #260

  Patch by Ting-Yuan Huang!

This fixes label calculation for ARM assembly, and is needed to enable
ARM assembly sources for OpenSSL.

Requested by: jkim

7 years agoMFC 304476: Fix various nits in the aio operation manpages.
jhb [Mon, 22 Aug 2016 17:52:10 +0000 (17:52 +0000)]
MFC 304476: Fix various nits in the aio operation manpages.

- Avoid double use of "request" in a single sentence.  Instead, describe
  aio_sigevent as being used to request notification of the associated
  operation's completion.  This matches the language used to describe
  aio_sigevent in aio(4).
- Simplify the prohibition on modifying buffers while requests are in
  flight.
- Fix case mismatch.
- Drop note about not using stack variables. C programmers should be able
  to figure out if a stack variable is safe based on the later warning
  about the life cycle requirements of control blocks.
- Remove prohibition on modifying the I/O buffer for aio_fsync() since
  it does not use an I/O buffer.  For aio_mlock(), prohibit modifications
  to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not
  prohibit modifications to the memory backing the buffer (stores into
  the pages backing the buffer).

7 years agoMFC r304440, r304487:
markj [Mon, 22 Aug 2016 17:23:27 +0000 (17:23 +0000)]
MFC r304440, r304487:
Fix some handling of P2_PTRACE_FSTP.

7 years agoMFC r304608:
bdrewery [Mon, 22 Aug 2016 15:53:32 +0000 (15:53 +0000)]
MFC r304608:

  Bump __FreeBSD_version for C++11 thread_local support in r303795.

PR:         192320

7 years agoMFC r304174:
kib [Mon, 22 Aug 2016 07:25:09 +0000 (07:25 +0000)]
MFC r304174:
VOP_FSYNC() does not take cred as an argument.  Correct comment.

7 years agoImport Dragonfly Mail Agent snapshort from 20160806 aka v0.11+
bapt [Mon, 22 Aug 2016 07:08:00 +0000 (07:08 +0000)]
Import Dragonfly Mail Agent snapshort from 20160806 aka v0.11+

Most important change being:
dma - Fix security hole

Affecting DragonFly 4.6 and earlier, Matt Dillon fixed this in base after
finding out from BSDNow Episode 152. Comments following were from his commit
which explains better than I. Just taking his change and putting it here as well.

* dma makes an age-old mistake of not properly checking whether a file
owned by a user is a symlink or not, a bug which the original mail.local
also had.

* Add O_NOFOLLOW to disallow symlinks.
Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked
about the mail.local bug.

7 years agoMFC 304251
sephe [Mon, 22 Aug 2016 02:23:05 +0000 (02:23 +0000)]
MFC 304251

    hyperv/storvsc: Deliver CAM_SEL_TIMEOUT upon SRB status error.

    SRB status is set to 0x20 by the hypervisor, if the specified LUN is
    unaccessible, and even worse the INQUIRY response will not be set by
    the hypervisor at all under this situation.  Additionally, SRB status
    is 0x20 too, for TUR on an unaccessible LUN.

    Deliver CAM_SEL_TIMEOUT to CAM upon SRB status errors as suggested by
    Scott Long, other values seems improper.

    This commit fixes the Hyper-V disk hotplug support.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7521

7 years agoMFC r304313:
ae [Sun, 21 Aug 2016 17:26:16 +0000 (17:26 +0000)]
MFC r304313:
  Teach netisr_get_cpuid() to limit a given value to supported by netisr.
  Use netisr_get_cpuid() in netisr_select_cpuid() to limit cpuid value
  returned by protocol to be sure that it is not greather than nws_count.

  PR: 211836

7 years agoMFC r304077:
manu [Sun, 21 Aug 2016 15:45:12 +0000 (15:45 +0000)]
MFC r304077:

Correct the size of the softc in a10_ehci

Reported by: andrew

7 years agoMFC r304545: Disable L2 caching for UDP over IPv6
karels [Sat, 20 Aug 2016 20:56:36 +0000 (20:56 +0000)]
MFC r304545: Disable L2 caching for UDP over IPv6

The ip6_output routine is missing L2 cache invalication as done
in ip_output.  Even with that code, some problems with UDP over
IPv6 have been reported.  Diabling L2 cache for that problem works
around the problem for now.

PR: 211872 211926
Reviewed by: gnn
Approved by: gnn (mentor)
Tested by: peter@, Mike Andrews
MFC after: immediate

7 years agoMFC r304319:
dim [Sat, 20 Aug 2016 12:49:05 +0000 (12:49 +0000)]
MFC r304319:

Pull in r262772 from upstream clang trunk (by Simon Pilgrim):

  [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE

  btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't
  support XSAVE.

  Differential Revision: http://reviews.llvm.org/D17682

Pull in r262782 from upstream llvm trunk (by Simon Pilgrim):

  [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE

  btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't
  support XSAVE.

  Differential Revision: http://reviews.llvm.org/D17683

This ensures clang does not emit AVX instructions for CPUTYPE=btver1.

Reported by: Michel Depeige <demik+freebsd@lostwave.net>
PR: 211864

7 years agoMFC r303795:
kib [Sat, 20 Aug 2016 11:58:23 +0000 (11:58 +0000)]
MFC r303795:
Add __cxa_thread_atexit(3) API implementation.

7 years agoMFC r303794:
kib [Sat, 20 Aug 2016 11:54:11 +0000 (11:54 +0000)]
MFC r303794:
Create namespace for the symbols added during 12-CURRENT cycle.

7 years agoMFC r304292:
tuexen [Sat, 20 Aug 2016 07:44:41 +0000 (07:44 +0000)]
MFC r304292:
Use names for SCTP and UDPLite when reporting the input histogram.

MFC r304295:
Fix the output for scope statistics.

7 years agoMFC r303147
pfg [Sat, 20 Aug 2016 02:14:14 +0000 (02:14 +0000)]
MFC r303147
binutils: fix "Bad value" error in bfd for MIPS when using -Bsymbolic.

From OpenBSD's log:

Inspired by https://sourceware.org/ml/binutils/2010-08/msg00333.html,
but expressed differently so there are no GPLv3 issues.

Obtained from: OpenBSD (CVS rev. 1.7)

7 years agoMFC r303062, r303567, r303593:
pfg [Sat, 20 Aug 2016 02:06:59 +0000 (02:06 +0000)]
MFC r303062, r303567, r303593:
MFV r298167, r300962, r303048:
openresolv(8): update to version 3.8.1.

Among the new features it attempts to support alternative init systems.

7 years agoMFC r304288:
bdrewery [Sat, 20 Aug 2016 00:34:19 +0000 (00:34 +0000)]
MFC r304288:

  Garbage collect _umtx_lock(2)/_umtx_unlock(2) references removed in r263318.

7 years agoMFC 304018: Add defines needed to export SMBIOS serial numbers
jhb [Fri, 19 Aug 2016 23:31:56 +0000 (23:31 +0000)]
MFC 304018: Add defines needed to export SMBIOS serial numbers

Some defines needed for exporting serial numbers from the SMBIOS were
missed during integration of SMBIOS support in the EFI boot loader (r281138).
This is needed for getting the hostid set from the system hardware UUID.

PR: 206031

7 years agoMFC 303001: Add PTRACE_VFORK to trace vfork events.
jhb [Fri, 19 Aug 2016 20:17:57 +0000 (20:17 +0000)]
MFC 303001: Add PTRACE_VFORK to trace vfork events.

First, PL_FLAG_FORKED events now also set a PL_FLAG_VFORKED flag when
the new child was created via vfork() rather than fork().  Second, a
new PL_FLAG_VFORK_DONE event can now be enabled via the PTRACE_VFORK
event mask.  This new stop is reported after the vfork parent resumes
due to the child calling exit or exec.  Debuggers can use this stop to
reinsert breakpoints in the vfork parent process before it resumes.

7 years agoMFC r303354,303373,303404,304045,304192
bapt [Fri, 19 Aug 2016 19:26:16 +0000 (19:26 +0000)]
MFC r303354,303373,303404,304045,304192

Set date and time formats back to what they were before CLDR

While CLDR brings us a good and up to date source data to generate locales for
all databses we are using for locales, it is not the case of LC_TIME. Where it
does not defines the informations we need.

Put back all the date and time formats from the old locales.
Make it statically for now (in order to be able to merge it now into
11.0-RELEASE). The generation tools will be updated soon.

That gives us time to properly work on LC_TIME during the 12 timeframe.

While here fix abbreviated month for af_ZA (which are already fixed in CLDR
data upstream)

In locales where AP/PM was not defined before CLDR data, remove again the AP/PM
informations

For locales where AP/PM was defined before CLDR data, keep the CLDR information
which was properly translated.

r303354,303373 by kevlo
r303404,304192 by jkim

7 years agoMFC r304217:
bdrewery [Fri, 19 Aug 2016 17:03:14 +0000 (17:03 +0000)]
MFC r304217:

  Trim unneeded bootstrap after r301470 made 9.1 the minimum supported release.

7 years agoMFC r304008:
bdrewery [Fri, 19 Aug 2016 17:02:14 +0000 (17:02 +0000)]
MFC r304008:

  Avoid taking PROC_LOCK in syscalls if not being traced.

7 years agoMFC r304006:
bdrewery [Fri, 19 Aug 2016 17:01:13 +0000 (17:01 +0000)]
MFC r304006:

  Avoid showing the bootstrap make command for check-old, etc.

7 years agoMFC r304005:
bdrewery [Fri, 19 Aug 2016 16:59:01 +0000 (16:59 +0000)]
MFC r304005:

  PORTS_MODULES: Don't leak in CC/CXX/CPP.

7 years agoMFC r303929,r303930,r303931,r303932,r303933:
bdrewery [Fri, 19 Aug 2016 16:56:52 +0000 (16:56 +0000)]
MFC r303929,r303930,r303931,r303932,r303933:

  r303929:
    Fix -S with -b not atomically updating the destination file.
  r303930:
    Support -v for -l.
  r303931:
    Fix -S with -l not being atomic.
  r303932:
    Fix -b failure not restoring flags on the destination file.
  r303933:
    Squelch a false-positive Clang static analyzer warning.

7 years agoMFC r304152:
kp [Fri, 19 Aug 2016 11:31:30 +0000 (11:31 +0000)]
MFC r304152:

pf: Add missing byte-order swap to pf_match_addr_range

Without this, rules using address ranges (e.g. "10.1.1.1 - 10.1.1.5") did not
match addresses correctly on little-endian systems.

PR:       211796
Obtained from:    OpenBSD (sthen)

7 years agoMFC r304016:
kib [Fri, 19 Aug 2016 08:00:48 +0000 (08:00 +0000)]
MFC r304016:
Move defines common between rtld and libsysdecode into the header.

7 years agoMFC r304012:
kib [Fri, 19 Aug 2016 07:59:00 +0000 (07:59 +0000)]
MFC r304012:
Fill phdr and phsize for rtld object.

7 years agoMFC r304011:
kib [Fri, 19 Aug 2016 07:57:43 +0000 (07:57 +0000)]
MFC r304011:
Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf.

7 years agoMFC r303991:
kib [Fri, 19 Aug 2016 07:56:07 +0000 (07:56 +0000)]
MFC r303991:
Decode 32bit utrace records on the 64bit host.

7 years agoMFC r303990:
kib [Fri, 19 Aug 2016 07:48:32 +0000 (07:48 +0000)]
MFC r303990:
Remove unused prototypes.

7 years agoMFH (r304142): ensure stripe size is non-zero multiple of 4096
des [Fri, 19 Aug 2016 07:05:34 +0000 (07:05 +0000)]
MFH (r304142): ensure stripe size is non-zero multiple of 4096

PR: 211361

7 years agoMFC r304246
vangyzen [Thu, 18 Aug 2016 21:47:00 +0000 (21:47 +0000)]
MFC r304246

PCIe HotPlug: Detect bridges that are not really HotPlug capable

Some devices report that they have an MRL when they actually
do not.  Since they always report that the MRL is open, child
devices would be ignored.  Try to detect these devices and
ignore their claim of HotPlug support.  Specifically,
if there is an open MRL but the Data Link Layer is active,
the MRL is not real.

Revert r303645 to re-enable HotPlug support for slots with
power controllers, since it works correctly in my testing.

Start the DLL state-change timer if Presence /or/ MRL state changes,
along with other conditions.  Previously, we started the timer iff
Presence changed.  If there is an MRL, it must be closed for power
to be turned on, so Presence is unlikely to change on an MRL-close event.

Add a printf() of interesting registers on HotPlug interrupts and
commands (one from erj@).  These were very useful for debugging.
Guard them with bootverbose, since they're spam in normal operation.

In collaboration with: jhb
Relnotes: yes (re-enable HotPlug support for slots with power controllers)
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D7509

7 years agoMFC r302783:
badger [Thu, 18 Aug 2016 14:10:36 +0000 (14:10 +0000)]
MFC r302783:

  Add explicit detection of KVM hypervisor

  Set vm_guest to a new enum value (VM_GUEST_KVM) when kvm is detected and use
  vm_guest in conditionals testing for KVM.

  Also, fix a conditional checking if we're running in a VM which caught only
  the generic VM case, but not more specific VMs (KVM, VMWare, etc.).  (Spotted
  by: vangyzen).

  Sponsored by: Dell Inc.
  Approved by: vangyzen (mentor)

7 years agoMFC r304146:
tuexen [Thu, 18 Aug 2016 12:51:26 +0000 (12:51 +0000)]
MFC r304146:
Ensure that sctp_it_ctl.cur_it does not point to a free object (during
a small time window).
Thanks to Byron Campen for reporting the issue and
suggesting a fix.

7 years agoMFC r303009: Negotiate/disable TXCSUM_IPV6 same as TXCSUM.
mav [Thu, 18 Aug 2016 12:08:39 +0000 (12:08 +0000)]
MFC r303009: Negotiate/disable TXCSUM_IPV6 same as TXCSUM.

7 years agoMFC r302504, r302666, r302668, r302932, r302933:
mav [Thu, 18 Aug 2016 11:51:14 +0000 (11:51 +0000)]
MFC r302504, r302666, r302668, r302932, r302933:
Add emulation for Intel e1000 (e82545) network adapter.

The code was successfully tested with FreeBSD, Linux, Solaris and Windows
guests.  This interface is predictably slower (about 2x) then virtio-net,
but it is very helpful for guests not supporting virtio-net by default.

Thanks to Jeremiah Lott and Peter Grehan for doing original heavy lifting.

7 years agoMFC r302460: Add emulation for multiple (up to 16) MSI vectors for AHCI.
mav [Thu, 18 Aug 2016 11:49:49 +0000 (11:49 +0000)]
MFC r302460: Add emulation for multiple (up to 16) MSI vectors for AHCI.

It was useless before, but may improve performance now if multiple devices
are configured and guest supports this feature.

Sponsored by:   iXsystems, Inc.

7 years agoMFC r302459: Allow AHCI controller to support up to 32 arbitrary devices.
mav [Thu, 18 Aug 2016 11:49:16 +0000 (11:49 +0000)]
MFC r302459: Allow AHCI controller to support up to 32 arbitrary devices.

While old syntax is still supported, new syntax looks like this:

-s 3,ahci,hd:/dev/zvol/XXX,hd:/dev/zvol/YYY,cd:/storage/ZZZ.iso

Sponsored by:   iXsystems, Inc.

7 years agoMFC r304154
oleg [Thu, 18 Aug 2016 11:23:02 +0000 (11:23 +0000)]
MFC r304154

Fix command: ipfw set (enable|disable) N (where N > 4).

7 years agoMFC r302947: In AHCI_IRQ_MODE_AFTER mode do not clear interrupts below.
mav [Thu, 18 Aug 2016 11:15:35 +0000 (11:15 +0000)]
MFC r302947: In AHCI_IRQ_MODE_AFTER mode do not clear interrupts below.

This is probably a NOP change since IS register is not activery used for
interrupts below the shared, but it looked odd to clear interrupts we did
not handle.

7 years agoMFC r302946:
mav [Thu, 18 Aug 2016 11:14:57 +0000 (11:14 +0000)]
MFC r302946:
Do not consider the last interrupt shared if there are enough interrupts
for all channels.

7 years agoMFC r304374
ache [Thu, 18 Aug 2016 10:37:20 +0000 (10:37 +0000)]
MFC r304374

Fix TAB replaced with spaces in prev. commit.

7 years agoMFC r303554, r303561:
mav [Thu, 18 Aug 2016 09:39:51 +0000 (09:39 +0000)]
MFC r303554, r303561:
Block MSIX negotiation until SMP started and IRQ reshuffled.

7 years agoMFC r303553: Make MAC address generation more random.
mav [Thu, 18 Aug 2016 09:38:01 +0000 (09:38 +0000)]
MFC r303553: Make MAC address generation more random.

'ticks' approach does not work at boot time.

7 years agoMFC r303551: Fix infinite loops introduced at r303429.
mav [Thu, 18 Aug 2016 09:37:27 +0000 (09:37 +0000)]
MFC r303551: Fix infinite loops introduced at r303429.

7 years agoMFC r303514: Fix NTBT_QP_LINKS negotiation.
mav [Thu, 18 Aug 2016 09:36:45 +0000 (09:36 +0000)]
MFC r303514: Fix NTBT_QP_LINKS negotiation.

I believe it never worked correctly for more the one queue even in Linux.
This fixes case when one of consumer drivers is not loaded on one side,
but its queues still announced as ready if something else brought link up.

While there, remove some pointless NULL checks.

7 years agoMFC r303510: Clear scratchpad after MSIX negotiation to not leak garbage.
mav [Thu, 18 Aug 2016 09:36:06 +0000 (09:36 +0000)]
MFC r303510: Clear scratchpad after MSIX negotiation to not leak garbage.

7 years agoMFC r303494: Once more refactor KPI between ntb_transport(4) and if_ntb(4).
mav [Thu, 18 Aug 2016 09:35:31 +0000 (09:35 +0000)]
MFC r303494: Once more refactor KPI between ntb_transport(4) and if_ntb(4).

New design allows to attach multiple consumers to ntb_transport(4) instance.
Previous design obtained from Linux theoretically allowed that, but was not
practically usable (Linux also has only one consumer driver now).

7 years agoMFC r303429, r303437:
mav [Thu, 18 Aug 2016 09:34:39 +0000 (09:34 +0000)]
MFC r303429, r303437:
Once more refactor KPI between NTB hardware and consumers.

New design allows hardware resources to be split between several consumers.
For example, one BAR can be dedicated for remote memory access, while other
resources can be used for packet transport for virtual Ethernet interface.
And even without resource split, this code allows to specify which consumer
driver should attach the hardware.

From some points this makes the code even closer to Linux one, even though
Linux does not provide the described flexibility.

7 years agoMFC r302520: Replace NTB man page with more detailed and up to date.
mav [Thu, 18 Aug 2016 09:33:22 +0000 (09:33 +0000)]
MFC r302520: Replace NTB man page with more detailed and up to date.

Sponsored by:   iXsystems, Inc.

7 years agoMFC r303266: Postpone ntb_get_msix_info() till we need to negotiate MSIX.
mav [Thu, 18 Aug 2016 09:30:55 +0000 (09:30 +0000)]
MFC r303266: Postpone ntb_get_msix_info() till we need to negotiate MSIX.

Calling it earlier increases the window when MSIX info may change.
This change does not solve the problem completely, but seems logical.
Complete solution should probably include link reset in case of MSIX
remap to trigger new negotiation, but we have no way to get notified
about that now.

7 years agoMFC r302622 (by sephe): ntb: Fix LINT
mav [Thu, 18 Aug 2016 09:30:21 +0000 (09:30 +0000)]
MFC r302622 (by sephe): ntb: Fix LINT

7 years agoMFC r302531: Revert odd change, setting limit registers before base.
mav [Thu, 18 Aug 2016 09:29:35 +0000 (09:29 +0000)]
MFC r302531: Revert odd change, setting limit registers before base.

I don't know what errata is mentioned there, I was unable to find it, but
setting limit before the base simply does not work at all.  According to
specification attempt to set limit out of the present window range resets
it to zero, effectively disabling it.  And that is what I see in practice.

Fixing this properly disables access for remote side to our memory until
respective xlat is negotiated and set.  As I see, Linux does the same.

7 years agoMFC r302529: Remove callout_reset(link_work) from ntb_transport_attach().
mav [Thu, 18 Aug 2016 09:28:59 +0000 (09:28 +0000)]
MFC r302529: Remove callout_reset(link_work) from ntb_transport_attach().

At that point link is quite likely not established yet, so messing with
scratch registers is premature there.  Original commit message mentioned
code diff reduction from Linux, but this line is not present in Linux now.

7 years agoMFC r302530: Fix wrong copy/paste in r302510.
mav [Thu, 18 Aug 2016 09:28:26 +0000 (09:28 +0000)]
MFC r302530: Fix wrong copy/paste in r302510.

7 years agoMFC r302510:
mav [Thu, 18 Aug 2016 09:27:46 +0000 (09:27 +0000)]
MFC r302510:
Simplify MSIX MW BAR xlat setup, and don't forget to unlock its limit.

The last fixes SB01BASE_LOCKUP workaround after driver reload.

7 years agoMFC r302508: Disable SB01BASE_LOCKUP workaround when split BARs disabled.
mav [Thu, 18 Aug 2016 09:27:11 +0000 (09:27 +0000)]
MFC r302508: Disable SB01BASE_LOCKUP workaround when split BARs disabled.

For some reason hack with sending MSI-X interrupts by writing to remote
LAPIC memory works only for 32-bit BARs, that are available only if split
BARs mode is enabled in BIOS.  If it is not, complain loudly and fall back
to less efficient workaround.

7 years agoMFC r302499: Improve checksum "offload" support.
mav [Thu, 18 Aug 2016 09:26:21 +0000 (09:26 +0000)]
MFC r302499: Improve checksum "offload" support.

For compatibility reasons make driver not report any checksum offload by
default, since there is indeed none.  But if administrator knows that
interface is used only for local traffic, he can enable fake checksum
offload manually on both sides to save some CPU cycles, since the data
are already protected by CRC32 of PCIe link.

Sponsored by:   iXsystems, Inc.

7 years agoMFC r302496: Rewrite if_ntb to use modern interface KPIs and features.
mav [Thu, 18 Aug 2016 09:25:45 +0000 (09:25 +0000)]
MFC r302496: Rewrite if_ntb to use modern interface KPIs and features.

It includes: link state, if_transmit, buf_ring, multiple queues, bpf, etc.

Sponsored by:   iXsystems, Inc.

7 years agoMFC r302495: Improve memory allocation errors handling on receive.
mav [Thu, 18 Aug 2016 09:25:10 +0000 (09:25 +0000)]
MFC r302495: Improve memory allocation errors handling on receive.

7 years agoMFC r302494: Synchronize MTU code with Linux.
mav [Thu, 18 Aug 2016 09:24:36 +0000 (09:24 +0000)]
MFC r302494: Synchronize MTU code with Linux.

It is mandatory for transport compatibility.

7 years agoMFC r302493: Reimplement doorbell register emulation for NTB_SB01BASE_LOCKUP.
mav [Thu, 18 Aug 2016 09:23:59 +0000 (09:23 +0000)]
MFC r302493: Reimplement doorbell register emulation for NTB_SB01BASE_LOCKUP.

This allows at least first three doorbells to work very close to normal
hardware, properly signaling events to upper layers without spurious or
lost events.  Doorbells above the first three may still report spurious
events due to lack of reliable information, but they are rarely used.

7 years agoMFC r302492: Bring some more order into link and qp state handling.
mav [Thu, 18 Aug 2016 09:22:46 +0000 (09:22 +0000)]
MFC r302492: Bring some more order into link and qp state handling.

Do not touch scratchpad registers until link is reported up.
Mask and do not handle doorbell events until respective qp is up.

7 years agoMFC r302491: Switch ctx_lock from mutex to rmlock.
mav [Thu, 18 Aug 2016 09:22:11 +0000 (09:22 +0000)]
MFC r302491: Switch ctx_lock from mutex to rmlock.

It is odd idea to serialize different MSI-X vectors.  Use of rmlocks
here allows them to execute in parallel, but still protects ctx.
If upper layers require any additional serialization -- they can
do it by themselves.

7 years agoMFC r302490: Create separate RX taskqueue for each qp.
mav [Thu, 18 Aug 2016 09:21:36 +0000 (09:21 +0000)]
MFC r302490: Create separate RX taskqueue for each qp.

7 years agoMFC r302489: Remove rx_completion_task taskqueue.
mav [Thu, 18 Aug 2016 09:20:58 +0000 (09:20 +0000)]
MFC r302489: Remove rx_completion_task taskqueue.

It is not needed after RX lock removed in previous commit.

7 years agoMFC r302488: Remove unneeded RX lock, and make TX lock per-qp.
mav [Thu, 18 Aug 2016 09:20:25 +0000 (09:20 +0000)]
MFC r302488: Remove unneeded RX lock, and make TX lock per-qp.

7 years agoMFC r302487: Reduce code divergence from Linux, preparing for DMA support.
mav [Thu, 18 Aug 2016 09:19:50 +0000 (09:19 +0000)]
MFC r302487: Reduce code divergence from Linux, preparing for DMA support.

7 years agoMFC r302486: Fix operation with multiple qps.
mav [Thu, 18 Aug 2016 09:19:01 +0000 (09:19 +0000)]
MFC r302486: Fix operation with multiple qps.

7 years agoMFC r302484: NewBus'ify NTB subsystem.
mav [Thu, 18 Aug 2016 09:18:23 +0000 (09:18 +0000)]
MFC r302484: NewBus'ify NTB subsystem.

This follows NTB subsystem modularization in Linux, tuning it to FreeBSD
native NewBus interfaces.  This change allows to support different types
of hardware with different drivers, support multiple NTB instances in a
system, ntb_transport module use for needs other then if_ntb, etc.

Sponsored by:   iXsystems, Inc.

7 years agoMFC r302483: Remove some dead code found by Clang static analyzer.
mav [Thu, 18 Aug 2016 09:17:39 +0000 (09:17 +0000)]
MFC r302483: Remove some dead code found by Clang static analyzer.

7 years agoMFC r302482: Fix NTB_SDOORBELL_LOCKUP workaround.
mav [Thu, 18 Aug 2016 09:16:59 +0000 (09:16 +0000)]
MFC r302482: Fix NTB_SDOORBELL_LOCKUP workaround.

Since SBARxSZ register can be write-once, it can be unusable for disabling
the SBAR.  For such case also set SBARxBASE to zero to not intersect with
config BAR.

7 years agoMFC r303581
ache [Thu, 18 Aug 2016 08:52:55 +0000 (08:52 +0000)]
MFC r303581

Fix date

7 years agoMFC r303568
ache [Thu, 18 Aug 2016 08:47:06 +0000 (08:47 +0000)]
MFC r303568

Remove another vestige of scripted conversion

7 years agoMFC r303569
ache [Thu, 18 Aug 2016 08:36:24 +0000 (08:36 +0000)]
MFC r303569

Reflect CLDR timedef changes

7 years agoMFC r302937
ache [Thu, 18 Aug 2016 07:43:18 +0000 (07:43 +0000)]
MFC r302937

Path generation was not according to collate

Approved by:    jilles