Commit Graph

146637 Commits

Author SHA1 Message Date
Brooks Davis
105a4f7b3c ng_atmllc: remove
This standalone module is the last vestage of ATM support in the tree so
send it on its way.

Reviewed by:	manu, emaste
Relnotes:	yes
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38880
2023-03-09 18:04:21 +00:00
Brooks Davis
af0cc0b223 NgATM: Remove netgraph ATM support
Most ATM support was removed prior to FreeBSD 12.  The netgraph support
was kept as it was less intrusive, but it is presumed to be unused.

Reviewed by:	manu
Relnotes:	yes
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38879
2023-03-09 18:04:02 +00:00
Mark Johnston
e08302f649 vm_fault: Update a comment to reflect the removal of the default pager
Fixes:	5d32157d4e ("vm_object: Modify vm_object_allocate_anon() to return OBJT_SWAP objects")
Reviewed by:	alc, kib
Differential Revision:	https://reviews.freebsd.org/D38985
2023-03-09 11:15:49 -05:00
Roger Pau Monné
6f80738b22 xen: fetch dom0 video console information from Xen
It's possible for Xen to switch the video mode set by the boot loader,
so that the information passed in the kernel metadata is no longer
valid.  Fetch the video mode used by Xen using an hypercall and update
the medatada for the kernel to use the correct video mode.

Sponsored by: Citrix Systems R&D
2023-03-09 17:13:17 +01:00
Roger Pau Monné
5489d7e93a xen: bump used interface version
This is required for a further change that will make use of a field
that was added in version 0x00040d00.

No functional change expected.

Sponsored by: Citrix Systems R&D
2023-03-09 17:13:17 +01:00
Alexander V. Chernikov
da4047d3ba fix buildworld after 595d23f777.
Reported by:	se
2023-03-09 15:45:57 +00:00
Alexander V. Chernikov
595d23f777 netlink: add snl(3) default parsers for routes and links.
This change adds the "default" parsers of _all_ route/link attributes
 exported by the kernel.
It removes the need to declare similar parsers in the userland applications,
 simplifying their logic.

Differential Revision: https://reviews.freebsd.org/D38979
MFC after:	2 weeks
2023-03-09 14:46:27 +00:00
Alexander V. Chernikov
90d6251228 netlink: add rtsock-compatible header to use with netlink snl(3).
Some routing socket defines (`RTM_` and `RTA_` ones) clash with the ones
 used by the the Netlink.
As some rtsock definitions like interface flags or route flags are used in
 both netlink and rtsock, provide a convenient way to include those without
 running into the define collision.

Differential Revision: https://reviews.freebsd.org/D38982
MFC after:	2 weeks
2023-03-09 14:37:42 +00:00
Alexander V. Chernikov
76f6d39150 netlink: add basic message writing support to snl(3).
Differential Revision:	https://reviews.freebsd.org/D38947
MFC after:	2 weeks
2023-03-09 14:33:26 +00:00
Tijl Coosemans
ecad3f5c4d rc.d: Generate machine-id from hostid_save
rc.d/hostid_save saves a UUID generated by rc.d/hostid in /etc/hostid.
Store the same UUID, without hyphens, in /etc/machine-id.  The hypĥens
are removed with a shell function because hostid_save runs before file
systems are mounted so other tools may not be available yet.

This eliminates some duplication between hostid and machine-id and for
virtual machines machine-id now contains the UUID configured in the
hypervisor like it does on Linux.

Reviewed by:	delphij
Discussed with:	bapt
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D38811
2023-03-09 10:31:55 +01:00
Ed Maste
4a869d380e nvram2env: Retire unused MIPS-specific driver
This code was used only on MIPS platforms, and has not built in some
time.

Reviewed by: ray
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38986
2023-03-08 18:24:02 -05:00
John Baldwin
3140e27ee5 sys/modules/Makefile: Add a section for arm64 + x86 + powerpc64.
This reduces some duplication between the existing arm64 + x86 section
and the powerpc64 section.  To make the diff simpler, enable mlx4 on
powerpc64 since it compiles.

Reviewed by:	pkubaj, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D38973
2023-03-08 15:12:25 -08:00
John Baldwin
fe0f695039 Enable OFED on all platforms except for 32-bit arm.
32-bit arm triggers multiple -Wunaligned-access errors due to
structure packing.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D38972
2023-03-08 15:12:00 -08:00
John Baldwin
f4ea84cea2 krping: Use get_cyclecount for get_cycles.
This avoids having to duplicate identical MD code.

Reviewed by:	np, emaste
Differential Revision:	https://reviews.freebsd.org/D38971
2023-03-08 15:06:59 -08:00
John Baldwin
eee4264c9f Make <sys/systm.h> more self-contained.
Replace <sys/cdefs.h> with <sys/types.h>.  Other includes need types
defined in <sys/types.h> and <sys/types.h> includes <sys/cdefs.h>
already.

While here, move the <machine/*.h> headers below the <sys/*.h>
headers.

Reviewed by:	imp, kib
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38841
2023-03-08 15:05:10 -08:00
Joerg Wunsch
b0484678d4
dpaa2_mc.c: unbreak by adding <sys/lock.h>
When compiling current on arm64, it breaks since LA_UNLOCKED is
undefined. This was in turn caused by the mutex code aliasing
it as MA_NOTOWNED.

Add <sys/lock.h> so the macro is defined.
2023-03-08 21:50:01 +01:00
Alexander Motin
49ebbdb264 Add NAMESPACE MANAGEMENT into admin_opcode[].
MFC after: 1 week
2023-03-08 15:42:31 -05:00
Joerg Wunsch
175a584e50
usb: dwc3: add <sys/mutex.h>
Commit 5e54bb1ea9 added USB_BUS_LOCK/USB_BUS_UNLOCK. They, in
consequence, require mutexes so <sys/mutex.h> is needed.
2023-03-08 20:59:29 +01:00
Stefan Eßer
2d8cf575d5 msdosfs: fix debug print format and parameter
Building with -DMSDOSFS_DEBUG failed due to a format mismatch and
a variable that has been renamed but not updated in the printf()
parameter list.

MFC after:	1 month
2023-03-08 17:58:00 +01:00
Justin Hibbits
d936c29ec0 dpaa2: Mechanically convert to IfAPI
Reviewed By:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38959
2023-03-08 10:18:16 -05:00
Justin Hibbits
a472fd7a57 eqos: Mechanically convert to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38963
2023-03-08 10:18:16 -05:00
Alexander V. Chernikov
0679eb1f39 netlink: make snl(3) scratch buffer growable
Differential Revision: https://reviews.freebsd.org/D38946
MFC after:	2 weeks
2023-03-08 12:28:55 +00:00
Yuri
109abf744b acpica: do not print warning for missing _ADR
Started seeing the following after updating to VMware ESXi 8.0:

pcib2: <ACPI Host-PCI bridge> on acpi0
pcib2: could not evaluate _ADR - AE_NOT_FOUND
pci2: <ACPI PCI bus> on pcib2
vmx0: <VMware VMXNET3 Ethernet Adapter> ...

The virtual NIC works fine, and the code comment suggests that
missing _ADR is not something fatal, skip printing the message
if status is AE_NOT_FOUND.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/682
2023-03-07 16:25:21 -07:00
Kirk McKusick
0eabe33087 Updates to UFS/FFS superblock integrity checks when reading a superblock.
Have to add a check that the computed cylinder group size does not
exceed the block size of the filesystem.

It is also necessary to validate additional parameters when a
superblock is going to be used in read-only mode if its supplementary
information is going to be read in to ensure that the size and
location of the supplementary information is valid. Also when a
warning is raised let it be accepted, but bound the flagged field
to the value checked by the warning.

No legitimate superblocks should fail as a result of these changes.

Reported by:  Bob Prohaska, John-Mark Gurney, and Mark Millard
Tested by:    Peter Holm
Reviewed by:  Peter Holm
MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38668
2023-03-07 15:02:19 -08:00
Justin Hibbits
954712e8f6 Mechanically convert cxgb(4) and cxgbe(4) to IfAPI
Reviewed by:	np
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38597
2023-03-07 15:31:48 -05:00
Justin Hibbits
54ab3b4a03 Mechanically convert qlxgbe(4) to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37821
2023-03-07 15:31:48 -05:00
Justin Hibbits
5b587352a2 Mechanically convert qlxgb(4) to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37820
2023-03-07 15:31:48 -05:00
Justin Hibbits
64c618ed7d Mechanically convert qlxge(4) to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37819
2023-03-07 15:31:48 -05:00
Alexander V. Chernikov
5c8277ec25 netlink: cleanup netlink_writer code
* Remove unused nlattr_add_nla() - that's a duplicate of nlattr_add_raw().
* Calculate alignment only once in nlmsg_reserve_data_raw()

MFC after:	2 weeks
2023-03-07 17:45:31 +00:00
Kyle Evans
1867702942 arm64: fix the LINT-ACPI build
This file uses VM_MEMATTR_DEVICE_NP, which it gets through header
pollution somewhere with FDT enabled.  Pull in vm/vm.h to make it
explicit.
2023-03-07 11:37:31 -06:00
Dag-Erling Smørgrav
b1218349ed tarfs: Set mountedfrom correctly.
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	sjg, kib
Differential Revision:	https://reviews.freebsd.org/D38930
2023-03-07 17:20:49 +00:00
Justin Hibbits
343c112dfe altera: Fix build from 068f2c0e10
Missed the altera dwc driver in the conversion.

Fixes:		068f2c0e10
Sponsored by:	Juniper Networks, Inc.
2023-03-07 12:00:00 -05:00
Justin Hibbits
068f2c0e10 Mechanically convert dwc(4) to IfAPI
Reviewed by:	manu (older)
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37846
2023-03-07 09:49:11 -05:00
Justin Hibbits
6d18b481f2 cpsw(4): Finish conversion to IfAPI
Two ifnet accesses were missed in 2c7bc0f55.

Sponsored by:	Juniper Networks, Inc.
2023-03-07 09:47:01 -05:00
Justin Hibbits
56928500ec linux: Use the if_name() accessor to get loopback name
Avoid directly accessing the if_xname ifnet member. and use the
designated accessor function instead.

Sponsored by:	Juniper Networks, Inc.
2023-03-07 09:47:01 -05:00
Justin Hibbits
084846271a ktls: Use IfAPI accessors to get capabilities
Summary:
Avoid referencing the ifnet struct directly, and use the IfAPI accessors
instead.

Reviewed by:	gallatin
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38932
2023-03-07 09:47:00 -05:00
Justin Hibbits
25c92cd2f6 iflib: Further convert to use IfAPI accessors
Summary:
When iflib was first converted some IfAPI APIs were not yet present, so
were tagged with "XXX" comments.  Finish the conversion by using these
new APIs.

Reviewed by:	gallatin, erj
Sponsored by:	Juniper Networks, Inc
Differential Revision: https://reviews.freebsd.org/D38928
2023-03-07 09:47:00 -05:00
Kyle Evans
d71a00e9f5 arm64: ofw: respect the nonposted-mmio prop in OF_decode_addr()
This is the only mapping remaining which needs to respect nonposted-mmio
to avoid breaking the boot on Apple silicon.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D38920
2023-03-07 00:15:32 -06:00
Mark Johnston
713264f6b8 netinet: Tighten checks for unspecified source addresses
The assertions added in commit b0ccf53f24 ("inpcb: Assert against
wildcard addrs in in_pcblookup_hash_locked()") revealed that protocol
layers may pass the unspecified address to in_pcblookup().

Add some checks to filter out such packets before we attempt an inpcb
lookup:
- Disallow the use of an unspecified source address in in_pcbladdr() and
  in6_pcbladdr().
- Disallow IP packets with an unspecified destination address.
- Disallow TCP packets with an unspecified source address, and add an
  assertion to verify the comment claiming that the case of an
  unspecified destination address is handled by the IP layer.

Reported by:	syzbot+9ca890fb84e984e82df2@syzkaller.appspotmail.com
Reported by:	syzbot+ae873c71d3c71d5f41cb@syzkaller.appspotmail.com
Reported by:	syzbot+e3e689aba1d442905067@syzkaller.appspotmail.com
Reviewed by:	glebius, melifaro
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D38570
2023-03-06 15:06:00 -05:00
Mark Johnston
df7bbd8c35 epair: Simplify the transmit path and address lost wakeups
epairs currently shuttle all transmitted packets through a single global
taskqueue thread.  To hand packets over to the taskqueue thread, each
epair maintains a pair of ring buffers and a lockless scheme for
notifying the thread of pending work.  The implementation can lead to
lost wakeups, causing to-be-transmitted packets to end up stuck in the
queue.

Rather than extending the existing scheme, simply replace it with a
linked list protected by a mutex, and use the mutex to synchronize
wakeups of the taskqueue thread.  This appears to give equivalent or
better throughput with >= 16 producer threads and eliminates the lost
wakeups.

Reviewed by:	kp
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D38843
2023-03-06 12:49:28 -05:00
Mark Johnston
48227d1c6d epair: Avoid loading m_flags into a short
The m_flags field of struct mbuf is 24 bits wide and so gets truncated
in a couple of places in the epair code.  Instead of preserving the
entire flag set, just remember whether M_BCAST or M_MCAST is set.

MFC after:	1 week
Sponsored by:	Klara, Inc.
2023-03-06 12:39:11 -05:00
Justin Hibbits
935b194ded Mechanically convert usb ethernet drivers to DrvAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37812
2023-03-06 11:04:15 -05:00
Justin Hibbits
70510800d1 mlx5: Enter network epoch when using if_foreach()
Summary: IFNET_RLOCK() is not sufficient, the epoch needs entered.

Reviewed by:	hselasky
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38711
2023-03-06 11:04:15 -05:00
Alexander V. Chernikov
055776c84a netlink: use newly-added if_foreach_sleep() to iterate over the interface list.
Summary: MFC after:	2 weeks

Subscribers: imp, glebius

Differential Revision: https://reviews.freebsd.org/D38907
2023-03-06 15:08:08 +00:00
Alexander V. Chernikov
df2b419a41 ifnet: add if_foreach_sleep() to allow ifnet iterations with sleep.
Subscribers: imp, ae, glebius

Differential Revision: https://reviews.freebsd.org/D38904
2023-03-06 15:08:08 +00:00
Alexander V. Chernikov
66bdbcd544 net: unify mtu update code
Subscribers: imp, ae, glebius

Differential Revision: https://reviews.freebsd.org/D38893
2023-03-06 15:08:08 +00:00
Andrew Turner
527bf20032 Remove a #error that sneaked in 2023-03-06 08:07:52 +00:00
Andrew Turner
5a91529479 Support non-posted MMIO on arm64 with FDT
To allow hardware to work around a broken memory bus where we need to
support the nonposted-mmio flag.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D34333
2023-03-05 20:17:21 +00:00
Andrew Turner
cb894f746c Map arm64 pci config memory as non-posted
On arm64 PCI config memory is expected to be mapped with a non-posted
device type. To handle this use the new bus_map_resource support in
arm64 to map memory with the new VM_MEMATTR_DEVICE_NP attribute. This
memory has already been allocated and activated, it just needs to be
mapped.

Reviewed by:	kevans, mmel
Differential Revision:	https://reviews.freebsd.org/D30079
2023-03-05 20:17:21 +00:00
Colin Percival
3689f8aeab linux_80211: Don't dequeue lsta if not queued
This fixes an instapanic when restarting wpa_supplicant on my laptop's
iwlwifi device.  After this change, iwlwifi enters a nonfunctional
state if wpa_supplicant is restarted, but "service netif restart wlan0"
is enough to get it working again.

releng/13.2 candidate.

Reviewed by:	bz
MFC after:	3 days
2023-03-05 12:16:22 -08:00