Commit Graph

122180 Commits

Author SHA1 Message Date
Matt Macy
1ef3a74e6b ufs: remove cgbno variable where unused 2018-05-19 19:30:42 +00:00
Matt Macy
f6cb0dea4c net: fix uninitialized variable warning 2018-05-19 19:00:04 +00:00
Ed Maste
0842ea9bb9 muge(4): chase r333813 if_addr_lock rwlock to epoch + mutex
muge was committed to the tree in r333713 but not yet connected to the
tree, and it crossed paths with the migration to using ck.

Sponsored by:	The FreeBSD Foundation
2018-05-19 18:44:29 +00:00
Matt Macy
fabb4256f6 disable printing value of SKEIN_LOOP during standard out,
not useful information
2018-05-19 18:27:14 +00:00
Matt Macy
4f4eb606dd bhnd nvram map: don't write "variable records written" to standard out by default
Add -v (verbose) option for the developers. The rest of us
derive no value from this information.
2018-05-19 18:15:41 +00:00
Warner Losh
f344fb0b4b Restore the all rights reserved language. Put it on each of the prior
two copyrights. The line originated with the Berkeely Regents, who
we have not approached about removing it (it's honestly too trivial
to be worth that fight). Restore it to rwatson's line as well. He
can decide if he wants it or not on his own. Matt clearly doesn't
want it, per project preference and his own statements on IRC.

Noticed by: rgrimes@
2018-05-19 17:29:57 +00:00
Matt Macy
e335651e1e mp_ring: fix i386
Even though 64-bit atomics are supported on i386 there are panics
indicating that the code does not work correctly there. Switch
to mutex based variant (and fix that while we're here).

Reported by:	pho, kib
2018-05-19 16:44:12 +00:00
Edward Tomasz Napierala
86c61317fd Fix whitespace; no functional changes.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-19 15:18:15 +00:00
Edward Tomasz Napierala
1558eec6db Add #defines for vendor/product USB IDs. No functional changes.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-19 15:11:24 +00:00
Ed Maste
1b30e10e48 Remove duplicate cap_no_rights from r333874
Archs using in-tree gcc were broken with `warning: redundant
redeclaration of 'cap_no_rights' [-Wredundant-decls]`.

Sponsored by:	The FreeBSD Foundation
2018-05-19 11:37:02 +00:00
Edward Tomasz Napierala
6073714909 Permit "(", ")", ":", and "/" in USB string descriptors.
This way we can properly show descriptors with URLs in them.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-19 10:49:51 +00:00
Matt Macy
f6a1a10613 Unbreak BeagleBone Black boot by collapsing 29 SYSINITs in to 1
Reported by:	ilya at bakulin.de
2018-05-19 07:31:35 +00:00
Matt Macy
fc2e87be2b intr unbreak KTR/LINT build 2018-05-19 07:04:43 +00:00
Matt Macy
f5ad6b4b00 pmap: silence warnings 2018-05-19 05:58:05 +00:00
Matt Macy
24a7d6d3a6 netmap and iflib drivers, silence unused var warnings 2018-05-19 05:57:26 +00:00
Matt Macy
f6960e207e netinet silence warnings 2018-05-19 05:56:21 +00:00
Matt Macy
7a3c5b05e4 tcp sysctl fix may be uninitialized 2018-05-19 05:55:31 +00:00
Matt Macy
21f6fe2d7c tcp fastopen: fix may be uninitialized 2018-05-19 05:55:00 +00:00
Matt Macy
4b06dee1e5 AF_UNIX: switch to annotations to avoid warnings 2018-05-19 05:37:58 +00:00
Matt Macy
3535fae847 netmap: compare e1 with e2, not with itself 2018-05-19 05:37:18 +00:00
Matt Macy
46d0f824be net: fix set but not used 2018-05-19 05:27:49 +00:00
Matt Macy
acbde29858 capsicum: propagate const correctness 2018-05-19 05:14:05 +00:00
Matt Macy
af2ffa3d52 back out DBGSET macro 2018-05-19 05:12:57 +00:00
Matt Macy
ba3f7276c0 intr: eliminate / annotate unused stack locals 2018-05-19 05:12:18 +00:00
Matt Macy
7fd6841438 sendfile: annotate unused value and ensure that npages is actually initialized 2018-05-19 05:10:51 +00:00
Matt Macy
e1a92f058f umtx: don't call umtxq_getchain unless the value is needed 2018-05-19 05:09:10 +00:00
Matt Macy
a6c7423a92 cpuset: revert and annotate instead 2018-05-19 05:07:31 +00:00
Matt Macy
6fa5abfdda conf: revert last change and annotate unused var instead 2018-05-19 05:07:03 +00:00
Matt Macy
1c0336c1c1 kevent: annotate unused stack local 2018-05-19 05:06:18 +00:00
Matt Macy
788390df0a lockf: annotate LOCKF_DEBUG only var 2018-05-19 05:04:38 +00:00
Matt Macy
d1230b1159 capsicum: annotate variable only used by debug 2018-05-19 05:02:40 +00:00
Matt Macy
3adccf38e3 turnstile / sleepqueue: annotate variables only used by debug builds 2018-05-19 05:00:16 +00:00
Matt Macy
84482abd21 vfs: annotate variables only used by debug builds as __unused 2018-05-19 04:59:39 +00:00
Justin Hibbits
4a11ed7159 Add SPR_HSRR0/SPR_HSRR1 definitions
Reported by:	Mark Millard
Pointy-hat to:	jhibbits
2018-05-19 04:56:10 +00:00
Matt Macy
a2bb4e080e tty: use __unused annotation instead to silence warnings 2018-05-19 04:48:26 +00:00
Matt Macy
b25651a46a epoch: avoid warning when INVARIANTS is not enabled 2018-05-19 04:47:34 +00:00
Matt Macy
e5ae3af78b disable set but not used on code that can't be changed 2018-05-19 04:46:34 +00:00
Matt Macy
5072a5f465 malloc: avoid possibly returning stack garbage if MALLOC_DEBUG is defined 2018-05-19 04:43:49 +00:00
Justin Hibbits
5321c01b50 Add hypervisor trap handling, using HSRR0/HSRR1
Summary:
Some hypervisor exceptions on POWER architecture only save state to HSRR0/HSRR1.
Until we have bhyve on POWER, use a lightweight exception frontend which copies
HSRR0/HSRR1 into SRR0/SRR1, and run the normal trap handler.

The first user of this is the Hypervisor Virtualization Interrupt, which targets
the XIVE interrupt controller on POWER9.

Reviewed By: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D15487
2018-05-19 04:21:50 +00:00
Matt Macy
39eef2f45a cpuset_thread0: avoid unused assignment on non debug build 2018-05-19 04:14:00 +00:00
Matt Macy
926cfdb8da make_dev: avoid unused assignments on non debug builds 2018-05-19 04:13:20 +00:00
Matt Macy
4949ad7264 mqueue: avoid unused variables 2018-05-19 04:10:53 +00:00
Matt Macy
cd6ba3f086 physio: avoid uninitialized variables 2018-05-19 04:09:58 +00:00
Matt Macy
e9b1074bc7 cache_lookup remove unused variable and initialize used 2018-05-19 04:08:11 +00:00
Matt Macy
ec8d23352b filt_timerdetach: only assign to old if we're going to check it in
a KASSERT
2018-05-19 04:07:00 +00:00
Matt Macy
5cc2d25a2b getnextevent: put variable only used by KTR under ifdef KTR 2018-05-19 04:05:36 +00:00
Matt Macy
bfd0eacb02 simplify control flow so that gcc knows we never pass save to curthread_pflags_restore
without initializing
2018-05-19 04:04:44 +00:00
Matt Macy
3ef78c9c96 tty: conditionally assign to ret value only used by MPASS statement 2018-05-19 04:02:29 +00:00
Justin Hibbits
30f3b0f5f7 powerpc64: Add OPAL definitions
Summary:
Add additional OPAL PCI definitions and expand the code to use them in order to
ease the OPAL interface process for new comers.

These definitions came directly from the OPAL code and they are the same for
both PHB3 (POWER8) and PHB4 (POWER9).

Submitted by:	Breno Leitao
Differential Revision: https://reviews.freebsd.org/D15432
2018-05-19 04:01:15 +00:00
Matt Macy
02fe8a2409 remove unused locked variable in lockmgr_unlock_fast_path 2018-05-19 03:58:40 +00:00
Matt Macy
ddd4d15ecd signotify: don't create a stack local that isn't used on non-debug builds 2018-05-19 03:57:41 +00:00
Matt Macy
46117e1f0c sysv_msg initialize saved_msgsz 2018-05-19 03:56:39 +00:00
Matt Macy
11d4f748d7 remove unused variable 2018-05-19 03:55:42 +00:00
Matt Macy
1dce110f63 fix uninitialized variable warning in reader locks 2018-05-19 03:52:55 +00:00
Matt Macy
f1b2eaf13b add DBGSET macro to conditionally assign to a variable depending on INVARIANTS 2018-05-19 03:50:29 +00:00
Matt Macy
b203713694 fix uninitialized variable warning 2018-05-19 03:49:36 +00:00
Matt Macy
ac8b2d5cb1 sys_process.c fix set but not used warning 2018-05-19 03:48:35 +00:00
Matt Macy
e339e43685 subr_epoch.c fix unused variable warnings 2018-05-19 03:47:37 +00:00
Justin Hibbits
c07c77a311 Fix a manual copy from the original diff for r333825
The 'else' was in the original diff.

Submitted by:	Breno Leitao
2018-05-19 03:47:28 +00:00
Justin Hibbits
876f3b9295 Add yet another option for gathering available memory
On some POWER9 systems, 'reg' denotes the full memory in the system, while
'linux,usable-memory' denotes the usable memory.  Some memory is reserved for
NVLink usage, so is partitioned off.

Submitted by:	Breno Leitao
2018-05-19 03:45:38 +00:00
Justin Hibbits
829c98b82e Add some Hypervisor interrupt definitions
This mostly completes the interrupt definitions.  There are still some left out,
less likely to be used in the near term.
2018-05-19 03:23:46 +00:00
Matt Macy
ae6be8e6f7 pidctrl Actually use the variables that we assign to as seatbelts to prevent divide
by zero

Reviewed by:	jeffr
2018-05-19 02:17:18 +00:00
Matt Macy
c0874c3468 fix gcc8 unused variable and set but not used variable in unix sockets
add copyright from lock rewrite while here
2018-05-19 02:15:40 +00:00
Matt Macy
cccc969bc7 Silence non-actionable warnings in vendor code
We can't modify vendor code so there's no signal in warnings from it.
Similarly -Waddress-of-packed-member is not useful on networking code
as access to packed structures is fundamental to its operation.
2018-05-19 00:04:01 +00:00
Matt Macy
3f25f5fbe5 Annotate td_pre_epoch_prio in struct thread
Reported by:	jhb
2018-05-18 23:17:49 +00:00
Mateusz Guzik
10391db530 lockmgr: avoid atomic on unlock in the slow path
The code is pretty much guaranteed not to be able to unlock.

This is a minor nit. The code still performs way too many reads.
The altered exclusive-locked condition is supposed to be always
true as well, to be cleaned up at a later date.
2018-05-18 22:57:52 +00:00
Edward Tomasz Napierala
6b7e508c4a Stop claiming the device-side USB serial interfaces talk Hayes AT.
There should be no functional difference.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-05-18 20:24:19 +00:00
Matt Macy
d7c5a620e2 ifnet: Replace if_addr_lock rwlock with epoch + mutex
Run on LLNW canaries and tested by pho@

gallatin:
Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5
based ConnectX 4-LX NIC, I see an almost 12% improvement in received
packet rate, and a larger improvement in bytes delivered all the way
to userspace.

When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1,
I see, using nstat -I mce0 1 before the patch:

InMpps OMpps  InGbs  OGbs err TCP Est %CPU syscalls csw     irq GBfree
4.98   0.00   4.42   0.00 4235592     33   83.80 4720653 2149771   1235 247.32
4.73   0.00   4.20   0.00 4025260     33   82.99 4724900 2139833   1204 247.32
4.72   0.00   4.20   0.00 4035252     33   82.14 4719162 2132023   1264 247.32
4.71   0.00   4.21   0.00 4073206     33   83.68 4744973 2123317   1347 247.32
4.72   0.00   4.21   0.00 4061118     33   80.82 4713615 2188091   1490 247.32
4.72   0.00   4.21   0.00 4051675     33   85.29 4727399 2109011   1205 247.32
4.73   0.00   4.21   0.00 4039056     33   84.65 4724735 2102603   1053 247.32

After the patch

InMpps OMpps  InGbs  OGbs err TCP Est %CPU syscalls csw     irq GBfree
5.43   0.00   4.20   0.00 3313143     33   84.96 5434214 1900162   2656 245.51
5.43   0.00   4.20   0.00 3308527     33   85.24 5439695 1809382   2521 245.51
5.42   0.00   4.19   0.00 3316778     33   87.54 5416028 1805835   2256 245.51
5.42   0.00   4.19   0.00 3317673     33   90.44 5426044 1763056   2332 245.51
5.42   0.00   4.19   0.00 3314839     33   88.11 5435732 1792218   2499 245.52
5.44   0.00   4.19   0.00 3293228     33   91.84 5426301 1668597   2121 245.52

Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch

Reviewed by:	gallatin
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D15366
2018-05-18 20:13:34 +00:00
John Baldwin
24ddd0ec9c Be more robust against garbage input on a TOE TLS TX socket.
If a socket is closed or shutdown and a partial record (or what
appears to be a partial record) is waiting in the socket buffer,
discard the partial record and close the connection rather than
waiting forever for the rest of the record.

Reported by:	Harsh Jain @ Chelsio
Sponsored by:	Chelsio Communications
2018-05-18 19:09:11 +00:00
Matt Macy
f2d19f98c1 epoch(9): allocate net epochs earlier in boot 2018-05-18 18:48:00 +00:00
Matt Macy
20ba6811e6 epoch(9): assert that epoch is allocated post-configure 2018-05-18 18:27:17 +00:00
Matt Macy
d71e30de40 epoch: move epoch variables to read mostly section 2018-05-18 17:58:15 +00:00
Ed Maste
891cf3ed44 Use NULL for SYSINIT's last arg, which is a pointer type
Sponsored by:	The FreeBSD Foundation
2018-05-18 17:58:09 +00:00
Ed Maste
3dc3b1235a amd64 GENERIC: correct whitespace on smartpqi entry 2018-05-18 17:51:42 +00:00
Matt Macy
70398c2f86 epoch(9): Make epochs non-preemptible by default
There are risks associated with waiting on a preemptible epoch section.
Change the name to make them not be the default and document the issue
under CAVEATS.

Reported by:	markj
2018-05-18 17:29:43 +00:00
Sean Bruno
1696e1f2b8 Quiesce a couple pages of clang warnings with a cast. Duplicates
linux maintainer commit:

627871b71c (diff-8c6ddb4c3ad69a6fb9f289475821db56)

ar9300template_aphrodite.h:575:40: warning: implicit conversion from 'int'
  to 'u_int8_t' (aka 'unsigned char') changes value from 3495 to 167
  [-Wconstant-conversion]
            /* Data[8].ctl_edges[7].bChannel*/FREQ2FBIN(5795, 0)}
                                              ^~~~~~~~~~~~~~~~~~
ar9300eep.h:142:41: note: expanded from macro 'FREQ2FBIN'
    (((y) == HAL_FREQ_BAND_2GHZ) ? ((x) - 2300) : (((x) - 4800) / 5))

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D15476
2018-05-18 17:23:23 +00:00
Ed Maste
e5151258c8 muge(4): style and comment cleanup
And tag some spots to revisit with XXX.

Sponsored by:	The FreeBSD Foundation
2018-05-18 17:07:59 +00:00
Mark Johnston
01f04471f4 Don't increment addl_page_shortage for wired pages.
Such pages are dequeued as they're encountered during the inactive queue
scan, so by the time we get to the active queue scan, they should have
already been subtracted from the inactive queue length.

Reviewed by:	alc
Differential Revision:	https://reviews.freebsd.org/D15479
2018-05-18 16:59:58 +00:00
Ed Maste
48bc175842 muge(4): sync register names with Microchip's lan7800.h
Microchip provided a permissively-licensed lan78xx header, which has
an 'ETH_' prefix on most definitions.  Follow suit in our driver.

Sponsored by:	The FreeBSD Foundation
2018-05-18 14:30:45 +00:00
Sean Bruno
f097a19eab bnxt(4)
- Fix HWRM warning message during HW LRO configuration.

Submitted by:	bhargava.marreddy@broadcom.com
MFC after:	1 week
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D15466
2018-05-18 13:49:12 +00:00
Olivier Houchard
a9772d1a0e Instead of ignoring the VFP registers, set the dumppcb's pcb_fpusaved
field, so that they are saved, as they may be used in the kernel, in the
EFI and the crypto code.

Reviewed by:	andrew
2018-05-18 13:28:02 +00:00
Andrew Turner
00454c400e Enable the Qualcomm MSM UART driver. This is needed for some Qualcomm
Snapdragon SoCs.

Obtained from:	ABT Systems Ltd
Sponsored by:	Turing Robotic Industries
2018-05-18 11:32:48 +00:00
Mateusz Guzik
10c51654ef amd64: tweak the read_frequently section
1. align to 128 bytes to avoid possible waste from the preceeding section
2. sort entries by alignment SORT_BY_ALIGNMENT, plugging the holes (most
entries are one byte in size, but they got interleaved with bigger ones)

Interestingly I was looking for a feature of the sort earlier and failed
to find it. It turns out the script was already utilizing sorting in other
places, so shame on me.

Thanks for Travis Geiselbrecht for pointing me at the feature.
2018-05-18 07:31:26 +00:00
Navdeep Parhar
67e071128d cxgbe(4): Implement ifnet callbacks that deal with send tags.
An etid (ethoffload tid) is allocated for a send tag and it acquires a
reference on the traffic class that matches the send parameters
associated with the tag.

Sponsored by:	Chelsio Communications
2018-05-18 06:09:15 +00:00
Matt Macy
cfa866f6a1 netmap: pull fix for 32-bit support from upstream
Approved by:	sbruno
2018-05-18 03:38:17 +00:00
Ed Maste
649d7b463a vt: add more cp437 mappings for vga textmode
In UTF-8 locales mandoc uses a number of characters outside of the Basic
Latin group, e.g. from general punctuation or miscellaneous mathematical
symbols, and these rendered as ? in text mode.

This change adds (char, replacement, code point, description):

    ¦ | U+00A6 Broken bar
    ✓ √ U+2713 Checkmark

Sponsored by:   The FreeBSD Foundation
2018-05-18 02:58:26 +00:00
Matt Macy
60b7b90d65 epoch: actually allocate the counters we've assigned sysctls too
Approved by:	sbruno
2018-05-18 02:57:39 +00:00
Matt Macy
5e68a3dfe3 epoch: add non-preemptible "critical" variant
adds:
- epoch_enter_critical() - can be called inside a different epoch,
  starts a section that will acquire any MTX_DEF mutexes or do
  anything that might sleep.
- epoch_exit_critical() - corresponding exit call
- epoch_wait_critical() - wait variant that is guaranteed that any
  threads in a section are running.
- epoch_global_critical - an epoch_wait_critical safe epoch instance

Requested by:   markj
Approved by:	sbruno
2018-05-18 01:52:51 +00:00
Brooks Davis
dedc82ae26 Use strsep() to parse init_path in start_init().
This simplifies the use of the path variable by making it NUL
terminated.  This is a prerequisite for further cleanups.

Reviewed by:	imp
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D15467
2018-05-17 23:07:51 +00:00
Olivier Houchard
8b2ec5a3a1 In pmap_get_tables(), check that the L2 is indeed a table before attempting
to get the l3.
2018-05-17 22:40:22 +00:00
Olivier Houchard
654a792922 In vfp_save_state(), don't bother trying to save the VFP registers if the
provided PCB doesn't have a pcb_fpusaved. All PCBs associated to a thread
should have one, but the dumppcb used when panic'ing doesn't.
2018-05-17 22:38:16 +00:00
Matt Macy
a5f1042498 epoch: skip poll function call in hardclock unless there are callbacks pending
Reported by:	mjg
Approved by:	sbruno
2018-05-17 21:39:15 +00:00
Rick Macklem
04b1905584 Add a missing nfsrv_freesession() call for an unlikely failure case.
Since NFSv4.1 clients normally create a single session which supports
both fore and back channels, it is unlikely that a callback will fail
due to a lack of a back channel.
However, if this failure occurred, the session wasn't being dereferenced
and would never be free'd.
Found by inspection during pNFS server development.

Tested by:	andreas.nagy@frequentis.com
MFC after:	2 months
2018-05-17 21:17:20 +00:00
Matt Macy
273428ec6d powerpc: fix LINT build
netmap currently doesn't build, take it out of LINT to prevent
hiding regressions in universe

Reviewed by:	jhibbits
Approved by:	sbruno
2018-05-17 21:04:19 +00:00
Matt Macy
c4d901e9bd epoch(9): schedule pcpu callback task in hardclock if there are callbacks pending
Approved by:	sbruno
2018-05-17 19:57:07 +00:00
Edward Tomasz Napierala
3dc87e52a9 Add a "multifunction" device side USB template, which provides mass
storage, CDC ACM (serial), and CDC ECM (ethernet) at the same time.
It's quite similar in function to Linux' "g_multi" gadget.

Reviewed by:	hselasky@
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2018-05-17 19:54:11 +00:00
Matt Macy
2a45e8282a epoch(9): eliminate the need to wait when polling for callbacks to run
by using ck's own callback handling mechanism we can simply check which
callbacks have had a grace period elapse

Approved by:	sbruno
2018-05-17 19:50:55 +00:00
Matt Macy
d1bcb409f6 epoch(9): fix potential deadlock
Don't acquire a waiting thread's lock while holding our own

Approved by:	sbruno
2018-05-17 19:41:58 +00:00
Matt Macy
80767b1c65 epoch(9): missed add from r333755
Reported by:	flo
Approved by:	sbruno
2018-05-17 19:30:57 +00:00
Matt Macy
766d225326 epoch(9): restore thread priority on exit if it was changed by a waiter
Reported by:	markj
Approved by:	sbruno
2018-05-17 19:08:28 +00:00