10445 Commits
Author SHA1 Message Date
Martin Matuska 61c70dc16a libarchive: merge from vendor branch
libarchive 3.8.10

ChangeLog:
https://github.com/libarchive/libarchive/compare/v3.8.9...v3.8.10

Obtained from:	libarchive
Vendor commit:	0c48412be2d94afe1859a807ea7896a18d8900bd
MFC after:	3 days
2026-10-26 22:47:32 +01:00
Martin Matuska a8dfdb79eb Update vendor/libarchive to 3.8.10
ChangeLog:
https://github.com/libarchive/libarchive/compare/v3.8.9...v3.8.10

Obtained from:		libarchive
Libarcive commit:	0c48412be2d94afe1859a807ea7896a18d8900bd
2026-10-26 14:25:48 +01:00
Dimitry Andric 28ec7cb871 Merge commit fd4113508a64 from llvm-project (by Minsoo Choo):
[libunwind] Support extended amd64 segment registers (#229176)

  Raise the amd64 DWARF register limit to 59 and add RFLAGS, all six
  segment selectors, FS.base, and GS.base to the register model. Capture
  the extended state and restore it when resuming, using sigreturn() on
  FreeBSD to restore selectors and bases together. Pack the state into the
  existing context buffers without changing their public sizes or the
  Windows XMM offsets.

  Add tests for register access, signal-frame CFI recovery, register
  bounds, and resume behavior.

  Assisted-by: GPT

MFC after:	1 week
2026-10-25 13:11:27 +01:00
Dimitry Andric 6a936d939b Merge commit 4d7292e58078 from llvm-project (by Minsoo Choo):
[libunwind] Unwind through AArch64 FreeBSD signal trampolines (#235065)

  Retried from https://reviews.llvm.org/D155066.

  Recognize signal trampolines using KERN_PROC_SIGTRAMP when unwind
  metadata is unavailable. Restore the interrupted PC, LR, SP, general
  registers, and valid floating-point registers.

  Add coverage for unwinding out of an interrupted leaf function on both
  regular and alternate signal stacks.

  Assisted-by: GPT

MFC after:	1 week
2026-10-25 13:11:27 +01:00
Dag-Erling Smørgrav 8133230d7e auditdistd: Avoid deprecated OpenSSL APIs
SSL_use_RSAPrivateKey_file() was deprecated in OpenSSL 3.0.  Use the
more generic SSL_use_PrivateKey_file() instead.

Sponsored by:	Klara, Inc.
Sponsored by:	Qualys, Inc.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D60899
2026-10-22 17:13:47 +02:00
Dag-Erling Smørgrav c6d7a2478c unbound: Update to 1.26.2
Release notes at
    https://community.nlnetlabs.nl/t/unbound-1-26-2-released

Merge commit 'ce3304d97ba4861eabac759e538426a568aef0a5'

Security:	CVE-2026-35501
Security:	CVE-2026-50106
Security:	CVE-2026-96405
Security:	CVE-2026-97206
Security:	CVE-2026-109125
2026-10-21 13:24:44 +00:00
Dag-Erling Smørgrav 0ce9d6e240 auditdistd: Fix build failure
Fixes:		4f19e4aca4 ("auditdistd: Use void pointers for opaque data")
Reported by:	garga@
2026-10-20 16:59:46 +02:00
Dag-Erling Smørgrav 4f19e4aca4 auditdistd: Use void pointers for opaque data
Use void, not char, for pointers to opaque data in our send and receive
functions.

Sponsored by:	Klara, Inc.
Sponsored by:	Qualys, Inc.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D60728
2026-10-20 15:28:37 +02:00
Igor Ostapenko af238d55d3 kyua: Fixes after vendor merge
Reviewed by:	ngie
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D60446
2026-10-18 17:22:55 +00:00
Ed Maste 79d491be21 Remove "All Rights Reserved" from FreeBSD Foundation copyrights
These ones were unambiguous cases where the Foundation was the only
listed copyright holder.
2026-10-15 13:07:36 -04:00
Dag-Erling Smørgrav 3ca4b8dd16 auditdistd: Use fixed-length protocol names
All communication between auditdistd senders and receivers and
internally between auditdistd and its worker children passes through the
same pair of send / receive functions.  The receive function uses
recv(2) with the MSG_WAITALL flag, which in theory means we should never
get a short read.  However, when handing off a socket to a worker child,
we also pass a variable-length string identifying the type of socket
we're passing, and reading this string relies on a short read.  This
used to work because the arrival of the descriptor would interrupt the
recv(2) call, but this bug was fixed when the AF_UNIX code was rewritten
a while ago and auditdistd has been broken ever since.

Fixing the length of the protocol name to four characters including the
terminating null solves the short-read bug by never requiring a short
read (nothing else in auditdistd requires one).

PR:		296107
MFC after:	1 week
Reviewed by:	js, kevans
Differential Revision:	https://reviews.freebsd.org/D59565
2026-10-13 17:55:40 +02:00
Dimitry Andric a3fbf20c05 Merge commit a5fa4dba6e2e from llvm-project (by PiJoules):
[compiler-rt] Add interceptors for free_[aligned_]sized for asan+hwasan (#189109)

This avoids a jemalloc assertion when running sanitized applications
against glib, which uses free_sized(3).

PR:		298943
MFC after:	1 week
2026-10-11 00:44:17 +02:00
Dimitry Andric 6b0f64133c Merge commit 681c2ee4dfbf from llvm-project (by Justin King):
asan: refactor interceptor allocation/deallocation functions (#145087)

  Do some refactoring to allocation/deallocation interceptors. Expose
  explicit per-alloc_type functions and stop accepting explicit AllocType.
  This ensures we do not accidentally mix.

  NOTE: This change rejects attempts to call `operator new(<some_size>,
  static_cast<std::align_val_t>(0))`.

  For https://github.com/llvm/llvm-project/issues/144435

  Signed-off-by: Justin King <[email protected]>

This a prerequisite for adding sanitizer interceptors for free_sized(3)
and free_aligned_sized(3).

PR:		298943
MFC after:	1 week
2026-10-11 00:44:17 +02:00
Dimitry Andric 0008561567 compiler-rt: enable use of .preinit_array after ef758b59a4
After base ef758b59a4 we can enable usage
of .preinit_array in compiler-rt's sanitizers. The comment that stated
"On FreeBSD, .preinit_array functions are called with rtld_bind_lock
writer lock held. It will lead to dead lock ..." can also be removed.

PR:		298943
MFC after:	1 week
2026-10-11 00:44:17 +02:00
Stefan Eßer 94d4ba04a9 contrib/bc: remove vs sub-directory
Some of the files in the vs sub-directory are checked out with  CRLF
line breaks via .getattributes. This causes issues when checking out
the source tree with other tools that operate on Git repositories like
"got". Remove the vs sub-directory from the contrib tree, since it is
not required on FreeBSD.
2026-10-10 22:56:37 +02:00
Xiaoqiang Zhao d45f069002 tests/libc: use an allowlist for sbrk in NetBSD-derived tests
sbrk is obsolete and libc only provides it on amd64, arm, i386 and
powerpc.  Replace the growing exclusion lists in t_dir.c and t_mlock.c
with a single positive HAVE_SBRK definition per file, so architectures
without sbrk need not be enumerated as they are added.

Signed-off-by: Xiaoqiang Zhao <[email protected]>
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D60358
2026-10-10 10:43:46 -07:00
Enji Cooper e8431fae65 Revert "tests/libc: use an allowlist for sbrk in NetBSD-derived tests"
Need to update the commit message.

This reverts commit 36b849b5c7.
2026-10-10 10:43:00 -07:00
Xiaoqiang Zhao 36b849b5c7 tests/libc: use an allowlist for sbrk in NetBSD-derived tests
sbrk is obsolete and libc only provides it on amd64, arm, i386 and
powerpc.  Replace the growing exclusion lists in t_dir.c and t_mlock.c
with a single positive HAS_SBRK definition per file, so architectures
without sbrk need not be enumerated as they are added.

Signed-off-by: Xiaoqiang Zhao <[email protected]>
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D60358
2026-10-10 10:41:27 -07:00
Enji Cooper 26eb328b52 contrib/kyua: commit generated files
MFC after:      1 month
Fixes: eb8f69902 ("contrib/kyua: update to 0.15.0")
2026-10-07 11:04:21 -07:00
Enji Cooper eb8f69902f contrib/kyua: update to 0.15.0
This new release contains multiple feature updates and bugfixes. Please
see the release notes mentioned in the merge commit for more details.

MFC after:	1 month
Merge commit '144afd05f8a2300361ec30c1c2020e4022ddd943'

Conflicts:
	contrib/kyua/cli/cmd_debug.cpp
	contrib/kyua/doc/kyua-debug.1.in
	contrib/kyua/doc/kyuafile.5.in
	contrib/kyua/engine/config.cpp
	contrib/kyua/engine/execenv/execenv.cpp
	contrib/kyua/engine/execenv/execenv.hpp
	contrib/kyua/engine/execenv/execenv_host.hpp
	contrib/kyua/engine/requirements.cpp
	contrib/kyua/engine/requirements.hpp
	contrib/kyua/engine/scheduler.cpp
	contrib/kyua/model/metadata.cpp
	contrib/kyua/os/freebsd/execenv_jail.hpp
	contrib/kyua/os/freebsd/execenv_jail_stub.cpp
	contrib/kyua/os/freebsd/main.cpp
	contrib/kyua/os/freebsd/reqs_checker_kmods.cpp
	contrib/kyua/os/freebsd/utils/jail.hpp
	contrib/kyua/utils/fs/directory.cpp
	contrib/kyua/utils/process/executor.cpp
2026-10-07 10:50:26 -07:00
Philip Paeps 22c3edb312 contrib/expat: import expat 2.9.0
Changes: https://github.com/libexpat/libexpat/blob/R_2_9_0/expat/Changes

Security:	CVE-2026-102633
Security:	CVE-2026-77214
MFC after:	3 days
2026-10-07 09:15:49 +08:00
Olivier Cochard 9af3990ba7 sem test: avoid ETIMEDOUT races in the EINTR test cases
timedwait and clockwait_absolute_intr_remaining arm a 50ms SIGALRM and then
wait until an absolute deadline only 100ms in the future.
On a loaded VM the signal can be delivered more than 50ms late, so the wait
times out first.

Approved by:	imp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D60347
2026-10-07 02:03:27 +02:00
Dimitry Andric fe9c713787 Merge commit c4ce37507537 from llvm-project (by ShengYi Hung):
[Clang][Sema] Create LocalScope for Variable Template (#228280)

  A variable template should create its own LocalScope, as it should be
  opaque to other instantiations. This can occur when there are multiple
  instantiations in the same lexical scope. The correct behavior is that
  these instantiations should not be chained together.

  Assisted-by: Claude # Test ReleaseNote
  Fixes: #134148

This fixes an assertion while building the devel/glaze port.

PR:		276265
MFC after:	3 days
2026-10-03 13:37:43 +02:00
Enji Cooper 9d5a33d9c2 [tests] lib/libc/gen:assert_test: undefine NDEBUG
In the event `NDEBUG` was defined, `assert` would become a no-op,
breaking some of the expectations in `assert_test` around `assert(..)`
failing generating a coredump.

This is a better approach than the previous one committed in 6f3445006a
as it continues to test the `assert(..)` function instead of just
skipping it if `NDEBUG` was defined.

Suggested by:	kevans
MFC after:	4 days
MFC with:	6f3445006a
Fixes:		6f3445006a
Differential Revision: https://reviews.freebsd.org/D60253
2026-10-02 13:42:53 -07:00
Dimitry Andric 37c9eba164 Merge commit 80e8c0a59189 from llvm-project (by ShengYi Hung):
[DebugInfo] Fill Column 0 if Line is not found (#227559)

  It is possible that user specified line 0 as the start of the line in C
  language (using `# 0`). However, it is rejected by the Lexer as we have
  no line but still carries column information. As a result, we fill
  column to 0 if we cannot find line.

  Assisted-by: Claude # Test
  Fixes: #56186

This fixes a fatal error when building the textproc/peg port.

PR:		264853
MFC after:	3 days
2026-10-01 14:31:42 +02:00
Dimitry Andric ca3747034e Merge commit c52392a6f464 from llvm-project (by ShengYi Hung):
[Clang][ExprConst] Drop PRValue for nothrow new (#226753)

  A user defined operator new can accept prvalue for nothrow. However, it
  should not be a ConstExpr. Early returns by
  isUsableAsGlobalAllocationFunctionInConstantEvaluation instead of doing
  LValue evaluation.
  Also, move CheckPlacement new logic into new OpCode. This decouples
  checking from Interp.cpp to Compiler.cpp.

This fixes "Assertion failed: (E->isGLValue() ||
E->getType()->isFunctionType() || E->getType()->isVoidType() ||
isa<ObjCSelectorExpr>(E->IgnoreParens())), function EvaluateLValue" when
building the databases/mariadb123-server port.

MFC after:	1 week
2026-09-30 18:32:47 +02:00
Dag-Erling Smørgrav 2447e7773e tzcode: Update to 2026e
MFC after:	1 week
2026-09-30 08:40:30 +00:00
Philip Paeps f11af65350 contrib/tzdata: import tzdata 2026e
Changes: https://github.com/eggert/tz/blob/2026e/NEWS

Briefly:
    Manitoba moves to permanent -05 on 2026-10-31.

MFC after:	3 days
2026-09-30 10:47:45 +08:00
Enji Cooper 8d94a93d96 integration_test: backport fix from freebsd/atf
See the related merge commit for more details.

MFC after:	28 days
Obtained from:	[freebsd/atf@2690b04c][upstream]
Fixes:		95223108 ("contrib/atf: upgrade to 0.26")

Merge commit '8fd09407c8e64fd26d095c9b00990c545577db5a'

[upstream]: https://github.com/freebsd/atf/commit/2690b04cbc608af165a58426b7275c063b779f03
2026-09-23 21:30:34 -07:00
Philip Paeps c7b6798563 contrib/expat: import expat 2.8.5
Changes: https://github.com/libexpat/libexpat/blob/R_2_8_5/expat/Changes

Security:	CVE-2026-93990
MFC after:	3 days
2026-09-23 12:30:45 +08:00
Enji Cooper 9522310861 contrib/atf: upgrade to 0.26
This new version gets contrib/atf in line with the published version of
the package up on [GitHub][github].

Please note that this release is a major update: it contains several
bugfixes and feature enhancements. Most were already present in the
FreeBSD src repo, but there were a large number of changes made in
addition to what was already present.

MFC after:      1 month

Merge commit '9c78088348bcf1059d82a62bb57a0746309d4312'

Conflicts:
        contrib/atf/.cirrus.yml
        contrib/atf/Makefile.am
        contrib/atf/Makefile.in
        contrib/atf/aclocal.m4
        contrib/atf/admin/ar-lib
        contrib/atf/admin/check-style-common.awk
        contrib/atf/admin/check-style.sh
        contrib/atf/admin/compile
        contrib/atf/admin/config.guess
        contrib/atf/admin/config.sub
        contrib/atf/admin/depcomp
        contrib/atf/admin/install-sh
        contrib/atf/admin/ltmain.sh
        contrib/atf/admin/missing
        contrib/atf/atf-c++/Makefile.am.inc
        contrib/atf/atf-c++/atf-c++.3
        contrib/atf/atf-c++/atf-c++.pc.in
        contrib/atf/atf-c++/check.cpp
        contrib/atf/atf-c++/check.hpp
        contrib/atf/atf-c++/detail/Makefile.am.inc
        contrib/atf/atf-c++/detail/process_test.cpp
        contrib/atf/atf-c/Makefile.am.inc
        contrib/atf/atf-c/atf-c.3
        contrib/atf/atf-c/atf-c.pc.in
        contrib/atf/atf-c/detail/Makefile.am.inc
        contrib/atf/atf-c/detail/fs.c
        contrib/atf/atf-c/detail/fs_test.c
        contrib/atf/atf-c/detail/process_test.c
        contrib/atf/atf-c/tc.c
        contrib/atf/atf-c/tc.h
        contrib/atf/atf-sh/Makefile.am.inc
        contrib/atf/atf-sh/atf-check.cpp
        contrib/atf/atf-sh/atf-check_test.sh
        contrib/atf/bootstrap/Makefile.am.inc
        contrib/atf/bootstrap/package.m4
        contrib/atf/bootstrap/testsuite
        contrib/atf/config.h
        contrib/atf/configure
        contrib/atf/configure.ac
        contrib/atf/doc/Makefile.am.inc
        contrib/atf/doc/atf-test-case.7
        contrib/atf/m4/developer-mode.m4
        contrib/atf/m4/libtool.m4
        contrib/atf/m4/ltoptions.m4
        contrib/atf/m4/ltsugar.m4
        contrib/atf/m4/ltversion.m4
        contrib/atf/m4/lt~obsolete.m4
        contrib/atf/m4/module-defs.m4
        contrib/atf/test-programs/Makefile.am.inc

[github]: https://github.com/freebsd/atf
2026-09-22 08:23:32 -07:00
Enji Cooper 6f3445006a [tests] lib/libc/gen:assert_test: skip tests when NDEBUG set
In the event that NDEBUG is specified in CFLAGS--which is most likely
triggered via `MK_ASSERT_DEBUG` == "no" -- all assert(3) statements are
optimized out by design. This breaks the assert(3) tests as they
specifically rely on assert(3) actually raising a `SIGABRT` instead of
quietly succeeding.

Skip both tests if `NDEBUG` is set. There's no sense running the
`assert(true)` test if the result could instead be a false positive.

MFC after:	2 weeks
2026-09-21 23:30:30 -07:00
Alexander Ziaee 14b855d296 mandoc: Drop -ieee754-2008 abbreviation
Improve manpage compatability by dropping an abbreviation macro that
compiler upstreams do not want, causing manuals using it to render
incorrectly on other toolchains or operating systems. It was only used
in three manuals, which are amended in this commit.

Reviewed by:	fuz, markj
MFC after:	no, these did not MFC
Requested by:	Ingo Schwarze <[email protected]>
Fixes:		db3884b039 ("contrib/mandoc: add -ieee754-2008")
Fixes:		63cd0841de ("document .St -ieee754-2008 in mdoc")
Differential Revision:	https://reviews.freebsd.org/D59880
2026-09-22 01:00:06 -04:00
Xin LI 4523eebc6c MFV: less v710.
MFC after:	1 week
2026-09-19 11:20:29 -07:00
Dimitry Andric 8a8c14464d Merge commit 1f332ae4f1b3 from llvm-project (by Alexander Kornienko):
Fix -Wformat diagnostic after #190965 (#193704)

  Fixes libunwind compiler diagnostic when building with clang after
  034d4dcad6396d1241e8262e69871b8d61da7e4f:
  ```
  In file included from libunwind/src/libunwind.cpp:31:
  In file included from libunwind/src/UnwindCursor.hpp:52:
  libunwind/src/CompactUnwinder.hpp:339:46: error: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat]
    338 |                            "function starting at 0x%llX",
        |                                                    ~~~~
        |                                                    %lX
    339 |                             compactEncoding, functionStart);
        |                                              ^~~~~~~~~~~~~
  libunwind/src/config.h:215:63: note: expanded from macro '_LIBUNWIND_DEBUG_LOG'
    215 |   #define _LIBUNWIND_DEBUG_LOG(msg, ...)  _LIBUNWIND_LOG(msg, __VA_ARGS__)
        |                                                          ~~~  ^~~~~~~~~~~
  libunwind/src/config.h:181:45: note: expanded from macro '_LIBUNWIND_LOG'
    181 |     fprintf(stderr, "libunwind: " msg "\n", __VA_ARGS__);                      \
        |                                   ~~~       ^~~~~~~~~~~
  In file included from libunwind/src/libunwind.cpp:31:
  In file included from libunwind/src/UnwindCursor.hpp:52:
  libunwind/src/CompactUnwinder.hpp:458:39: error: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat]
    457 |                            "function starting at 0x%llX",
        |                                                    ~~~~
        |                                                    %lX
    458 |                             encoding, functionStart);
        |                                       ^~~~~~~~~~~~~
  libunwind/src/config.h:215:63: note: expanded from macro '_LIBUNWIND_DEBUG_LOG'
    215 |   #define _LIBUNWIND_DEBUG_LOG(msg, ...)  _LIBUNWIND_LOG(msg, __VA_ARGS__)
        |                                                          ~~~  ^~~~~~~~~~~
  libunwind/src/config.h:181:45: note: expanded from macro '_LIBUNWIND_LOG'
    181 |     fprintf(stderr, "libunwind: " msg "\n", __VA_ARGS__);                      \
        |                                   ~~~       ^~~~~~~~~~~
  ```

This avoids a -Werror failure with clang >= 23.

MFC after:	3 days
2026-09-17 21:36:46 +02:00
Devin Teske 3fe5961a0b Add sysconf(8) and libbsdconf(3)
Complete the native configuration trinity: sysctl(8) for live kernel
state, sysrc(8) for rc.conf(5), and sysconf(8) for the remaining base
configuration -- loader.conf(5), sysctl.conf(5), and the make.conf(5)
family -- atop libbsdconf(3).

libbsdconf resurrects figpar as a unified reader/writer.  Callbacks own
semantics; statements may span multiple lines via backslash continuation;
non-seekable input is spooled; writes are atomic (mkstemp, fsync, rename)
with mode/owner preservation.  Format descriptors name each target, its
files, and quoting rules without private parsers.  Multi-file targets
follow boot sourcing order; loader chases loader_conf_files as the boot
loader does.

sysconf(8) is the operator-facing tool: name / name=value on a required
target, sysrc-style list edits, make append and list-strike where they
belong, jail/altroot, and a capsicum sandbox for read-only use.

Sysctl writes validate against the running kernel first -- unknown and
read-only OIDs, CTLFLAG_TUN (pointing at the loader target), and CTLTYPE
range checks -- so a typo or overflow does not land in sysctl.conf.

Make and src treat WITH_/WITHOUT_ as presence knobs (as bsd.mkopt.mk /
src.conf(5) do) and warn on the WITH_*=no form that does not disable the
option, so a bad assignment is caught before an /usr/src build surfaces
it.

The rc target passes through to sysrc(8).

Defaults querying (-d/-D/-A) mirrors sysrc for dumps and descriptions on
targets that have a defaults file; named reads already see defaults, and
-A only widens dump scope.

Manuals are split pkg(8)-style (bsdconf/put/format; sysconf plus
per-target pages).  ATF coverage exercises the frontend.

Co-authored-by:	Faraz Vahedi <[email protected]>
Reviewed by:	fuz, kfv
Differential Revision:	https://reviews.freebsd.org/D58066
2026-09-16 14:28:14 -07:00
Dag-Erling Smørgrav 1fb9c5ffe2 unbound: Update to 1.26.1
Release notes at
    https://community.nlnetlabs.nl/t/unbound-1-26-1-released

Merge commit '120aa088f4807126af42a652a07c5090e7294fcf'

Security:	CVE-2026-77860
Security:	CVE-2026-77955
Security:	CVE-2026-78227
Security:	CVE-2026-80225
Security:	CVE-2026-81634
Security:	CVE-2026-81642
Security:	CVE-2026-82717
Security:	CVE-2026-82720
Security:	CVE-2026-85501
2026-09-16 14:22:09 +00:00
Ariel Ehrenberg 6ff2d2d5d4 fixup! verbs/mlx5: Add GRE and MPLS flow specification filter
Import rdma-core upstream commit ff01da2c5ac2 ("verbs: Fix typo in copying
IBV_FLOW_SPEC_UDP/TCP 'val'").

The TCP/UDP filter value was copied using the size of the IPv4 filter,
overrunning the destination subobject.

Also accept inner MPLS flow specs, matching 6d6f29721eea ("verbs: Allow
creation of inner MPLS flow spec").  Upstream deliberately has no inner
case for GRE - it is a tunnel header, matched only in the outer stack - so
that part of the review comment is not applied.

Sponsored by:	NVidia networking
MFC after:	1 month
2026-09-16 17:12:10 +03:00
Vag Singh 644f8990e2 verbs/mlx5: Add GRE and MPLS flow specification filter
[PATCH 30/31] FreeBSD OFED support for DPDK MLX5 PMD

a) Allow verbs applications packet steering of GRE tunneled traffic.
Adding GRE flow specification based on RFC 2890.
GRE consists of flags, protocol and key fields.
IPv4 protocol 47 (IPPROTO_GRE) can be used when GRE packets are
encapsulated in IPv4.

b) verbs: Add MPLS flow specification filter
Add MPLS flow specification based on RFC 3032.
MPLS spec defined with label field which includes the
label value and additional parameters such as: BoS, TC and TTL.
MPLS allows stacking multiple labels in sequence.
In addition, the MPLS header can be encapsulated on top of different
layers, e.g.: ETH, IP (rfc4023), UDP (rfc7510), GRE (rfc4023).

Therefore, when using the flow creation verb, the application should
organize the spec filters list in the command in an ordered manner, such
that reflects the actual protocol stack of the packet, to determine the
exact position of the MPLS headers in the protocol stack.

c) mlx5: Report MPLS tunnel offload capabilities through mlx5 direct
verbs
This patch exposes the mlx5 device's capability to offload MPLS based
tunnel protocols via DV API.
The possible protocols are:
- Control word + MPLS over GRE.
- Control word + MPLS over UDP.

Differential revision:	https://reviews.freebsd.org/D32205
MFC after:	1 month
2026-09-16 17:12:10 +03:00
Ariel Ehrenberg 966d4c21b1 fixup! IB/mlx5: Expose GRE flow spec to user-kernel ABI header
Import Linux upstream commit a93b632c4531 ("IB/mlx5: Fix GRE flow
specification").

Honour the user-supplied GRE protocol mask instead of hard-coding 0xffff,
so wildcard and partial masks work.

Also give flow_spec_data[] 8-byte alignment, so this userspace copy of
struct ib_uverbs_flow_spec_hdr matches the kernel UAPI on 32-bit builds.
The kernel header has always used __aligned_u64 here and only our copy
diverged, so there is no upstream commit for that half.  The attribute is
spelled out instead of introducing an __aligned_u64 macro, which
<infiniband/types.h> does not provide and which libbnxtre already defines
for itself.

Sponsored by:	NVidia networking
MFC after:	1 month
2026-09-16 17:12:10 +03:00
Vag Singh d58b41b0f2 IB/mlx5: Expose GRE flow spec to user-kernel ABI header
[PATCH 29/31] FreeBSD OFED support for DPDK MLX5 PMD

a) Add ib_uverbs_flow_spec_gre to define the rule to match GRE
encapsulation protocol.

The spec includes the generic specs header, type, size and reserved
fields while the filter itself is defined as ib_uverbs_flow_gre_filter
and includes:

- Checksum present bit, key present bit and version bits in a single
16bit field.
- Protocol type field - Indicates the ether protocol type of the
encapsulated payload.
- Key field - present if key bit is set and contains an application
specific key value.

b) IB/uverbs: Expose MPLS flow spec to user-kernel ABI header
Add ib_uverbs_flow_spec_mpls to define the rule to match MPLS
protocol.

The spec includes the generic specs header, type, size and reserved
fields while the filter itself is defined as ib_uverbs_flow_mpls_filter
and includes a single 32bit field named 'label' which consists of:
Bits 0:19 - The MPLS label.
Bits 20:22 - Traffic class field.
Bit 23 - Bottom of stack bit.
Bits 24:31 - Time to live (TTL) field.

c) IB/mlx5: Add support for GRE flow specification
This patch introduces support for the GRE flow spec and
allowing the creation of rules based on the protocol and
key fields that are part of GRE protocol header.

d) IB/mlx5: Expose MPLS related tunneling offloads
This patch reports the device's capbilities to offload
encapsulated MPLS tunnel protocols to user-space:
- Capability to offload MPLS over GRE.
- Capability to offload MPLS over UDP.

Differential revision:	https://reviews.freebsd.org/D32204
MFC after:	1 month
2026-09-16 17:12:10 +03:00
Ariel Ehrenberg a2703fef5c fixup! verbs/mlxs: mlx5: Add tunnel offloads support in direct verbs
Fix is based on upstream rdma-core commit ee54f9d5348f ("mlx5: Add
loopback flags to QP creation").

Validate create_flags against a supported-flags mask instead of rejecting
anything that is not MLX5DV_QP_CREATE_TUNNEL_OFFLOADS.  A create_flags of
0 is now accepted, unknown bits are rejected, and the vendor flag is OR-ed
in rather than assigned.  The loopback flags that commit also adds do not
exist in this tree, so only the validation is taken.

Sponsored by:	NVidia networking
MFC after:	1 month
2026-09-16 17:12:10 +03:00
Vag Singh 4b32c67bbf verbs/mlxs: mlx5: Add tunnel offloads support in direct verbs
[PATCH 28/31] FreeBSD OFED support for DPDK MLX5 PMD

a) In order to enable offloading such as checksum and LRO for incoming
tunneling traffic, the QP should be created with tunnel offloads flag -
MLX5DV_QP_CREATE_TUNNEL_OFFLOAD.

b) Reports capability of which tunneling type supports
the tunneling offloads.

c) verbs: Add support in RSS of the inner packet
Some user space application would like to do RSS on the inner packet
fields instead of the outer. When user will set the IBV_RX_HASH_INNER
bit with one of the other hash fields, then the RSS will be on the inner
packet.

Differential revision:	https://reviews.freebsd.org/D32203
MFC after:	1 month
2026-09-16 17:12:09 +03:00
Vag Singh 2b42072b23 verbs/mlx5: Allow creation of a Multi-Packet RQ using direct verbs
[PATCH 27/31] FreeBSD OFED support for DPDK MLX5 PMD

a) Add needed definitions to allow creation of a Multi-Packet RQ
using the mlx5 direct verbs interface.

In order to create a Multi-Packet RQ, one needs to provide a
mlx5dv_wq_init_attr containing the following information in its
striding_rq_attrs struct:
- single_stride_log_num_of_bytes: log of size of each stride
- single_wqe_log_num_of_strides: log of number of strides per WQE
- two_byte_shift_en: When enabled, hardware pads 2 bytes of zeros
before writing the message to memory (e.g. for IP alignment).

b) Add a helper function to verify 64 bit comp mask
The common check for a mask is as follows:
if (comp_mask & ~COMP_MASK_SUPPORTED_VALUES)
      return EINVAL;

This can cause an issue when using 64 bit mask if the supported variable
is signed 32 bit: It will be bitwise inverted and then zeroed to 64
bits. Hence, wrong bits in the mask that exceed 32 bits will not raise
an error but would be ignored.

To fix this, a helper function is added in driver.h to be used by providers
code and fix wrong mask checks where the above was found to be applicable.

Differential revision:	https://reviews.freebsd.org/D32202
MFC after:	1 month
2026-09-16 17:12:09 +03:00
Vag Singh 35763e9689 libmlx5: Report Multi-Packet RQ capabilities through mlx5 direct verbs
[PATCH 26/31] FreeBSD OFED support for DPDK MLX5 PMD

A Multi-Packet RQ is a receive queue where multiple packets are
written to the same WQE. Each message starts in the beginning of a
stride. The total size of the scatter elements of each WQE is
determined upon RQ creation and all the posted WQEs should meet the
determined size.

A Multi-Packet RQ reduces the number of needed post-recv operations
thus increasing performance.

It reduces memory footprint by allowing each packet to consume a
different number of strides instead of the whole WR.

Differential revision:	https://reviews.freebsd.org/D32201
MFC after:	1 month
2026-09-16 17:12:09 +03:00
Ariel Ehrenberg 7482011cdb fixup! libmlx5: Report SW parsing capabilities through mlx5 direct verbs
Document the full struct mlx5dv_context (cqe_comp_caps, sw_parsing_caps)
and the mlx5dv_context_comp_mask enum in mlx5dv_query_device.3, and note
that these caps are only valid when the matching comp_mask bit is asked
for on input and returned on output.

Sponsored by:	NVidia networking
MFC after:	1 month
2026-09-16 17:12:09 +03:00
Vag Singh 5189261cd0 libmlx5: Report SW parsing capabilities through mlx5 direct verbs
[PATCH 24/31] FreeBSD OFED support for DPDK MLX5 PMD

Software parsing (SWP) is a feature that can be used to instruct the
device to stop using its internal parser and to parse packets on the
transmit path according to offsets set for each packet.

Through this feature, the device allows the handling of checksum and LSO
by the hardware according to the location of IP and TCP/UDP headers.

Report various SW parsing capabilities and supported QP types through
mlx5 direct verbs interface.

Differential revision:	https://reviews.freebsd.org/D32199
MFC after:	1 month
2026-09-16 17:12:09 +03:00
Ariel Ehrenberg 3c4338089e fixup! verbs/mlx5: Expose tag matching capabilities
Reject TM-SRQ creation when tm_cap.max_ops is 0, so the internal command
QP's send queue is not sized to zero work-queue entries.

Sponsored by:	NVidia networking
MFC after:	1 month
2026-09-16 17:12:09 +03:00
Vag Singh 4601cb6295 verbs/mlx5: Expose tag matching capabilities
[PATCH 23/31] FreeBSD OFED support for DPDK MLX5 PMD

a) Expose tag matching capabilities and show them in ibv_devinfo.

b) verbs: Introduce tag matching SRQ
Introducing tag matching SRQ (TM-SRQ), which retains basic semantic of
regular SRQ, reports completions to own CQ, and has additional tag
based message receiving mechanism.
Detailed description for the TM-SRQ usage was added into
Documentation/tag_matching.md

c) mlx5: Add support to tag matching SRQ type
Create command QP for a tag-matching SRQ. Command QP used for
inserting/removing entries from the tag matching list. This command QP
is hidden from the users in the mlx5_srq structure.
New verb ibv_post_srq_ops() will be added in next patch to use it.

Differential revision:	https://reviews.freebsd.org/D32198
MFC after:	1 month
2026-09-16 17:12:09 +03:00
Ariel Ehrenberg e4bdc092db fixup! libmlx5: Report if kernel allows using MPW in SQ
Interpret the kernel's raw multi_pkt_send_wqe value (0, 1 or 3) instead of
masking it against a bitmask the kernel never emits, which silently
disabled MPW.

Sponsored by:	NVidia networking
MFC after:	1 month
2026-09-16 17:12:08 +03:00