Commit Graph

272685 Commits

Author SHA1 Message Date
Mark Johnston
c89def05b5 armv8crypto: Remove leftover debug printfs
Fixes:	26b08c5d21 ("armv8crypto: Use cursors to access crypto buffer data")
Reported by:	bz
2022-02-17 14:25:45 -05:00
Aleksandr Fedorov
cb28dfb27d md(4): Add dummy support of the BIO_FLUSH command for malloc and swap
backend.

PR:	260200
Reported by:	editor@callfortesting.org
Reviewed by:	vmaffione (mentor), markj
Approved by:	vmaffione (mentor), markj
Differential Revision:	https://reviews.freebsd.org/D34260
2022-02-17 22:21:56 +03:00
Michael Tuexen
76e03cc940 sctp: avoid undefined behaviour and cleanup the code.
MFC after:	3 days
2022-02-17 19:23:59 +01:00
Cy Schubert
0640e0c196 unbound: Refresh manpages to latest version
Update unbound manpages by copying the current unbound manpages in
contrib/doc/*.in to their respective manpages,

PR:		262013
Reported by:	Michael Osipov <michael.osipov@siemens.com>
Fixes:		numerous previous updates
MFC after:	3 days
2022-02-17 09:05:34 -08:00
Eric van Gyzen
86e5e10daf elfdump: handle small files more gracefully
elfdump -E on an empty file would complain "Invalid argument" because
it tried to mmap zero bytes.  With the -E flag, elfdump should
simply exit non-zero.  For tiny files, the code would reference off
the end of the mapped region.

Ensure the file is large enough to contain an ELF header before mapping it.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2022-02-17 10:09:53 -06:00
Bjoern A. Zeeb
95edb10b47 LinuxKPI: implement dma_sync_single_for_*, apply to (un)map single/sg
Implement dma_sync_single_for_{cpu,device} translating the Linux
DMA_ flags to BUS_DMASYNC_ combinations.  Make map_single/unmap_single*
functions call the respective sync function.   Apply the same logic to
the scatter-gather list map/unmap functions.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D32255
2022-02-17 13:39:15 +00:00
Kristof Provost
7d3fc84b2d pf tests: Test per-anchor tables
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-02-17 14:13:50 +01:00
Kristof Provost
7f55a9b490 pf tests: remove a stray 'set -x'
'set -x' is very useful when debugging tests, but does not need to be
left in.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-02-17 13:40:41 +01:00
Hans Petter Selasky
bc531a1faa mlx5en: Improve CQE error debugging.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-17 13:13:09 +01:00
Hans Petter Selasky
015f22f5d0 mlx5en: Fix TLS worker thread race.
Create a dedicated free state, in case the taskqueue worker is still pending,
to avoid re-activation of a freed send tag.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-17 13:13:09 +01:00
Hans Petter Selasky
ebdb700649 mlx5en: Improve RX- and TX- TLS refcounting.
Use the send tag refcounting mechanism to refcount the RX- and TX- TLS
send tags. Then it is no longer needed to wait for refcounts to reach
zero when destroying RX- and TX- TLS send tags as a result of pending
data or WQE commands.

This also ensures that when TX-TLS and rate limiting is used at the same
time, the underlying SQ is not prematurely destroyed.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-17 13:13:09 +01:00
Hans Petter Selasky
d2a788a522 mlx5en: Add missing refcount decrement on link-down.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-17 13:13:09 +01:00
Mateusz Piotrowski
bf8e978583 freebsd-update.conf.5: Sort options
Reported by:	pauamma_gundo.com
MFC after:	1 week
2022-02-17 10:54:07 +01:00
Mateusz Piotrowski
b80bb8b197 freebsd-update.conf.5: Address style issues
- Do not set Os to FreeBSD explicitly. We don't do it in other manual
  pages.
- Remove macros from the -width specifier.
- Use Xr instead of Cm to refer to the freebsd-update command.
- Address some mandoc lint warnings and use \(em instead of --.
- Wordsmith some paragraphs.
- Add a missing El macro.

MFC after:	1 week
2022-02-17 10:46:48 +01:00
Mateusz Piotrowski
6d17f2d043 freebsd-update.8: Document CreateBootEnv
Also, add bectl(8) to section "See Also". [1]

PR:		261716
Reviewed by:	debdrup, pauamma_gundo.com
MFC after:	1 week
Fixes:		f28f138905 freebsd-update: create a ZFS boot environment on install
Differential Revision:	https://reviews.freebsd.org/D34169
Co-authored-by:	Tobias Rehbein <tobias.rehbein@web.de> [1]
2022-02-17 10:26:59 +01:00
Emmanuel Vadot
ba87e9bf74 Bump FreeBSD_version after linuxkpi update.
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-17 09:42:42 +01:00
Emmanuel Vadot
995c3b88d4 linuxkpi: Add mmap_lock.h
This contain mmap_read_lock, mmap_read_unlock and mmap_write_lock_killable
which are abstraction around down_read, up_read and down_write_killable.
Note that in Linux 5.8 mmap_sem was renamed to mmap_lock.
We might want to do the same at some point but some drivers still uses
the old mmap locking API.

Reviewed by:	bz
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D34297
2022-02-17 09:31:51 +01:00
Emmanuel Vadot
1889bed23d linuxkpi: Add atomic64_fetch_add
Linux variant of atomic_fetchadd_64.

Reviewed by:	bz
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D34296
2022-02-17 09:31:39 +01:00
Emmanuel Vadot
8021ba6723 linuxkpi: Add orderly_poweroff
This simply poweroff the system.
Needed by drm-kmod v5.8

Reviewed by:	bz
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D34287
2022-02-17 09:31:25 +01:00
Emmanuel Vadot
e3f1af9b33 linuxkpi: Add dev_emerg
Needed by drm-kmod v5.8

Reviewed by:	bz
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D34286
2022-02-17 09:31:17 +01:00
Emmanuel Vadot
2cc3af6e1d linuxkpi: Add backlight_device_set_brightness
This simply set the brightness of a backlight device.
Needed by drm-kmod v5.8

Reviewed by:	bz, emaste
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D34285
2022-02-17 09:31:12 +01:00
Emmanuel Vadot
4f689b302f linuxkpi: Add user_write_access_*
Needed by drm-kmod v5.8

Reviewed by:	bz
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D34284
2022-02-17 09:30:55 +01:00
Emmanuel Vadot
bf7deecfe7 linuxkpi: Add list_rotate_to_front
This just calls list_move_tail.

Reviewed by:	hselasky, bz
Sponsored by:	Beckhoff Automation GmbH & Co. KG
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D34251
2022-02-17 09:30:46 +01:00
Emmanuel Vadot
cb15ed7da2 linuxkpi: Add __var_waitqueue
This returns the wait queue based on the object but in LinuxKPI
we only have one waitqueue for this.

Reviewed by:	hselasky, bz
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D34250
2022-02-17 09:30:27 +01:00
David E. O'Brien
74ca6a22f9 Document when zfree(9) was added to FreeBSD. 2022-02-16 20:03:48 -08:00
David E. O'Brien
aea2a658ef Don't delete hack.c - causes perpetual 'out of date' kernel
Deleting hack.c cause the kernel to always be out of date:

   $ make kernel
   make: /usr/src/sys/amd64/compile/GENERIC/.depend.hack.pico, 1:
	     ignoring stale .depend for hack.c
   :> hack.c
   cc -shared -O2 -pipe ... -nostdlib hack.c -o hack.pico
   rm -f hack.c
   MAKE="make" sh ../../../conf/newvers.sh "-R" GENERIC
   cc -c -O2 -pipe ...  -std=iso9899:1999 -Werror  vers.c
   ctfconvert -L VERSION -g vers.o
   linking kernel.full

Keeping hack.c in the compile directory causes no harm,
so there's no reason to delete it.

Also rename the file to "force-dyamic-hack.c" so it is
clear what the hack is aboug.

Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D34281
2022-02-16 20:02:50 -08:00
Ed Maste
e49b6ead41 Add a number of five letter words to the dictionary
(And a four letter root of one of them.)

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34299
2022-02-16 20:39:16 -05:00
Bjoern A. Zeeb
c0cadd99d1 LinuxKPI: 802.11 simplify beacon checks in rx path
In linuxkpi_ieee80211_rx() check if the frame is a beacon once upfront
and use the result for enhanced debugging and further checks.
This was done intially for rx_status->device_timestamp debugging.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-02-17 00:58:12 +00:00
Bjoern A. Zeeb
cc4e78d513 LinuxKPI: 802.11 advertise full offload scanning based on hw_scan only
We disabled hw_scan for drivers not advertising SINGLE_SCAN_ON_ALL_BANDS.
Do not depend on this hw flag to set IEEE80211_FEXT_SCAN_OFFLOAD for
net80211 as otherwise scanning will never work.
Long-term we probably want to re-think how we do/integrate hw_scan
better in net80211.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-02-17 00:15:56 +00:00
Bjoern A. Zeeb
3d09d310d9 LinuxKPI: 802.11: disable ic_headroom for the moment
There is a problem with some drivers, such as rtw88, asking for more
headroom than we currently can handle throughout the stack (we have
other legacy wireless driver in the tree with similar problems).
This may trigger an assertion in the TCP syncache where we are checking
for a reply to fit in MHLEN.
While for the moment we still copy data from mbufs to skbs,
we can simply disable the extra headroom request in ic_headroom and
deal with it ourselves (which we already did anyway).
Leave a link to the thread on freebsd-transport detailing more of the
problem so we can find it again and solve it here or there.

MFC after:	3 days
2022-02-16 23:57:27 +00:00
Simon J. Gerraty
c4bf04f40b cc-wrap.mk: fix typo in modifiers 2022-02-16 15:21:27 -08:00
Ed Maste
ef135466f8 Clean up warnings in pthread tests
I intend to move these into lib/libthr/tests/ and connect to kyua.  This
is a first step to address warnings emitted when building using standard
make infrastructure.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34306
2022-02-16 16:28:31 -05:00
Eric van Gyzen
1581ec9a45 Integrate contrib/file/tests with kyua/atf
This could be done better by making each test a separate ATF test case.
This exercise is left for the reader.

Reviewed by:	delphij (earlier version)
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34303
2022-02-16 13:02:45 -06:00
Ed Maste
089eb4ead8 readelf: add newer Linux core arm note types
Sponsored by:	The FreeBSD Foundation
2022-02-16 11:02:02 -05:00
Eric van Gyzen
4e71258227 newfs_msdos: connect the ATF test from NetBSD
NetBSD has an ATF test for newfs_msdos.  Connect it to the build.
Adapt it for FreeBSD.  This would have caught the bug fixed by my
previous commit.

Reviewed by:	delphij, emaste
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34116
2022-02-16 09:56:16 -06:00
Eric van Gyzen
9990450e17 newfs_msdos: fix type of kern.maxphys
The type of the kern.maxphys sysctl OID is now ulong.  Change the
local variable type to match.

Reviewed by:	delphij, emaste
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34116
2022-02-16 09:56:16 -06:00
Kristof Provost
995cba5a0c netinet: allow UDP tunnels to be removed
udp_set_kernel_tunneling() rejects new callbacks if one is already set.
Allow callbacks to be cleared. The use case for this is OpenVPN DCO,
where the socket is opened by userspace and then adopted by the kernel
to run the tunnel. If the DCO interface is removed but userspace does
not close the socket (something the kernel cannot prevent) the installed
callbacks could be called with an invalidated context.

Allow new functions to be set, but only if they're NULL (i.e. allow the
callback functions to be cleared).

Reviewed by:	tuexen
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34288
2022-02-16 10:59:04 +01:00
Bjoern A. Zeeb
c4f52f71de LinuxKPI: pci.h add more defines
Add and sort in more defines needed by newer drivers.

MFC after:	3 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D34293
2022-02-16 09:47:14 +00:00
Peter Holm
87000c893c stress2: Finish work on two gunion(8) test scenarios 2022-02-16 10:20:39 +01:00
Andriy Gapon
af8b51b0ba aw_mmc: add crash dumping support in MMCCAM mode
MFC after:	1 week
2022-02-16 09:58:08 +02:00
Andriy Gapon
1a93b2288c liberate wdog_kern_pat call from SW_WATCHDOG in arm minimdump code
Obviosuly, there are hardware watchdogs on arm.

MFC after:	1 week
2022-02-16 09:57:52 +02:00
Mateusz Guzik
70439285ad crypto: hide crypto_destroyreq behind a tunable
Reviewed by:	jhb, markj
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32084
2022-02-16 07:45:12 +00:00
Bjoern A. Zeeb
61a68e50d4 LinuxKPI: 802.11 enahnce linuxkpi_ieee80211_iterate_interfaces()
Add support for IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER in
linuxkpi_ieee80211_iterate_interfaces() needed by a driver.

MFC after:	3 days
2022-02-16 03:56:54 +00:00
Bjoern A. Zeeb
c5b96b3eae LinuxKPI: 802.11 assign an(y) early chandef
The Realtek driver assumes an early chandef to be set.  At the time
of linuxkpi_ieee80211_ifattach() we do not really know one yet so
try to find the first one which is available and set that.
This prevents a NULL-deref panic.

MFC after:	3 days
2022-02-16 03:48:54 +00:00
Bjoern A. Zeeb
652e22d395 LinuxKPI: 802.11: defer workq allocation until we have a name
Turned out all the workq's taskqueues were named "wlanNA" if you had
more then one card in a machine as by the time we called wiphy_name()
the device name was not set yet and we returned the fallback.

Move the alloc_ordered_workqueue() from linuxkpi_ieee80211_alloc_hw()
to linuxkpi_ieee80211_ifattach() at which time the device name has
to be set to give us a unique name.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-02-16 03:26:30 +00:00
Bjoern A. Zeeb
d3ef7fb459 LinuxKPI: 802.11 scan update
Realtek's rtw88 is returning a hard-coded 1 in case they cannot
hw_scan (fw not advertising it).  In that case if we want any scan
to run we need to fall-back to sw scan.  Start dealing with this.
Long-term we probably need to keep internal state.

MFC after:	3 days
2022-02-16 03:11:01 +00:00
Mark Johnston
26b08c5d21 armv8crypto: Use cursors to access crypto buffer data
Currently armv8crypto copies the scheme used in aesni(9), where payload
data and output buffers are allocated on the fly if the crypto buffer is
not virtually contiguous.  This scheme is simple but incurs a lot of
overhead: for an encryption request with a separate output buffer we
have to
- allocate a temporary buffer to hold the payload
- copy input data into the buffer
- copy the encrypted payload to the output buffer
- zero the temporary buffer before freeing it

We have a handy crypto buffer cursor abstraction now, so reimplement the
armv8crypto routines using that instead of temporary buffers.  This
introduces some extra complexity, but gallatin@ reports a 10% throughput
improvement with a KTLS workload without additional CPU usage.  The
driver still allocates an AAD buffer for AES-GCM if necessary.

Reviewed by:	jhb
Tested by:	gallatin
Sponsored by:	Ampere Computing LLC
Submitted by:	Klara Inc.
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D28950
2022-02-15 21:50:41 -05:00
Mark Johnston
0b3235ef74 armv8crypto: Factor out some duplicated GCM code
This is in preparation for using buffer cursors.  No functional change
intended.

Reviewed by:	jhb
Sponsored by:	Ampere Computing LLC
Submitted by:	Klara Inc.
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D28948
2022-02-15 21:47:41 -05:00
Mark Johnston
09bfa5cf16 opencrypto: Add a routine to copy a crypto buffer cursor
This was useful in converting armv8crypto to use buffer cursors.  There
are some cases where one wants to make two passes over data, and this
provides a way to "reset" a cursor.

Reviewed by:	jhb
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D28949
2022-02-15 21:47:10 -05:00
Bjoern A. Zeeb
6baea3312d LinuxKPI: skbuff updates
Various updates to skbuff for new/updated drivers and some housekeeping:
- update types and struct members, add new (stub) functions
- improve freeing of frags.
- fix an issue with sleeping during alloc for dev_alloc_skb().
- Adjust a KASSERT for skb_reserve() which apparently can be called
  multiple times if no data was put into the skb yet.
- move the sysctl from linux_8022.c (which may be in a different module)
  to linux_skbuff.c so in case we turn debugging on we do not run into
  unresolved symbols.  Rename the sysctl variable to be less conflicting
  and update debugging macros along with that; also add IMPROVE().
- add DDB support to show an skbuff.
- adjust comments/whitespace.

No functional changes intended for iwlwifi.

Sponsored by:	The FreeBSD Foundation (partially)
MFC after:	3 days
2022-02-16 02:10:10 +00:00