Kristof Provost [Thu, 16 Nov 2023 16:06:29 +0000 (17:06 +0100)]
pf: always create multihomed states as floating
When we create a new state for multihomed sctp connections (i.e.
based on INIT/INIT_ACK or ASCONF parameters) we cannot know what
interfaces we'll be seeing that traffic on. Make those states floating,
irrespective of state policy.
MFC after: 1 week
Sponsored by: Orange Business Services
Kirk McKusick [Fri, 17 Nov 2023 22:10:29 +0000 (14:10 -0800)]
Ensure I/O buffers in libufs(3) are 128-byte aligned.
Various disk controllers require their buffers to be aligned to a
cache-line size (128 bytes). For buffers allocated in structures,
ensure that they are 128-byte aligned. Use aligned_malloc to allocate
memory to ensure that the returned memory is 128-byte aligned.
While we are here, we replace the dynamically allocated inode buffer
with a buffer allocated in the uufsd structure just as the superblock
and cylinder group buffers do.
This can be removed if/when the kernel is fixed. Because this problem
has existed on one I/O subsystem or another since the 1990's, we
are probably stuck with dealing with it forever.
The problem most recent showed up in Azure, see:
https://reviews.freebsd.org/D41728
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267654
Before these fixes were applied, it was confirmed that the changes
in this commit also fixed the issue in Azure.
Reviewed-by: Warner Losh, kib
Tested-by: Souradeep Chakrabarti of Microsoft (earlier version)
PR: 267654
Differential Revision: https://reviews.freebsd.org/D41724
Mike Karels [Fri, 17 Nov 2023 18:51:18 +0000 (12:51 -0600)]
khelp: suppress useless warning message on shutdown
If a module (e.g. the ertt hhook for TCP) can't clean up at
shutdown, there is nothing to be done about it. In the ertt case,
cleanup is just shutting down a UMA zone, which doesn't need to be
done. Suppress EBUSY warnings on shutdown.
PR: 271677
Reviewed by: tuexen, imp
Differential Revision: https://reviews.freebsd.org/D42650
Gordon Bergling [Fri, 17 Nov 2023 18:24:22 +0000 (19:24 +0100)]
SEE ALSO section improvements for tuning(7), tunefs(8) and fsck_ffs(8)
cross-reference ffs(7) in fsck_ffs(8)
cross-reference ffs(7) and tuning(7) in tunefs(8)
cross-reference ffs(7) in tuning(7)
PR: 263433
Reviewed by: bcr
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D42631
Alexander Motin [Fri, 17 Nov 2023 17:41:41 +0000 (12:41 -0500)]
Fix typo in previous
d282baddb0b02, breaking DTrace.
Gleb Smirnoff [Fri, 17 Nov 2023 17:24:30 +0000 (09:24 -0800)]
ng_ksocket: fix accept(2)
- Provide listen upcall and set it on NGM_KSOCKET_LISTEN
- Mask EWOULDBLOCK on NGM_KSOCKET_ACCEPT
Reviewed by: afedorov
Differential Revision: https://reviews.freebsd.org/D42637
PR: 272319
PR: 275106
Fixes:
779f106aa169256b7010a1d8f963ff656b881e92
Gleb Smirnoff [Fri, 17 Nov 2023 17:23:58 +0000 (09:23 -0800)]
ng_ksocket: fix upcall clearing on node shutdown
Note: imho, the proper solution would be to guarantee that upcalls
won't ever be called after soclose(), but this isn't the case, yet.
This change at least makes the node work the way it always worked.
Reviewed by: afedorov
Differential Revision: https://reviews.freebsd.org/D42636
PR: 272319
PR: 275106
Fixes:
779f106aa169256b7010a1d8f963ff656b881e92
Brad Davis [Fri, 17 Nov 2023 17:06:36 +0000 (10:06 -0700)]
Fix a comment typo.
Igor Ostapenko [Fri, 17 Nov 2023 16:04:01 +0000 (17:04 +0100)]
pf: fix dummynet + ipdivert use case
Dummynet re-injects an mbuf with MTAG_IPFW_RULE added, and the same mtag
is used by divert(4) as parameters for packet diversion.
If according to pf rule set a packet should go through dummynet first
and through ipdivert after then mentioned mtag must be removed after
dummynet not to make ipdivert think that this is its input parameters.
At the very beginning ipfw consumes this mtag what means the same
behavior with tag clearing after dummynet.
And after
fabf705f4b5a pf passes parameters to ipdivert using its
personal MTAG_PF_DIVERT mtag.
PR: 274850
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D42609
Ka Ho Ng [Fri, 17 Nov 2023 16:34:57 +0000 (11:34 -0500)]
dirdeps: Fix libpcap Makefile.depend.options
This prevents libpcap's Makefile.depend from flip-flopping when OFED is
enabled.
Sponsored by : Juniper Networks, Inc.
MFC after: 7 days
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D42649
Mark Johnston [Fri, 17 Nov 2023 14:29:28 +0000 (09:29 -0500)]
ktls tests: Relax error checking for shutdown(2) a bit
In my test suite runs I occasionally see shutdown(2) fail with
ECONNRESET rather than ENOTCONN. soshutdown(2) will return ENOTCONN if
the socket has been disconnected (synchronized by the socket lock), and
tcp_usr_shutdown() will return ECONNRESET if the inpcb has been dropped
(synchronized by the inpcb lock). I think it's possible to pass the
first check in soshutdown() but fail the second check in
tcp_usr_shutdown(), so modify the KTLS tests to permit this.
Reviewed by: jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42277
Bjoern A. Zeeb [Fri, 17 Nov 2023 12:31:36 +0000 (12:31 +0000)]
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
Bjoern A. Zeeb [Fri, 17 Nov 2023 12:26:28 +0000 (12:26 +0000)]
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
Kristof Provost [Fri, 17 Nov 2023 09:19:38 +0000 (10:19 +0100)]
libpfctl: handle pfctl_do_ioctl() failures better
Ensure that we free nvlists and other allocations if pfctl_do_ioctl()
fails.
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Kristof Provost [Fri, 17 Nov 2023 09:14:59 +0000 (10:14 +0100)]
libpfctl: handle allocation failure
While it's unlikely for userspace to fail to allocate memory it is still
possible. Handle malloc() returning NULL.
Reported by: Bill Meeks <bill@themeeks.net>
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Bjoern A. Zeeb [Wed, 15 Nov 2023 13:13:22 +0000 (13:13 +0000)]
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
Bjoern A. Zeeb [Fri, 17 Nov 2023 00:47:11 +0000 (00:47 +0000)]
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
Bjoern A. Zeeb [Wed, 15 Nov 2023 11:46:44 +0000 (11:46 +0000)]
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
Richard Scheffenegger [Wed, 15 Nov 2023 21:37:42 +0000 (22:37 +0100)]
[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
Martin Matuska [Fri, 17 Nov 2023 09:00:16 +0000 (10:00 +0100)]
zfs: update zfs_config.h and zfs_gitrev.h missed in
47bb16f8f0
Martin Matuska [Fri, 17 Nov 2023 08:39:42 +0000 (09:39 +0100)]
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:
03e9caaec006134b3db9d02ac40fe9369ee78b03
Gleb Smirnoff [Fri, 17 Nov 2023 02:30:35 +0000 (18:30 -0800)]
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
Konstantin Belousov [Thu, 16 Nov 2023 22:42:25 +0000 (00:42 +0200)]
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
Konstantin Belousov [Thu, 16 Nov 2023 20:47:18 +0000 (22:47 +0200)]
kernel: add missed FEATUREs compat_freebsd 8-14
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Konstantin Belousov [Thu, 16 Nov 2023 19:45:52 +0000 (21:45 +0200)]
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
Konstantin Belousov [Tue, 14 Nov 2023 22:49:35 +0000 (00:49 +0200)]
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
Konstantin Belousov [Tue, 14 Nov 2023 22:48:47 +0000 (00:48 +0200)]
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
Rich Ercolani [Thu, 16 Nov 2023 19:35:22 +0000 (14:35 -0500)]
Add a tunable to disable BRT support.
Copy the disable parameter that FreeBSD implemented, and extend it to
work on Linux as well, until we're sure this is stable.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #15529
Jonathan T. Looney [Thu, 16 Nov 2023 17:45:02 +0000 (17:45 +0000)]
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:
accfb4cc9346
Sponsored by: Netflix
Umer Saleem [Thu, 16 Nov 2023 16:58:47 +0000 (21:58 +0500)]
Packaging: Auto-generate changelog during configure (#15528)
Auto-generate changelog based off on @VERSION@ during configure,
so that it is not needed to be update with new releases / version
updates.
Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Gleb Smirnoff [Thu, 16 Nov 2023 16:23:48 +0000 (08:23 -0800)]
socket tests: add socket_accept
Start with most basic functionality on a TCP socket.
Jonathan T. Looney [Thu, 16 Nov 2023 15:02:32 +0000 (15:02 +0000)]
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
Martin Matuska [Mon, 13 Nov 2023 13:29:27 +0000 (14:29 +0100)]
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
Thomas Eberhardt [Thu, 16 Nov 2023 09:59:38 +0000 (10:59 +0100)]
Fix /root permissions after 'make installworld'
According to /etc/mtree/BSD.root.dist /root should have
0750 permissions, but the build target 'make installworld'
changes these to 0755.
This is caused by the installation of the configuration
files of sh(1) and csh(1).
Correct this by specifying the correct default /root permissions.
PR: 273342
Reviewed by: jilles
Approved by: jilles
MFC after: 2 weeks
Differential Revision:https://reviews.freebsd.org/D42395
Gordon Bergling [Thu, 16 Nov 2023 09:48:09 +0000 (10:48 +0100)]
Document library types in the intro(3) manual page
Add a paragraph about library types to the intro(3)
manual page. Document library types, locations
and versioning.
Reviewed by: emaste, jilles, mhorne, pauamma_gundo.com
Obtained from: OpenBSD (partial)
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D36594
Yan-Hao Wang [Thu, 16 Nov 2023 07:58:49 +0000 (15:58 +0800)]
Add tests for gunion(8)
Reviewed by: mckusick (earlier version)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41645
Alexander Motin [Thu, 16 Nov 2023 04:45:22 +0000 (23:45 -0500)]
iostat: Restore lost spaces after tout
MFC after: 2 weeks
Alexander Motin [Thu, 16 Nov 2023 04:03:40 +0000 (23:03 -0500)]
Add interface NVME to devstat
This allows to list only NVMe devices in systat, iostat, vmstat, etc.
Previously those were counted as OTHER.
Alexander Motin [Thu, 16 Nov 2023 03:56:51 +0000 (22:56 -0500)]
vmstat: Make disks reporting some more reasonable
MFC after: 1 month
John Baldwin [Thu, 16 Nov 2023 00:53:53 +0000 (16:53 -0800)]
pkg: Allocate a suitably-sized string for the local ABI
Previously the local ABI string was written to an on-stack buffer and
the pointer to that buffer was saved in a global before the function
returned. This had two issues: c[ABI].val pointed to a
no-longer-valid on-stack buffer after config_init returned, and the
string could potentially be truncated. Fix both of those by changing
pkg_get_myabi to return a pointer to a string allocated by asprintf.
Note that the allocated string is left in the global config array
until it is implicitly freed on process exit.
Reported by: GCC 13 -Wdangling-pointer
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42623
Andrew Gallatin [Thu, 16 Nov 2023 00:51:28 +0000 (19:51 -0500)]
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
Brooks Davis [Wed, 15 Nov 2023 23:43:56 +0000 (23:43 +0000)]
libc: remove unused stub vdso timecounter implementations
All supported architectures have shared page support so remove this
unused stub.
Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D42619
Brooks Davis [Wed, 15 Nov 2023 23:42:37 +0000 (23:42 +0000)]
libc: centralize a few numeric symbols
fabs, __infinity, and __nan are universally implemented so declare them
in gen/Symbol.map.
We would also include __flt_rounds, but it's under FBSD_1.3 on arm so
until that's gone we're stuck with it. Likewise, everyone but i386
implements fp[gs]etmask.
Reviewed by: imp, kib, emaste
Differential Revision: https://reviews.freebsd.org/D42618
Brooks Davis [Wed, 15 Nov 2023 23:42:18 +0000 (23:42 +0000)]
libc: centralize makecontext symbols
Declare makecontext() and __makecontext() symbols centrally as they are
always implemented.
Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D42617
Brooks Davis [Wed, 15 Nov 2023 23:41:35 +0000 (23:41 +0000)]
libc: centralize {_,sig,}{set,long}jmp symbols
These symbols are universally exposed and documented so declare them
centrally. Double- and triple-underscore versions exist on some
platforms, but leave those alone for now.
Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D42616
Brooks Davis [Wed, 15 Nov 2023 23:40:54 +0000 (23:40 +0000)]
libc: centralize ntoh symbols
These are implemented by net/ntoh.c via headers and compiler intrinsics
so declare them in net/Symbol.map.
Reviewed by: imp, kib, emaste
Differential Revision: https://reviews.freebsd.org/D42615
Brooks Davis [Wed, 15 Nov 2023 23:40:33 +0000 (23:40 +0000)]
libc: further centralize syscall symbols
All architectures necessarily implement _exit(2) and vfork(2) so
declare them in sys/Symbol.map.
Reviewed by: imp, kib, emaste
Differential Revision: https://reviews.freebsd.org/D42614
Brooks Davis [Wed, 15 Nov 2023 23:39:46 +0000 (23:39 +0000)]
lib{c,lzma,z}: remove -DSYMBOL_VERSIONING from CFLAGS
This was part of a libkse and libpthread transition aide when libc
gained symbol versions in
e62165c8b0f7d6452c0033127a0fd8ad1d9e34d3
(March 2006). The code that cared about this macro was removed in
commit
00fb440c1a145b56b6c75fd405d80071aef2aab1 (May 2007) when symbol
versioning was enabled by default and libthr became the default
threading library. For unknown reasons, it stayed in libc (which
seemingly never used it) and seems to have been copied to liblzma and
libz.
Reviewed by: imp, kib, emaste
Differential Revision: https://reviews.freebsd.org/D42613
Alan Somers [Fri, 10 Nov 2023 17:28:32 +0000 (10:28 -0700)]
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
Alan Somers [Thu, 9 Nov 2023 22:58:56 +0000 (15:58 -0700)]
libc/libc/rpc: refactor some global variables
* Combine dg_fd_locks and dg_cv into one array.
* Similarly for vc_fd_locks and vc_cv
* Turn some macros into inline functions
This is a mostly cosmetic change to make refactoring these strutures in
a future commit easier.
MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D42597
Konstantin Belousov [Mon, 13 Nov 2023 00:09:57 +0000 (02:09 +0200)]
mlx5_core: add new files to the static files list
Sponsored by: NVidia networking
MFC after: 1 week
Konstantin Belousov [Mon, 13 Nov 2023 00:17:09 +0000 (02:17 +0200)]
mlx5core: add linux/bitops.h include for mlx5_ifc.h use of BIT()
Sponsored by: NVidia networking
MFC after: 1 week
Patrisious Haddad [Tue, 4 Apr 2023 06:01:24 +0000 (09:01 +0300)]
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
Konstantin Belousov [Mon, 13 Nov 2023 00:16:51 +0000 (02:16 +0200)]
mlx5ib: adjust for the mlx5_create_auto_grouped_flow_table() interface change
Sponsored by: NVidia networking
MFC after: 1 week
Mark Bloch [Wed, 22 Feb 2023 05:44:56 +0000 (05:44 +0000)]
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
Raed Salem [Mon, 20 Feb 2023 16:10:29 +0000 (16:10 +0000)]
mlx5: add fs_counters
Signed-off-by: Raed Salem <raeds@nvidia.com>
Sponsored by: NVidia networking
MFC after: 1 week
Mark Bloch [Mon, 20 Feb 2023 15:46:42 +0000 (15:46 +0000)]
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
Mark Bloch [Sun, 19 Feb 2023 14:16:43 +0000 (14:16 +0000)]
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
Mark Bloch [Sun, 19 Feb 2023 14:05:16 +0000 (14:05 +0000)]
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
Mark Bloch [Sun, 19 Feb 2023 12:25:10 +0000 (12:25 +0000)]
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
Mark Bloch [Sun, 19 Feb 2023 11:27:30 +0000 (11:27 +0000)]
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
Mark Bloch [Sun, 19 Feb 2023 11:15:00 +0000 (11:15 +0000)]
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
Mark Bloch [Sun, 19 Feb 2023 10:47:50 +0000 (10:47 +0000)]
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
Mark Bloch [Sun, 19 Feb 2023 09:36:07 +0000 (09:36 +0000)]
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
Mark Bloch [Sun, 19 Feb 2023 08:41:24 +0000 (08:41 +0000)]
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
Warner Losh [Wed, 15 Nov 2023 22:28:05 +0000 (15:28 -0700)]
Revert "awk: Merge upstream 2nd Edition Awk Book"
The pre-push testing I did turned out to be testing the old version with
the old testsuite (for reasons I don't understnad). There's issues with
the new version, the new test in the suite or (likely) both. Revert
until they can be chased down.
This should also fix the github CI that's gone red since this commit.
This reverts commit
3fd60a6b73ac01a72df89751f173970fae4cae73, reversing
changes made to
194df014feebd8b169b41ecd75ae73d63a792d6b.
Sponsored by: Netflix
Andrew Gallatin [Wed, 15 Nov 2023 21:22:00 +0000 (16:22 -0500)]
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
Andrew Turner [Wed, 15 Nov 2023 18:13:39 +0000 (18:13 +0000)]
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
Andrew Turner [Wed, 15 Nov 2023 17:42:02 +0000 (17:42 +0000)]
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
Andrew Turner [Mon, 13 Nov 2023 15:39:06 +0000 (15:39 +0000)]
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
Andrew Turner [Mon, 13 Nov 2023 15:29:30 +0000 (15:29 +0000)]
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
Andrew Turner [Mon, 13 Nov 2023 16:34:56 +0000 (16:34 +0000)]
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
Andrew Turner [Sat, 11 Nov 2023 09:27:30 +0000 (09:27 +0000)]
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
Brooks Davis [Wed, 15 Nov 2023 17:51:03 +0000 (17:51 +0000)]
libc: Remove empty comments in Symbol.map
These were left over from $FreeBSD$ removal.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42612
Brooks Davis [Wed, 15 Nov 2023 17:50:53 +0000 (17:50 +0000)]
libc/<arch>/sys/Makefile.inc: remove cruft
Remove stray blank lines left over from $FreeBSD$ removal as well as
some CVS-era (perhaps pre-repocopy) version comments.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42611
Brooks Davis [Wed, 15 Nov 2023 17:47:02 +0000 (17:47 +0000)]
git-blame-ignore-revs: OptionalObsoleteFiles.inc sorting commits
Add sorting commits. This causes (suitably configured) git blame to
ignore the moving of blocks, correcting the associated commit for ~300
lines.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42602
Brooks Davis [Wed, 15 Nov 2023 17:46:57 +0000 (17:46 +0000)]
Sort .git-blame-ignore-revs by commit order
This makes it easier to add blocks of commits such as
4ca5df80393e1f2..
c90d0600ee000e78 which do a single thing over the
course of multiple commits. Sorting by hash would require manually
inserting each one with a comment.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42601
Andrew Gallatin [Wed, 15 Nov 2023 16:11:53 +0000 (11:11 -0500)]
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
Doug Moore [Wed, 15 Nov 2023 09:25:45 +0000 (03:25 -0600)]
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
fa8a6585c7522b7de6d29802967bd5eba2f2dcf1, 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:
fa8a6585c752 vm_phys: avoid waste in multipage allocation
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D42509
John Baldwin [Wed, 15 Nov 2023 02:37:25 +0000 (18:37 -0800)]
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
John Baldwin [Wed, 15 Nov 2023 02:37:06 +0000 (18:37 -0800)]
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
John Baldwin [Wed, 15 Nov 2023 02:36:48 +0000 (18:36 -0800)]
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
John Baldwin [Wed, 15 Nov 2023 02:36:32 +0000 (18:36 -0800)]
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
John Baldwin [Wed, 15 Nov 2023 02:36:03 +0000 (18:36 -0800)]
snmp_wlan: 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/D42582
John Baldwin [Wed, 15 Nov 2023 02:35:44 +0000 (18:35 -0800)]
makefs: Quiet a -Wdangling-pointer warning in cd9660_generate_path_table
This function temporarily stores a pointer to an on-stack variable (a
TAILQ_HEAD of a temporary list) into a global variable (*n).
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D42581
John Baldwin [Wed, 15 Nov 2023 02:35:27 +0000 (18:35 -0800)]
makefs cd9660: Unexpand a few TAILQ macros
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D42580
John Baldwin [Wed, 15 Nov 2023 02:35:04 +0000 (18:35 -0800)]
bsd.sys.mk: Disable -Wdangling-reference for GCC 13+
GCC raises this warning for libc++'s istream. It raises false
positives in other cases as well (GCC bugs 109640, 109642, 109671).
Warning from <istream>:
/usr/include/c++/v1/istream:1464:34: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
1464 | const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
| ^~~~
/usr/include/c++/v1/istream:1464:71: note: the temporary was destroyed at the end of the full expression 'std::__1::use_facet<ctype<char> >(std::__1::ios_base::getloc() const())'
1464 | const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D42579
John Baldwin [Wed, 15 Nov 2023 02:34:45 +0000 (18:34 -0800)]
Merge commit
3537338d1ab9 from llvm git (by Nikolas Klauser):
[libc++][libunwind] Fixes to allow GCC 13 to compile libunwind/libc++abi/libc++
These are changes to allow GCC 13 to successfully compile the runtimes stack.
Reviewed By: ldionne, #libc, #libunwind, MaskRay
Spies: MaskRay, zibi, SeanP, power-llvm-team, mstorsjo, arichardson, libcxx-commits
Differential Revision: https://reviews.llvm.org/D151387
Reviewed by: imp, dim, emaste
Differential Revision: https://reviews.freebsd.org/D42578
John Baldwin [Wed, 15 Nov 2023 02:34:21 +0000 (18:34 -0800)]
libgpio: Fix type mismatch for gpio_pin_[gs]et
Reported by: GCC 13 via -Wenum-int-mismatch
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D42577
John Baldwin [Wed, 15 Nov 2023 02:34:01 +0000 (18:34 -0800)]
libcasper: Neuter false positive -Wuse-after-free warnings from GCC 13
GCC 13 incorrectly thinks a call to free after a failed realloc is a
use after free.
lib/libcasper/services/cap_grp/cap_grp.c: In function 'group_resize':
lib/libcasper/services/cap_grp/cap_grp.c:65:17: error: pointer 'buf' may be used after 'realloc' [-Werror=use-after-free]
65 | free(buf);
| ^~~~~~~~~
lib/libcasper/services/cap_grp/cap_grp.c:63:19: note: call to 'realloc' here
63 | gbuffer = realloc(buf, gbufsize);
| ^~~~~~~~~~~~~~~~~~~~~~
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D42576
Cy Schubert [Tue, 14 Nov 2023 23:04:28 +0000 (15:04 -0800)]
libevent: Import libevent 2.1.12
MFC after: 2 weeks
Merge commit '
5223d1d95fddcef6f9a36e264a5800bd907ade8b' into main
Stephen J. Kiernan [Wed, 15 Nov 2023 00:38:47 +0000 (19:38 -0500)]
zoneinfo: fix makefile rules script
In make target rules, one needs to use subshell if there are
change directory commands that should only have an effect on the
other commands in the same line. Otherwise, if make is not running in
compatibility mode (for example, when -j flag is specified), commands
would be executed in a single shell and lines following the "cd" might
not work as expected.
Adjust the target script lines that use "cd" to run in a subshell
by adding appropriate parenthesis.
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D42608
Cy Schubert [Tue, 14 Nov 2023 23:02:42 +0000 (15:02 -0800)]
libevent: Import libevent 2.1.12
Alexander Motin [Tue, 14 Nov 2023 21:47:57 +0000 (16:47 -0500)]
L2ARC: Restrict write size to 1/4 of the device
PR #15457 exposed weird logic in L2ARC write sizing. If it appeared
bigger than device size, instead of liming write it reset all the
system-wide tunables to their default. Aside of being excessive,
it did not actually help with the problem, still allowing infinite
loop to happen.
This patch removes the tunables reverting logic, but instead limits
L2ARC writes (or at least eviction/trim) to 1/4 of the capacity.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15519
Justin Hibbits [Thu, 2 Nov 2023 20:09:14 +0000 (16:09 -0400)]
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
George V. Neville-Neil [Tue, 14 Nov 2023 21:09:18 +0000 (16:09 -0500)]
Address review feedback on a typo.
Reviewed by: jhb, gbe
Differential Revision: <https://reviews.freebsd.org/D42096>
George V. Neville-Neil [Thu, 5 Oct 2023 20:05:31 +0000 (16:05 -0400)]
A skeleton kernel module suitable for creating new such modules.
Chunwei Chen [Tue, 14 Nov 2023 20:59:02 +0000 (12:59 -0800)]
Fix snap_obj_array memory leak in check_filesystem()
Use goto out instead of return for early exit to make sure
snap_obj_array is freed.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@nutanix.com>
Closes #15516
Tony Hutter [Tue, 14 Nov 2023 17:55:28 +0000 (09:55 -0800)]
Linux 6.6 compat: META
Update the META file to reflect compatibility with the 6.6 kernel.
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #15520
Robert Clausecker [Fri, 22 Sep 2023 20:42:00 +0000 (16:42 -0400)]
lib/libc/tests/string: add extended unit tests for strcmp()
This changeset add a new set of tests that comprehensively test strcmp() on
various alignments of the input. This made it easy to smoke out many
exciting new bugs in the new SSE strcmp() implementation from D41971.
MFC after: 1 week
Reviewed by: ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41970