Commit Graph

280609 Commits

Author SHA1 Message Date
Konstantin Belousov
25b18d8935 libcxx: use __SIZEOF_LONG__ == 8 instead of __LP64__
for CHERI.

Requested by:	arichardson
Reviewed by:	arichardson, emaste, imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38178
2023-01-25 03:19:27 +02:00
Przemyslaw Lewandowski
9147969bc2
iflib: Add null check to iflib_stop()
Ever since gtaskqueue_drain() was added to iflib_stop(), a kernel panic
occurs when the ice(4) driver is in recovery mode. Queues are not
initialized in this mode, so gt_taskqueue is not initialized, and
gtaskqueue_drain() will panic.

Fix this by only doing a drain if an RX queue's gt_taskqueue is
initialized.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	erj@
MFC after:	1 week
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D37892
2023-01-24 15:45:15 -08:00
Eric Joyner
2508da22cd
ice_ddp: Update package to 1.3.30.0
This updated DDP is intended to be used with the forthcoming ice(4)
driver update to 1.37.7-k. (But it will still work with the current
version.)

Co-authored-by: Piotr Kubaj <pkubaj@FreeBSD.org>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>

MFC after:	1 week
Sponsored by:	Intel Corporation
2023-01-24 14:19:54 -08:00
Justin Hibbits
ff06a8dbb6 Mechanically convert ixgbe(4) to IfAPI
Reviewed by:	erj
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37845
2023-01-24 15:05:28 -05:00
Justin Hibbits
0083fc5c76 Mechanically convert dtsec(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37815
2023-01-24 15:05:28 -05:00
Justin Hibbits
053a24d12c debugnet: Add ifnet accessor to set debugnet methods
As part of the effort to hide the internals of the ifnet struct, convert
the DEBUGNET_SET() macro to use an accessor instead of directly touching
the methods member.

Reviewed by:	glebius (older version)
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38105
2023-01-24 15:03:35 -05:00
Justin Hibbits
2c2b37ad25 ifnet/API: Move struct ifnet definition to a <net/if_private.h>
Hide the ifnet structure definition, no user serviceable parts inside,
it's a netstack implementation detail.  Include it temporarily in
<net/if_var.h> until all drivers are updated to use the accessors
exclusively.

Reviewed by:	glebius
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38046
2023-01-24 14:36:30 -05:00
Justin Hibbits
fa25dbfd98 ifnet API: Change if_init() to take context argument
Some drivers, like iflib drivers, take a 'context' argument instead of a
ifnet argument, as a single interface may have multiple contexts.
Follow this scheme by passing the context argument down.  Most drivers
will likely pass 'ifp' as the context.

Reviewed by:	glebius
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38102
2023-01-24 14:36:30 -05:00
Justin Hibbits
2e6a8c1ae3 Mechanically convert etherswitch drivers to IfAPI
Reviewed by:	kd
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37813
2023-01-24 14:36:29 -05:00
Justin Hibbits
d8096b2df2 Mechanically convert iavf(4) to IfAPI
Reviewed by:	erj
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37858
2023-01-24 14:36:29 -05:00
Justin Hibbits
8680326022 Mechanically convert ixl(4) to IfAPI
Reviewed by:	erj
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37857
2023-01-24 14:36:29 -05:00
Justin Hibbits
992fa62b23 Mechanically convert neta(4) to IfAPI
Reviewed by:	mw
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37825
2023-01-24 14:36:28 -05:00
Justin Hibbits
2c7bc0f551 Mechanically convert if_cpsw(4) to IfAPI
Reviewed By:	manu
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37789
2023-01-24 14:36:28 -05:00
Justin Hibbits
4ee967921a Mechanically convert if_vtnet(4) to IfAPI
Reviewed By:	bryanv
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37799
2023-01-24 14:36:28 -05:00
Justin Hibbits
c2a4666cd3 Mechanically convert if_emac(4) to IfAPI
Reviewed by:	manu
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37788
2023-01-24 14:35:33 -05:00
Justin Hibbits
759ad4dd8a Convert xl(4) to IfAPI
Reviewed by:	melifaro
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37785
2023-01-24 14:35:32 -05:00
Michal Gulbicki
a977168c48 qat: Add Intel® 4xxx Series platform support
Overview:
Intel(R) QuickAssist Technology (Intel(R) QAT) provides hardware
acceleration for offloading security, authentication and compression
services from the CPU, thus significantly increasing the performance and
efficiency of standard platform solutions.

This commit introduces:
- Intel® 4xxx Series platform support.
- QuickAssist kernel API implementation update for Generation 4 device.
  Enabled services: symmetric cryptography and data compression.
- Increased default number of crypto instances in static configuration
  for performance purposes.

OCF backend changes:
- changed GCM/CCM MAC validation policy to generate MAC by HW
  and validate by SW due to the QAT HW limitations.

Patch co-authored by: Krzysztof Zdziarski <krzysztofx.zdziarski@intel.com>
Patch co-authored by: Michal Jaraczewski <michalx.jaraczewski@intel.com>
Patch co-authored by: Michal Gulbicki <michalx.gulbicki@intel.com>
Patch co-authored by: Julian Grajkowski <julianx.grajkowski@intel.com>
Patch co-authored by: Piotr Kasierski <piotrx.kasierski@intel.com>
Patch co-authored by: Adam Czupryna <adamx.czupryna@intel.com>
Patch co-authored by: Konrad Zelazny <konradx.zelazny@intel.com>
Patch co-authored by: Katarzyna Rucinska <katarzynax.kargol@intel.com>
Patch co-authored by: Lukasz Kolodzinski <lukaszx.kolodzinski@intel.com>
Patch co-authored by: Zbigniew Jedlinski <zbigniewx.jedlinski@intel.com>

Sponsored by:	Intel Corporation
Reviewed by:	markj, jhb
Differential Revision:	https://reviews.freebsd.org/D36254
2023-01-24 10:33:50 -05:00
Christos Margiolis
2d3515d61e mixer(3): Add HEADNAME to TAILQ_HEAD declarations in man page
Forgot to modify the man page in commit 249526dace.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38118
2023-01-24 09:10:49 -05:00
Domagoj Stolfa
7c5bc69a1a dtrace: Improve a verifier error message
Using '%r0' in efunc causes it to parse %r as a 'r' specifier.

This diff just adds a '%' in front of '%r0' in order to create the
correct output.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38176
2023-01-24 09:09:27 -05:00
Dag-Erling Smørgrav
14ebab25e1 find: Logic nit in man page.
Arguments follow primaries, not the other way around.

MFC after:	1 week
Sponsored by:	Klara, Inc.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38173
2023-01-24 09:53:35 +01:00
Kristof Provost
ecdd0b48cb dtrace: remove stray {
Fixes:	da81cc6035
PR:	269128
2023-01-24 08:39:37 +01:00
Kristof Provost
cd80c52cad pfctl: rule.label is a two-dimensional array
Fix checking for a non-empty first string.

PR:		269075
MFC after:	1 week
Reported by:	nreilly@blackberry.com
2023-01-24 07:46:46 +01:00
Andrew Gallatin
da81cc6035 dtrace: conditionally load the systrace_linux klds when loading dtrace.
When dtrace starts, it tries to detect if the dtrace klds are loaded,
and if not, it loads them by loading the dtraceall kld. This module
depends on most dtrace modules, including systrace for the native
freebsd and freebsd32 ABIs. However, it does not depend on the
systrace_linux klds, as they in turn depend on the linux ABI klds, and
we don't want to load an ABI module that the user has not explicitly
requested. This can leave a naive user in a state where they think all
syscall providers have been loaded, yet linux ABI syscalls are
"invisible" to dtrace.

To fix this, check to see if the linux ABI modules are loaded. If they
are, then load their systrace klds.

Reviewed by: markj, (emaste & jhb, earlier versions)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37986
2023-01-23 20:36:24 -05:00
Konstantin Belousov
9c996882b0 libcxx: Implement atomic::wait/notify using _umtx_op(2) for 64bit arches
Only 64bit architectures can be supported this way, because libcxx
defines __cxx_contention_t to be int64_t for FreeBSD, and 32bit arches
do not have a kind of UMTX_OP_WAIT_INT64_PRIVATE operation.

LLVM review:	https://reviews.llvm.org/D142134

Tested by:	emaste
Reviewed by:	dim, emaste, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38132
2023-01-24 02:52:42 +02:00
Warner Losh
62adb1e953 UPDATING: fix typo
I'd forgotten to fix this from the review, and a couple of people have
pointed it out after the commit.

Sponsored by:		Netflix
2023-01-23 17:09:08 -07:00
Ed Maste
247e03ed8b Add git-blame ignore file
.git-blame-ignore-revs lists commit hashes that should be skipped by
`git blame` e.g. non-functional whitespace or style cleanup.

The file is populated with a few sample entries.

Reviewed by:	brooks, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36525

fixup ignore revs
2023-01-23 15:27:25 -05:00
Mark Johnston
df40e30c97 netmap: Try to count packet drops in emulated mode
Right now we have little visibility into packet drops within netmap.
Start trying to make packet loss issues more visible by counting queue
drops in the transmit path, and in the input path for interfaces running
in emulated mode, where we place received packets in a bounded software
queue that is processed by rxsync.

Reviewed by:	vmaffione
MFC after:	1 week
Sponsored by:	Zenarmor
Sponsored by:	OPNsense
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D38064
2023-01-23 14:42:41 -05:00
Mark Johnston
854b2f302d netmap: Correct a comment
Reviewed by:	vmaffione
MFC after:	1 week
Sponsored by:	Zenarmor
Sponsored by:	OPNsense
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D38063
2023-01-23 14:42:19 -05:00
Mark Johnston
539437c828 netmap: Fix a queue length check in the generic port rx path
The check is ok by default, since the default value of
netmap_generic_ringsize is 1024.  But we should check against the
configured "ring" size.

Reviewed by:	vmaffione
MFC after:	1 week
Sponsored by:	Zenarmor
Sponsored by:	OPNsense
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D38062
2023-01-23 14:41:55 -05:00
Mark Johnston
56c438fcd4 netmap: Tell the compiler to avoid reloading ring indices
Per the removed comments these fields should be loaded only once, since
they can in principle be modified concurrently, though this would be a
violation of the userspace contract with netmap.

No functional change intended.

Reviewed by:	vmaffione
MFC after:	1 week
Sponsored by:	Zenarmor
Sponsored by:	OPNsense
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D38061
2023-01-23 14:41:05 -05:00
Mitchell Horne
6f5141456e vtblk: secondary fix for dumping
The code paths while dumping do not got through busdma. As such,
safeguard against calling bus_dmamap_sync() with a NULL map. The x86
implementation tolerates this but others do not, resulting in a
NULL dereference panic when dumping to a vtblk device on arm64, riscv,
etc.

Fixes:		782105f7c8 ("vtblk: Use busdma")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37990
2023-01-23 15:21:36 -04:00
Mitchell Horne
5644850620 ddb: have 'reset' command use normal reboot path
This conditionally gives all registered shutdown handlers a chance to
perform the reboot, with cpu_reset() being the fallback. The '\s'
modifier can be used with the command to get the previous behaviour.

The motivation is that some platforms may not be able do anything
meaningful via cpu_reset(), due to a lack of standardized reset
mechanism and/or firmware shortcomings. However, they may have a
separate device driver attached that normally performs the reboot. Such
is the case for some versions of the Raspberry Pi, where reset via PSCI
fails, but the BCM2835 watchdog driver has a shutdown hook.

Reported by:	bz
Reviewed by:	markj (slightly earlier version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D37981
2023-01-23 15:10:24 -04:00
Mitchell Horne
627ca221c3 kern_reboot: unconditionally call shutdown_reset()
Currently shutdown_reset() is registered as the final entry of the
shutdown_final event handler. However, if a panic occurs early in boot
before the event is registered (SI_SUB_INTRINSIC), we may end up
spinning in the subsequent infinite for loop and failing to reset
altogether. Instead we can simply call this function unconditionally.

Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D37981
2023-01-23 15:10:24 -04:00
Jiajie Chen
dec7db4960 Add kf_file_nlink field to kf_file and populate it
This will allow user-space programs (e.g. lsof) to locate deleted files
whose nlink equals zero. Prior to this commit, programs has to use
stat(kf_path) to get nlink, but that will fail if the file is deleted.

[mjg: s/fail/file in the commit message]

Reviewed by:	mjg
Differential Revision:  https://reviews.freebsd.org/D38169
2023-01-23 17:09:52 +00:00
Ed Maste
8089749d38 blacklistd: diff reduction against upstream
Add `conf_` prefix, maching https://github.com/zoulasc/blocklist

Sponsored by:	The FreeBSD Foundation
2023-01-23 11:22:10 -05:00
Mike Karels
7d189f6698 growfs(7): conditionalize mention of adding dump device
The growfs_fstab script will add a new swap partition as a dump
device as well, but only if dumpdev is set to AUTO.

MFC after:	3 days
Reviewed by:	pauamma
Differential Revision:	https://reviews.freebsd.org/D38166
2023-01-23 08:37:07 -06:00
Xin LI
047153b416 MFV: xz 5.4.1.
MFC after:	3 days
2023-01-22 16:50:36 -08:00
Alexander V. Chernikov
30dd227cff netinet6: honor blackhole/unreach routes in the non-fastforwading code.
Currently, under the conditions specified below, IPv6 ingress packet
 processing can ignore blackhole/reject flag on the prefix. The packet
 will instead be looped locally till TTL expiration and a single ICMPv6
 unreachable message will be send to the source even in case of
 RTF_BLACKHOLE.
The following conditions needs hold to make the scenario happen:
* IPv6 forwarding is enabled
* Packet is not fast-forwarded
* Destination prefix has either RTF_BLACKHOLE or RTF_REJECT flag
Fix this behavior by checking for the blackhole/reject flags in
ip6_forward().

Reported by:	Dmitriy Smirnov <fox@sage.su>
Reviewed by:	ae
Differential Revision: https://reviews.freebsd.org/D38164
MFC after:	3 days
2023-01-22 18:48:07 +00:00
Xin LI
2690f2feae Vendor import of xz 5.4.1 (trimmed) 2023-01-22 09:32:29 -08:00
Peter Holm
7a56009cf5 stress2: Added a regression test 2023-01-22 10:35:28 +01:00
Poul-Henning Kamp
2da12891da Document another example for "binat". 2023-01-22 09:31:18 +00:00
Kajetan Staszkiewicz
06012728be netpfil tests: improve pfsync_defer.py
Return different exit code depending on which failure was encountered.
The pfsync test expect a very particular failure, not just any.

MFC after:	1 week
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D38123
2023-01-22 04:26:32 +01:00
Kajetan Staszkiewicz
f57218e469 netpfil tests: improve pft_ping.py
Multiple improvements to pft_ping.py:

* Automatically use IPv6 when IPv6 addresses are used, --ip6 is not needed.
* Building of ping requests and parsing of ping replies is done layer by
  layer. This way most arguments are available both for IPv6 and IPv4,
  for ICMP and TCP.
* Use argument groups for improved readability.
* Change ToS and TTL argument name to TC and HL to reflect the modern
  IPv6 nomenclature. The argument still set related IPv4 header fields
  properly.
* Instead of sniffing for the very specific case of duplicated packets,
  allow for sniffing on multiple interfaces.
* Report which sniffer has failed by setting bits of error code.
* Raise meaningful exceptions when irrecoverable errors happen.
* Make IPv4 fragmentation flags configurable.
* Make IPv6 HL / IPv4 TTL configurable.
* Make TCP MSS configurable.
* Make TCP sequence number configurable.
* Make ICMP payload size configurable.
* Add debug output.
* Move command line argument parsing out of network functions.
* Make the code somehow PEP-8 compliant.

MFC after:	1 week
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D38122
2023-01-22 04:26:32 +01:00
Kajetan Staszkiewicz
a39dedeb31 netpfil tests: improve sniffer.py
Multiple improvements to sniffer.py:

* Remove ambiguity of configuring recvif, it must be now explicitly specified.
* Don't catch exceptions around creating the sniffer, let it properly
  fail and display the whole stack trace.
* Count correct packets so that duplicates can be found.

MFC after:	1 week
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D38120
2023-01-22 04:26:32 +01:00
Andrew Gallatin
9cb6ba29cb vm: centralize VM_BATCHQUEUE_SIZE definition
Remove the platform-specific definitions of VM_BATCHQUEUE_SIZE
for amd64 and powerpc64, and instead treat all 64-bit platforms
identically.  This has the effect of increasing the arm64
and riscv VM_BATCHQUEUE_SIZE to match that of other platforms.

Reviewed by: jhb, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37707
2023-01-21 14:30:00 -05:00
Alexander V. Chernikov
10f2a38769 netlink: fix OOB write when creating attribute bitmask.
Fix wrong arithmetics by moving to the standard bitset(9) functions.

Reported by:	markj, KASAN
2023-01-21 18:03:47 +00:00
Alexander V. Chernikov
0079d177ab netlink: allow creating sockets with SOCK_DGRAM.
Some existing applications setup Netlink socket with
SOCK_DGRAM instead of SOCK_RAW. Update the manpage to clarify
that the default way of creating the socket should be with
SOCK_RAW. Update the code to support both SOCK_RAW and SOCK_DGRAM.

Reviewed By: pauamma
Differential Revision: https://reviews.freebsd.org/D38075
2023-01-21 14:58:19 +00:00
Warner Losh
03a1b75950 elf: EF_ARM_EABI_VERSION_UNKNOWN is no longer used, retire
EF_ARM_EABI_VERSION_UNKNOWN was used when we could run either eabi or
oabi. That was armv[45] only, and went away when we migrated to eabi
many major releases ago. No standard defines this symbol, so retire it.

Pointed out by:		jrtc27
Sponsored by:		Netflix
2023-01-20 22:12:32 -07:00
Adrian Chadd
ffc58e2ca3 asmc: Add MacbookAir6,2
Add in the zones for my MacbookAir6,2, a 2013 Macbook Air.

Tested - said Macbook Air 2013.  Thermal Zones and keyboard backlight
control works fine.

Differential Revision: https://reviews.freebsd.org/D38073
Approved by: jrtc27
2023-01-21 04:34:31 +00:00
Warner Losh
34784d17eb elf: Catch up with defining EF_ARM_EABI_VERSION in elf_common.h
FreeBSD defines EF_ARM_EABI_VERSION in a non-standard way (at least
differently than everybody else). We use this only in elf*machdep.c to
make sure the image is new enough. Switch to the more standard way of
defining this and adjust other constants to match.

Fixes:			c52c98e69a
Sponsored by:		Netflix
2023-01-20 19:18:15 -07:00