There is some exotic conditional logic here to avoid building a
particular test if a certain UBSAN library isn't present in the
toolchain sysroot. This causes build failures for me when doing an
"installworld WITHOUT_TOOLCHAIN=", which I do frequently during tests.
I believe the problem is that SYSROOT is unset during installworld, so
the build sees the host's copy of libclang_rt.ubsan_standalone.a and
then tries to install a binary that wasn't built during buildworld. Try
to make the check a bit less fragile.
Reviewed by: dim
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D45035
This patch introduces the RoCE driver for the
Broadcom NetXtreme-E 10/25/50/100/200G RoCE HCAs.
The RoCE driver is a two part driver that relies
on the bnxt_en NIC driver to operate. The changes
needed in the bnxt_en driver is included through
another patch "L2-RoCE driver communication interface"
in this set.
Presently, There is no user space support, Hence
recommendation to use the krping kernel module for
testing. User space support will be incorporated in
subsequent patch submissions.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45011
This file is automatically generated from the firmware code to
export the driver interfaces.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45009
Implement firmware error recovery support for Thor adapters.
This entails enabling the capability for the firmware to initiate
error recovery. Specifically, the firmware will send the reset notify
asynchronous event to notify the driver of an error and impending reset.
Subsequently, the driver will queue a task to execute the following steps.
1. Deactivate the allocated resources.
2. Await completion of the firmware's recovery process.
3. Configure the resources and reactivate the network interface.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45008
- Added Aux bus support for RoCE.
- Implemented the ulp ops that are required by RoCE driver.
- Restructure context memory data structures
- DBR pacing support
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45006
... or install an empty file.
The locate database is a mutable working file, and unsuitable to be
managed by pkg(8). locate(1) copes gracefully with the absence of
this file. Running /etc/periodic/weekly/310.locate will create the
locate database with the correct ownership and permissions.
Having the locate.database file as part of the FreeBSD-runtime package
means it gets zeroed if ever that package gets updated, which is
excessive, given that updating packages will typically only change a
relatively small number of the _filenames_ on the system -- unlike the
file contents. Plus it always causes it to flag as modified when
verifying checksums, but /var/db/locate.database is expected to be
modified by the user.
MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D45384
Created new directory "bnxt_en" in /dev/bnxt and /modules/bnxt
and moved source files and Makefile into respective directory.
ETS support:
- Added new files bnxt_dcb.c & bnxt_dcb.h
- Added sysctl node 'dcb' and created handlers 'ets' and
'dcbx_cap'
- Add logic to validate user input and configure ETS in
the firmware
- Updated makefile to include bnxt_dcb.c & bnxt_dcb.h
PFC support:
- Created sysctl handlers 'pfc' under node 'dcb'
- Added logic to validate user input and configure PFC in
the firmware.
App TLV support:
- Created 3 new sysctl handlers under node 'dcb'
- set_apptlv (write only): Sets a specified TLV
- del_apptlv (write only): Deletes a specified TLV
- list_apptlv (read only): Lists all APP TLVs configured
- Added logic to validate user input and configure APP TLVs
in the firmware.
Added Below DCB ops for management interface:
- Set PFC, Get PFC, Set ETS, Get ETS, Add App_TLV, Del App_TLV
Lst App_TLV
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45005
In function qlnx_rdma_deregister_if,
the address of object rdma_if will be printed out.
rdma_if is the address of a global variable qlnxr_drv,
which is passed from dev/qlnx/qlnxr/qlnxr_os.c
A kernel address leakage happens.
Fix this by removing the printf statement.
PR: 238646
MFC after: 1 week
QL_DPRINT2 checks the debug level first before printing.
Replace device_printf with QL_DPRINT2 to check debug level
first before printing out the kernel pointers.
PR: 238656
MFC after: 1 week
QL_DPRINT2 checks the debug level first and then prints.
Replace device_printf with QL_DPRINT2 to check debug level
first before printing out the kernel pointers.
PR: 238655
MFC after: 1 week
mlx4 and mlx5 are Ethernet devices and ether_ifattach() does an
unconditional bpfattach(). From commit 16d878cc99 [1] and on, we
should not check ifp->if_bpf to tell us whether or not we have any bpf
peers that might be interested in receiving packets. And since commit
2b9600b449 [2], ifp->if_bpf can not be NULL even after the network
interface has been detached.
No functional change intended.
1. 16d878cc99 Fix the following bpf(4) race condition which can result in a panic
2. 2b9600b449 Add dead_bpf_if structure, that should be used as fake bpf_if during ifnet detach
Reviewed by: kp, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45196
Commit a16ff32f04 added support to the kernel RPC to set
TCP_USE_DDP.
However, for the unusual case of a NFSv4.1/4.2 non-NULL callback,
the xp_socket field of SVCXPRT is NULL, since it uses the same
socket as the client->server connection.
This patch adds the check for this to avoid crashes.
This only affects NFSv4.1/4.2 mounts where either pNFS or
delegations are in use.
MFC after: 3 days
I cannot find a time where the function was not named this.
Reviewed by: kib, markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45383
Change --mixedform output to adapt to bsdinstall restoring dialog(1)
behavior.
Avoid to print the field value to output if <fieldlen> is read-only
(less than or equal to zero). This fixes passwords in wlanconfig,
avoiding to print also SSID.
To note --mixedform continues to print field value if <flag> is
read-only. This avoids breaking netconfig and netconfig_ipv6.
See /usr/src/contrib/bsddialog/CHANGELOG '2024-05-27 Version 1.0.3'
for more detailed information.
Reported by: garga
(redo branch main moved forward)
Merge commit '813f3dc7b302324a361326c2583f37b002100968' into redo-bsddialog-1.0.3
Change --mixedform output to adapt to bsdinstall restoring dialog(1)
behavior.
Avoid to print the field value to output if <fieldlen> is read-only
(less than or equal to zero). This fixes passwords in wlanconfig,
avoiding to print also SSID.
To note --mixedform continues to print field value if <flag> is
read-only. This avoids breaking netconfig and netconfig_ipv6.
See /usr/src/contrib/bsddialog/CHANGELOG '2024-05-27 Version 1.0.3'
for more detailed information.
Reported by: garga
aesni.ko only exists on amd64 and i386, so on other platforms we are
just running geli.sh twice.
In fact, this test has little value anymore because aesni is included in
GENERIC, so it's always going to be used in preference to cryptosoft.
Reviewed by: pho
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45366
On arm platforms "char" is typically unsigned, in which case the test
"(c = getopt(...)) != -1" does not behave as desired.
Reviewed by: pho
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45365
da76d34 repurposed the use of UMA_MD_SMALL_ALLOC in a way that breaks
arc_available_memory on -CURRENT. This change ensures that
arc_available_memory uses the new symbol while maintaining compatibility
with older FreeBSD releases. This change was submitted to upstream
as well.
Approved by: markj (mentor)
Fixes: da76d34
The functions like gmtime(3) expect to cache a GMT time zone. Some
sandboxed programs (like last(1)) use the gmtime(3) function.
In case of last(1), this function fails to load a proper time zone
because it is called after entering the capability mode.
_open () at _open.S:4
0x00000008011bc5a8 in tzloadbody (name=0x8018b9580 "/usr/share/zoneinfo/Etc/UTC", sp=0x801870140,
tzload (name=<optimized out>, sp=0x801870140, doextend=true)
0x00000008011bb8ba in gmtload (sp=0x801870140) at /usr/src/contrib/tzcode/localtime.c:1456
gmtcheck () at /usr/src/contrib/tzcode/localtime.c:1581
0x000000080111f85a in _libc_once (once_control=0x80127c550, init_routine=0x0)
_once (once_control=0x80127c550, init_routine=0x0) at /usr/src/lib/libc/gen/_once_stub.c:63
0x00000008011bb9d0 in gmtime_r (timep=0x7fffffffe3a8, tmp=0x80127c568)
gmtime (timep=timep@entry=0x7fffffffe3a8) at /usr/src/contrib/tzcode/localtime.c:1865
0x0000000001024cd4 in printentry (bp=bp@entry=0x8018b4800, tt=tt@entry=0x80186a0a0)
0x00000000010245ae in doentry (bp=0x8018b4800)
0x00000000010243a7 in main (argc=1, argv=<optimized out>)
This time zone is not loaded by the tzset(3) function. Because of
that, extend the caph_cache_tzdata(3) function to also include the
GMT time zone. There is no other way to cache this data than
calling gmtime(3) once.
MFC after: 5 days
Reviewed by: emaste, markj
Differential Revision: https://reviews.freebsd.org/D45297
This ensures we use the handle opened with pfctl_open(), and also brings
us closer to the ideal state where everything uses the handle rather
than a file descriptor.
Neither glibc nor musl define these interfaces, so provide them for all
Linux builds.
Sponsored by: Netflix
Reviewed by: val_packett.cool
Differential Revision: https://reviews.freebsd.org/D45355
FreeBSD assumes that sys/types.h includes sys/cdefs.h, so add it here.
FreeBSD also needs __*int*_t defined for software we bootstrap (a lot of
it). GLIBC defines these, but musl does not, so we have to define them
here, even though it looks backwards. There's no good #define to key off
of, so use !defined GLIBC since on Linux defacto there's only two libc
implementations.
Co-authored-by: Val Packett <val@packett.cool>
Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by: val_packett.cool
Differential Revision: https://reviews.freebsd.org/D45354
string.h defines strmode with a mode_t argument. POSIX states that one
must include sys/types.h to get mode_t, so do that here. This makes musl
happier. We know that sys/types.h will include sys/cdefs.h, so just
replace the latter with the former.
Co-authored-by: Val Packett <val@packett.cool>
Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by: val_packett.cool
Differential Revision: https://reviews.freebsd.org/D45353
FreeBSD has a style(9) enforced assumption that sys/param.h includes
sys/types.h. However, Linux under musl doesn't do this so go ahead and
explicitly include it here. It won't hurt on the glibc systems, and
helps musl.
Co-authored-by: Val Packett <val@packett.cool>
Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by: val_packett.cool
Differential Revision: https://reviews.freebsd.org/D45352
On Linux with musl, sys/cdefs.h isn't included with fcntl.h, so when we
use __BEGIN_DECL and __END_DECL in this file, it fails. There's no harm
in unconditionally including sys/cdefs.h here, so do that to avoid
encoding exactly where it is or isn't needed so we don't have to know
too much about the internal state of other libc implementations.
Co-authored-by: Val Packett <val@packett.cool>
Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by: val_packett.cool
Differential Revision: https://reviews.freebsd.org/D45351
On Linux, stddef.h will define __size_t to something when size_t is
defined. On FreeBSD, __size_t is an actual typedef which we need for
other parts of the system. If __size_t isn't defined, that tells us we
need to define the fallback __size_t typedef (if it is defined, then we
can't easily redefine it without issues because glob.h will define it to
something different than stddef.h defines it). Add a comment to this
effect.
Sponsored by: Netflix
Reviewed by: val_packett.cool
Differential Revision: https://reviews.freebsd.org/D45350
fts has different types for its compare rotuine. Other systems, not
4.4BSD based, have a non-const version. Before we tested against
__GLIBC__, but now we test against __linux__ because that's Linux's API
and musl doesn't define __GLIBC__.
In addition, link against libftl on this platform since musl doesn't
include ftl routines in libc, but rather in libftl.
Co-authored-by: Val Packett <val@packett.cool>
Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by: val_packett.cool
Differential Revision: https://reviews.freebsd.org/D45349
The LK_NOWAIT was added to suppress a witness warning, but LK_NOWITNESS
is more what we mean. This makes pbuf_ctor() more consistent with
buf_alloc(), although, unlike buf_alloc(), for pbuf there should not be
any danger of a wild locker relying on the type stability of the buf to
attempt a lock. That is, this is essentially cosmetic.
Relevant history:
- 531f8cfea0 Use dedicated lock name for pbufs
- 5875b94c74 buf_alloc(): lock the buffer with LK_NOWAIT
- c9e023541a pbuf_ctor(): lock the buffer with LK_NOWAIT
- 1fb00c8f10 buf_alloc(): Stop using LK_NOWAIT, use LK_NOWITNESS
Reviewed by: rew, kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D45360
The PR reported hangs that were avoided when this commit was
reverted. Since it was only a cleanup, revert it.
The LORs in the PR need further investigation, since I think
readahead only hides the problem.
PR: 279138
This reverts commit fbe965591f.
UMA_MD_SMALL_ALLOC was recently replaced by UMA_USE_DMAP, but
da76d349b6 missed some improper uses of the old symbol.
This change makes sure that UMA_USE_DMAP is used properly in
code that selects uma_small_alloc.
Fixes: da76d349b6
Reported by: eduardo, rlibby
Approved by: markj (mentor)
Differential Revision: https://reviews.freebsd.org/D45368
PR: 279182
Some manual pages have a copyright notice or commit id before including
other files with the .so macro. We need to skip comments and empty lines
at the beginning of the manpage while checking for the first .so macro.
MFC after: 1 week
[X86] Add slow div64 tuning flag to Nehalem target (#91129)
This appears to have been missed because later cpus don't inherit from Nehalem tuning much.
Noticed while cleaning up for #90985
Merge commit 8b400de79eff from llvm-project (by Simon Pilgrim):
[X86] Enable TuningSlowDivide64 on Barcelona/Bobcat/Bulldozer/Ryzen Families (#91277)
Despite most AMD cpus having a lower latency for i64 divisions that converge early, we are still better off testing for values representable as i32 and performing a i32 division if possible.
All AMD cpus appear to have been missed when we added the "idivq-to-divl" attribute - this patch now matches Intel cpu behaviour (and the x86-64/v2/3/4 levels).
Unfortunately the difference in code scheduling means I've had to stop using the update_llc_test_checks script and just use old-fashioned CHECK-DAG checks for divl/divq pairs.
Fixes#90985
This fixes possibly worse runtime performance on AMD Zen hardware, when
using -march=znver4 (or any other znver), as opposed to -march=x86-64-v4
or the baseline -march=x86-64. A similar fix is applied for Nehalem.
PR: 278908
MFC after: 3 days
When we first find an inp, we set also the tp. If then a second
lookup is necessary, the inp is recomputed. If this fails, the
tp is not cleared, which resulted in failing KASSERT.
Therefore, clear the tp when staring the inp lookup procedure.
Reported by: Jenkins
Fixes: 02d15215ce ("tcp: improve blackhole support")
MFC after: 1 week
Sponsored by: Netflix, Inc.
This commit introduces the MINIDUMP_STARTUP_PAGE_TRACKING symbol and
uses it to simplify several instances of a complex preprocessor conditional
for adding pages allocated when bootstraping the kernel to minidumps.
Reviewed by: markj, mhorne
Approved by: markj (mentor)
Differential Revision: https://reviews.freebsd.org/D45085