Commit graph

149207 commits

Author SHA1 Message Date
Bjoern A. Zeeb 1965dd85c3 mii: add Vitesse/Microsemi VSC8514
The VSC8514 Quad-Port 10/100/1000BASE-T PHY seems to match the handling
for the VSC8504 (for the little we support of what we could) and while
it works with our generic ukphy add it as vscphy for porper display of
names in the system message buffer and the like (or in case we decide
to implement some extra features).

Tested on:	Ten64
MFC after:	3 days
2023-11-17 12:38:07 +00:00
Bjoern A. Zeeb 43324ec770 mii: resort VSC8641 entry in miidevs
VSC8641 is a ciphy not a vscphy.
Sort it with the other entries of ciphy to avoid confusion.

MFC after:	3 days
2023-11-17 12:38:07 +00:00
Bjoern A. Zeeb 6c46ebb05d dpaa2: fdt improve detection for dpmac/phys
'pcs-handles' are not mandatory in the device tree here so do not
enforce them.  This allows us to find dpmac entries needed for phys
on the WHLE-LS1 as well.

MFC after:	3 days
Reviewed by:	jceel, dsl
Differential Revision: https://reviews.freebsd.org/D42644
2023-11-17 12:20:11 +00:00
Bjoern A. Zeeb 964b3408fa dpaa2: defer link_state updates until we are up
dpaa2_ni_media_change() was called in early setup stages, before we
were fully setup.  That lead to internal driver state being all synched
and fine but hardware state was lost/never setup corrently.

Introduce dpaa2_ni_media_change_locked() so we can avoid reccursive
locking and call "dpaa2_ni_media_change()" instead of mii_mediachg()
as the latter does not setup our state there either.

In order for this all to work, call if_setdrvflagbits() just before
rather than after the above.

Also remove an unecessary direct call to dpaa2_ni_miibus_statchg()
which mii_mediachg() will trigger anyway.

This all fixes a problem [1] that one had to lose the link (either
unplugging/replugging the cable or using ifconfig media none;
ifconfig media auto) to re-trigger the all updates and get the
full state programmed when hardware expected.

MFC after:	3 days
GH-Issue:	https://github.com/mcusim/freebsd-src/issues/21 [1]
Reviewed by:	dsl, dch
Differential Revision: https://reviews.freebsd.org/D42643
2023-11-17 12:20:03 +00:00
Bjoern A. Zeeb 0480dccd3f dpaa2: make software VLANs usable on dpni
dpni announces IFCAP_VLAN_MTU but internally does not increase the
maximum frame length.  Createing a vlan interface on top of a dpni
interface will result in full-sized frames not passing.
Extend the maximum frame length by ETHER_VLAN_ENCAP_LEN to allow at
least for one layer of (software) vlans for now

MFC after:	3 days
GH-Issue:	https://github.com/mcusim/freebsd-src/issues/22
Reviewed by:	dsl
Differential Revision: https://reviews.freebsd.org/D42645
2023-11-17 12:17:54 +00:00
Richard Scheffenegger 49a6fbe387 [tcp] add PRR 6937bis heuristic and retire prr_conservative sysctl
Improve Proportional Rate Reduction (RFC6937) by using a
heuristic, which automatically chooses between
conservative CRB and more aggressive SSRB modes.
Only when snd_una advances (a partial ACK), SSRB may be
used. Also, that ACK must not have any indication of
ongoing loss - using the addition of new holes into the
scoreboard as proxy for such an event.

MFC after: 4 weeks
Reviewed By: #transport, kbowling, rrs
Sponsored By: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D28822
2023-11-15 23:10:29 +01:00
Martin Matuska cf0ad6fd64 zfs: update zfs_config.h and zfs_gitrev.h missed in 47bb16f8f0 2023-11-17 10:00:16 +01:00
Martin Matuska 47bb16f8f0 zfs: merge openzfs/zfs@03e9caaec
Notable upstream pull request merges:
 #15516 da51bd17e Fix snap_obj_array memory leak in check_filesystem()
 #15519 35da34516 L2ARC: Restrict write size to 1/4 of the device
 #15529 03e9caaec Add a tunable to disable BRT support

Obtained from:	OpenZFS
OpenZFS commit:	03e9caaec0
2023-11-17 09:39:42 +01:00
Gleb Smirnoff 70e30addaf tcp: remove extraneous network epoch entry
accept(2) on IPv6 TCP doesn't need epoch.  Some leaf functions may
need it, but they will enter accordingly, see sa6_recoverscope().

Reviewed by:		rscheff, tuexen (implicitly, see deleted XXXMT)
Differential Revision:	https://reviews.freebsd.org/D42634
2023-11-16 18:30:35 -08:00
Konstantin Belousov 22bac49b09 vn_lock_pair(): reasonably handle vp1 == vp2 case
Lock the vnode in the most exclusive lock mode requested, once.
All callers already ensure that vp1 != vp2 or are careful enough to only
unlock once otherwise.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42642
2023-11-17 03:51:41 +02:00
Konstantin Belousov e256f71389 kernel: add missed FEATUREs compat_freebsd 8-14
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-11-17 00:04:55 +02:00
Konstantin Belousov 0aa93010c5 arm64: do not register elf32 brand if hardware cannot exec aarch32
Reviewed by:	imp, jrtc27
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42639
2023-11-17 00:04:40 +02:00
Konstantin Belousov 4c6cded216 fuse_vnop_copy_file_range(): add safety
v_mount for unlocked vnode could be NULL, check for it.  Explain why it
is safe to access fs-specific data for mp if it is read as non-NULL.

Reviewed by:	asomers, jah
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42625
2023-11-16 22:10:31 +02:00
Konstantin Belousov 318c56714a fuse_vnop_copy_file_range(): use vn_lock_pair()
Reviewed by:	asomers, jah
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42625
2023-11-16 22:10:30 +02:00
Jonathan T. Looney 884eeff20c genoffset.sh: fix build break on MacOS
Switch from using the shell's builtin echo command to using the
builtin printf command to print the asserts.

Reported by:	jrtc27
Suggested by:	imp
Fixes:	accfb4cc93
Sponsored by:	Netflix
2023-11-16 17:54:28 +00:00
Jonathan T. Looney accfb4cc93 genoffset.sh: stop using a temporary file
Instead, use a here document for the input. This allows us to run the
while loop in the main script so we can build the list of asserts in
a shell variable. We then print out the list of asserts at the end of
the loop.

Reviewed by:	imp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D42407
2023-11-16 15:02:32 +00:00
Martin Matuska a592812327 mlx5_core: fix deadlock when using RXTLS
If removing a node of type FS_TYPE_FLOW_DEST we lock the flow group too
late. This can lead to a deadlock with fs_add_dst_fg().

PR:		274715
MFC after:	1 week
Reviewed by:	kib
Tested by:	mm
Differential Revision: https://reviews.freebsd.org/D42368
2023-11-16 12:17:41 +01:00
Alexander Motin d282baddb0 Add interface NVME to devstat
This allows to list only NVMe devices in systat, iostat, vmstat, etc.
Previously those were counted as OTHER.
2023-11-15 23:03:40 -05:00
Andrew Gallatin 5972ffde91 ig4(4): Add an EMAG device type
Sponsored by: Ampere Computing LLC, Netflix
Submitted by: allanjude
Differential Revision: https://reviews.freebsd.org/D28746
Reviewed by: imp
2023-11-15 19:53:21 -05:00
Alan Somers 24938f9311 lib/libc/rpc: switch the per-fd structs in clnt_{dg,vc}.c to RB Trees
This saves oodles of memory, especially when "ulimit -n" is large.  It
also prevents a buffer overflow if getrlimit should fail.

Also replace per-fd condvars with mutexes to simplify the code.

PR:		274968
MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D42597
2023-11-15 16:12:50 -07:00
Konstantin Belousov 6eda49b7bf mlx5_core: add new files to the static files list
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:17 +02:00
Konstantin Belousov 97beac79ed mlx5core: add linux/bitops.h include for mlx5_ifc.h use of BIT()
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:17 +02:00
Patrisious Haddad 7b959396ca mlx5: Introduce new destination type TABLE_TYPE
This new destination type supports flow transition between different
table types, e.g. from NIC_RX to RDMA_RX or from RDMA_TX to NIC_TX.

In addition add driver support to be able to query the capability for
this new destination type.

Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:17 +02:00
Konstantin Belousov b94ef2a3bc mlx5ib: adjust for the mlx5_create_auto_grouped_flow_table() interface change
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:17 +02:00
Mark Bloch ad74454131 mlx5: add ability to attach flow counter to steering rule
Expose a way to attach a counter to a flow rule.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:17 +02:00
Raed Salem 35bbcf0916 mlx5: add fs_counters
Signed-off-by: Raed Salem <raeds@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:17 +02:00
Mark Bloch 6a6af22b6e mlx5: Add a no-append flow insertion mode
This allows to insert a rule and make sure it doesn't get
combined by the steering layer with any other rule.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:16 +02:00
Mark Bloch 0a5db6bb3a net/mlx5: Allow creating autogroups with reserved entries
Exclude the last n entries for an autogrouped flow table.

Reserving entries at the end of the FT will ensure that this FG will be
the last to be evaluated. This will be used in the next patch to create

Linux upstream commit: 79cdb0aaea8b5478db34afa1d4d5ecc808689a67
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:16 +02:00
Mark Bloch 04db54fe43 net/mlx5: Fix auto group size calculation
Once all the large flow groups (defined by the user when the flow table
is created - max_num_groups) were created, then all the following new
flow groups will have only one flow table entry, even though the flow table
has place to larger groups.
Fix the condition to prefer large flow group.

Upstream Linux commit: 97fd8da281f80e7e69e0114bc906575734d4dfaf
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:16 +02:00
Mark Bloch 76ed99ed8a mlx5: Use software enum in APIs instead of PRM
Users of the steering APIs shouldn't use the PRM directly.
Create an software enum to be used instead.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:16 +02:00
Mark Bloch 45e2e55df6 mlx5: Add packet reformat support to flow rules
Allow attaching a packet reformat action to a flow rule.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:16 +02:00
Mark Bloch 847542c60c mlx5: Add modify header support to flow rules
Allow attaching a modify header to a flow rule.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:16 +02:00
Mark Bloch cb054a493a mlx5: Refactor flow actions into a struct
Create a struct to hold flow actions to be used when creating
a flow rule.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:16 +02:00
Mark Bloch bb4645b95b mlx5: Add packet reformat allocation support
Add support to allocating a packet reformat context.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:16 +02:00
Mark Bloch e4f84168b3 mlx5: Add modify header support
Add support to allocating a modify header context.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:15 +02:00
Andrew Gallatin 6f38d2e7b0 acpi: Add workaround for Altra I2C memory resource
Submitted by: allanjude
Sponsored by: Ampere Computing LLC
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D28741
2023-11-15 16:25:00 -05:00
Andrew Turner 257b044548 arm64: Correct a comment in locore.S
We now use the physical address of get_load_phys_addr. Use it in a
comment rather than the old symbol.

Sponsored by:	Arm Ltd
2023-11-15 18:13:39 +00:00
Andrew Turner 9eecef0521 Add an Armv8 rndr random number provider
Armv8.5 adds an optional random number generator. This is implemented
as two special registers one to read a random number, the other to
re-seed the entropy pool before reading a random number. Both registers
will set the condition flags to tell the caller they can't produce a
random number in a reasonable amount of time.

Without a signal to reseed the entropy pool use the latter register
to provide random numbers to the kernel pool. If at a later time we
had a way to tell the provider if it needs to reseed or not we could
use the former.

On an Amazon AWS Graviton3 VM this never failed, however this may not
be the case on low end CPUs so retry reading the random number 10 times
before returning an error.

Reviewed by:	imp, delphij (csprng)
Sponsored by:	The FreeBSD Foundation
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D35411
2023-11-15 18:05:08 +00:00
Andrew Turner 61f14f1da3 arm64: Clean up finding our load address
Use the linker to pre-calculate the offset of a known symbol from
KERNBASE, and use this to find the physical address KERNBASE should
map to.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42568
2023-11-15 18:05:08 +00:00
Andrew Turner ba31362694 arm64: Make kern_delta unneeded in the boot params
Use pmap_early_vtophys to translate from a virtual to physical where
we were previously using the calculated delta. This means that, while
we still calculate it, we don't need to pass it to initarm or either
pmap bootstrap functions.

While here remove an unneeded printf that indirectly used it or was
related to the previous printf.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42567
2023-11-15 18:05:08 +00:00
Andrew Turner 5fae53589e arm64: Use pmap_early_vtophys in pmap_bootstrap_san
Use pmap_early_vtophys to find the physical address of the kernel base
rather than using the calculated offset as it will be removed in a
latter commit.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42566
2023-11-15 18:05:08 +00:00
Andrew Turner 7eb26be9c8 arm64: Use adrp + :lo12: to load globals from asm
When loading a global variable we can use a pseudo-instruction similar
to "ldr, xn, =global" to load the address of the symbol. As this is
unlikely to be supported by a mov instruction a pc-relative load is
used, with the absolute address written at the end of the function so
it will be loaded.

This load can be partially replaced with an adrp instruction. This
generates the address, aligned to a 4k boundary, using a pc-relative
addition. Because the address is 4k-aligned we then update reading the
global variable using a load with the offset of the load the low
12-bits of the global. Arm64 assemblers have :lo12: to support this,
e.g. "ldr xn, [xn, :lo12:global]".

The only remaining users of "ldr, xn, =global" that I can find are
executed from the physical address space the kernel was loaded in and
need an address in the kernels virtual address space. Because of this
they can't use adrp.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42565
2023-11-15 18:05:08 +00:00
Andrew Gallatin ba0e4d7971 smbios: handle smbios3 for arm64
Get smbios working on arm64 where it seems to be
exclusively smbios version 3.x

The "interesting" thing here is that the smbios table seems to be
RAM in the EFI runtime services table. This makes it owned by "ram0",
and not io memory. That prevents bus_alloc_resource() from being able
to claim it, since ram0 already owns it. According to jhb, this is
how things are supposed to work.  Eg, bus_alloc_resource() is meant
to be used with IO memory, not physical memory.  Following his
suggestion, I converted the driver to simply use pmap_mapbios().

This is a prerequisite for getting IPMI to attach via the SSIF
attachment on arm64 servers, where all IPMI that I've seen
uses SSIF.

Note that this change is based on initial work by Allan Jude in
https://reviews.freebsd.org/D28739.

Reviewed by: imp
Sponsored by: Netflix, Ampere Computing LLC (D28739)
Differential Revision: https://reviews.freebsd.org/D42592
2023-11-15 11:20:04 -05:00
Doug Moore 2a4897bd4e vm_phys: fix freelist_contig
vm_phys_find_freelist_contig is called to search a list of max-sized
free page blocks and find one that, when joined with adjacent blocks
in memory, can satisfy a request for a memory allocation bigger than
any single max-sized free page block. In commit
fa8a6585c7, I defined this function in
order to offer two improvements: 1) reduce the worst-case search time,
and 2) allow solutions that include less-than max-sized free page
blocks at the front or back of the giant allocation. However, it turns
out that this change introduced an error, reported in In Bug
274592. That error concerns failing to check segment boundaries. This
change fixes an error in vm_phys_find_freelist_config that resolves
that bug. It also abandons improvement 2), because the value of that
improvement is small and because preserving it would require more
testing than I am able to do.

PR:		274592
Reported by:	shafaisal.us@gmail.com
Reviewed by:	alc, markj
Tested by:	shafaisal.us@gmail.com
Fixes:	fa8a6585c7 vm_phys: avoid waste in multipage allocation
MFC after:	10 days
Differential Revision:	https://reviews.freebsd.org/D42509
2023-11-15 03:25:45 -06:00
John Baldwin ede077bf2a sys: Disable -Walloc-size-larger-than for GCC 9+
By default this warns about sizes larger than PTRDIFF_MAX passed to
malloc (rather than SIZE_MAX).  This doesn't trigger
deterministically, but it does trigger for kmalloc() of struct_size()
in iwlwifi's iwl_configure_rxq even when struct_size() is changed to
use PTRDIFF_MAX.  NB: struct_size() in Linux caps the size at
SIZE_MAX, not PTRDIFF_MAX via size_mul().

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D42587
2023-11-14 18:37:25 -08:00
John Baldwin be909a79a8 qlnx: Fix a couple of type mismatches in function declarations
Reported by:	GCC 13 via -Wenum-int-mismatch
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42586
2023-11-14 18:37:06 -08:00
John Baldwin 7aa5b2a9e7 ocs: Fix a couple of type mismatches in function prototypes
Reported by:	GCC 13 via -Wenum-int-mismatch
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42585
2023-11-14 18:36:48 -08:00
John Baldwin 1e65df6840 ath_hal: Fix a couple of type mismatches in function prototypes
Reported by:	GCC 13 via -Wenum-int-mismatch
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42584
2023-11-14 18:36:32 -08:00
Justin Hibbits 8ef8939fd4 bcm2835/spi: Support SPI_FLAG_KEEP_CS
Summary:
3c08673438 brought in SPI_FLAG_KEEP_CS to keep the SPI chip select held
post-transfer completion.  Add this support to bcm2835 SPI for SPI
devices that need it.  As part of this, the owner thread needed carried
through so that no other thread can take over the SPI bus until the
owner releases the chip select.

Reviewed by:	manu
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D42599
2023-11-14 16:47:35 -05:00
Eugene Grosbein 20e1f207cc ng_ipfw: allow use of 32 bits wide cookies
There is no reason in truncating 32 bits cookie value to 16 bits.

Reviewed by:	glebius
MFC after:	2 weeks
2023-11-14 16:36:08 +07:00