Commit Graph

219875 Commits

Author SHA1 Message Date
Dexuan Cui
40d60d6ee1 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
2017-01-24 09:25:42 +00:00
Dexuan Cui
5bdfd3fd36 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
2017-01-24 09:24:14 +00:00
Dexuan Cui
92a6859b91 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
2017-01-24 09:19:46 +00:00
Dexuan Cui
c927d68136 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
2017-01-24 09:15:36 +00:00
Dexuan Cui
3ab0fea134 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
2017-01-24 09:09:53 +00:00
Sevan Janiyan
4d0e06e6e6 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
2017-01-24 08:56:54 +00:00
Xin LI
1d1e1f6311 Don't reference NULL pointer.
MFC after:	2 weeks
2017-01-24 07:48:36 +00:00
Kevin Lo
a6bac5b604 Sort REALTEK section and remove duplicate entry for RTL8192CU. 2017-01-24 03:00:22 +00:00
Kevin Lo
60b9567d16 Add support for the Realtek RTL8192EU chipset.
Committed over the D-Link DWA-131 rev E1 on amd64 with WPA.

Reviewed by:	avos
2017-01-24 02:35:38 +00:00
Ian Lepore
83988d944b 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.
2017-01-24 02:09:30 +00:00
Ravi Pokala
d592868ebf 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
2017-01-24 01:39:40 +00:00
Jung-uk Kim
cc8440a569 Fix a typo introduced in r306024. 2017-01-23 21:09:27 +00:00
Oleksandr Tymoshenko
3279df7e87 [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
2017-01-23 19:20:55 +00:00
Alexander Motin
b96d9778eb Fix overrun handling issue in r312291.
MFC after:	1 week
2017-01-23 17:44:33 +00:00
Bjoern A. Zeeb
09d8a96e1c 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
2017-01-23 16:40:20 +00:00
Pedro F. Giffuni
692cd1a3b2 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
2017-01-23 15:39:51 +00:00
Xin LI
4994a9b8e0 Always initialize 'c'.
MFC after:	2 weeks
2017-01-23 07:32:47 +00:00
Xin LI
c0d0b76655 When creating record file, use umask 077 instead of the default.
MFC after:	2 weeks
2017-01-23 06:04:43 +00:00
Adrian Chadd
5e2c0d2d47 [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.
2017-01-23 04:47:38 +00:00
Adrian Chadd
57af292d36 [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.
2017-01-23 04:30:08 +00:00
Adrian Chadd
6eb9f206a6 [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
2017-01-23 04:20:37 +00:00
Justin Hibbits
8d2f50dba6 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
2017-01-23 04:03:12 +00:00
Mark Johnston
792e2f09ee 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.
2017-01-23 02:21:06 +00:00
Andriy Voskoboinyk
98ff1f7c6e net80211: fix flags setup for HT40 5GHz channels. 2017-01-22 23:45:59 +00:00
Edward Tomasz Napierala
25b20d78f8 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
2017-01-22 20:11:24 +00:00
Edward Tomasz Napierala
f308ab7043 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@
2017-01-22 20:06:15 +00:00
Baptiste Daroussin
b11244e721 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
2017-01-22 20:03:18 +00:00
Konstantin Belousov
ba2f90c1eb Document mount option "nonc" for tmpfs.
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D9258
2017-01-22 19:50:23 +00:00
Konstantin Belousov
b0b22f297f 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
2017-01-22 19:46:14 +00:00
Konstantin Belousov
3467f88cd6 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
2017-01-22 19:41:42 +00:00
Konstantin Belousov
25c6816845 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
2017-01-22 19:38:45 +00:00
Konstantin Belousov
aec8391d46 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
2017-01-22 19:36:02 +00:00
Baptiste Daroussin
6789e5acf2 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
2017-01-22 18:55:01 +00:00
Sean Bruno
db569544d1 igb(4) enable WOL features for this class of devices.
PR:	208343
Submitted by:	Kaho Tashikazu <kaho@elam.kais.kyoto-u.ac.jp>
2017-01-22 18:04:57 +00:00
Kirk McKusick
8b273fc833 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
2017-01-22 17:49:14 +00:00
Luiz Otavio O Souza
6386d003c9 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)
2017-01-22 17:24:00 +00:00
Luiz Otavio O Souza
3a3d1c770e 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)
2017-01-22 17:07:37 +00:00
Edward Tomasz Napierala
5c93966020 Remove redundant KASSERT. 2017-01-22 15:35:51 +00:00
Edward Tomasz Napierala
c6646787ab Add SCSI descriptors for USB Mass Storage.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2017-01-22 15:32:17 +00:00
Edward Tomasz Napierala
8acac5a9f5 Improve debugging printf. 2017-01-22 15:27:14 +00:00
Adrian Chadd
a5da70d59e [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.
2017-01-22 07:05:41 +00:00
Justin Hibbits
3e7e31bda0 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
2017-01-22 06:30:55 +00:00
Adrian Chadd
e334d5bd3f [athalq] print out unsigned tx timestamps. 2017-01-22 06:25:41 +00:00
Justin Hibbits
279ae8fec0 Fix r312613.
Somehow this slipped through my build testing.
2017-01-22 06:17:31 +00:00
Justin Hibbits
0b58112faf 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
2017-01-22 06:00:05 +00:00
Justin Hibbits
5c1f5ea426 Fix use of uninitialized variable.
I don't know how gcc didn't catch this.  This was caught during test building
with clang.
2017-01-22 05:49:43 +00:00
Adrian Chadd
a2d74cc30b [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.
2017-01-22 05:45:42 +00:00
Adrian Chadd
3f637132cf [athalq] add debug parsing for the TX FIFO push status. 2017-01-22 05:28:26 +00:00
Jason A. Harmening
e0b79e669b 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
2017-01-22 00:46:04 +00:00
Adrian Chadd
28dc144e73 [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.
2017-01-21 23:35:54 +00:00