]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agocxgbe(4): Changes to the fatal error handler.
Navdeep Parhar [Fri, 4 Feb 2022 21:16:35 +0000 (13:16 -0800)]
cxgbe(4): Changes to the fatal error handler.

* New error_flags that can be used from the error ithread and elsewhere
  without a synch_op.
* Stop the adapter immediately in t4_fatal_err but defer most of the
  rest of the handling to a task.  The task is allowed to sleep, unlike
  the ithread.  Remove async_event_task as it is no longer needed.
* Dump the devlog, CIMLA, and PCIE_FW exactly once on any fatal error
  involving the firmware or the CIM block.  While here, dump some
  additional info (see dump_cim_regs) for these errors.
* If both reset_on_fatal_err and panic_on_fatal_err are set then attempt
  a reset first and do not panic the system if it is successful.

MFC after: 1 week
Sponsored by: Chelsio Communications

2 years agouname: -v: strip final whitespace compatibly with uname(3)
наб [Fri, 18 Feb 2022 13:34:40 +0000 (14:34 +0100)]
uname: -v: strip final whitespace compatibly with uname(3)

This restores POSIX.1 conformance

PR: 260938

2 years agosctp: improve robustness
Michael Tuexen [Fri, 18 Feb 2022 13:30:07 +0000 (14:30 +0100)]
sctp: improve robustness

MFC after: 3 days

2 years agosctp: cleanup, no functional change intended.
Michael Tuexen [Fri, 18 Feb 2022 13:20:01 +0000 (14:20 +0100)]
sctp: cleanup, no functional change intended.

MFC after: 3 days

2 years agodiff: fix failed compare when ignoring file case
Tom Jones [Fri, 18 Feb 2022 15:21:23 +0000 (15:21 +0000)]
diff: fix failed compare when ignoring file case

With --ignore-file-name-case we need to compare files regardless of
case. We need to propigate both names down to diffit so we can look up
the correct file when the names differ based on case, otherwise we try
to look up the file using the case from the a tree which might not be
discoverable if its case is different in the b tree.

Reviewed by: bapt
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D34201

2 years agoRemove surplus check for which diff is being tested
Tom Jones [Fri, 18 Feb 2022 15:47:46 +0000 (15:47 +0000)]
Remove surplus check for which diff is being tested

Must have left this when I was testing the test invocation for
8f79bd9b85716c495c2741ac25db37e8d71f22f7

Pointy hat: thj
Sponsored by: Klara Inc.

2 years agodiff: add --no-dereference flag
Tom Jones [Fri, 18 Feb 2022 15:13:13 +0000 (15:13 +0000)]
diff: add --no-dereference flag

When diffing files and directories, don't follow symbolic links, instead
compare where the links point to.

Reviewed by: bapt
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D34203

2 years agodiff: Detect Objective-C methods
Tom Jones [Fri, 18 Feb 2022 15:07:52 +0000 (15:07 +0000)]
diff: Detect Objective-C methods

When searching back for function definitions, consider lines starting
with '+' and '-', this allows us to pick up Objective-C methods as well
as C style function definitions.

Reviewed by: bapt
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D34202

2 years agosctp: remove unused parameter
Michael Tuexen [Fri, 18 Feb 2022 11:20:44 +0000 (12:20 +0100)]
sctp: remove unused parameter

MFC after: 3 days

2 years agovtfontcvt: update FreeBSD Foundation copyrights
Ed Maste [Fri, 18 Feb 2022 01:04:29 +0000 (20:04 -0500)]
vtfontcvt: update FreeBSD Foundation copyrights

Remove "All Rights Reserved"

2 years agounbound: Vendor import 1.15.0
Cy Schubert [Fri, 18 Feb 2022 00:05:15 +0000 (16:05 -0800)]
unbound: Vendor import 1.15.0

Vendor import GA release of unbound 1.15.0.

MFC after:      2 weeks

2 years agounbound: Vendor import 1.15.0
Cy Schubert [Thu, 17 Feb 2022 22:47:14 +0000 (14:47 -0800)]
unbound: Vendor import 1.15.0

2 years agosctp: fix a signed/unsigned mismatch.
Michael Tuexen [Thu, 17 Feb 2022 21:44:41 +0000 (22:44 +0100)]
sctp: fix a signed/unsigned mismatch.

MFC after: 3 days

2 years agoAdd support for getting early entropy from UEFI
Colin Percival [Thu, 17 Feb 2022 21:01:11 +0000 (13:01 -0800)]
Add support for getting early entropy from UEFI

UEFI provides a protocol for accessing randomness. This is a good way
to gather early entropy, especially when there's no driver for the RNG
on the platform (as is the case on the Marvell Armada8k (MACCHIATObin)
for now).

If the entropy_efi_seed option is enabled in loader.conf (default: YES)
obtain 2048 bytes of entropy from UEFI and pass is to the kernel as a
"module" of name "efi_rng_seed" and type "boot_entropy_platform"; if
present, ingest it into the kernel RNG.

Submitted by: Greg V
Reviewed by: markm, kevans
Approved by: csprng (markm)
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D20780

2 years agoAdd myself (asiciliano) as src committer and bapt as my mentor
Alfonso S. Siciliano [Thu, 17 Feb 2022 18:45:11 +0000 (19:45 +0100)]
Add myself (asiciliano) as src committer and bapt as my mentor

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D34310

2 years agoarmv8crypto: Remove leftover debug printfs
Mark Johnston [Thu, 17 Feb 2022 19:19:23 +0000 (14:19 -0500)]
armv8crypto: Remove leftover debug printfs

Fixes: 26b08c5d21b5 ("armv8crypto: Use cursors to access crypto buffer data")
Reported by: bz

2 years agomd(4): Add dummy support of the BIO_FLUSH command for malloc and swap
Aleksandr Fedorov [Thu, 17 Feb 2022 19:21:56 +0000 (22:21 +0300)]
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

2 years agosctp: avoid undefined behaviour and cleanup the code.
Michael Tuexen [Thu, 17 Feb 2022 18:23:59 +0000 (19:23 +0100)]
sctp: avoid undefined behaviour and cleanup the code.

MFC after: 3 days

2 years agounbound: Refresh manpages to latest version
Cy Schubert [Thu, 17 Feb 2022 16:11:33 +0000 (08:11 -0800)]
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

2 years agoelfdump: handle small files more gracefully
Eric van Gyzen [Thu, 17 Feb 2022 15:53:48 +0000 (09:53 -0600)]
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

2 years agoLinuxKPI: implement dma_sync_single_for_*, apply to (un)map single/sg
Bjoern A. Zeeb [Fri, 1 Oct 2021 10:51:50 +0000 (10:51 +0000)]
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

2 years agopf tests: Test per-anchor tables
Kristof Provost [Thu, 17 Feb 2022 13:13:50 +0000 (14:13 +0100)]
pf tests: Test per-anchor tables

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agopf tests: remove a stray 'set -x'
Kristof Provost [Thu, 17 Feb 2022 12:40:41 +0000 (13:40 +0100)]
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")

2 years agomlx5en: Improve CQE error debugging.
Hans Petter Selasky [Thu, 17 Feb 2022 11:50:22 +0000 (12:50 +0100)]
mlx5en: Improve CQE error debugging.

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agomlx5en: Fix TLS worker thread race.
Hans Petter Selasky [Thu, 17 Feb 2022 11:48:57 +0000 (12:48 +0100)]
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

2 years agomlx5en: Improve RX- and TX- TLS refcounting.
Hans Petter Selasky [Thu, 17 Feb 2022 11:47:20 +0000 (12:47 +0100)]
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

2 years agomlx5en: Add missing refcount decrement on link-down.
Hans Petter Selasky [Thu, 17 Feb 2022 11:45:25 +0000 (12:45 +0100)]
mlx5en: Add missing refcount decrement on link-down.

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agofreebsd-update.conf.5: Sort options
Mateusz Piotrowski [Thu, 17 Feb 2022 09:54:07 +0000 (10:54 +0100)]
freebsd-update.conf.5: Sort options

Reported by: pauamma_gundo.com
MFC after: 1 week

2 years agofreebsd-update.conf.5: Address style issues
Mateusz Piotrowski [Thu, 17 Feb 2022 09:40:48 +0000 (10:40 +0100)]
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

2 years agofreebsd-update.8: Document CreateBootEnv
Mateusz Piotrowski [Fri, 4 Feb 2022 10:20:49 +0000 (11:20 +0100)]
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: f28f13890541 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]

2 years agoBump FreeBSD_version after linuxkpi update.
Emmanuel Vadot [Thu, 17 Feb 2022 08:42:42 +0000 (09:42 +0100)]
Bump FreeBSD_version after linuxkpi update.

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agolinuxkpi: Add mmap_lock.h
Emmanuel Vadot [Wed, 16 Feb 2022 10:26:14 +0000 (11:26 +0100)]
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

2 years agolinuxkpi: Add atomic64_fetch_add
Emmanuel Vadot [Wed, 16 Feb 2022 09:44:55 +0000 (10:44 +0100)]
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

2 years agolinuxkpi: Add orderly_poweroff
Emmanuel Vadot [Tue, 15 Feb 2022 11:06:26 +0000 (12:06 +0100)]
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

2 years agolinuxkpi: Add dev_emerg
Emmanuel Vadot [Tue, 15 Feb 2022 11:05:56 +0000 (12:05 +0100)]
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

2 years agolinuxkpi: Add backlight_device_set_brightness
Emmanuel Vadot [Tue, 15 Feb 2022 11:05:07 +0000 (12:05 +0100)]
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

2 years agolinuxkpi: Add user_write_access_*
Emmanuel Vadot [Tue, 15 Feb 2022 11:04:40 +0000 (12:04 +0100)]
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

2 years agolinuxkpi: Add list_rotate_to_front
Emmanuel Vadot [Fri, 11 Feb 2022 15:10:08 +0000 (16:10 +0100)]
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

2 years agolinuxkpi: Add __var_waitqueue
Emmanuel Vadot [Fri, 11 Feb 2022 10:33:59 +0000 (11:33 +0100)]
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

2 years agoDocument when zfree(9) was added to FreeBSD.
David E. O'Brien [Thu, 17 Feb 2022 04:03:48 +0000 (20:03 -0800)]
Document when zfree(9) was added to FreeBSD.

2 years agoDon't delete hack.c - causes perpetual 'out of date' kernel
David E. O'Brien [Mon, 14 Feb 2022 02:24:36 +0000 (18:24 -0800)]
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

2 years agoAdd a number of five letter words to the dictionary
Ed Maste [Wed, 16 Feb 2022 13:47:33 +0000 (08:47 -0500)]
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

2 years agoLinuxKPI: 802.11 simplify beacon checks in rx path
Bjoern A. Zeeb [Thu, 17 Feb 2022 00:58:12 +0000 (00:58 +0000)]
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

2 years agoLinuxKPI: 802.11 advertise full offload scanning based on hw_scan only
Bjoern A. Zeeb [Thu, 17 Feb 2022 00:15:56 +0000 (00:15 +0000)]
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

2 years agoLinuxKPI: 802.11: disable ic_headroom for the moment
Bjoern A. Zeeb [Wed, 16 Feb 2022 23:57:27 +0000 (23:57 +0000)]
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

2 years agocc-wrap.mk: fix typo in modifiers
Simon J. Gerraty [Wed, 16 Feb 2022 23:21:27 +0000 (15:21 -0800)]
cc-wrap.mk: fix typo in modifiers

2 years agoClean up warnings in pthread tests
Ed Maste [Wed, 16 Feb 2022 21:10:45 +0000 (16:10 -0500)]
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

2 years agoIntegrate contrib/file/tests with kyua/atf
Eric van Gyzen [Wed, 16 Feb 2022 15:50:43 +0000 (09:50 -0600)]
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

2 years agoreadelf: add newer Linux core arm note types
Ed Maste [Wed, 16 Feb 2022 16:00:57 +0000 (11:00 -0500)]
readelf: add newer Linux core arm note types

Sponsored by: The FreeBSD Foundation

2 years agonewfs_msdos: connect the ATF test from NetBSD
Eric van Gyzen [Mon, 31 Jan 2022 20:43:04 +0000 (14:43 -0600)]
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

2 years agonewfs_msdos: fix type of kern.maxphys
Eric van Gyzen [Mon, 31 Jan 2022 20:34:17 +0000 (14:34 -0600)]
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

2 years agonetinet: allow UDP tunnels to be removed
Kristof Provost [Tue, 15 Feb 2022 10:49:39 +0000 (11:49 +0100)]
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

2 years agoLinuxKPI: pci.h add more defines
Bjoern A. Zeeb [Tue, 15 Feb 2022 23:51:40 +0000 (23:51 +0000)]
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

2 years agostress2: Finish work on two gunion(8) test scenarios
Peter Holm [Wed, 16 Feb 2022 09:20:39 +0000 (10:20 +0100)]
stress2: Finish work on two gunion(8) test scenarios

2 years agoaw_mmc: add crash dumping support in MMCCAM mode
Andriy Gapon [Wed, 16 Feb 2022 07:56:06 +0000 (09:56 +0200)]
aw_mmc: add crash dumping support in MMCCAM mode

MFC after: 1 week

2 years agoliberate wdog_kern_pat call from SW_WATCHDOG in arm minimdump code
Andriy Gapon [Wed, 16 Feb 2022 07:53:42 +0000 (09:53 +0200)]
liberate wdog_kern_pat call from SW_WATCHDOG in arm minimdump code

Obviosuly, there are hardware watchdogs on arm.

MFC after: 1 week

2 years agocrypto: hide crypto_destroyreq behind a tunable
Mateusz Guzik [Wed, 16 Feb 2022 07:45:12 +0000 (07:45 +0000)]
crypto: hide crypto_destroyreq behind a tunable

Reviewed by: jhb, markj
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D32084

2 years agoLinuxKPI: 802.11 enahnce linuxkpi_ieee80211_iterate_interfaces()
Bjoern A. Zeeb [Wed, 16 Feb 2022 03:56:54 +0000 (03:56 +0000)]
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

2 years agoLinuxKPI: 802.11 assign an(y) early chandef
Bjoern A. Zeeb [Wed, 16 Feb 2022 03:48:54 +0000 (03:48 +0000)]
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

2 years agoLinuxKPI: 802.11: defer workq allocation until we have a name
Bjoern A. Zeeb [Wed, 16 Feb 2022 03:20:29 +0000 (03:20 +0000)]
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

2 years agoLinuxKPI: 802.11 scan update
Bjoern A. Zeeb [Wed, 16 Feb 2022 03:00:34 +0000 (03:00 +0000)]
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

2 years agoarmv8crypto: Use cursors to access crypto buffer data
Mark Johnston [Wed, 16 Feb 2022 02:50:41 +0000 (21:50 -0500)]
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

2 years agoarmv8crypto: Factor out some duplicated GCM code
Mark Johnston [Wed, 16 Feb 2022 02:45:59 +0000 (21:45 -0500)]
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

2 years agoopencrypto: Add a routine to copy a crypto buffer cursor
Mark Johnston [Wed, 16 Feb 2022 02:45:32 +0000 (21:45 -0500)]
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

2 years agoLinuxKPI: skbuff updates
Bjoern A. Zeeb [Wed, 16 Feb 2022 02:10:10 +0000 (02:10 +0000)]
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

2 years agoLinuxKPI: 802.11 header updates and add/adjust source dependencies.
Bjoern A. Zeeb [Tue, 15 Feb 2022 23:45:15 +0000 (23:45 +0000)]
LinuxKPI: 802.11 header updates and add/adjust source dependencies.

This update is for more/newer versions of drivers:
- add and properly place more structs, enums, defines needed by drivers.
- correct types of struct fields.
- make various function arguments const.
- move REG_RULE() macro to its own file regulatory.h and
  use macros for calculations.
- add linuxkpi_ieee80211_get_channel() implementation.
- change linuxkpi_ieee80211_ifattach() to return int for error checking.

No intended functional changes for iwlwifi.

Sponsored by: The FreeBSD Foundation (partially)
MFC after: 3 days

2 years agoLinuxKPI: lockdep add lockdep_assert_not_held()
Bjoern A. Zeeb [Wed, 9 Feb 2022 12:01:32 +0000 (12:01 +0000)]
LinuxKPI: lockdep add lockdep_assert_not_held()

Add lockdep_assert_not_held() asserting LA_UNLOCKED as needed by a
driver.

MFC after: 3 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D34232

2 years agogssd: Modify /etc/rc.d/gssd so that it starts after NETWORKING
Rick Macklem [Tue, 15 Feb 2022 22:18:23 +0000 (14:18 -0800)]
gssd: Modify /etc/rc.d/gssd so that it starts after NETWORKING

Arno Tuber reported via email that he needed to restart the gssd daemon
after booting, to get his Kerberized NFS mount to work.

Without this patch, rcorder shows that the gssd starts before NETWORKING
and kdc. The gssd will need NETWORKING to connect to the KDC and, if
the kdc is running on the same system, it does not make sense to start it
before the kdc.  This fixed the problem for Arno.

While here, I also added a "# BEFORE: mountcritremote".
It does not affect ordering at this time, but I felt
it should be added, since the gssd needs to be running
when remote NFS mounts are done.

PR: 261939
Reported by: anothatuber@gmail.com
Tested by: anothatuber@gmail.com
Reviewed by: rew
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34265

2 years agoCirrus-CI: add a manual amd64-gcc9 build and smoketest job
Ed Maste [Mon, 14 Feb 2022 20:02:08 +0000 (15:02 -0500)]
Cirrus-CI: add a manual amd64-gcc9 build and smoketest job

Allow users to test changes and find GCC-specific issues using Cirrus-CI
against their own GitHub forks.

Reviewed by: lwhsu, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34289

2 years agofd: add fde_copy
Mateusz Guzik [Mon, 14 Feb 2022 15:43:19 +0000 (16:43 +0100)]
fd: add fde_copy

To dedup handrolled memcpy. This will be used later to make fd code
atomic-clean.

2 years agofd: add missing seqc to dupfdopen
Mateusz Guzik [Mon, 14 Feb 2022 15:33:24 +0000 (16:33 +0100)]
fd: add missing seqc to dupfdopen

2 years agoseqc: rename seqc_consistent_nomb to seqc_consistent_no_fence
Mateusz Guzik [Mon, 14 Feb 2022 18:50:37 +0000 (19:50 +0100)]
seqc: rename seqc_consistent_nomb to seqc_consistent_no_fence

For more consistency with other primitives.

2 years agoiscsi: Use calloutng instead of ticks in iscsi initiator
Richard Scheffenegger [Tue, 15 Feb 2022 16:35:47 +0000 (17:35 +0100)]
iscsi: Use calloutng instead of ticks in iscsi initiator

callout *_sbt functions are used to reduce ping/timeout scheduling
overhead, while allowing later improvments in the functionality.
Keep similar 1000ms callouts while adding a 10 ms window, to allow
some kernel scheduling improvements.

Reviewed By: jhb
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34222

2 years agobhyve/snapshot: use a string for cmd element in the nvlist
Robert Wing [Tue, 15 Feb 2022 17:12:15 +0000 (08:12 -0900)]
bhyve/snapshot: use a string for cmd element in the nvlist

The nvlist for a checkpoint request will now look like:

    { cmd="checkpoint", suspend="true/false", filename="afilename" }

Reviewed by: jhb
Suggested by:   jhb
Differential Revision: https://reviews.freebsd.org/D34237

2 years agolibpmc: Allow specifying explicit EVENT_xxH events on armv7 and arm64
Jessica Clarke [Tue, 15 Feb 2022 16:10:34 +0000 (16:10 +0000)]
libpmc: Allow specifying explicit EVENT_xxH events on armv7 and arm64

This is useful for processors where we don't have an event table; in
those cases we default to a Cortex A8 (armv7) or Cortex A53 (arm64) in
order to attempt to provide something useful, but you're then limited to
the counters in those tables, some of which may also not be implemented
(e.g. LD/ST_RETIRED are no longer implemented in more recent cores,
replaced by LD/ST_SPEC).

Adding the raw EVENT_xxH event lists to each table ensures that you can
always request the exact events you want, regardless of what has been
detected or is known.

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33805

2 years agomlx5e: Make TLS tag zones unmanaged
Mark Johnston [Tue, 15 Feb 2022 14:03:31 +0000 (09:03 -0500)]
mlx5e: Make TLS tag zones unmanaged

These zones are cache zones used to allocate TLS offload contexts from
firmware.  Releasing items from the cache is a sleepable operation due
to the need to await a response from the firmware command freeing the
tag, so items cannot be reclaimed from the zone in non-sleepable
contexts.  Since the cache size is limited by firmware limits, avoid
this by setting UMA_ZONE_UNMANAGED to avoid reclamation by uma_timeout()
and the low memory handler.

Reviewed by: hselasky, kib
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34142

2 years agouma: Add UMA_ZONE_UNMANAGED
Mark Johnston [Tue, 15 Feb 2022 13:57:22 +0000 (08:57 -0500)]
uma: Add UMA_ZONE_UNMANAGED

Allow a zone to opt out of cache size management.  In particular,
uma_reclaim() and uma_reclaim_domain() will not reclaim any memory from
the zone, nor will uma_timeout() purge cached items if the zone is idle.
This effectively means that the zone consumer has control over when
items are reclaimed from the cache.  In particular, uma_zone_reclaim()
will still reclaim cached items from an unmanaged zone.

Reviewed by: hselasky, kib
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34142

2 years agoelfctl: whitespace cleanup
Ed Maste [Tue, 15 Feb 2022 13:45:05 +0000 (08:45 -0500)]
elfctl: whitespace cleanup

Reported by: jrm (in review D34283)

2 years agoif_epair: Use ANSI C definition
Li-Wen Hsu [Tue, 15 Feb 2022 13:45:22 +0000 (21:45 +0800)]
if_epair: Use ANSI C definition

This fixes -Werror=strict-prototypes from gcc9

Sponsored by: The FreeBSD Foundation

2 years agoelfctl: fix operations with multiple features on multiple files
Ed Maste [Tue, 15 Feb 2022 03:44:01 +0000 (22:44 -0500)]
elfctl: fix operations with multiple features on multiple files

Previously an invocation like

  elfctl -e +feature1,feature2 file1 file2

would set both feature flags in file 1 but only feature1 in file2 (due
to the string being modified by strsep()).

Reported by: jrm
Tested by: jrm
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34283

2 years agotcp: Restore 6 tcps padding entries in HEAD
Richard Scheffenegger [Tue, 15 Feb 2022 07:56:49 +0000 (08:56 +0100)]
tcp: Restore 6 tcps padding entries in HEAD

The padding in CURRENT shall not shrink. It is
designed that in CURRENT at always stays
the same, and then when a new stable is branched, it
inherits 6 pointer placeholders that can be used
withing this stable/X lifetime to extend the structure.

Reviewed By: tuexen, #transport
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34269

2 years agoif_epair: implement fanout
Kristof Provost [Thu, 9 Dec 2021 13:24:13 +0000 (14:24 +0100)]
if_epair: implement fanout

Allow multiple cores to be used to process if_epair traffic. We do this
(if RSS is enabled) based on the RSS hash of the incoming packet. This
allows us to distribute the load over multiple cores, rather than
sending everything to the same one.

We also switch from swi_sched() to taskqueues, which also contributes to
better throughput.

Benchmark results:
With net.isr.maxthreads=-1

Setup A: (cc0 - bridge0 - epair0a) (epair0b - bridge1 - cc1)

Before          627 Kpps
After (no RSS)  1.198 Mpps
After (RSS)     3.148 Mpps

Setup B: (cc0 - bridge0 - epaira0) (epair0b - vnet jail - epair1a) (epair1b - bridge1 - cc1)

Before          7.705 Kpps
After (no RSS)  1.017 Mpps
After (RSS)     2.083 Mpps

MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D33731

2 years agovlan tests: fix bpf_pcp test
Kristof Provost [Tue, 15 Feb 2022 06:52:45 +0000 (07:52 +0100)]
vlan tests: fix bpf_pcp test

We now allow net.link.vlan.mtag_pcp to be set per-vnet, so we must set
it in the correct vnet, not on the host.

2 years agomana: Add handling of CQE_RX_TRUNCATED
Wei Hu [Tue, 15 Feb 2022 07:07:31 +0000 (23:07 -0800)]
mana: Add handling of CQE_RX_TRUNCATED

The proper way to drop this kind of CQE is advancing rxq tail
without indicating the packet to the upper network layer.

MFC after: 2 weeks
Sponsored by: Microsoft

2 years agoelfctl: fix -e invalid operation error handling
Ed Maste [Tue, 15 Feb 2022 03:30:29 +0000 (22:30 -0500)]
elfctl: fix -e invalid operation error handling

Validate the operation prior to parsing the feature string, so that e.g.
-e 0x1 reports invalid operation '0' rather than invalid feature 'x11'.
Also make it an error rather than a warning, so that it is not repeated
if multiple files are specified.

(Previously an invalid operation resulted in a segfault.)

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

2 years agoelfctl: error if -e is specified multiple times
Ed Maste [Tue, 15 Feb 2022 03:04:29 +0000 (22:04 -0500)]
elfctl: error if -e is specified multiple times

Reported by: jrm
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

2 years agoBump __FreeBSD_version to 1400052 for LinuxKPI changes.
Bjoern A. Zeeb [Mon, 14 Feb 2022 23:55:16 +0000 (23:55 +0000)]
Bump __FreeBSD_version to 1400052 for LinuxKPI changes.

Add a marker after GUID_INIT() and linux/pm_qos.h were added, so
that future version of drm-kmod can selectively remove these bits.
The latest port version does not require user updates for this so
no UPDATING entry.

2 years agoLinuxKPI: add linux/pm_qos.h
Bjoern A. Zeeb [Wed, 9 Feb 2022 12:07:44 +0000 (12:07 +0000)]
LinuxKPI: add linux/pm_qos.h

Add a linux/pm_qos.h with three dummy functions and a struct as needed
by a driver and drm-kmod [1] with no intend to support this for the moment.

Submitted by: wulf (drm-kmod bits) [1]
Sponsored by: The FreeBSD Foundation (drm-kmod requested updates)
MFC after: 3 days
Reviewed by: hselasky (earlier version), wulf
Differential Revision: https://reviews.freebsd.org/D34234

2 years agoLinuxKPI: add UUID_STRING_LEN and GUID_INIT to uuid.h
Bjoern A. Zeeb [Wed, 9 Feb 2022 12:10:59 +0000 (12:10 +0000)]
LinuxKPI: add UUID_STRING_LEN and GUID_INIT to uuid.h

Add a definition for UUID_STRING_LEN to uuid.h as needed by a driver.
Also add GUID_INIT for drm-kmod [1].

Submitted by: wulf [1]
MFC after: 3 days
Reviewed by: hselasky (earlier), wulf
Differential Revision: https://reviews.freebsd.org/D34235

2 years agoLinuxKPI: 802.11: get rid of lkpi_ic_getradiocaps warnings
Bjoern A. Zeeb [Mon, 14 Feb 2022 22:29:38 +0000 (22:29 +0000)]
LinuxKPI: 802.11: get rid of lkpi_ic_getradiocaps warnings

Users are seeing warnings about 2 channels (1 per band)
triggered by an ioctl from wpa_supplicant usually:
lkpi_ic_getradiocaps: Adding chan ... returned error 55
This was an early FAQ.

Check the current number of channels against maxchans and the return
code from net80211. In case net80211 reports that we reached the limit
do not print the warning and do not try to add further channels.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agopf tests: Basic 'set prio' test
Kristof Provost [Mon, 14 Feb 2022 17:44:15 +0000 (18:44 +0100)]
pf tests: Basic 'set prio' test

The ability to set VLAN PCP from pf was introduced in 3e248e0fb4, but
never had a test added.

Create a basic setup to set the PCP to an arbitrary value and use
tcpdump to check it's actually set.

MFC after: 1 week

2 years agovlan: allow net.link.vlan.mtag_pcp to be set per vnet
Kristof Provost [Mon, 14 Feb 2022 19:09:54 +0000 (20:09 +0100)]
vlan: allow net.link.vlan.mtag_pcp to be set per vnet

The primary reason for this change is to facilitate testing.

MFC after: 1 week

2 years agopf: fix set_prio after nv conversion
Franco Fichtner [Mon, 14 Feb 2022 19:26:39 +0000 (20:26 +0100)]
pf: fix set_prio after nv conversion

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34266

2 years agonet80211: enhance (disabled) debugging
Bjoern A. Zeeb [Mon, 14 Feb 2022 22:16:59 +0000 (22:16 +0000)]
net80211: enhance (disabled) debugging

Add maxchans to the disabled debugging in addchan() and copychan_prev()
to aid debugging possible errors rreturned due to reaching maxchans
limits.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoveriexec(8): explain that only a unique prefix is required
Simon J. Gerraty [Mon, 14 Feb 2022 21:52:40 +0000 (13:52 -0800)]
veriexec(8): explain that only a unique prefix is required

When setting or querying state it is sufficient to
provide only enough of the state name to be unambiguous.

2 years agoCirrus-CI: use qemu-nox11
Ed Maste [Mon, 14 Feb 2022 20:14:02 +0000 (15:14 -0500)]
Cirrus-CI: use qemu-nox11

We use -nographic for the smoke test and there is no need to pull in all
of the x11 deps.  This saves some time and bandwidth during package
installation.

When I originally added Cirrus-CI support the -nox11 package was not
available.

Sponsored by: The FreeBSD Foundation

2 years agoDisable -Wreturn-type on GCC.
John Baldwin [Mon, 14 Feb 2022 19:48:47 +0000 (11:48 -0800)]
Disable -Wreturn-type on GCC.

GCC is more pedantic than clang about warning when a function doesn't
handle undefined enum values (see GCC bug 87950).  Clang's warning
gives a more pragmatic coverage and should find any real bugs, so
disable the warning for GCC rather than adding __unreachable
annotations to appease GCC.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D34147

2 years agoimprove c style
Wolfram Schneider [Mon, 14 Feb 2022 19:30:09 +0000 (19:30 +0000)]
improve c style

- BSD KNF: return is a native statement and we use
  a space before the parenthesis
- remove superfluous empty lines

Reported by:    jrtc27

2 years agovt.4: clarify that a KMS driver switches to graphics mode
Ed Maste [Mon, 14 Feb 2022 19:03:52 +0000 (14:03 -0500)]
vt.4: clarify that a KMS driver switches to graphics mode

PR: 261909
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

2 years agoUse vmspace->vm_stacktop in place of sv_usrstack in more places.
John Baldwin [Mon, 14 Feb 2022 18:57:30 +0000 (10:57 -0800)]
Use vmspace->vm_stacktop in place of sv_usrstack in more places.

Reviewed by: markj
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D34174