Commit Graph

278135 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav
0266a5d610 pax: comment typo fixes from NetBSD / OpenBSD.
Sponsored by:	Klara, Inc.
2022-09-13 17:58:59 +02:00
Dag-Erling Smørgrav
30c30e220a pax: remove 4.4BSD compatibility
Sponsored by:	Klara, Inc.
2022-09-13 17:36:37 +02:00
Aleksandr Fedorov
0e6e2c4ef3 netgraph(4): Don't process NGQF_MESG items in NET_EPOCH context.
Netgraph has two main types of message items:

- NGQF_DATA items are used for data processing. This is a hot path that
should be called from a NET_EPOCH context.

- NGQF_MESG items are used for node configuration. There are many places
in netgraph(4) where processing the NGQF_MESG item can call sections of code
that are forbidden in the NET_EPOCH context.

All item types can be queued and then processed using ngthread().
But ngthread() is unconditionally enter in the NET_EPOCH section for all types.
This causes panic/deadlocks when processing NGQF_MESG elements.

Reported by:	mjg
Reviewed by:	glebius, vmaffione (mentor)
Tested by:	mjg, afedorov
Approved by:	glebius, vmaffione (mentor)
Sponsored by:	vstack.com
Differential Revision:	https://reviews.freebsd.org/D36496
2022-09-13 17:20:41 +03:00
Richard Scheffenegger
bb1d472d79 tcp: make CUBIC the default congestion control mechanism.
This changes the default TCP Congestion Control (CC) to CUBIC.
For small, transactional exchanges (e.g. web objects <15kB), this
will not have a material effect. However, for long duration data
transfers, CUBIC allocates a slightly higher fraction of the
available bandwidth, when competing against NewReno CC.

Reviewed By: tuexen, mav, #transport, guest-ccui, emaste
Relnotes: Yes
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36537
2022-09-13 12:09:21 +02:00
Richard Scheffenegger
ea6d0de299 tcp: Make all references to CUBIC uppercase
Consistently refer to the CUBIC congestion control
mechanism in uppercase throughout all comments.

No functional change.

Reviewed By: #transport, tuexen, mav, guest-ccui, emaste
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36547
2022-09-13 12:07:06 +02:00
Bram Ton
06bfd0b914 setkey.8: Improve direction descriptions
Be more precise in the definition of policy directions
and policy levels.

PR:		250177
Reported by:	Bram Ton <bram at cbbg dot nl>
Reviewed by:	gbe, ae
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26719
2022-09-13 13:16:48 +02:00
Filipe da Silva Santos
10c6af3441 bhyve: Fix build when BHYVE_SNAPSHOT is set
Fixes:		9cc9abf409 ("bhyve: create all vcpus on startup")
Sponsored by:	Beckhoff Automation GmbH & Co. KG
X-MFC-With:	9cc9abf409
2022-09-13 08:32:09 +02:00
Doug Moore
4893472c9a rb_tree: pass parent to RB_INSERT_COLOR
Change RB_COLOR_INSERT to take a parent parameter, to avoid looking up
a value already available. Make adjustments to a linux rbtree header,
which invokes it.

Reviewed by:	alc, hselasky
Differential Revision:	https://reviews.freebsd.org/D36114
2022-09-13 01:11:47 -05:00
Adrian Chadd
633d178c63 qcom_qup: compilation fixes
Fix compilation warning/errors - in this instance we do need the register
IO.

Reviewed by: imp

Differential Revision: https://reviews.freebsd.org/D36535
2022-09-12 20:10:25 -07:00
Adrian Chadd
82302a49fd qcom_tlmm: use return code instead of always returning true.
This was failing due to unused/ignored return values; so just use them.

Reviewed by: imp

Differential Revision: https://reviews.freebsd.org/D36534
2022-09-12 20:10:25 -07:00
Adrian Chadd
3d9bd82522 qcom_clk: compilation fixes
* remove dead code
* mark enabled as unused, happens if debugging isn't enabled
* log the enabled state if debugging is enabled

Reviewed by: imp

Differential Revision: https://reviews.freebsd.org/D36533
2022-09-12 20:10:25 -07:00
Adrian Chadd
f060362ade ipq4018: remove write-only variables in USB ehci/xhci bus glue
Changes in compilers / warnings/errors caused this to stop compiling.
Delete the write-only code.

Reviewed by: imp

Differential Revision: https://reviews.freebsd.org/D36532
2022-09-12 20:10:24 -07:00
Adrian Chadd
f05b3c9f47 qcom_gcc: fix the parent clock to work again
Rename it to match the clock-output-names field in the device
tree.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36531
2022-09-12 20:10:24 -07:00
Mateusz Guzik
b4137c9ed1 vfs: make NDVALIDATE private to vfs_lookup.c
it is not used elsewhere.
2022-09-12 22:50:48 +00:00
Navdeep Parhar
998eb37aca cxgbe(4): Add knob to control congestion behavior for TOE queues.
hw.cxgbe.ofld_cong_drop works just like hw.cxgbe.cong_drop but for TOE
rx queues.

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2022-09-12 11:40:35 -07:00
Navdeep Parhar
df275ae509 cxgbe(4): Add another setting to the knob that controls congestion.
hw.cxgbe.cong_drop=2 will generate backpressure *and* drop frames for
queues that are congested.

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2022-09-12 11:40:29 -07:00
Navdeep Parhar
c387ff0045 cxgbe(4): Specify the ingress queue's type when creating it.
The firmware takes the type into account when setting up the PCIe
channel for the queue.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-09-12 11:40:25 -07:00
Dag-Erling Smørgrav
c198adf394 siftr: spell PFIL_PASS correctly.
Sponsored by:	NetApp
Sponsored by:	Klara Inc.
Differential Revision: https://reviews.freebsd.org/D36539
2022-09-12 19:20:10 +02:00
Kristof Provost
95d5a656a2 pf tests: syncookie limits test
Test that we can successfuly set syncookie high/low watermarks for very
low or very high state limits.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36498
2022-09-12 09:32:02 +02:00
Kristof Provost
6049ee60e0 libpfctl: improve syncookie watermark calculation
Ensure that we always pass sane limits for the high and low watermark
values.
This is especially important if users do something silly, like set the
state limit to 1. In that case we wound up calculating 0/0 as a limit,
which gets rejected by the kernel.

While here also shift the calculation to use uint64_t, so we don't end
up with overflows (and subsequently higher low than high values) with
very large state limits.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36497
2022-09-12 09:32:02 +02:00
Adrian Chadd
7d0e83c60b arm: add dwc3/xhci as build options for ARM
Summary:
This mirrors the recentish changes to armv8; the ipq4018 port uses
dwc3 + xhci and thus needs this.

Subscribers: imp, andrew

Reviewed by: imp

Differential Revision: https://reviews.freebsd.org/D36530
2022-09-11 19:36:42 -07:00
Vladimir Kondratyev
975407b1d8 usbhid(4): Increase probe priority to BUS_PROBE_DEFAULT + 1
usbhid(4) vs other USB HID drivers precedence is determined by
hw.usb.usbhid.enable loader tunable and HID quirk subsystem rather
than by device_probe() return value. Raise priority high enough to
always give usbhid(4) a possible chance to attach.

Fixes usbhid(4) attachment on USB device hotplug.

Reported by:	Ivan Quitschal <tezeka_AT_hotmail_DOT_com>
MFC after:	1 week
2022-09-11 13:21:16 +03:00
Alan Cox
8d7ee2047c pmap: don't recompute mpte during promotion
When attempting to promote 4KB user-space mappings to a 2MB user-space
mapping, the address of the struct vm_page representing the page table
page that contains the 4KB mappings is already known to the caller.
Pass that address to the promotion function rather than making the
promotion function recompute it, which on arm64 entails iteration over
the vm_phys_segs array by PHYS_TO_VM_PAGE().  And, while I'm here,
eliminate unnecessary arithmetic from the calculation of the first PTE's
address on arm64.

MFC after:	1 week
2022-09-11 01:19:22 -05:00
Allan Jude
b20ec58669 vfs.typenumhash: fix sysctl description
a string continuation was missing a space, resulting in two works
being smushed together.

Sponsored by:	Klara, Inc.
2022-09-10 22:47:51 +00:00
Mateusz Guzik
1760a6950a Fixup build after recent getsock changes 2022-09-10 20:40:43 +00:00
Warner Losh
e66c6b993e da.4: Don't document softtimeout
kern.cam.da.default_softtimeout currently does nothing. It sets a value
in the CCB that SIMs could look at, only none do. Leave it undocumented
until it actually does something. It was introduced to allow a 'soft
recovery' to be started when things were taking too long in the SIM by
not scheduling new I/O, or other measures the SIM knew would help when
it seemed like things were getting 'backed up'. No SIM in the FreeBSD
tree implements this and scsi_da doesn't use it other than to pass it
down, so best remove it from the documentation until it does something.

Sponsored by:		Netflix
Fixes:			53af9c235f
Reviewed by:		gbe
Differential Review:	https://reviews.freebsd.org/D36518
2022-09-10 13:51:37 -06:00
Mateusz Guzik
3be2225fc8 Remove fflag argument from getsock_cap
Interested callers can obtain in other own easily enough
and there is no reason to branch on it.
2022-09-10 19:47:47 +00:00
Mateusz Guzik
3212ad15ab Add getsock
All but one consumers of getsock_cap only pass 4 arguments.
Take advantage of it.
2022-09-10 19:47:47 +00:00
Mateusz Guzik
a2ad70923f Add branch prediction hints to getsock_cap 2022-09-10 19:41:52 +00:00
Gordon Bergling
13604a80f7 iscsi(4): Remove a double word in a source code comment
- s/to to/to/

MFC after:	3 days
2022-09-10 13:04:42 +02:00
Gordon Bergling
a5beac3992 isp: Remove a double word in the driver manual
- s/to to/to/

MFC after:	3 days
2022-09-10 13:03:38 +02:00
Gordon Bergling
bcb2341c7d netinet6: Remove a double word in a source code comment
- s/to to/to/

MFC after:	3 days
2022-09-10 13:01:44 +02:00
Gordon Bergling
eb2f7d9a5a ocs_fc(4): Remove double words in source code comments
- s/to to/to/

MFC after:	3 days
2022-09-10 13:00:23 +02:00
Gordon Bergling
82007616d0 msun: Remove a double word in a source code comment
- s/to to/to/

MFC after:	3 days
2022-09-10 12:59:10 +02:00
Gordon Bergling
8dcfb0282d mk: Remove a double word in a comment
- s/to to/to/

MFC after:	3 days
2022-09-10 12:57:55 +02:00
Gordon Bergling
11bc6be152 ipf-howto: Remove a double word
- s/to to/to/

MFC after:	3 days
2022-09-10 12:56:48 +02:00
Gordon Bergling
08cb3ac76c tools: Remove a double words
- s/to to/to/
 - s/to to/to do/ in an error message

MFC after:	3 days
2022-09-10 12:54:33 +02:00
Gordon Bergling
59cdd0e2ff stress2: Remove double words in comments
- s/to to/to/

 MFC after:3 days
2022-09-10 12:52:50 +02:00
Gordon Bergling
ba594e730e regression-netinet: Remove a double word in a source code comment
- s/to to/to/

 MFC after:	3 days
2022-09-10 12:52:01 +02:00
Peter Jeremy
c02d4224c8
arm64: allwinner: aw_r_intc: Add A64 and H6 compatible.
This fixes booting the Pine H64 with a 5.13 DTS.

Suggested by:	manu@
2022-09-10 20:36:22 +10:00
Gleb Smirnoff
29b4b63c59 ip_reass: optimize ipreass_drain_vnet()
- Call ipreass_reschedule() only once per slot [1]
- Aggregate stats and update them once

Suggested by:	jtl [1]
2022-09-10 02:17:15 -07:00
Gleb Smirnoff
13018bfae8 ip_reass: make stray callout assertion more verbose
Syzcaller hits this assertion, but can't find reproducer.  I also never
seen it hit in my testing.  Try to get more information via syzcaller.
2022-09-10 02:11:39 -07:00
Felix Johnson
53af9c235f da.4: Add some sysctl descriptions
Add descriptions for the following sysctl's:

- kern.cam.da.default_softtimeout
- kern.cam.da.disable_wp_protection
- kern.cam.da.enable_biospeedup
- kern.cam.da.enable_uma_ccbs
- kern.cam.da.poll_period
- kern.cam.da.send_ordered

While here, fix some mandocs warnings.

PR:		258727
Reported by:	Felix Johnson <felix dot the dot red at gmail dot com>
Reviewed by:	debdrup, pauamma, gbe
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32278
2022-09-10 09:44:08 +02:00
Maxim Konovalov
1b7f08b917 ifnet(9): Duplicates for IFCAP_TOE flags removed.
PR:	266330
2022-09-10 01:35:34 +00:00
Warner Losh
45ad955714 stand: Add driver interface docs
Add some rather bare-bones driver interface docs.

Sponsored by:		Netflix
Suggestions by:		rpokala
Reviewed by:		pauamma
Differential Revision:	https://reviews.freebsd.org/D35912
2022-09-09 17:25:59 -06:00
Kirk McKusick
927f8d8bbb Handle NULL return from localtime(3) in ls(1) and find(1)
The ls(1) (with -l option) and find(1) (with -ls option) utilties
segment fault when operating on files with very large modification
times. A recent disk corruption set a spurious bit in the mtime
field of one of my files to 0x8000000630b0167 (576460753965089127)
which is in year 18,266,940,962. I discovered the problem when
running fsck_ffs(8) which uses ctime(3) to convert it to a readable
format. Ctime cannot fit the year into its four character field, so
returns ??? ??? ?? ??:??:?? ???? (typically Thu Nov 24 18:22:48 2021).

With the filesystem mounted, I used `ls -l' to see how it would
report the modification time and it segment faulted. The find(1)
program also segment faulted (see script below). Both these utilities
call the localtime(3) function to decode the modification time.
Localtime(3) returns a pointer to a struct tm (which breaks things
out into its component pieces: year, month, day, hour, minute,
second). The ls(1) and find(1) utilities then print out the date
based on the appropriate fields in the returned tm structure.

Although not documented in the localtime(3) manual page, localtime(3)
returns a NULL pointer if the passed in time translates to a year
that will not fit in an "int" (which if "int" is 32-bits cannot
hold the year 18,266,940,962). Since ls(1) and find(1) do not check
for a NULL struct tm * return from localtime(3), they segment fault
when they try to dereference it.

When localtime(3) returns NULL, the attached patches produce a date
string of "bad date val". This string is chosen because it has the
same number of characters (12) and white spaces (2) as the usual
date string, for example "Sep 3 22:06" or "May 15 2017".

The most recent ANSI standard for localtime(3) does say that localtime(3)
can return NULL (see https://pubs.opengroup.org/onlinepubs/9699919799/
and enter localtime in the search box). Our localtime(3) man page should
be updated to indicate that NULL is a possible return. More importantly,
there are over 100 uses of localtime(3) in the FreeBSD source tree (see
Differential Revision D36474 for the list). Most do not check for a NULL
return from localtime(3).

Reported by:  Peter Holm
Reviewed by:  kib, Chuck Silvers, Warner Losh
MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36474
2022-09-09 14:30:42 -07:00
Bjoern A. Zeeb
800aa9cd3d LinuxKPI: 80211 (+net80211): update and cleanup headers
Fix types for various struct fields (initially added as int).

Move structs and inline functions logically together, e.g., for wowlan.
Add more skeleton functions and #defines needed for iwlwifi d3.c
in the future.

Add struct ieee80211_vht_cap (without "_ie") to net80211 and remove
duplicate definitions in LinuxKPI headers now using net80211 structs.
For now leave ieee80211_ie_vhtcap in net80211.  I am not sure yet if we
actually need it as such.  That'll be cleaned up with more VHT updates
in net80211 in the future.

No functional changes in currently compiled code intended.

Try to implement ieee80211_action_contains_tpc() as I ran into it with
an older iwlwifi chipset.  This depends on c994352a88.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2022-09-09 18:40:23 +00:00
Mateusz Guzik
e5d08f4729 pf: remove pf_bcmp_state_key
Clang 14 performs the optimisation on its own, thus the custom code is
no longer needed.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-09-09 17:16:58 +00:00
Mateusz Guzik
6b94546a7e pf: partially depessimize pf_match_translation
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-09-09 17:03:55 +00:00
Bjoern A. Zeeb
866e021654 rtw89: import firmware for Realtek's rtw89 supported chipsets.
Import the most recent versions of the firmware images for the
rtw89 driver.

This is based on linux-firmware at 2f2f0181581d3e35bfdb9fc65f609ee9d3fbaeb7.

The license of the firmware matches the previously added rtw88(4) firmware
and you can find a copy in sys/contrib/dev/rtw89fw/LICENCE.rtlwifi_firmware.txt.

Add build infrastructure to create the .ko files but do not yet hook
it up to the build until all parts are in the tree.

Approved by:	core.11 (imp) [2022-03-27]
MFC after:	6 weeks
2022-09-09 16:32:17 +00:00