]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoRevert 312696 due to build tests.
sbruno [Tue, 24 Jan 2017 15:55:52 +0000 (15:55 +0000)]
Revert 312696 due to build tests.

7 years agoiflib:
sbruno [Tue, 24 Jan 2017 14:48:32 +0000 (14:48 +0000)]
iflib:
   Add internal tracking of smp startup status to reliably figure out
   what methods are to be used to get gtaskqueue up and running.

e1000:
   Calculating this pointer gives undefined behaviour when (last == -1)
   (it is before the buffer).  The pointer is always followed.  Panics
   occurred when it points to an unmapped page.  Otherwise, the pointed-to
   garbage tends to not have the E1000_TXD_STAT_DD bit set in it, so in the
   broken case the loop was usually null and the function just returned, and
   this was acidentally correct.

Submitted by: bde
Reviewed by: Matt Macy <mmacy@nextbsd.org>

7 years agoMake CTL ramdisk backend a real RAM disk.
mav [Tue, 24 Jan 2017 12:13:41 +0000 (12:13 +0000)]
Make CTL ramdisk backend a real RAM disk.

If "capacity" LU option is set, ramdisk backend now implements featured
thin provisioned disk, storing data in malloc(9) allocated memory blocks
of pblocksize bytes (default PAGE_SIZE or 4KB).  Additionally ~0.2% of LU
size is used for indirection tree (bigger pblocksize reduce the overhead).
Backend supports all unmap and anchor operations.  If configured capacity
is overflowed, proper error conditions are reported.

If "capacity" LU option is not set, the backend operates mostly the same
as before without allocating real storage: writes go to nowhere, reads
return zeroes, reporting that all LBAs are unmapped.

This backend is still mostly oriented on testing and benchmarking (it is
still a volatile RAM disk), but now it should allow to run real FS tests,
not only simple dumb dd.

MFC after: 2 weeks

7 years agoImprove wording when describing -mmin.
sevan [Tue, 24 Jan 2017 10:42:21 +0000 (10:42 +0000)]
Improve wording when describing -mmin.

PR: 215922
Submitted by: danielsh AT apache DOT org
Approved by: bcr (mentor)
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D9313

7 years agoAdd RISC-V support for truss(1)
lwhsu [Tue, 24 Jan 2017 09:41:44 +0000 (09:41 +0000)]
Add RISC-V support for truss(1)

While here, extract NARGREG as a definition.

Reviewed by: br
Differential Revision: https://reviews.freebsd.org/D9249

7 years agohyperv/hn: add devctl_notify for VF_UP/DOWN events
dexuan [Tue, 24 Jan 2017 09:27:13 +0000 (09:27 +0000)]
hyperv/hn: add devctl_notify for VF_UP/DOWN events

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D9102

7 years agohyperv/hn: add a sysctl name for the VF interface
dexuan [Tue, 24 Jan 2017 09:25:42 +0000 (09:25 +0000)]
hyperv/hn: add a sysctl name for the VF interface

This makes it easier for the userland script to find the releated
VF interface.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D9101

7 years agohyperv/hn: add the support for VF drivers (SR-IOV)
dexuan [Tue, 24 Jan 2017 09:24:14 +0000 (09:24 +0000)]
hyperv/hn: add the support for VF drivers (SR-IOV)

Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and
a VF NIC to work together (both NICs have the same MAC address), mainly to
support seamless live migration.

When the VF device becomes UP (or DOWN), the synthetic NIC driver needs
to switch the data path from the synthetic NIC to the VF (or the opposite).

Note: multicast/broadcast packets are still received through the synthetic
NIC and we need to inject the packets through the VF interface (if the VF is
UP), even if the synthetic NIC is DOWN (so we need to force the rxfilter
to be NDIS_PACKET_TYPE_PROMISCUOUS, when the VF is UP).

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8964

7 years agoifnet: introduce event handlers for ifup/ifdown events
dexuan [Tue, 24 Jan 2017 09:19:46 +0000 (09:19 +0000)]
ifnet: introduce event handlers for ifup/ifdown events

Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and
a VF NIC to work together, mainly to support seamless live migration.

When the VF device becomes UP (or DOWN), the synthetic NIC driver needs
to switch the data path from the synthetic NIC to the VF (or the opposite).

So the synthetic NIC driver needs to know when a VF device is becoming
UP or DOWN and hence the patch is made.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8963

7 years agohyperv/hn: remove the MTU and IFF_DRV_RUNNING checking in hn_rxpkt()
dexuan [Tue, 24 Jan 2017 09:15:36 +0000 (09:15 +0000)]
hyperv/hn: remove the MTU and IFF_DRV_RUNNING checking in hn_rxpkt()

It's unnecessary because the upper nework stack does the same checking.

In the case of Hyper-V SR-IOV, we need to remove the checking because
1) multicast/broadcast packets are still received through the synthetic
NIC and we need to inject the packets through the VF interface;
2) we must inject the packets even if the synthetic NIC is down, or has
a different MTU from the VF device.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8962

7 years agohyperv/hn: remember the channel pointer in struct hn_rx_ring
dexuan [Tue, 24 Jan 2017 09:09:53 +0000 (09:09 +0000)]
hyperv/hn: remember the channel pointer in struct hn_rx_ring

This will be used by the coming NIC SR-IOV patch.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8909

7 years agoExtend manual to cover more commands and options.
sevan [Tue, 24 Jan 2017 08:56:54 +0000 (08:56 +0000)]
Extend manual to cover more commands and options.

PR: 203406
Submitted by: Fehmi Noyan Isi (fnoyanisi AT yahoo DOT com)
Approved by: wblock (mentor)
MFC after: 5 days
Differential Revision:  https://reviews.freebsd.org/D8691

7 years agoDon't reference NULL pointer.
delphij [Tue, 24 Jan 2017 07:48:36 +0000 (07:48 +0000)]
Don't reference NULL pointer.

MFC after: 2 weeks

7 years agoSort REALTEK section and remove duplicate entry for RTL8192CU.
kevlo [Tue, 24 Jan 2017 03:00:22 +0000 (03:00 +0000)]
Sort REALTEK section and remove duplicate entry for RTL8192CU.

7 years agoAdd support for the Realtek RTL8192EU chipset.
kevlo [Tue, 24 Jan 2017 02:35:38 +0000 (02:35 +0000)]
Add support for the Realtek RTL8192EU chipset.
Committed over the D-Link DWA-131 rev E1 on amd64 with WPA.

Reviewed by: avos

7 years agoHandle imx6 erratum ERR004346... to reboot, clear the SRS bit twice within
ian [Tue, 24 Jan 2017 02:09:30 +0000 (02:09 +0000)]
Handle imx6 erratum ERR004346... to reboot, clear the SRS bit twice within
the same cycle of the 32khz clock.

I've never actually noticed this error happening, but it's an easy fix.

7 years agoEliminate misleading comments and dead code in lacp_port_create()
rpokala [Tue, 24 Jan 2017 01:39:40 +0000 (01:39 +0000)]
Eliminate misleading comments and dead code in lacp_port_create()

Variables "fast" and "active" are both constant in lacp_port_create(), but
comments mispleadingly suggest that "fast" can be changed via ioctl. The
constant values control the value of "lp->lp_state", so it too is constant,
and the code for assigning different value to it is essentially dead.

Remove both "fast" and "active", and set "lp->lp_state" unconditionally;
that gets rid of the dead code and misleading comments.

CID: 1305692
CID: 1305734

Reported by: asomers
Reviewed by: asomers
MFC after: 1 week
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D9302

7 years agoFix a typo introduced in r306024.
jkim [Mon, 23 Jan 2017 21:09:27 +0000 (21:09 +0000)]
Fix a typo introduced in r306024.

7 years ago[am335x] Use upstream tda19988 framer node from upstream DTS
gonzo [Mon, 23 Jan 2017 19:20:55 +0000 (19:20 +0000)]
[am335x] Use upstream tda19988 framer node from upstream DTS

Remove custom DTS duplicate of tda19988 node and use upstream-provided
one introduced by r295436. This duplication created two tdaX devices
which confused fb driver into using only 640x480 area while setting
display to native resolution.

Reported by: Michael Smith
MFC after: 3 days

7 years agoFix overrun handling issue in r312291.
mav [Mon, 23 Jan 2017 17:44:33 +0000 (17:44 +0000)]
Fix overrun handling issue in r312291.

MFC after: 1 week

7 years agoRemove a static function declaration for a function not implemented.
bz [Mon, 23 Jan 2017 16:40:20 +0000 (16:40 +0000)]
Remove a static function declaration for a function not implemented.

Makes head code compile on 10.3 and cleanup is never wrong.

MFC after: 3 days

7 years agosort - Don't live-loop threads.
pfg [Mon, 23 Jan 2017 15:39:51 +0000 (15:39 +0000)]
sort - Don't live-loop threads.

Worker threads now use a pthread_cond_t to wait for work instead of
burning the cpu up.

Obtained from: DragonflyBSD (07774aea0ccf64a48fcfad8899e3bf7c8f18277a)
MFC after: 2 weeks

7 years agoAlways initialize 'c'.
delphij [Mon, 23 Jan 2017 07:32:47 +0000 (07:32 +0000)]
Always initialize 'c'.

MFC after: 2 weeks

7 years agoWhen creating record file, use umask 077 instead of the default.
delphij [Mon, 23 Jan 2017 06:04:43 +0000 (06:04 +0000)]
When creating record file, use umask 077 instead of the default.

MFC after: 2 weeks

7 years ago[ath] modify cabq and per-node packet usage limits.
adrian [Mon, 23 Jan 2017 04:47:38 +0000 (04:47 +0000)]
[ath] modify cabq and per-node packet usage limits.

* limit cabq to 64 - in practice if this stays at ath_txbuf then
  all buffers can be tied up by a very busy broadcast domain (eg ARP
  storm, way too much MDNS/NETBIOS).  It's been like this in the
  freebsd-wifi-build AP project for the longest time.

* Now that I figured out the hilarity inherent in aggregate forming
  and AR9380 EDMA work, change the per-node to 64 frames by default.
  I'll do some more work to shorten the queue latency introduced when
  doing data so TCP isn't so terrible, but it's now no longer /always/
  tens of milliseconds of extra latency  when doing active iperf tests.

Notes:

The reason for the extra latency is partly tx/rx taskqueue handling and
scheduling, and partly due to a lack of airtime/QoS awareness of per-node
traffic.  Ideally we'd have different limits/priorities on the QoS/TID
levels per node so say, voice/video data got a better share of buffer
allocations over best effort/bulk data, but we currently don't implement
that.  It's not /hard/ to do, I just need to do it.

Tested:

* AR9380 (STA), AR9580 (hostap) - both with the relevant changes.
  TCP is now at around 180mbit with rate control and RTS protection
  enabled.  UDP stays at 355mbit at MCS23, no HT protection.

7 years ago[ath] fix thresholds for deciding to queue to the software queue and populate hardwar...
adrian [Mon, 23 Jan 2017 04:30:08 +0000 (04:30 +0000)]
[ath] fix thresholds for deciding to queue to the software queue and populate hardware frames

This is two fixes, which establishes what I /think/ is pretty close to the
theoretical PHY maximum speed on the AR9380 devices.

* When doing A-MPDU on a TID, don't queue to the hardware directly if
  the hardware queue is busy.  This gives us time to get more packets
  queued up (and the hardware is busy, so there's no point in queuing
  more to the hardware right now) to potentially form an A-MPDU.

  This fixes up the throughput issue I was seeing where a couple hundred
  single frames were being sent a second interspersed between A-MPDU
  frames.  It just happened that the software queue had exactly one
  frame in it at that point.  Queuing it until the hardware finishes
  transmitting isn't exactly costly.

* When determining whether to dequeue from a software node/TID queue into
  the hardware queue, fix up the checks to work right for EDMA chips
  (ar9380 and later.)   Before it was not dispatching anything until
  the FIFO was empty.  Now we allow it to dispatch another aggregate
  up to the hardware aggregate limit, like I intended with the earlier
  work.

This allows a 5GHz HT40, short-GI, "htprotmode off" test at MCS23
to achieve 357 Mbit/sec in a one-way UDP test.  The stars have to be
aligned /just right/ so there are no retries but it can happen.
Just don't expect it to work in an OTA test if your 2yo is running
around the room - MCS23 is very very sensitive to channel conditions.

Tested:

* AR9380 STA (test) -> AR9580 hostap

TODO:

* More thorough testing on pre-AR9380 chips (AR5416, AR9160, AR9280)
* (Finally) teach ath_rate_sample about throughput/latency rather than
  air time, so I can get good transmit rates with a 2yo running around.

7 years ago[ath] [ar9300] ensure the software scheduler is called to form more aggregates for...
adrian [Mon, 23 Jan 2017 04:20:37 +0000 (04:20 +0000)]
[ath] [ar9300] ensure the software scheduler is called to form more aggregates for EDMA chips

When investigating performance on UDP TX on the AR9380 I found that the
following sequence was occuring:

* INTR
* EINPROGRESS - nothing yet
* INTR
* TXSTATUS - process a TX completion for an aggregate
* INTR, INTR
* TXSTATUS - process a TX completion for an aggregate
* TXD, TXD ... populate frames from the hardware queue and submit

What should be happening is a completed TXSTATUS fires off more packets
that are queued on active TIDs.

What /was/ happening was after that first TXSTATUS the TX queue hardware queue
was still empty, so it didn't push anything into the FIFO.  Only after the
second TXSTATUS did any progress get made.

This is one of two commits - it ensures that the software TX queue scheduler
is called /after/ TX completion, otherwise no frames from the software staging
queues will be processed into the hardware queues.

The second commit will fix it so it populates aggregate frames correctly
when the above occurs - right now ath_txq_sched() is called, but it doesn't
populate anything because its pre-check conditions are wrong.

Whilst here, add/tweak debugging.

Tested:

* AR9380 STA (testing device) -> AR9580 hostap

7 years agoAvoid using non-zero argument for __builtin_frame_address().
jhibbits [Mon, 23 Jan 2017 04:03:12 +0000 (04:03 +0000)]
Avoid using non-zero argument for __builtin_frame_address().

Building kernel with devel/powerpc64-gcc (6.2.0) yields the following error:
/usr/src/sys/powerpc/powerpc/db_trace.c:299:20: error: calling
'__builtin_frame_address' with a nonzero argument is unsafe
[-Werror=frame-address]

Work around this by dereferencing the frame address manually instead.

PR: 215600
Reported by: Mark Millard <markmi AT dsl-only DOT net>
MFC after: 2 weeks

7 years agoRemove the DTRACEHIOC_ADD ioctl.
markj [Mon, 23 Jan 2017 02:21:06 +0000 (02:21 +0000)]
Remove the DTRACEHIOC_ADD ioctl.

This ioctl has been considered legacy by upstream since the DTrace code
was first imported, and is unused. The removal also allows some
simplification of dtrace_helper_slurp().

Also remove a bogus copyout in the DTRACEHIOC_ADDDOF handler. Due to a
bug, it would overwrite an in-memory copy of the DOF header rather than
the passed-in DOF helper. Moreover, DTRACEHIOC_ADDDOF already copies the
helper back out automatically since its argument has the IOC_OUT attribute.

7 years agonet80211: fix flags setup for HT40 5GHz channels.
avos [Sun, 22 Jan 2017 23:45:59 +0000 (23:45 +0000)]
net80211: fix flags setup for HT40 5GHz channels.

7 years agoMove values displayed by "iscsictl -v" one character to the right,
trasz [Sun, 22 Jan 2017 20:11:24 +0000 (20:11 +0000)]
Move values displayed by "iscsictl -v" one character to the right,
to line up output from "iscsictl -v" with "ctladm islist -v".

MFC after: 2 weeks

7 years agoRemove max_targets and max_target_id CTL port variables; they were unused.
trasz [Sun, 22 Jan 2017 20:06:15 +0000 (20:06 +0000)]
Remove max_targets and max_target_id CTL port variables; they were unused.

This changes the CTL frontend ABI and thus shouldn't be MFC-ed.

Reviewed by: mav@

7 years agoReally restore the old behaviour for pw usermod -m
bapt [Sun, 22 Jan 2017 20:03:18 +0000 (20:03 +0000)]
Really restore the old behaviour for pw usermod -m

It again reinstall missing skel files without overwriting changed one
Add a regression test about it

Reported by: ae
MFC after: 3 days

7 years agoDocument mount option "nonc" for tmpfs.
kib [Sun, 22 Jan 2017 19:50:23 +0000 (19:50 +0000)]
Document mount option "nonc" for tmpfs.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D9258

7 years agoEditing and clarifications for tmpfs(5).
kib [Sun, 22 Jan 2017 19:46:14 +0000 (19:46 +0000)]
Editing and clarifications for tmpfs(5).

Submitted by: wblock
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D9211

7 years agoAdd comments explaining unobvious td_critnest adjustments in
kib [Sun, 22 Jan 2017 19:41:42 +0000 (19:41 +0000)]
Add comments explaining unobvious td_critnest adjustments in
critical_exit().

Based on the discussion with: jhb
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential revision: D9276
MFC after: 1 week

7 years agoMore style cleanup. Use ANSI C definition for vn_closefile(). Switch
kib [Sun, 22 Jan 2017 19:38:45 +0000 (19:38 +0000)]
More style cleanup.  Use ANSI C definition for vn_closefile().  Switch
to VNASSERT in _vn_lock(), simplify messages.

Sponsored by: The FreeBSD Foundation
X-MFC with: r312600, r312601, r312602, r312606

7 years agoProvide fallback VOP methods for crossmp vnode.
kib [Sun, 22 Jan 2017 19:36:02 +0000 (19:36 +0000)]
Provide fallback VOP methods for crossmp vnode.

In particular, crossmp vnode might leak into rename code.

PR: 216380
Reported by: fnacl@protonmail.com
Sponsored by: The FreeBSD Foundation
X-MFC with: r309425

7 years agoReadd a feature lost in pw(8) refactoring
bapt [Sun, 22 Jan 2017 18:55:01 +0000 (18:55 +0000)]
Readd a feature lost in pw(8) refactoring

pw usermod foo -m

It used to be able to (re)create the home directory if it didn't exists

PR: 216224
Reported by: ae
MFC after: 3 days

7 years agoigb(4) enable WOL features for this class of devices.
sbruno [Sun, 22 Jan 2017 18:04:57 +0000 (18:04 +0000)]
igb(4) enable WOL features for this class of devices.

PR: 208343
Submitted by: Kaho Tashikazu <kaho@elam.kais.kyoto-u.ac.jp>

7 years agoBy default, when doing incremental restores the restore program
mckusick [Sun, 22 Jan 2017 17:49:14 +0000 (17:49 +0000)]
By default, when doing incremental restores the restore program
overwrites an existing file rather than removing it and creating a
new file.  If the old and new version of the file both have extended
attributes and the extended attributes of the two versions of the
file are different, the result is that the new file ends up with
the union of the extended attributes of the old and new files.

To get the behavior of replacing the extended attributes rather
than augmenting them requires explicitly removing the old attributes
and then adding the new ones.

To get this behavior, the old file must be unlinked (which clears
out the old extended attributes).  Then the new file of the same
name must be created and the new extended attributes added to it.

This behavior can be obtained by specifying the -u flag when running
restore.  Rather than defaulting the -u option to on and possibly
breaking existing scripts using restore, this change simply notes
in the restore.8 manual page that the -u flag is recommended when
using restore on filesystems that contain extended attributes.

PR:                     216127
Reported by:            dewayne at heuristicsystems.com.au
Differential Revision:  https://reviews.freebsd.org/D9208

7 years agoBe a little more pedantic here, the TRM says the hardware is supposed to
loos [Sun, 22 Jan 2017 17:24:00 +0000 (17:24 +0000)]
Be a little more pedantic here, the TRM says the hardware is supposed to
only clean the OWNER bit on SOP descriptors.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoProperly assemble an mbuf chain out of received fragments.
loos [Sun, 22 Jan 2017 17:07:37 +0000 (17:07 +0000)]
Properly assemble an mbuf chain out of received fragments.

Remove the rx_batch hack, it makes no difference now that most of bugs have
been sorted out.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoRemove redundant KASSERT.
trasz [Sun, 22 Jan 2017 15:35:51 +0000 (15:35 +0000)]
Remove redundant KASSERT.

7 years agoAdd SCSI descriptors for USB Mass Storage.
trasz [Sun, 22 Jan 2017 15:32:17 +0000 (15:32 +0000)]
Add SCSI descriptors for USB Mass Storage.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

7 years agoImprove debugging printf.
trasz [Sun, 22 Jan 2017 15:27:14 +0000 (15:27 +0000)]
Improve debugging printf.

7 years ago[athalq] fix rxtimestamp wrapping; print out per-packet timestamp deltas.
adrian [Sun, 22 Jan 2017 07:05:41 +0000 (07:05 +0000)]
[athalq] fix rxtimestamp wrapping; print out per-packet timestamp deltas.

The delta here is just between the current TX/RX copmletion and the previous
TX/RX completion.  The metadata needed to link TX descriptor timestamps to their
/completion/ timestamp isn't there yet.

7 years agoHide the 'MOREARGS' macro, it conflicts with contrib code, and is only used in one...
jhibbits [Sun, 22 Jan 2017 06:30:55 +0000 (06:30 +0000)]
Hide the 'MOREARGS' macro, it conflicts with contrib code, and is only used in one file.

PR: 211818
Reported by: Mark Millard <markmi AT dsl-only.net>
MFC after: 2 weeks

7 years ago[athalq] print out unsigned tx timestamps.
adrian [Sun, 22 Jan 2017 06:25:41 +0000 (06:25 +0000)]
[athalq] print out unsigned tx timestamps.

7 years agoFix r312613.
jhibbits [Sun, 22 Jan 2017 06:17:31 +0000 (06:17 +0000)]
Fix r312613.

Somehow this slipped through my build testing.

7 years agoDon't pass -Wa,-many through clang, the integrated as doesn't support it.
jhibbits [Sun, 22 Jan 2017 06:00:05 +0000 (06:00 +0000)]
Don't pass -Wa,-many through clang, the integrated as doesn't support it.

Our base binutils sets -many by default anyway, but external gcc may not do
this.

PR: kern/215948
Submitted by: Mark Millard <markmi AT dsl-only DOT net>
Reported by: Mark Millard
MFC after: 2 weeks

7 years agoFix use of uninitialized variable.
jhibbits [Sun, 22 Jan 2017 05:49:43 +0000 (05:49 +0000)]
Fix use of uninitialized variable.

I don't know how gcc didn't catch this.  This was caught during test building
with clang.

7 years ago[ath] only apply the AR9300 delimiter workaround for the first sub-frame.
adrian [Sun, 22 Jan 2017 05:45:42 +0000 (05:45 +0000)]
[ath] only apply the AR9300 delimiter workaround for the first sub-frame.

This is supposed to only be applied to the first subframe and only if
RTS/CTS is being done.  I'm still not yet checking RTS/CTS exchange status
so it's just happening for all subframes on AR9380 and later.

This gets MCS23 throughput up from around 250mbit to 303mbit with RTS/CTS
protection enabled, and around 330mbit with no HT protection enabled.

Now, MCS23 has a PHY rate of 450mbit and we should be seeing closer to
400mbit for a straight one-way UDP test, but this beats the previous
maximum throughput.

Tested:

* AR9380 (STA) -> AR9580 (AP) - STA with the modifications, doing UDP TX
  test using iperf.

7 years ago[athalq] add debug parsing for the TX FIFO push status.
adrian [Sun, 22 Jan 2017 05:28:26 +0000 (05:28 +0000)]
[athalq] add debug parsing for the TX FIFO push status.

7 years agoLike r310481 for i386, move the objects used to create temporary
jah [Sun, 22 Jan 2017 00:46:04 +0000 (00:46 +0000)]
Like r310481 for i386, move the objects used to create temporary
mappings for armv6 pmap zero and copy operations to the MD PCPU region.
Change sysmap initialization to only allocate KVA pages for CPUs that
are actually present.

While here, collapse CMAP3 into CMAP2 (their use was mutually exclusive
anyway) and "recover" some space in PCPU padding that has always been
available due to 64-byte cacheline padding.

Reviewed by: skra
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9172

7 years ago[ath] improve the debugging when looking into the maximum A-MPDU size being chosen.
adrian [Sat, 21 Jan 2017 23:35:54 +0000 (23:35 +0000)]
[ath] improve the debugging when looking into the maximum A-MPDU size being chosen.

This is how I caught the "why are we only sending 8K aggregates?" problem.

7 years agoHandle the rx queue stall while reading the packets from NIC (when the
loos [Sat, 21 Jan 2017 23:07:15 +0000 (23:07 +0000)]
Handle the rx queue stall while reading the packets from NIC (when the
descriptor state will not change anymore).  This seems to eliminate the
race where we can miss a stalled queue under high load.

While here remove the unnecessary curly brackets.

Reported by: Konstantin Kormashev <konstantin@netgate.com>
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoath: adapt LDPC support checks
avos [Sat, 21 Jan 2017 21:03:26 +0000 (21:03 +0000)]
ath: adapt LDPC support checks

Set both IEEE80211_HTCAP_LDPC and IEEE80211_HTC_TXLDPC capability flags
if LDPC is supported + set 'do_ldpc = 1' only when it is not disabled,
not just supported.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D9277

7 years agovfs: fix LK_RETRY logic braino in r312600
mjg [Sat, 21 Jan 2017 20:34:20 +0000 (20:34 +0000)]
vfs: fix LK_RETRY logic braino in r312600

7 years agoCommit the struture changes for the padding of small packets on if_cpsw.
loos [Sat, 21 Jan 2017 19:56:28 +0000 (19:56 +0000)]
Commit the struture changes for the padding of small packets on if_cpsw.

Should have been committed together with r312604.

MFC with: r312604

7 years agoSimplify the handling of small packets padding in cpsw:
loos [Sat, 21 Jan 2017 19:49:39 +0000 (19:49 +0000)]
Simplify the handling of small packets padding in cpsw:

 - Pad small packets to 60 bytes and not 64 (exclude the CRC bytes);
 - Pad the packet using m_append(9), if the packet has enough space for
   padding, which is usually true, it will not be necessary append a newly
   allocated mbuf to the chain.

Suggested by: yongari
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoAdd initial support for CTL module unloading.
mav [Sat, 21 Jan 2017 19:38:26 +0000 (19:38 +0000)]
Add initial support for CTL module unloading.

It is only a first step and not perfect, but better then nothing.
The main blocker is CAM target frontend, that can not be unloaded,
since CAM does not have mechanism to unregister periph driver now.

MFC after: 2 weeks

7 years agovfs: __predict_false the need to handle F_HASLOCK
mjg [Sat, 21 Jan 2017 19:01:42 +0000 (19:01 +0000)]
vfs: __predict_false the need to handle F_HASLOCK

Also reorder the check with DTYPE_VNODE. Passed files are vnodes vast
majority of the time, so it is typically true.

7 years agovfs: fix whitespace damage in r312600
mjg [Sat, 21 Jan 2017 18:56:58 +0000 (18:56 +0000)]
vfs: fix whitespace damage in r312600

While here wrap the previously overly long line so that it fits 80 chars.

7 years agovfs: refactor _vn_lock
mjg [Sat, 21 Jan 2017 18:38:16 +0000 (18:38 +0000)]
vfs: refactor _vn_lock

Stop testing for LK_RETRY and error multiple times. Also postpone the
VI_DOOMED until after LK_RETRY was seen as it reads from the vnode.

No functional changes.

7 years agoAdd remaining ELF compression definitions and structs
cem [Sat, 21 Jan 2017 17:39:10 +0000 (17:39 +0000)]
Add remaining ELF compression definitions and structs

A follow-up to r300231.

Sponsored by: Dell EMC Isilon

7 years agovfs: hide the getvnode NULL mp message behind DIAGNOSTIC
mjg [Sat, 21 Jan 2017 16:59:50 +0000 (16:59 +0000)]
vfs: hide the getvnode NULL mp message behind DIAGNOSTIC

Since crossmp vnode changes the message was being printed on each boot.

Reported by: trasz
Discussed with: kib

7 years agortwn: enable LDPC support where possible
avos [Sat, 21 Jan 2017 15:03:58 +0000 (15:03 +0000)]
rtwn: enable LDPC support where possible

Tested with RTL8821AU, STA mode.

7 years agonet80211: allow to configure LDPC support
avos [Sat, 21 Jan 2017 14:19:06 +0000 (14:19 +0000)]
net80211: allow to configure LDPC support

Tested with RTL8821AU, STA mode (Tx support only)

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D9268

7 years agoImport mandoc cvs snapshot 20170121 (pre 1.14)
bapt [Sat, 21 Jan 2017 13:17:25 +0000 (13:17 +0000)]
Import mandoc cvs snapshot 20170121 (pre 1.14)

Note that mandoc does not use anymore sqlite3 but a home made database format
An important improvement has been made as well in makewhatis performance:
Tests on my laptop shows makewhatis on the entire system goes from 26s to 12s

7 years agoImport mandoc cvs snapshot 20170121 (pre 1.14)
bapt [Sat, 21 Jan 2017 13:01:39 +0000 (13:01 +0000)]
Import mandoc cvs snapshot 20170121 (pre 1.14)

7 years agoEnable TMPFS on MALTA so we can use it on minimalist disk images without
brooks [Sat, 21 Jan 2017 09:08:27 +0000 (09:08 +0000)]
Enable TMPFS on MALTA so we can use it on minimalist disk images without
modules.

Sponsored by: DARPA, AFRL

7 years agoMention softfloat and hardfloat supports for RISC-V.
kevlo [Sat, 21 Jan 2017 07:07:50 +0000 (07:07 +0000)]
Mention softfloat and hardfloat supports for RISC-V.

Reviewed by: br

7 years ago[ath] ensure both iv_ampdu_limit and iv_ampdu_rxmax is set.
adrian [Sat, 21 Jan 2017 06:53:30 +0000 (06:53 +0000)]
[ath] ensure both iv_ampdu_limit and iv_ampdu_rxmax is set.

A recent change enforced the VAP limit as well as the peer limit.
I now need to actually set iv_ampdu_limit or we don't transmit more
than 8K sized aggregates.

This restores the expected (suboptimal, but still much faster) behaviour.

Tested:

* AR9380, STA mode

7 years agoifconfig(8): fix '-stbc' parameter name.
avos [Fri, 20 Jan 2017 22:41:16 +0000 (22:41 +0000)]
ifconfig(8): fix '-stbc' parameter name.

MFC after: 5 days

7 years agoFix misc Coverity defects in camdd(8)
asomers [Fri, 20 Jan 2017 21:40:04 +0000 (21:40 +0000)]
Fix misc Coverity defects in camdd(8)

CID 1341620 Fix a small memory leak
CID 1341630 Though this is technically a false positive, rearrange the
code for clarity.
CID 1341635 Eliminate dead code
CID 1368663 Fix a double mutex unlock in the error path

Also:
* Use sig_atomic_t for variables accessed from signal handlers
* Don't conditionalize free(3) on its argument being non-null

Reported by: Coverity
CID: 1341620 1341630 1341635 1368663
Reviewed by: ken
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9237

7 years agoMisc Coverity fixes in camcontrol(8)
asomers [Fri, 20 Jan 2017 21:21:41 +0000 (21:21 +0000)]
Misc Coverity fixes in camcontrol(8)

CID 1229913 Fix output of "camcontrol persist -i report_capabilities".
The reported Persistent Reservation Types were wrong in all
cases.
CID 1356029 Annotate the code so Coverity will know that this is a false
positive.
CID 1366830 Fix a memory leak in "camcontrol timestamp -s"
CID 1366832 Fix a segfault that could be caused by bad drive firmware

Also, fix the man page entry for the "camcontrol epc state" command to match
what the code does.

Reviewed by: ken, wblock
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9239

7 years agoUse SFENCE for ordering CLFLUSHOPT.
kib [Fri, 20 Jan 2017 19:08:44 +0000 (19:08 +0000)]
Use SFENCE for ordering CLFLUSHOPT.

SDM states that CLFLUSHOPT instructions can be ordered with other
writes by SFENCE, heavier MFENCE is not required.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoImprove wording around SO_TS_CLOCK documentation.
sobomax [Fri, 20 Jan 2017 18:37:14 +0000 (18:37 +0000)]
Improve wording around SO_TS_CLOCK documentation.

Submitted by: wblock
Differential Revision: https://reviews.freebsd.org/D9171

7 years agoFix "camcontrol timestamp -s" with LTO-7 drives
asomers [Fri, 20 Jan 2017 17:54:24 +0000 (17:54 +0000)]
Fix "camcontrol timestamp -s" with LTO-7 drives

The length of the scsi_set_timestamp_parameters struct was incorrect.  LTO-5
drives don't care, but LTO-7 drives do.

Reviewed by: Sam Klopsch
MFC after: 2 weeks
Sponsored by: Spectra Logic Corp

7 years agoFix build with ICL_KERNEL_PROXY.
mav [Fri, 20 Jan 2017 17:43:36 +0000 (17:43 +0000)]
Fix build with ICL_KERNEL_PROXY.

MFC after: 2 weeks

7 years agoFix for race leading to endless timer interrupts related to
hselasky [Fri, 20 Jan 2017 17:40:31 +0000 (17:40 +0000)]
Fix for race leading to endless timer interrupts related to
configtimer().

During normal operation "state->nextcallopt" will always be less than
or equal to "state->nextcall" and checking only "state->nextcallopt"
before calling "callout_process()" is sufficient. However when
"configtimer()" is called a race might happen requiring both of these
binary times to be checked.

Short description of race:

1) A configtimer() call will reset both "state->nextcall" and
"state->nextcallopt" to the same binary time.

2) If a "callout_reset()" call happens between "configtimer()" and the
next "callout_process()" call, "state->nextcallopt" will get updated
and "state->nextcall" will remain at the current time. Refer to logic
inside cpu_new_callout().

3) getnextcpuevent() only respects "state->nextcall" and returns this
value over and over again, even if it is in the past, until "now >=
state->nextcallopt" becomes true. Then these two time variables are
corrected by a "callout_process()" call and the situation goes back to
normal.

The problem manifests itself in different ways. The common factor is
the timer process(es) consume all CPU on one or more CPU cores for a
long time, blocking other kernel processes from getting execution
time. This can be seen by very high interrupt counts as displayed by
"vmstat -i | grep timer" right after boot.

When EARLY_AP_STARTUP was enabled in r310177 the likelyhood of hitting
this bug apparently increased.

Example output from "vmstat -i" before patch:
cpu0:timer                          7591         69
cpu9:timer                      39031773     358089
cpu4:timer                          9359         85
cpu3:timer                          9100         83
cpu2:timer                          9620         88

Example output from "vmstat -i" after patch:
cpu0:timer                          4242         34
cpu6:timer                          5531         44
cpu3:timer                          6450         52
cpu1:timer                          4545         36
cpu9:timer                          7153         58

Before the patch cpu9 in the example above, was spinning in a loop in
order to reach 39 million interrupts just a few seconds after
bootup. After the patch the timer interrupt counts are more or less
consistent.

Discussed with: mav @
Reported by: several people
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoMention sendfile(2) by popular demand.
wblock [Fri, 20 Jan 2017 17:29:59 +0000 (17:29 +0000)]
Mention sendfile(2) by popular demand.

Submitted by: alc, kib
MFC after: 1 week
Sponsored by: iXsystems
Differential Revision: https://reviews.freebsd.org/D9259

7 years agoFix reference to free memory in ixgbe/if_media.c
rstone [Fri, 20 Jan 2017 17:16:48 +0000 (17:16 +0000)]
Fix reference to free memory in ixgbe/if_media.c

When ixgbe receives an interrupt indicating that a new optical module
may have been inserted, it discards all of its current media types
by calling ifmedia_removeall() and then creates a new set of media
types for the supported media on the new module.  However,
ifmedia_removeall() was maintaining a pointer to whatever the
current media type was before the call to ifmedia_removealL().
The result of this was that any attempt to read the current media
type of the interface (e.g. via ifconfig) would return potentially
garbage data from free memory (or if one were particularly unlucky
on an architecture that does not malloc() from a direct map, page
fault the kernel).

Fix this by NULL'ing out the current media field in if_media.c,
and have ixgbe update the current media type after recreating
them.

Submitted by: Matt Joras <matt.joras AT gmail DOT com>
Reviewed by: sbruno, erj
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9164

7 years agoRemove ISCSI_MAX_DATA_SEGMENT_LENGTH, using negotiated value.
mav [Fri, 20 Jan 2017 17:14:10 +0000 (17:14 +0000)]
Remove ISCSI_MAX_DATA_SEGMENT_LENGTH, using negotiated value.

MFC after: 2 weeks

7 years agoRemove some unused code.
mav [Fri, 20 Jan 2017 16:01:01 +0000 (16:01 +0000)]
Remove some unused code.

MFC after: 2 weeks

7 years agoAddition of clang nullability qualifiers.
pfg [Fri, 20 Jan 2017 15:56:40 +0000 (15:56 +0000)]
Addition of clang nullability qualifiers.

For consistency with the qualifiers added in r310977, define a new
qualifier _Null_unspecified which is also defined in clang 3.7+.

Add two new macros:
__NULLABILITY_PRAGMA_PUSH
__NULLABILITY_PRAGMA_POP

These are for use in headers when we want avoid noisy warnings if
some pointers are left without nullability annotations.

These are added with way ahead of their first use to teach the GCC
ports headers of their existance before their first use.

7 years agoRemove superfluous return statement.
hselasky [Fri, 20 Jan 2017 15:47:29 +0000 (15:47 +0000)]
Remove superfluous return statement.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoAllow transmit packet bufring in software to be disabled.
hselasky [Fri, 20 Jan 2017 15:45:21 +0000 (15:45 +0000)]
Allow transmit packet bufring in software to be disabled.

- Add new sysctl node to control the transmit packet bufring.

- Add optimised version of the transmit routine which output packets
directly to the DMA ring instead of using bufring in case the transmit
lock is congested. This can reduce the number of taskswitches which in
turn influence the overall system CPU usage, depending on the
workload.

- Add " TX" suffix to debug name for transmit mutexes to silence some
witness warnings about aquiring duplicate locks having same name.

MFC after: 1 week
Sponsored by: Mellanox Technologies
Suggested by: gallatin @

7 years agoMFV 312436
jpaetzel [Fri, 20 Jan 2017 15:01:04 +0000 (15:01 +0000)]
MFV 312436

 6569 large file delete can starve out write ops

  illumos/illumos-gate@ff5177ee8bf9a355131ce2cc61ae2da6a5a6fdd6
  https://github.com/illumos/illumos-gate/commit/ff5177ee8bf9a355131ce2cc61ae2da6a5a6fdd6

  https://www.illumos.org/issues/6569
    The core issue I've found is that there is no throttle for how many
    deletes get assigned to one TXG. As a results when deleting large files
    we end up filling consecutive TXGs with deletes/frees, then write
    throttling other (more important) ops.

    There is an easy test case for this problem. Try deleting several
    large files (at least 1/2 TB) while you do write ops on the same
    pool. What we've seen is performance of these write ops (let's
    call it sideload I/O) would drop to zero.

    More specifically the problem is that dmu_free_long_range_impl()
    can/will fill up all of the dirty data in the pool "instantly",
    before many of the sideload ops can get in. So sideload
    performance will be impacted until all the files are freed.

    The solution we have tested at Nexenta (with positive results)
    creates a relatively simple throttle for how many "free" ops we let
    into one TXG.

    However this solution exposes other problems that should also be
    addressed. If we are to slow down freeing of data that means one
    has to wait even longer (assuming vnode ref count of 1) to get shell
    back after an rm or for NFS thread to finish the free-ing op.
    To avoid this the proposed solution is to call zfs_inactive() async
    for "large" files. Async freeing then begs for the reclaimed space
    to be accounted for in the zpool's "freeing" prop.

    The other issue with having a longer delete is the inability to
    export/unmount for a longer period of time. The proposed solution
    is to interrupt freeing of blocks when a fs is unmounted.

  Author: Alek Pinchuk <alek@nexenta.com>
  Reviewed by: Matt Ahrens <mahrens@delphix.com>
  Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
  Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
  Approved by: Dan McDonald <danmcd@omniti.com>

Reviewed by: avg
Differential Revision: D9008

7 years agoANSYfy kern_ktrace.c and remove archaic register keyword
emaste [Fri, 20 Jan 2017 14:59:56 +0000 (14:59 +0000)]
ANSYfy kern_ktrace.c and remove archaic register keyword

Sponsored by: The FreeBSD Foundation

7 years agoReport disk addition errors on `add` or `create` subcommand.
mav [Fri, 20 Jan 2017 13:49:04 +0000 (13:49 +0000)]
Report disk addition errors on `add` or `create` subcommand.

MFC after: 1 week

7 years agodon't abort writing of a core dump after EFAULT
avg [Fri, 20 Jan 2017 13:39:07 +0000 (13:39 +0000)]
don't abort writing of a core dump after EFAULT

It's possible to get EFAULT when writing a segment backed by a file
if the segment extends beyond the file.
The core dump could still be useful if we skip the rest of the segment
and proceed to other segements.
The skipped segment (or a portion of it) will be zero-filled.

While there, use 'const' to signify that core_write() only reads the
buffer and use __DECONST before calling vn_rdwr_inchunks() because it
can be used for both reading and writing.

Before the change:
kernel: Failed to write core file for process mmap_trunc_core (error 14)
kernel: pid 77718 (mmap_trunc_core), uid 1001: exited on signal 6

After the change:
kernel: Failed to fully fault in a core file segment at VA 0x800645000 with size 0x4000 to be written at offset 0x29000 for process mmap_trunc_core
kernel: pid 4901 (mmap_trunc_core), uid 1001: exited on signal 6 (core dumped)

Reviewed by: julian, kib
Obtained from: Panzura (older version of the change)
MFC after: 5 days
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D9233

7 years agovmm_dev: work around a bogus error with gcc 6.3.0
avg [Fri, 20 Jan 2017 13:21:27 +0000 (13:21 +0000)]
vmm_dev: work around a bogus error with gcc 6.3.0

The error is:
vmm_dev.c: In function 'alloc_memseg':
vmm_dev.c:261:11: error: null argument where non-null required (argument 1) [-Werror=nonnull]

Apparently, the gcc is unable to figure out that if a ternary operator
produced a non-NULL value once, then the operator with exactly the same
operands would produce the same value again.

MFC after: 1 week

7 years agoMake draining a sendqueue more robust.
hselasky [Fri, 20 Jan 2017 12:02:40 +0000 (12:02 +0000)]
Make draining a sendqueue more robust.

Add own state variable to track if a sendqueue is stopped or not.
This will prevent traffic from entering the sendqueue while it is
being destroyed.

Update drain function to wait for traffic to be transmitted before
returning when the link state is active.

Add extra checks in transmit path for stopped SQ's.

While at it:
- Use likely() for a mbuf pointer check.
- Remove redundant IFF_DRV_RUNNING check.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoAdd runtime support for modifying the SQ and RQ completion event
hselasky [Fri, 20 Jan 2017 11:11:49 +0000 (11:11 +0000)]
Add runtime support for modifying the SQ and RQ completion event
moderation mode. The presence of this feature is indicated through the
firmware capabilities.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoUpdate firmware interface structures and definitions adding support
hselasky [Fri, 20 Jan 2017 10:47:32 +0000 (10:47 +0000)]
Update firmware interface structures and definitions adding support
for new features and commands.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoAdd some basic -s flag testcases for cut(1)
ngie [Fri, 20 Jan 2017 08:00:36 +0000 (08:00 +0000)]
Add some basic -s flag testcases for cut(1)

The remaining functionality seems to be covered in one form or
another via the NetBSD ATF testcase.

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years ago[net80211] allow for MCS16-23 to be statically configured.
adrian [Fri, 20 Jan 2017 07:43:40 +0000 (07:43 +0000)]
[net80211] allow for MCS16-23 to be statically configured.

Tested:

* AR9380, STA mode

7 years agoAdd testcases for -i with hardlinks and symlinks
ngie [Fri, 20 Jan 2017 07:11:21 +0000 (07:11 +0000)]
Add testcases for -i with hardlinks and symlinks

The symlink testcase is expected to fail, post-r312519 (the revert of
r312404); mark it so.

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon