Commit Graph

255262 Commits

Author SHA1 Message Date
Andrew Turner
e324f1e9f4 Stop redefining PAGE_SHIFT in virtio-mmio
This is alreaady defined by each architecture as that is the only place
we can know what the correct page shift should be.

Sponsored by:	Innovate UK
2020-12-23 13:10:26 +00:00
Andrew Turner
166ceb6fd1 More the arm64 early page tables and stack to .bss
This removes 806k from the kernel ELF file that is only needed while
the kernel is running, not in the static file.

Sponsored by:	Innovate UK
2020-12-23 13:10:23 +00:00
Yuri Pankov
f952bdf142 tools/tools/locale: skip control character widths
Do not explicitly encode control characters widths as 0
allowing wcwidth() to return the proper implicit value for
non-printable characters (-1).

Reported by:	naddy
2020-12-23 15:53:43 +03:00
Kristof Provost
1c00efe98e pf: Use counter(9) for pf_state byte/packet tracking
This improves cache behaviour by not writing to the same variable from
multiple cores simultaneously.

pf_state is only used in the kernel, so can be safely modified.

Reviewed by:	Lutz Donnerhacke, philip
MFC after:	1 week
Sponsed by:	Orange Business Services
Differential Revision:	https://reviews.freebsd.org/D27661
2020-12-23 12:03:21 +01:00
Kristof Provost
2d3fda5fa1 pf tests: Verify (tcp) checksum modification on unaligned options
It turns out pf incorrectly updates the TCP checksum if the TCP option
we're modifying is not 2-byte algined with respect to the start of the
packet.

Create a TCP packet with such an option and throw it through a scrub
rule, which will update timestamps and modify the packet.

PR:		240416
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27688
2020-12-23 12:03:20 +01:00
Kristof Provost
e1f6571a12 pf tests: Sort Makefile entries
MFC after:	1 week
2020-12-23 12:03:20 +01:00
Kristof Provost
c3f69af03a pf: Fix unaligned checksum updates
The algorithm we use to update checksums only works correctly if the
updated data is aligned on 16-bit boundaries (relative to the start of
the packet).

Import the OpenBSD fix for this issue.

PR:		240416
Obtained from:	OpenBSD
MFC after:	1 week
Reviewed by:	tuexen (previous version)
Differential Revision:	https://reviews.freebsd.org/D27696
2020-12-23 12:03:20 +01:00
Hans Petter Selasky
1622a49852 No need to stop XHCI endpoints in disabled state.
Some AMD XHCI implementations apparently assert a permanent
internal failure if this happens.

Submitted by:	ali.abdallah@suse.com
PR:		251503
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-12-23 12:04:51 +01:00
Hans Petter Selasky
ddce63fcb6 Remove not needed variable initialization.
And switch from int to bool while at it.

Reviewed by:	melifaro@
Differential Revision:	https://reviews.freebsd.org/D27725
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-12-23 12:04:46 +01:00
Konstantin Belousov
84eaf2ccc6 x86: stop punishing VMs with low priority for TSC timecounter
I suspect that virtualization techniques improved from the time when we
have to effectively disable TSC use in VM.  For instance, it was reported
(complained) in https://github.com/JuliaLang/julia/issues/38877 that
FreeBSD is groundlessly slow on AWS with some loads.

Remove the check and start watching for complaints.

Reviewed by:	emaste, grehan
Discussed with:	cperciva
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27629
2020-12-23 12:45:15 +02:00
Konstantin Belousov
994e47023a vxlan: stop checking CSUM_ENCAP_VXLAN when converting inner CSUM flags into normal, for decapsulation.
The packet, if processed at this point, was already parsed to be UDP
directed to a vxlan port.

Connect-X 4+ does not provide easy method to infer which parser
processed the packet, so driver cannot set the flag without a lot of
efforts which are only to satisfy the formal requirements.

Reviewed by:	bryanv, np
Sponsored by:	Mellanox Technologies/NVidia Networking
Differential revision:	https://reviews.freebsd.org/D27449
MFC after:	1 week
2020-12-23 10:54:06 +02:00
Vladimir Kondratyev
2ac1c19272 psm(4): Always initialize Synaptics touchpad report range with defaults
Otherwise libinput refuses to recoginize some Synaptics touchpads with
"kernel bug: device has min == max on ABS_X" message in Xorg.log.

PR:		251149
Reported-by:	Jens Grassel <freebsd-ports@jan0sch.de>
Tested-by:	Jens Grassel <freebsd-ports@jan0sch.de>
MFC-after:	2 weeks
2020-12-23 11:10:53 +03:00
Vladimir Kondratyev
bde56c9942 acpi_wmi(4): Allow attachment to ACPI node if EC is not found
Conducted tests showed that Embedded Controller is not mandatory for
WMI extensions to work.

Reported-by:	yuripv
Reviewed-by:	avg
MFC-after:	2 weeks
Differential-Revision:	https://reviews.freebsd.org/D27653
2020-12-23 11:10:53 +03:00
Vladimir Kondratyev
54d2dfc4b2 cyapa(4): Add support for evdev protocol
Tested-by:	Matthias Apitz <guru@unixarea.de>
MFC-after:	2 weeks
2020-12-23 11:10:49 +03:00
Vladimir Kondratyev
a223aa8abd cyapa(4): Make button detection matching ChromeOS driver
Tested-by:	Matthias Apitz <guru@unixarea.de>
MFC-after:	2 weeks
2020-12-23 11:09:25 +03:00
Andrew Turner
659f1a6aad Improve address generation in the early arm64 boot
The adr instruction allows for an address of +-1M from the instruction.
If we replace these with an adrp and an add instruction we can generate
an address +-4G. The adrp will get an address of the 4k page the label
is within, and the add uses the :lo12: prefix to add just the low bits
to this address.

This will allow us to move things around with fewer issues than if we
needed to keep them within the +-1MB range.

Sponsored by:	Innovate UK
2020-12-23 07:54:59 +00:00
Mateusz Guzik
906a73e791 cache: fix up cache_hold_vnode comment 2020-12-23 07:24:29 +00:00
Mark Johnston
cd698c5179 netgraph: Fix ng_ether's shutdown handing
When tearing down a VNET, netgraph sends shutdown messages to all of the
nodes before detaching interfaces (SI_SUB_NETGRAPH comes before
SI_SUB_INIT_IF in teardown order).  ng_ether nodes handle this by
destroying themselves without detaching from the parent ifnet.  Then,
when ifnets go away they detach their ng_ether nodes again, triggering a
use-after-free.

Handle this by modifying ng_ether_shutdown() to detach from the ifnet.
If the shutdown was triggered by an ifnet being destroyed, we will clear
priv->ifp in the ng_ether detach callback, so priv->ifp may be NULL.

Also get rid of the printf in vnet_netgraph_uninit().  It can be
triggered trivially by ng_ether since ng_ether_shutdown() persists the
node unless NG_REALLY_DIE is set.

PR:		233622
Reviewed by:	afedorov, kp, Lutz Donnerhacke
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27662
2020-12-23 00:12:16 -05:00
Xin LI
1cc908de3a Remove unused includes. 2020-12-22 21:04:36 -08:00
Ed Maste
17eba5e32a newvers.sh: fix sense of git dirty check
Previously we reported -dirty for an unmodified tree, and no -dirty if
there were changes.

PR:		252028
Reported by:	John Kennedy
2020-12-22 23:31:15 -05:00
Li-Wen Hsu
5ef5f51d2b
Mark the repository has been converted to Git
This is the first Git commit to src.

Sponsored by:	The FreeBSD Foundation
2020-12-23 12:27:27 +08:00
Li-Wen Hsu
3cc0c0d66a Mark the repository as being converted to Git.
This is the last Subversion commit to src.

Sponsored by:	The FreeBSD Foundation
2020-12-20 02:59:44 +00:00
Andrew Gallatin
a034518ac8 Filter TCP connections to SO_REUSEPORT_LB listen sockets by NUMA domain
In order to efficiently serve web traffic on a NUMA
machine, one must avoid as many NUMA domain crossings as
possible. With SO_REUSEPORT_LB, a number of workers can share a
listen socket. However, even if a worker sets affinity to a core
or set of cores on a NUMA domain, it will receive connections
associated with all NUMA domains in the system. This will lead to
cross-domain traffic when the server writes to the socket or
calls sendfile(), and memory is allocated on the server's local
NUMA node, but transmitted on the NUMA node associated with the
TCP connection. Similarly, when the server reads from the socket,
he will likely be reading memory allocated on the NUMA domain
associated with the TCP connection.

This change provides a new socket ioctl, TCP_REUSPORT_LB_NUMA. A
server can now tell the kernel to filter traffic so that only
incoming connections associated with the desired NUMA domain are
given to the server. (Of course, in the case where there are no
servers sharing the listen socket on some domain, then as a
fallback, traffic will be hashed as normal to all servers sharing
the listen socket regardless of domain). This allows a server to
deal only with traffic that is local to its NUMA domain, and
avoids cross-domain traffic in most cases.

This patch, and a corresponding small patch to nginx to use
TCP_REUSPORT_LB_NUMA allows us to serve 190Gb/s of kTLS encrypted
https media content from dual-socket Xeons with only 13% (as
measured by pcm.x) cross domain traffic on the memory controller.

Reviewed by:	jhb, bz (earlier version), bcr (man page)
Tested by: gonzo
Sponsored by:	Netfix
Differential Revision:	https://reviews.freebsd.org/D21636
2020-12-19 22:04:46 +00:00
Andrew Gallatin
02bc3865aa Optionally bind ktls threads to NUMA domains
When ktls_bind_thread is 2, we pick a ktls worker thread that is
bound to the same domain as the TCP connection associated with
the socket. We use roughly the same code as netinet/tcp_hpts.c to
do this. This allows crypto to run on the same domain as the TCP
connection is associated with. Assuming TCP_REUSPORT_LB_NUMA
(D21636) is in place & in use, this ensures that the crypto source
and destination buffers are local to the same NUMA domain as we're
running crypto on.

This change (when TCP_REUSPORT_LB_NUMA, D21636, is used) reduces
cross-domain traffic from over 37% down to about 13% as measured
by pcm.x on a dual-socket Xeon using nginx and a Netflix workload.

Reviewed by:	jhb
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D21648
2020-12-19 21:46:09 +00:00
Gordon Bergling
f6d234d870 libc: Fix most issues reported by mandoc
- varios "new sentence, new line" warnings
- varios "sections out of conventional order" warnings
- varios "unusual Xr order" warnings
- varios "missing section argument" warnings
- varios "no blank before trailing delimiter" warnings
- varios "normalizing date format" warnings

MFC after:	1 month
2020-12-19 14:54:28 +00:00
Gordon Bergling
a652079615 trim(8): Fix a few issues reported by mandoc
- new sentence, new line
- unusual Xr order: ioctl(2) after da(4)
- unusual Xr order: sysexits(3) after nda(4)

MFC after:	1 week
2020-12-19 13:56:19 +00:00
Gordon Bergling
8ef235787b zonectl(8): Fix a few issues reported by mandoc
- Add missing quotation mark for a comment above the .Dd
- inserting missing end of block: Sh breaks Bd
- skipping paragraph macro: Pp before Bl
- skipping paragraph macro: Pp before Bd
- empty block: Bd

MFC after:	1 week
2020-12-19 13:51:46 +00:00
Gordon Bergling
749ddf491b nfsv4(4): Fix a few issues reported by mandoc
- new sentence, new line
- function name without markup: rtalloc()
- function name without markup: VOP_RECLAIM()

MFC after:	1 week
2020-12-19 13:45:39 +00:00
Gordon Bergling
60ee05db4b bluetooth: Fix a mandoc related issues
- new sentence, new line
- sections out of conventional order: Sh FILES
- unusual Xr order: bthost(1) after bthidd(8)
- no blank before trailing delimiter
- whitespace at end of input line
- sections out of conventional order: Sh EXIT STATUS

MFC after:	1 week
2020-12-19 13:36:59 +00:00
Gordon Bergling
84572415b4 mpsutil(8): Remove trailing whitespace
MFC after:	1 week
2020-12-19 13:23:26 +00:00
Gordon Bergling
1c77a78367 bhyvectl(8): Normalize the man page date
MFC after:	1 week
2020-12-19 13:21:40 +00:00
Gordon Bergling
cc984b0a5a camdd(8): Fix the man page date
The comment before the .Dd macro was missing a quotation mark, so that
the date of the man page was always today.

MFC after:	3 days
2020-12-19 13:17:25 +00:00
Gordon Bergling
aeb0c721f5 config: Fix a few mandoc related errors
- new sentence, new line
- no blank before trailing delimiter

MFC after:	1 week
2020-12-19 13:11:44 +00:00
Gordon Bergling
267d86e15d devctl(8): Correct "sections out of conventional order" error
MFC after:	1 week
2020-12-19 13:05:54 +00:00
Gordon Bergling
a2f1c81b28 patch(1): Fix a few mandoc related issues
- no blank before trailing delimiter

MFC after:	1 week
2020-12-19 13:00:17 +00:00
Gordon Bergling
3f6cdd59fe uname(1): Fix a typo in the man page date
MFC after:	3 days
2020-12-19 12:55:27 +00:00
Gordon Bergling
a5b4dfcfbc ident(1): Normalizing date format
MFC after:	3 days
2020-12-19 12:54:00 +00:00
Gordon Bergling
bae74ca922 ipfw(8): Fix a few mandoc related issues
- no blank before trailing delimiter
- missing section argument: Xr inet_pton
- skipping paragraph macro: Pp before Ss
- unusual Xr order: syslogd after sysrc
- tab in filled text

There were a few multiline NAT examples which used the .Dl macro with
tabs. I converted them to .Bd, which is a more suitable macro for that case.

MFC after:	1 week
2020-12-19 12:47:40 +00:00
Gordon Bergling
ea0dd3ca44 ping(8): Fix a mandoc related issue
- unusual Xr punctuation: none before traceroute6(8)
2020-12-19 11:57:47 +00:00
Gordon Bergling
9bca273d84 nvmecontrol(8): Fix a few mandoc related issues and add a SEE ALSO section
- inserting missing end of block: Ss breaks Bl
- skipping paragraph macro: Pp before Ss
- referenced manual not found: Xr nvme 4 (2 times)
- unknown standard specifier: St The

The macro .St can only be used for standards known by mdoc(7). So add a
SEE ALSO section and add a reference to the NVM Express Base Specification.

MFC after:	2 weeks
2020-12-19 11:47:38 +00:00
Hans Petter Selasky
7d0368ee34 Ensure a minimum packet length before creating a mbuf in if_ure.
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-12-19 11:03:54 +00:00
Gordon Bergling
226f43e757 devd.conf(5): Fix a mandoc related issue
- sections out of conventional order: Sh SEE ALSO

MFC after:	1 week
2020-12-19 11:03:04 +00:00
Hans Petter Selasky
412bbd0811 Move SYSCTL_ADD_PROC() to unlocked context in if_ure to avoid lock order reversal.
MFC after:	1 week
Reported by:	Mark Millard <marklmi@yahoo.com>
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-12-19 11:00:11 +00:00
Gordon Bergling
bb0358d4d7 sysctl(9): Fix a few mandoc related issues
- missing comma before name: Nm SYSCTL_UQUAD
- bad NAME section content: text

MFC after:	1 week
2020-12-19 10:31:25 +00:00
Gordon Bergling
0492f4030d ofw_bus_status_okay(9): Fix a few mandoc related issues
- missing comma before name: Nm ofw_bus_status_okay
- missing comma before name: Nm ofw_bus_node_status_okay
- skipping paragraph macro: Pp after Sh

MFC after:	1 week
2020-12-19 10:26:40 +00:00
Gordon Bergling
8bf0ef84d9 ofw_bus_is_compatible(9): Fix a few mandoc related issues
- missing comma before name: Nm ofw_bus_is_compatible_strict
- missing comma before name: Nm ofw_bus_node_is_compatible
- missing comma before name: Nm ofw_bus_search_compatible
- skipping paragraph macro: Pp after Sh

MFC after:	1 week
2020-12-19 10:24:36 +00:00
Gordon Bergling
501de9c0c1 fail(9): Fix a few mandoc related issues
- function name without markup: return()
- function name without markup: print()

MFC after:	1 week
2020-12-19 10:20:22 +00:00
Gordon Bergling
f37f378d35 driver(9): Fix a mandoc related issue
- sections out of conventional order: Sh SEE ALSO

MFC after:	1 week
2020-12-19 10:18:21 +00:00
Gordon Bergling
a549eb675b bhnd_erom(9): Fix a few mandoc related issues
- skipping paragraph macro: Pp before Bl
- skipping paragraph macro: Pp after Ss
- skipping paragraph macro: Pp at the end of Ss
- unusual Xr punctuation: none before bhnd_driver_get_erom_class(9)
- unusual Xr punctuation: none before bus_space(9)

MFC after:	1 week
2020-12-19 10:15:58 +00:00
Gordon Bergling
05419da506 bhnd(9): Fix a few mandoc related issues
- skipping paragraph macro: Pp before Bl
- skipping paragraph macro: Pp at the end of Ss
- missing section argument: Xr device_set_desc
- unusual Xr punctuation: none before bhnd_erom(9)

MFC after:	1 week
2020-12-19 10:11:37 +00:00