Commit Graph

278915 Commits

Author SHA1 Message Date
Kristof Provost
22893e5840 bridge: default to not filtering L3
Change the default for net.link.bridge.pfil_member and
net.link.bridge.pfil_bridge to zero.

That is, default to not calling layer 3 firewalls on the bridge or its
member interfaces.

With either of these enabled the bridge will, during L2 processing,
remove the Ethernet header from packets, feed them to L3 firewalls,
re-add the Ethernet header and send them out.

Not only does this interact very poorly with firewalls which defer
packets, or reassemble and refragment IPv6, it also causes considerable
confusion for users, because the firewall gets called in unexpected
ways.

For example, a bridge which contains a bhyve tap and the host's LAN
interface. We'd expect traffic between the LAN and bhyve VM to pass, no
matter what (layer 3) firewall rules are set on the host. That's not the
case as long as pfil_bridge or pfil_member are set.

Reviewed by:	Zhenlei Huang
MFC:		never
Differential Revision:	https://reviews.freebsd.org/D37009
2022-10-24 08:52:21 +02:00
Wei Hu
2db785aa01 arm64: Hyper-V: fix couple more commit errors caused by duplicated lines
Remove those duplicated lines.

Reported by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Fixes:		6cf00ef80c
Sponsored by:	Microsoft
2022-10-24 08:14:25 +00:00
Kristof Provost
dc12ee39b7 if_ovpn: add sysctls for netisr_queue() and crypto_dispatch_async()
Allow the choice between asynchronous and synchronous netisr and crypto
calls. These have performance implications, but depend on the specific
setup and OCF back-end.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D37017
2022-10-24 10:08:35 +02:00
Peter Holm
ee920bc903 stress2: Added a regression test for D37024 2022-10-24 09:48:09 +02:00
Peter Holm
799db59e9a stress2: Update tool to list both DATA and HOLES in a file.
Added a regression test.
2022-10-24 09:45:32 +02:00
Bjoern A. Zeeb
d3975204e4 LinuxKPI: add MSEC_PER_SEC
Sponsored by:	The FreeBSD Foundation
Reviewed by:	imp, emaste
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D37087
2022-10-23 21:54:36 +00:00
Bjoern A. Zeeb
64d3da0063 LinuxKPI: 802.11: add MO tracing
Add a macro to each implemented mac80211 operation.  This currently
turns into a printf if LINUXKPI_80211_DEBUG is defined but in the
future could become a different probe as well.
This is helpful for quick analysis and boot-time problem debugging
when DTrace and other frameworks may be harder to use.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-10-23 21:48:22 +00:00
Vitaliy Gusev
3b5e5ce87b bhyve: Handle snapshots of unconfigured virtio-net devices
In case of device reset or not configured - features_negotiated is not
set, calling calling pci_vtnet_neg_features is wrong and resume gets
"Segmentation fault".

Reviewed by:	markj
Sponsored by:	vStack
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36244
2022-10-23 14:50:43 -04:00
Hans Petter Selasky
fdd9548333 time(3): Fix spelling.
Noted by:	Gary Jennejohn <garyj@gmx.de>
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-10-23 18:42:11 +02:00
Mark Johnston
eb805f4e0f bhyve: Annotate an unused function as such
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
489392feb7 bhyve: Make hda_ops function tables const
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
84633b9d52 bhyve: Put the prototype for vga_render() in a header
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
f703dc0ef0 bhyve: Put the prototype for vmexit_task_switch() in a header
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
c9faf69874 bhyve: Fix some warnings in the snapshot code
- Qualify unexported symbols with "static".
- Drop some unnecessary and incorrect casts.
- Avoid arithmetic on void pointers.
- Avoid signed/unsigned comparisons in loops which use nitems() as a
  bound.

No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
63898728b5 bhyve: Avoid arithmetic on void pointers
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
cd49c066a3 bhyve: USB device model structures can be qualified with "static"
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
7039bdd535 bhyve: Use the proper type for string literals
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
33dfef5cf3 bhyve: Fix some warnings in the ps2 emulation code
- Include headers containing prototypes for exported functions.
- Initialize all fields of the extended translation table.
- Qualify an unexported translation table as static.
- Fix error handling for a read(2).
- Fix some style bugs.

No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
4a1c23a708 bhyve: Address some warnings in bhyverun.c
- Annotate unused parameters as such.
- Avoid shadowing the global "vmexit".

No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Tom Jones
15bd2f366d acpi: Create cppc_notify sysctl before it is checked
Reported by:	Henrix
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D37081
2022-10-23 10:10:56 +01:00
Hans Petter Selasky
35a33d14b5 time(3): Optimize tvtohz() function.
List of changes:
- Use integer multiplication instead of long multiplication, because the result is an integer.
- Remove multiple if-statements and predict new if-statements.
- Rename local variable name, "ticks" into "retval" to avoid shadowing
the system "ticks" global variable.

Reviewed by:	kib@ and imp@
MFC after:	1 week
Sponsored by:	NVIDIA Networking
Differential Revision:  https://reviews.freebsd.org/D36859
2022-10-23 10:04:50 +02:00
Hans Petter Selasky
ee29897fc3 time(3): Declare the minimum and maximum hz values supported.
Reviewed by:	kib@ and imp@
MFC after:      1 week
Sponsored by:   NVIDIA Networking
Differential Revision:	https://reviews.freebsd.org/D37072
2022-10-23 10:04:50 +02:00
Warner Losh
e0c3f66b4d stand/efi: Call md_copymodules based on __LP64__ to fix 32-bit arm
When I refactored everything, I neglected to pass in the proper is64
value on 32-bit platforms. This corrects that. This prevented armv7 and
armv6 platforms from booting due to misaligned data in the kernel.  The
only platform we support 32-bit booting in armv[67], which I apparently
neglected to test before commiting my refactoring.

Tested by:		skibo
Fixes:			5d1531d9d4
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D37095
2022-10-22 19:47:25 -06:00
Warner Losh
2cb90a7b2e stand/kboot: hostdisk isn't a DEVT_DISK, use a different value.
We assume in all the code that a DEVT_DISK uses common/disk.c and/or
common/part.c and we can access a struct disk_devdesc. hostdisk.c
opens raw devices directly, so has no such structures. Define a
kboot-specific DEVT_HOSTDISK and use that instead.

In addition, disk_fmtdev assumes it is working with a struct
disk_devdesc, so write hostdisk_fmtdev as well.

Sponsored by:		Netflix
2022-10-22 19:47:24 -06:00
Warner Losh
bb3230e40b geli: Move check for DEVT_DISK into geli_probe_and_attach
We only work on DEVT_DISK disks, so move that into the probe to drive
the point home better.

Sponsored by:		Netflix
2022-10-22 19:47:24 -06:00
Bjoern A. Zeeb
0080f30ff1 LinuxKPI: 802.11: add changes to support debugfs in iwlwifi
Add new fields (also have to move a struct up, no changes there)
in order to make iwlwifi debugfs support compile.

Sposnored by:	The FreeBSD Foundation
MFC after:	3 days
2022-10-22 20:42:35 +00:00
Bjoern A. Zeeb
92daf3a606 iwlwifi: prepare to support debugfs
Import two files left out initially from the driver needed for debugfs
support [1].  Adjust the driver further to make it compile on FreeBSD.
This is currently turned off and needs more LinuxKPI/lindebugfs work.
Being in the tree will allow us to collaboratively work on it and
then we can enable it for good.

Obtained from:	Linux wireless-testing (tag: wt-2022-10-19) [1]
		2c9078b9abcb884e27360340aaa7dfd4c0de29b3
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-10-22 17:40:17 +00:00
Bjoern A. Zeeb
71ebd2d00b iwlwifi: constify another argument of iwl_print_hex_dump()
This is needed when enabling debugfs as it passes a const in which
would otherwise be dropped.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-10-22 17:33:18 +00:00
Dag-Erling Smørgrav
8d7221ca2d sh: when loading profile, read only .sh files.
Reviewers: jilles, eugen_grosbein.net, cy

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D37034
2022-10-22 19:05:31 +02:00
John Grafton
4c9db9566e linprocfs: Add net/route.
PR:			266482
Reviewed by:		melifaro, me
Differential revision:	https://reviews.freebsd.org/D36949
MFC after:		1 week
2022-10-22 13:52:58 +03:00
Colin Percival
b7761f1f08 x86/busdma: Limit reserved pages if low nsegs
When bus_dmamap_create is called, if bouncing might be required we
reserve enough pages for a maximum-length request, subject to the
MAX_BPAGES constraint (32 MB on amd64; 32 MB or 2 MB on i386
depending on the amount of RAM).

Since pages used for bouncing are typically non-consecutive, each
bounced page will typically constitute a busdma segment; as such, we
are unlikely to ever successfully use more pages than the nsegments
limit.  Limit the number of pages reserved to nsegments.

On FreeBSD/Firecracker, this reduces bounce page memory consumption
from 32 MB to 512 kB, making VMs with 128 MB of RAM usable.

Reviewed by:	imp, mav
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D37082
2022-10-21 22:47:33 -07:00
Konstantin Belousov
f585d13dd6 rtld: remove unused macro FPTR_TARGET
It is a remnant from the ia64 removal

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-10-22 05:15:06 +03:00
Alan Somers
15b3e3bb7e ctld: if adding a target fails, retry it on the next reload
If the admin creates more CTL ports than kern.cam.ctl.max_ports, then
adding some will fail.  If he then removes some ports and does
"service ctld reload", he would expect that the new ports would get
added in the newly-freed port space. But they don't, because ctld
assigned them port numbers during their first creation attempts.

Fix this bug by removing newly created ports from ctld's internal list
if the kernel rejects them for any reason.  That way, a subsequent
config reload will attempt to add them again, possibly with new port
numbers.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	jhb, mav
Differential Revision: https://reviews.freebsd.org/D36974
2022-10-21 18:28:45 -06:00
Warner Losh
787df454c8 stabd/geli: Bail out if you can't get the disks size
If the DIOCGMEDIASIZE ioctl fails, assume the disk doesn't have geli
encryption. While all disks should implement this, fail safe for disks /
partitions that do not.

Sponsored by:		Netflix
2022-10-21 17:39:34 -06:00
Kirk McKusick
243a0eda9a Increase the maximum size of the journaled soft-updates journal.
The size of the journaled soft-updates journal should be big enough
to hold two minutes of filesystem metadata-update activity. The
maximum size of the soft updates journal was set in the 1990s. At
the time it was assummed that disk arrays would top out at 16 drives
and disk writes per drive would top out at 500 per second. Today's
I/O subsystems are considerably bigger and faster than those limits.
Thus this delta removes the hard upper limit and lets tunefs(8) and
newfs(8) set the upper bound based on the size of the filesystem and
its cylinder groups.

Sponsored by: The FreeBSD Foundation
2022-10-21 11:00:00 -07:00
Kirk McKusick
0929a153fc Add a description of soft updates journaling to newfs(8).
Add a descrition to the newfs(8) -j (journal enablement) flag
that explains what soft updates journaling does, the tradeoffs
to using it, and the limitations that it imposes. Copied from
the description in tunefs(8).

PR:           261944
Sponsored by: The FreeBSD Foundation
2022-10-21 10:57:31 -07:00
Dag-Erling Smørgrav
04f6b9cb18 w: cosmetic fixes.
Sponsored by:	Klara, Inc.
2022-10-21 16:37:44 +00:00
Wei Hu
443e6eccbd arm64: Hyper-V: fix a commit error caused duplicated lines in vmbus_aarch64.c
Remove those duplicated lines.

Reported by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Fixes:	6cf00ef80c
Sponsored by:	Microsoft
2022-10-21 11:09:17 +00:00
Souradeep Chakrabarti
3f8f02b2ab arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 2)
This is the second part of the ARM64 Hyper-V enablement.
These changes here are mostly with Make, release changes and also
changes required in vmbus.c hyperv.c and common files in hyperv.

Reviewed by:	whu
Tested by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D36467
2022-10-21 09:46:22 +00:00
Souradeep Chakrabarti
0c38e1c338 arm64: Hyper-V: vmbus: use the IRQ resource from vmbus_res
In ARM64 gen2 Hyper-V, use IRQ resource from vmbus_res, which is owning
the IRQ for current device tree. It allows the MMIO resource to be
successfully allocated for vmbus from parent acpi_syscontainer.
Reviewed by:	whu
Tested by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D37064
2022-10-21 08:40:32 +00:00
Hans Petter Selasky
a2d60916d0 xhci(4): Fix spelling in manual page.
Noted by:	Gary Jennejohn <garyj@gmx.de>
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-10-21 07:48:30 +02:00
Richard Scheffenegger
83c1ec92e4 tcp: ECN preparations for ECN++, AccECN (tcp_respond)
tcp_respond is another function to build a tcp control packet
quickly. With ECN++ and AccECN, both the IP ECN header, and
the TCP ECN flags are supposed to reflect the correct state.

Also ensure that on receiving multiple ECN SYN-ACKs, the
responses triggered will reflect the latest state.

Reviewed By:		tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D36973
2022-10-20 21:48:27 +02:00
Ronald Klop
7ca710589a Add me as ports committer, update mentor/mentee
This completes step 7 from Committer's Guide.

Approved by:	rene (mentor)
Differential Revision:	https://reviews.freebsd.org/D37066
2022-10-20 21:37:45 +02:00
Hans Petter Selasky
30e555de80 xhci(4): Update list of quirks in manual page.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-10-20 19:23:43 +02:00
Hans Petter Selasky
3346ae0d24 xhci(4): Don't allocate an IRQ vector if hw.usb.xhci.use_polling=1 is set.
This is useful for debugging purposes.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-10-20 19:23:42 +02:00
Warner Losh
e32e6e42fa arm: Remove unused ffs.S
We've not used ffs.S since we retired armv[45] support. Remove it from
the tree.

Suggested by:		andrew in D37069
Sponsored by:		Netflix
2022-10-20 10:48:31 -06:00
Warner Losh
91dc225a7b conf: Document why we have ARM64 and RISCV options
These are needed for the 'cpu ARM64' and 'cpu RISCV' options in these
architecture's config files. cpu lines are non-optional in config(8), so
we must define them here. There's no other use for them in the tree.

Sponsored by:		Netflix
2022-10-20 10:48:31 -06:00
Warner Losh
f94d74ff3a arm: Fix name of config file in comment
This file was never named GENERICV6 in the FreeBSD tree. It entered the
tree in b9413b5512 as GENERIC.

Sponsored by:		Netflix
2022-10-20 10:48:31 -06:00
Warner Losh
f9d615746f arm: Remove useless armv6/armv7 options
Cleanup another remnant of the armv4/armv5 support. Now that we always
define armv6 or armv7, these lines can be deleted (execpt hwpmc_armv7.c
which now needs just one line). Since we don't do anything different
between armv6 and armv7 from a config file selection point of view,
delete them from options.arm. We are extremely unlikely to grow anything
new here during the remaining lifetime of 32-bit arm in FreeBSD.

Sponsored by:		Netflix
Reviewed by:		kevans, andrew
Differential Revision:	https://reviews.freebsd.org/D37069
2022-10-20 10:48:31 -06:00
Mitchell Horne
a9b24e4dc2 riscv: fix relocation handling for R_RISCV_64
It requires the addend. In practice this doesn't seem to be a problem,
since relocations of this type are all with an addend of zero.
Obviously, we still want to handle this correctly if that ever changes.

Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37039
2022-10-20 12:01:29 -03:00