Commit Graph

272710 Commits

Author SHA1 Message Date
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
Bjoern A. Zeeb
2e183d999c 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
2022-02-15 23:45:15 +00:00
Bjoern A. Zeeb
064c110f4b 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
2022-02-15 23:15:00 +00:00
Rick Macklem
0f5e9425e7 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
2022-02-15 14:18:23 -08:00
Ed Maste
75e44873df 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
2022-02-15 12:55:14 -05:00
Mateusz Guzik
e68a5225e8 fd: add fde_copy
To dedup handrolled memcpy. This will be used later to make fd code
atomic-clean.
2022-02-15 17:51:08 +00:00
Mateusz Guzik
ec12b4f4ff fd: add missing seqc to dupfdopen 2022-02-15 17:51:08 +00:00
Mateusz Guzik
c9a995994b seqc: rename seqc_consistent_nomb to seqc_consistent_no_fence
For more consistency with other primitives.
2022-02-15 17:51:07 +00:00
Richard Scheffenegger
972a7d95eb 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
2022-02-15 17:36:22 +01:00
Robert Wing
4379c1da56 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
2022-02-15 08:12:15 -09:00
Jessica Clarke
9f22e0959b 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
2022-02-15 16:10:34 +00:00
Mark Johnston
235ed6a486 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
2022-02-15 09:25:34 -05:00
Mark Johnston
389a3fa693 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
2022-02-15 09:25:34 -05:00
Ed Maste
828e50092a elfctl: whitespace cleanup
Reported by:	jrm (in review D34283)
2022-02-15 08:46:14 -05:00
Li-Wen Hsu
7442b63231
if_epair: Use ANSI C definition
This fixes -Werror=strict-prototypes from gcc9

Sponsored by:	The FreeBSD Foundation
2022-02-15 21:45:22 +08:00
Ed Maste
82b611ed18 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
2022-02-15 08:42:17 -05:00
Richard Scheffenegger
0c2832ee4f 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
2022-02-15 09:24:07 +01:00
Kristof Provost
24f0bfbad5 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
2022-02-15 09:03:24 +01:00
Kristof Provost
31566b98b8 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.
2022-02-15 07:53:30 +01:00
Wei Hu
de64aa32c8 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
2022-02-15 07:27:42 +00:00
Ed Maste
b8185579f4 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
2022-02-14 22:35:03 -05:00
Ed Maste
f0cf9b602d elfctl: error if -e is specified multiple times
Reported by:	jrm
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-02-14 22:08:47 -05:00
Bjoern A. Zeeb
05f0b24bfb 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.
2022-02-14 23:55:16 +00:00
Bjoern A. Zeeb
fa6d3522b5 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
2022-02-14 23:53:17 +00:00
Bjoern A. Zeeb
97009980c4 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
2022-02-14 23:51:51 +00:00
Bjoern A. Zeeb
cee56e77d7 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
2022-02-14 23:48:31 +00:00