Commit Graph

131126 Commits

Author SHA1 Message Date
Warner Losh
0c8ea9e567 Convert rotating and unmapped_io to a DA flag
Rotating and unmapped_io are really da flags. Convert them to a flag so it will
be reported with the other flags for the device. Deprecate the .rotating and
.unmapped_io sysctls in FreeBSD 14 and remove the softc ints.

Differential Revision: https://reviews.freebsd.org/D23417
2020-02-13 01:23:44 +00:00
Warner Losh
a8d238cd6d Export the current da flags as bitfield
Export the current flags. They can be useful to other programs wanting to do
special thigns for removable or similar devices.

Differential Revision: https://reviews.freebsd.org/D23417
2020-02-13 01:23:32 +00:00
Mateusz Guzik
9fd552ada1 netipsec: fix a mismatched uma_zfree -> uma_zfree_pcpu
PR:		244077
Reported by:	lwhsu
Fixes: r357805 ("amd64: store per-cpu allocations subtracted by __pcpu")
2020-02-12 20:18:29 +00:00
Kyle Evans
b30ab6d8fe sys/kern sysent: re-add dependency on capabilities.conf
r356868 inadvertently removed this, so changes to capabilities.conf were no
longer considered for being outdated.
2020-02-12 19:06:34 +00:00
Ed Maste
fe16bad415 regen sysent after r357831, r357838
Capability mode changes allowing fdatasync and getloginclass.

Sponsored by:	The FreeBSD Foundation
2020-02-12 19:05:10 +00:00
Ed Maste
e953765f15 Allow getloginclass in capability mode
As with e.g. getgroups and getlogin it allows querying current process
credential state.

Reported by:	sigsys@gmail.com via kevans
Sponsored by:	The FreeBSD Foundation
2020-02-12 18:59:00 +00:00
Ed Maste
9cdfb2d69a Allow fdatasync in capability mode
fdatasync is essentially a subset of fsync (and may be exactly fsync,
depending on filesystem and development effort) and operates only on
a provided fd.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-12 17:12:26 +00:00
Michael Tuexen
56ccb48fd6 Don't panic under INVARIANTS when we can't allocate memory for storing
a vtag in time wait.
This issue was found by running syzkaller.

MFC after:		1 week
2020-02-12 17:05:10 +00:00
Michael Tuexen
ca3de626ec Mark the socket as disconnected when freeing the association the first
time.
This issue was found by running syzkaller.

MFC after:		1 week
2020-02-12 17:02:15 +00:00
Randall Stewart
348404bce1 Lets get the real correct version.. gessh. I need
more coffee evidently.

Sponsored by:	Netflix
2020-02-12 15:26:56 +00:00
Mitchell Horne
9ce0b407c2 Implement vm.pmap.kernel_maps for RISC-V
This is taken from the arm64 version, with the following simplifications:

- Our current pmap implementation uses a 3-level paging scheme
- The "mode" field has been omitted since RISC-V PTEs don't encode
  typical mode attributes

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D23594
2020-02-12 14:06:02 +00:00
Mitchell Horne
ccfb8acd70 RISC-V: un-ifdef vm.kvm_size and vm.kvm_free
Fix formatting and add CTLFLAG_MPSAFE.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D23522
2020-02-12 13:58:37 +00:00
Randall Stewart
b8f8a6b719 Opps committed the wrong ratelimit version in the
whitespace cleanup.. Restore it to the proper version.

Sponsored by:	Netfilx Inc.
2020-02-12 13:37:53 +00:00
Randall Stewart
481be5de9d White space cleanup -- remove trailing tab's or spaces
from any line.

Sponsored by:	Netflix Inc.
2020-02-12 13:31:36 +00:00
Randall Stewart
df341f5986 Whitespace, remove from three files trailing white
space (leftover presents from emacs).

Sponsored by:	Netflix Inc.
2020-02-12 13:07:09 +00:00
Randall Stewart
596ae436ef This small fix makes it so we properly follow
the RFC and only enable ECN when both the
CWR and ECT bits our set within the SYN packet.

Sponsored by:	Netflix Inc.
Differential Revision:	https://reviews.freebsd.org/D23645
2020-02-12 13:04:19 +00:00
Randall Stewart
3fba40d9f2 Remove all trailing white space from the BBR/Rack fold. Bits
left around by emacs (thanks emacs).
2020-02-12 12:40:06 +00:00
Randall Stewart
d2517ab04b Now that all of the stats framework is
in FreeBSD the bits that disabled stats
when netflix-stats is not defined is no longer
needed. Lets remove these bits so that we
will properly use stats per its definition
in BBR and Rack.

Sponsored by:	Netflix Inc
Differential Revision:	https://reviews.freebsd.org/D23088
2020-02-12 12:36:55 +00:00
Mateusz Guzik
4602214772 vfs: refactor vputx and add more comment
Reviewed by:	jeff (previous version)
Tested by:	pho (previous version)
Differential Revision:	https://reviews.freebsd.org/D23530
2020-02-12 11:19:07 +00:00
Mateusz Guzik
ed67a63c39 vfs: drop remaining zpcpu casts 2020-02-12 11:18:12 +00:00
Mateusz Guzik
123c519731 vfs: switch to smp_rendezvous_cpus_retry for vfs_op_thread_enter/exit
In particular on amd64 this eliminates an atomic op in the common case,
trading it for IPIs in the uncommon case of catching CPUs executing the
code while the filesystem is getting suspended or unmounted.
2020-02-12 11:17:45 +00:00
Mateusz Guzik
00ac9d2632 rms: use smp_rendezvous_cpus_retry instead of a hand-rolled variant 2020-02-12 11:17:18 +00:00
Mateusz Guzik
e4f584971b Add smp_rendezvous_cpus_retry
This is a wrapper around smp_rendezvous_cpus which enables use of IPI
handlers which can fail and require retrying.

wait_func argument is added to to provide a routine which can be used to
poll CPU of interest for when the IPI can be retried.

Handlers which succeed must call smp_rendezvous_cpus_done to denote that
fact.

Discussed with:	 jeff
Differential Revision:	https://reviews.freebsd.org/D23582
2020-02-12 11:16:55 +00:00
Mateusz Guzik
2318ed2508 amd64: provide custom zpcpu set/add/sub routines
Note that clobbers are highly overzealous, can be cleaned up later.
2020-02-12 11:15:33 +00:00
Mateusz Guzik
bee115bc59 Dedup zpcpu assertions into one macro and guard the rest with #ifndef
Sponsored by:	The FreeBSD Foundation
2020-02-12 11:14:23 +00:00
Mateusz Guzik
fb886947d9 amd64: store per-cpu allocations subtracted by __pcpu
This eliminates a runtime subtraction from counter_u64_add.

before:
mov    0x4f00ed(%rip),%rax        # 0xffffffff80c01788 <numfullpathfail4>
sub    0x808ff6(%rip),%rax        # 0xffffffff80f1a698 <__pcpu>
addq   $0x1,%gs:(%rax)

after:
mov    0x4f02fd(%rip),%rax        # 0xffffffff80c01788 <numfullpathfail4>
addq   $0x1,%gs:(%rax)

Reviewed by:	jeff
Differential Revision:	https://reviews.freebsd.org/D23570
2020-02-12 11:12:13 +00:00
Mateusz Guzik
3acb6572fc Store offset into zpcpu allocations in the per-cpu area.
This shorten zpcpu_get and allows more optimizations.

Reviewed by:	jeff
Differential Revision:	https://reviews.freebsd.org/D23570
2020-02-12 11:11:22 +00:00
Mateusz Guzik
48baf00f54 epoch: convert zpcpu_get_cpua(.., curcpu) to zpcpu_get 2020-02-12 11:10:10 +00:00
Hans Petter Selasky
01651e9615 Add support for debugnet in mlx5en(4).
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-02-12 10:03:25 +00:00
Hans Petter Selasky
f14d849862 Add support for disabling and polling MSIX interrupts in mlx5core.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-02-12 09:58:19 +00:00
Hans Petter Selasky
f98977b521 Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
incoming packets in taskqueue context.

This patch extends r357772.

Tested by:	yp@mm.st
Sponsored by:	Mellanox Technologies
2020-02-12 09:19:47 +00:00
Hans Petter Selasky
fb1a29b45e Make sure the so-called end of receive interrupts don't starve in iflib.
When the receive ring cannot be filled with mbufs, due to lack of memory,
no more interrupts may be generated to fill the receive ring later on.
Make sure to have a watchdog, to try refilling the receive ring from time
to time, hopefully when more mbufs are available.

Differential Revision:	https://reviews.freebsd.org/D23315
MFC after:	1 week
Reviewed by:	gallatin@
Sponsored by:	Mellanox Technologies
2020-02-12 08:30:07 +00:00
Navdeep Parhar
77ad00bf36 cxgbe(4): Update T4/5/6 firmwares to 1.24.12.0.
Obtained from:	Chelsio Communications
MFC after:	1 month
Sponsored by:	Chelsio Communications
2020-02-12 02:55:06 +00:00
Brooks Davis
8e2e3137a3 Mark hme(4) as deprecated.
It was saved from the initial purge of drivers in fcp-101 due to being
the onboard Ethernet device on a number of sparc64 machines.  Now that
sparc64 is gone, it serves little purpose (PCI cards exist, but are rare
and are unlikely to have been deployed outside Sun systems).

MFC after:	3 days
2020-02-12 00:58:17 +00:00
Eugene Grosbein
49f384cb47 ng_nat: avoid panic if attached directly to ng_ether and got short packet
From the beginning, ng_nat safely assumed cleansed traffic
because of limited ways it could be attached to NETGRAPH:
ng_ipfw or ng_ppp only.

Now as it may be attached with ng_ether too, the assumption proven wrong.
Add needed check to the ng_nat. Thanks for markj for debugging this.

PR:		243096
Submitted by:	Lutz Donnerhacke <lutz@donnerhacke.de>
Reported by:	Robert James Hernandez <rob@sarcasticadmin.com>
Reviewed by:	markj and others
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23091
2020-02-12 00:31:00 +00:00
Gleb Smirnoff
47602aa4e9 Remove assertion from TASK_INIT() macro, since some users of
sys/taskqueue.h may not have includes that define MPASS. It
was useful during testing of r357771, but can be omitted now.
An invalid value of priority will yield only in potential
priority inversion, not a crash.

This fixes compilation of ports/x11/nvidia-driver.
2020-02-11 20:59:41 +00:00
Mark Johnston
4ab3aee8fb Reduce lock hold time in keg_drain().
Maintain a count of free slabs in the per-domain keg structure and use
that to clear the free slab list in constant time for most cases.  This
helps minimize lock contention induced by reclamation, in preparation
for proactive trimming of excesses of free memory.

Reviewed by:	jeff, rlibby
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D23532
2020-02-11 20:06:33 +00:00
Michael Tuexen
8803350d6d Revert https://svnweb.freebsd.org/changeset/base/357761
This was suggested by cem@
2020-02-11 20:02:20 +00:00
Gleb Smirnoff
301a87ac4c Mark lio taskqueue as requiring network epoch. 2020-02-11 19:13:34 +00:00
Gleb Smirnoff
6c3e93cb5a Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
incoming packets in taskqueue context.

Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D23518
2020-02-11 18:57:07 +00:00
Gleb Smirnoff
4426b2e64b Add flag to struct task to mark the task as requiring network epoch.
When processing a taskqueue and a task has associated epoch, then
enter for duration of the task.  If consecutive tasks belong to the
same epoch, batch them.  Now we are talking about the network epoch
only.

Shrink the ta_priority size to 8-bits.  No current consumers use
a priority that won't fit into 8 bits.  Also complexity of
taskqueue_enqueue() is a square of maximum value of priority, so
we unlikely ever want to go over UCHAR_MAX here.

Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D23518
2020-02-11 18:48:07 +00:00
Mateusz Guzik
57349a4f41 vfs: fix vhold race in mnt_vnode_next_lazy_relock
vdrop can set the hold count to 0 and wait for the ->mnt_listmtx held by
mnt_vnode_next_lazy_relock caller. The routine incorrectly asserted the
count has to be > 0.

Reported by:	pho
Tested by:	pho
2020-02-11 18:19:56 +00:00
Hans Petter Selasky
b4426a7175 Add missing EPOCH(9) wrapper in ipfw(8).
Backtrace:
panic()
ip_output()
dyn_tick()
softclock_call_cc()
softclock()
ithread_loop()

Differential Revision:	https://reviews.freebsd.org/D23599
Reviewed by:	glebius@ and ae@
Found by:	mmacy@
Reported by:	jmd@
Sponsored by:	Mellanox Technologies
2020-02-11 18:16:29 +00:00
Michael Tuexen
9803f01cdb Don't start an SCTP timer using a net, which has been removed.
Submitted by:		Taylor Brandstetter
MFC after:		1 week
2020-02-11 18:15:57 +00:00
Mateusz Guzik
e7ce9c32a7 amd64: remove redundant sa->code assignment from cpu_fetch_syscall_args_fallback
It is already set in the only caller.
2020-02-11 18:15:23 +00:00
Mateusz Guzik
1b853b62f3 capsicum: restore the cap_rights_contains symbol
It is expected to be provided by libc.

PR:		244033
Reported by:	 Jan Kokemueller
2020-02-11 18:13:53 +00:00
Konstantin Belousov
5d1277ca9a if_media.h: Add 50G KR4 ethernet media type.
Submitted by:	Adam Peace <adam.e.peace@gmail.com>
Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D23620
2020-02-11 18:03:45 +00:00
Konstantin Belousov
48ad3b215c if_media.c: staticize and constify ifmedia description structures used under IFMEDIA_DEBUG.
The reason for this change is to make it clear the scope of the in-kernel usage
of IFM_TYPE_DESCRIPTIONS and IFM_SUBTYPE_ETHERNET_DESCRIPTIONS macros.  Also it
is somewhat better C.

Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
Differential revision:	https://reviews.freebsd.org/D23620
2020-02-11 17:45:01 +00:00
Konstantin Belousov
a249895df8 if_media.c: use __FBSDID().
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies
Differential revision:	https://reviews.freebsd.org/D23620
2020-02-11 17:41:45 +00:00
Ruslan Bukin
667c3fc0f6 Add PCI Express driver for the ARM Neoverse N1 System Development
Platform (N1SDP).

Neoverse N1 is a high-performance ARM microarchitecture designed
by the ARM Holdings for the server market.

The PCI part on N1SDP was shipped untested and suffers from some
integration issues.

For instance accessing to not existing BDFs causes System Error
(SError) exception. To mitigate this, the firmware scans the bus,
catches SErrors and creates a table with valid BDFs. That allows
us to filter-out accesses to invalid BDFs in this driver.

Also the root complex config space (BDF == 0) has an unusual
location in memory map, so remapping accesses to it is required.

Finally, the config space is restricted to 32-bit accesses only.

This was tested on the ARM boxes kindly provided by the ARM Ltd
to the DARPA CHERI Project.

In collaboration with:	andrew
Reviewed by:	andrew
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D23349
2020-02-11 15:12:09 +00:00