]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 months ago13.2: update to RC2
Colin Percival [Fri, 10 Mar 2023 00:24:24 +0000 (16:24 -0800)]
13.2: update to RC2

Approved by: re (implicit)
Sponsored by: https://www.patreon.com/cperciva

14 months agogrowfs_fstab startup script: set dumpdev to AUTO
Mike Karels [Tue, 28 Feb 2023 13:55:35 +0000 (07:55 -0600)]
growfs_fstab startup script: set dumpdev to AUTO

The growfs_fstab script has been testing dumpdev, and if it is AUTO,
enables dumps on the newly-added swap device for the initial boot.
However, dumpdev defaults to AUTO on main, but NO on stable/13 and
release branches.  On the other hand, bsdinstall adds dumpdev="AUTO"
by default (controlled by a menu item).  bsdinstall is not used when
booting an SD card or other disk image.  Adopt the default from
bsdinstall, and set dumpdev to AUTO in /etc/rc.conf in the
growfs_fstab script if a swap partition has been added, along with
the explanatory comment added by bsdinstall.

Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D38751

(cherry picked from commit eef9f9900f118b5efcabbd5864e7b8b993d09922)
(cherry picked from commit 009abff336b6e83219178e7d87f6a91f54e31839)

14 months agolinux_80211: Don't dequeue lsta if not queued
Colin Percival [Sun, 5 Mar 2023 20:10:57 +0000 (12:10 -0800)]
linux_80211: Don't dequeue lsta if not queued

This fixes an instapanic when restarting wpa_supplicant on my laptop's
iwlwifi device.  After this change, iwlwifi enters a nonfunctional
state if wpa_supplicant is restarted, but "service netif restart wlan0"
is enough to get it working again.

Approved by: re (kib)

(cherry picked from commit 3689f8aeab82150da6789be87b6c2f9385810c23)
(cherry picked from commit 790dc4d825c910c8a2eda49fe9e6dd827519f0f4)

14 months agoxz: Improve compatibility with systems without capability mode support
Xin LI [Sun, 5 Mar 2023 09:40:13 +0000 (01:40 -0800)]
xz: Improve compatibility with systems without capability mode support

When the kernel is built without capability mode support, or when
using an emulator like qemu-user-static that does not translate
system calls, these calls will return a negative number and set
the errno to ENOSYS. However, this error does not indicate a
real programming or runtime error and is generally ignored by
base system applications built with capability mode sandboxing.

Match this behavior by making xz(1) to ignore ENOSYS errors
when calling capability mode system calls too.

PR: 269185
Reported by: Dan Kotowski
Approved by: re (cperciva)

(cherry picked from commit c237c10a2346dec422233db05b2012afd45363fa)
(cherry picked from commit 0cc2deb476bec103ad7c8dbeb650aa2937d6a0da)

14 months agoamd64: Avoid copying td_frame from kernel procs
Mark Johnston [Sat, 25 Sep 2021 14:15:31 +0000 (10:15 -0400)]
amd64: Avoid copying td_frame from kernel procs

When creating a new thread, we unconditionally copy td_frame from the
creating thread.  For threads which never return to user mode, this is
unnecessary since td_frame just points to the base of the stack or a
random interrupt frame.

If KASAN is configured this copying may also trigger false positives
since the td_frame region may contain poisoned stack regions.  It was
not noticed before since thread0 used a dummy proc0_tf trapframe, and
kernel procs are generally created by thread0.  Since commit
df8dd6025af88a99d34f549fa9591a9b8f9b75b1, though, we call
cpu_thread_alloc(&thread0) when initializing FPU state, which
reinitializes thread0.td_frame.

Work around the problem by not copying the frame unless the copying
thread came from user mode.  While here, de-duplicate the copying and
remove redundant re(initialization) of td_frame.

Reported by: syzbot+2ec89312bffbf38d9aec@syzkaller.appspotmail.com
Reviewed by: kib
Approved by: re (delphij)
Fixes: df8dd6025af8
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32057

(cherry picked from commit ca1e447b1048b26b855d7f7fbcdad78309e4d741)
(cherry picked from commit cf25fa7f31e7bda9b8aa20757659524db9c4ef97)

14 months agonetlink: fix OOB read in genetlink
Alexander V. Chernikov [Sat, 18 Feb 2023 17:24:59 +0000 (17:24 +0000)]
netlink: fix OOB read in genetlink

Reported by: Coverity Scan
Approved by: re (cperciva)
CID: 1498863

(cherry picked from commit 8f7455a9265f4952f885b06c08c57fcce6f16e5c)
(cherry picked from commit d9d596bb2ce04bbec5ea811342efd4216c1fc2a3)

14 months agonetlink: call genetlink notification handler upon successful family
Alexander V. Chernikov [Fri, 17 Feb 2023 17:58:53 +0000 (17:58 +0000)]
netlink: call genetlink notification handler upon successful family
search.

Approved by: re (cperciva)

(cherry picked from commit 7cbe771f013f6cf3316910648f6d46641cad7f44)
(cherry picked from commit ac40ea6fbb4e6af98a4540fc8fd5a3e824cb181d)

14 months agomachine-id: generate a compact version of the uuid
Baptiste Daroussin [Tue, 28 Feb 2023 10:31:06 +0000 (11:31 +0100)]
machine-id: generate a compact version of the uuid

dbus and other actually expect an uuid without hyphens

Approved by: re (cperciva)
Reported by: tijl
MFC After: 3 days

(cherry picked from commit a28ccb32bf5678fc401f1602865ee9b37ca4c990)

14 months agouuidgen: add -c for compact uuid
Baptiste Daroussin [Tue, 28 Feb 2023 10:29:51 +0000 (11:29 +0100)]
uuidgen: add -c for compact uuid

It generates the uuid string but without the hyphen

Approved by: re (cperciva)
MFC After: 3 days
Reviews by: tcberner
Differential Revision: https://reviews.freebsd.org/D38820

(cherry picked from commit b2b294f27cf4618d6f7510007b41882860a080b9)
(cherry picked from commit 0ba66872bea87abdf13660d5a7946769fd7b118f)
(cherry picked from commit 4cd30c640db978355cf2da666e2749189babda5e)

14 months agonetlink: do not memcpy 0 bytes from a NULL pointer
Ed Maste [Mon, 6 Mar 2023 16:30:26 +0000 (11:30 -0500)]
netlink: do not memcpy 0 bytes from a NULL pointer

Although it works in practice it is UB, and might break after a future
compiler update.

This was rewritten in main and the memcpy call no longer exists, so this
is a direct commit to stable/13 before 055776c84a41 is MFC'd.

Discussed with: melifaro
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38927

(cherry picked from commit 305aaa93e0c805294c8bcbb5fe8b9f7caa28b349)

14 months agonetlink: simplify temporary address allocation in rtnl_handle_getlink().
Alexander V. Chernikov [Fri, 17 Feb 2023 17:57:44 +0000 (17:57 +0000)]
netlink: simplify temporary address allocation in rtnl_handle_getlink().

Approved by: re (cperciva)

(cherry picked from commit 45356a1864c79680c6911b48a18b14a88a7d07fa)
(cherry picked from commit 4c1ef49999c6687905664eecd73ea9473ffe5fda)

14 months agonetlink: fix interface dump.
Alexander V. Chernikov [Thu, 16 Feb 2023 13:17:58 +0000 (13:17 +0000)]
netlink: fix interface dump.

The current code missed interface addition when reallocating
 temporary buffer.
Tweak the code to perform the reallocation first and add
 interface afterwards unconditionally.

Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Approved by: re (cperciva)

(cherry picked from commit 86fd0bdba540132ae298457e160b651f61d1db6b)
(cherry picked from commit a800622765b1e7cab79fa857e9a671e6c0c1ccec)

14 months agong_atmllc: deprecate
Brooks Davis [Fri, 3 Mar 2023 16:20:29 +0000 (16:20 +0000)]
ng_atmllc: deprecate

With the deprecation of NgATM, ng_atmllc is the last vestage of ATM
support so deprecate it too.

Reviewed by: manu, emaste
Approved by: re (cperciva)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D38878

(cherry picked from commit c2285a7b092f524b5694e42bfb5fd24f71815771)
(cherry picked from commit 85aac7cc92f59ad023d40c81826b5c4f829dba15)

14 months agoNgATM: deprecate
Brooks Davis [Fri, 3 Mar 2023 16:20:18 +0000 (16:20 +0000)]
NgATM: deprecate

Support for ATM NICs was removed prior to FreeBSD 12.  At the time it
was unclear if this code was still useful without it.  Now the time has
come to finish removing support.

Add DREPRECATION NOTICEs to the manpages and gone_in(14, ...) warnings
in the constructors (or module init for ngatmbase).

Reviewed by: manu, emaste
Approved by: re (cperciva)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D38877

(cherry picked from commit 211c302f10d76fc12e50c87039cfc06aa9e659c1)
(cherry picked from commit 08a5f8c5cbc7143601a34ac7e52831e996a9347e)

14 months agofreebsd-update: use grep -E instead of egrep
Ed Maste [Thu, 2 Mar 2023 23:54:52 +0000 (18:54 -0500)]
freebsd-update: use grep -E instead of egrep

GNU egrep emits a warning that it is obsolescent and suggests grep -E
instead.  Switch to grep -E in case we end up invoking GNU (e)grep (and
for consistency with other invocations in this file).

Reported by: Steffen Nurpmeso
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit e27ded83c76a609687a3d9e82b80fe7e1b782bf6)
(cherry picked from commit b562307b70346030f59fe6a05d125814c74da47b)

14 months agomergemaster: add deprecation notice to man page
Ed Maste [Wed, 22 Jan 2020 21:04:03 +0000 (16:04 -0500)]
mergemaster: add deprecation notice to man page

PR: 252417
Reviewed by: bapt, gjb, kevans (all earlier)
Approved by: re (cperciva)
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23327

(cherry picked from commit 398b12691b4f1e7a73afca4c051c182bfcaf9671)
(cherry picked from commit ab53efd14237b71c3c0e4e212ada6526ef14402c)

14 months agoEnsure .inc files are regenerated when llvm/clang tblgen binaries change
Dimitry Andric [Sat, 25 Feb 2023 15:25:57 +0000 (16:25 +0100)]
Ensure .inc files are regenerated when llvm/clang tblgen binaries change

When doing a fully incremental build (with WITHOUT_CLEAN enabled), from
a commit before llvm 15 was merged (3264f6b88fce), to a commit after
that, a number of .inc files were not regenerated. This could lead to
unexpected compilation errors when these .inc files were included from
llvm-project sources, similar to:

  In file included from /usr/src/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp:8268:
  /usr/obj/usr/src/amd64.amd64/lib/clang/libclang/clang/Basic/arm_mve_builtin_cg.inc:279:18: error: no matching constructor for initialization of 'clang::CodeGen::Address'
    Address Val2 = Address(Val1, CharUnits::fromQuantity(2));
                   ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Work around this by making the .inc files dependent on the tblgen binary
used for generating them. E.g., we can relatively safely assume that if
the binary gets updated, the .inc files must also be updated. (Although
this is not 100% optimal, the gain by complicating things even more is
probaby not worth the effort.)

Approved by: re (cperciva)
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38770

(cherry picked from commit ab80f0b21fbb9c44d40e6f7a99090188f4ed2f71)
(cherry picked from commit 3912f99ecae61dc7fe89c076a654332e3adb1bdc)

14 months ago13.2: update to RC1
Colin Percival [Fri, 3 Mar 2023 00:01:05 +0000 (16:01 -0800)]
13.2: update to RC1

Approved by: re (implicit)
Sponsored by: https://www.patreon.com/cperciva

14 months agofreebsd-update: avoid effects of user's environment on grep
Ed Maste [Wed, 14 Dec 2022 17:13:19 +0000 (12:13 -0500)]
freebsd-update: avoid effects of user's environment on grep

A user had GREP_OPTIONS containing --color=always, which broke grep use
in freebsd-update.  Unset this environment variable.

PR: 255990
Reviewed by: kevans
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit e093c61b2d69e9cca54a2332096c0e36f97bffc0)
(cherry picked from commit 24fe8a518324e291b9ea3fe4e60f2e0fb4f857c5)

14 months agofreebsd-update: re-edit files if merge conflict markers remain
Ed Maste [Wed, 14 Dec 2022 17:34:59 +0000 (12:34 -0500)]
freebsd-update: re-edit files if merge conflict markers remain

freebsd-update will open ${EDITOR} if conflicts occur while merging
updates to config files.  Inform the user if they've left conflict
markers behind, and go back to editing the file.

PR: 185546
PR: 229689
Reviewed by: delphij
Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37703

(cherry picked from commit ceb5f28ba5fcfa69de7410d2327d4a5abf2a421f)
(cherry picked from commit c7e3703352037a5afacdc4126725f351fe7da72b)

14 months agoRemove an extra argument to SYSCTL_FOREACH
Andrew Turner [Wed, 5 Oct 2022 09:27:48 +0000 (10:27 +0100)]
Remove an extra argument to SYSCTL_FOREACH

This was missed in e0853c933661.

Approved by: re (cperciva, delphij)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit fbc9f1b2d6cf90c02b918671fb7791cf36472cfd)
(cherry picked from commit f36ca798c42960383e0ff9612e56eb20c796cf04)

14 months agolinprocfs(4): Fixup process size in the /proc/pid/stat file
Dmitry Chagin [Sun, 26 Feb 2023 13:42:22 +0000 (16:42 +0300)]
linprocfs(4): Fixup process size in the /proc/pid/stat file

According to the Linux sources the kernel exposes a proces virtual
memory size via proc filesystem into the three files - stat, status
and statm. This is the struct mm->total_vm value adjusted to the
corresponding units - bytes, kilobytes and pages.

The fix is based on a fernape@ analysis.

Approved by: re (delphij)
PR: 265937
Reported by: Ray Bellis
MFC after: 3 days

(cherry picked from commit a55b5a9aed3981fcec205e246436991d138c78a2)
(cherry picked from commit 867e8404efed7a33553646b89588831db1a2102b)

14 months agossh: default VerifyHostKeyDNS to no, following upstream
Ed Maste [Fri, 17 Feb 2023 01:26:41 +0000 (20:26 -0500)]
ssh: default VerifyHostKeyDNS to no, following upstream

Revert to upstream's default.  Using VerifyHostKeyDNS may depend on a
trusted nameserver and network path.

This reverts commit 83c6a5242c80160fff76fb85454938761645b0c4.

Reported by: David Leadbeater, G-Research
Reviewed by: gordon
Approved by: re (delphij)
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38648

(cherry picked from commit 41ff5ea22cb95deb9e7415510eb2f5f00b91537a)
(cherry picked from commit 43fd77233cd49061839cfdd936cfeba53e9855c3)

14 months agoapic: prevent divide by zero in CPU frequency init
Mina Galić [Tue, 28 Feb 2023 02:58:45 +0000 (19:58 -0700)]
apic: prevent divide by zero in CPU frequency init

If a CPU for some reason returns 0 as CPU frequency, we currently panic
on the resulting divide by zero when trying to initialize the CPU(s) via
APIC. When this happens, we'll fallback to measuring the frequency
instead.

PR: 269767
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/664
Approved by: re@ (cperciva)

(cherry picked from commit 499171a98c8813e4dc6e085461d5c47750efa555)
(cherry picked from commit a1c63b8e29e832d9ada7c252e7e80ce8b94aeb41)

14 months agostand: fix build userboot without zfs
Michael Paepcke [Tue, 28 Feb 2023 02:58:03 +0000 (19:58 -0700)]
stand: fix build userboot without zfs

Fix regression in building userboot -DWITHOUT_LOADER_ZFS

Fixes: e307eb94ae520
MFC After: 3 days
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/665
Approved by: re@ (cperciva)

(cherry picked from commit 4d59545d0cacb5881e2515eecce15e8478f07276)
(cherry picked from commit 3464fc5f2a3376b4cd5612f1ee0986072b4a65f3)

14 months agoDelete obsolete Solaris compat header file stdlib.h
Zhenlei Huang [Thu, 23 Feb 2023 18:00:09 +0000 (02:00 +0800)]
Delete obsolete Solaris compat header file stdlib.h

This drops function `getexecname()` redirection.

Historically `getexecname()` is a compatibility definition. Since
openzfs has its own implementation of function `getexecname()` in libspl
and has been merged into base, the compat header file stdlib.h is
no longer needed and should not be used.

Also without this fix libspl will end up an incompatible version of
`getprogname()` with libc. In particular, if zfs is enabled, programs
such as pgrep in /rescue can be wrongly statically linked with libspl
and will not function properly.

PR: 269738
Reviewed by: markj
Approved by: re (delphij)
Fixes: 9e5787d2284e Merge OpenZFS support in to HEAD
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38733

(cherry picked from commit 7f0ebf0876c82a098bd5815ea6bf3a8efa6dd6f3)
(cherry picked from commit 95f418fe2a0fb96080afbd2afc160929a32d12fb)

14 months agoctfdump: Use getprogname()
Zhenlei Huang [Thu, 23 Feb 2023 16:28:35 +0000 (00:28 +0800)]
ctfdump: Use getprogname()

Also remove no longer used function `getpname()`.

Reviewed by: markj
Approved by: re (delphij)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D38740

(cherry picked from commit 3dd5524264095ed8612c28908e13f80668eff2f9)
(cherry picked from commit 994eb2fb8a901c883f2bd24fa29c6cd513cb4340)

ctf: Remove unused function prototype for getpname()

(cherry picked from commit f8e1aa85fed08d5f689cb36d65a76d191f6500dd)
(cherry picked from commit eba26d0ba37e647572b3ec285352f778ef0ec9f0)

14 months agonetlink: make the maximum allowed netlink socket buffer runtime tunable.
Alexander V. Chernikov [Mon, 27 Feb 2023 10:44:54 +0000 (10:44 +0000)]
netlink: make the maximum allowed netlink socket buffer runtime tunable.

Dumping large routng tables (>1M paths with multipath) require the socket
 buffer which is larger than the currently defined limit.
Allow the limit to be set in runtime, similar to kern.ipc.maxsockbuf.

Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
MFC after: 1 day
Approved by: re(cperciva)

(cherry picked from commit 28a5d88f7091d1fc72f4f1bd8562d3c8b15883f5)
(cherry picked from commit b656161b84dce0322ab00d7958267fa47cda6318)

14 months agosrc.conf: regen man page for settings on release branch
Ed Maste [Wed, 1 Mar 2023 16:09:06 +0000 (11:09 -0500)]
src.conf: regen man page for settings on release branch

Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation

14 months agosrc.conf: regen man page
Ed Maste [Tue, 28 Feb 2023 21:42:53 +0000 (16:42 -0500)]
src.conf: regen man page

This hadn't been regenerated on the stable branch after some MFCs.

Approved by: re (cperciva)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 242ef804209cce56cb9689283a5d4507a3714fce)

14 months agounbound: Fix config file path
Juraj Lutter [Tue, 17 Jan 2023 17:25:47 +0000 (18:25 +0100)]
unbound: Fix config file path

Commit 1838dec31895fd4752fa8631322ab93be0705a66 changed the
config file path to /usr/local/etc/unbound/unbound.conf which
is wrong for unbound in base.

Reported by: Ihor Antonov <ihor_AT_antonovs_family>
Approved by: re (cperciva)
Reviewed by: zlei
Approved by: zlei
Differential Revision: https://reviews.freebsd.org/D38106

Fixes: 1838dec31895fd4752fa8631322ab93be0705a66
(cherry picked from commit 1d577bedbae80ced38ccb834e6835e5fd98bc411)
(cherry picked from commit e0c3f2a1e2961b5e4813399bf2a4bea467d2c301)

14 months agounbound: Fix config.h
Cy Schubert [Sun, 15 Jan 2023 06:55:05 +0000 (22:55 -0800)]
unbound: Fix config.h

FreeBSD src does not support HAVE_DECL_EVSIGNAL_ASSIGN. While reviewing
the new config.h after regenerating it, this definition was not removed.

Updating config.h is a manual process of configuring the port and
copying/merging the generated config.h into src. This definition was
missed and not removed (#undef'd).

Approved by: re (cperciva)
Fixes: 1838dec31895fd4752fa8631322ab93be0705a66

(cherry picked from commit 06b93ef8cda227d755d7f6cfa95d08c0ccc9dc2d)
(cherry picked from commit 9f9f2a1270c510b33e1e50b1bac09ebe10bbb974)

14 months agounbound: Vendor import 1.17.1
Cy Schubert [Sun, 15 Jan 2023 05:39:31 +0000 (21:39 -0800)]
unbound: Vendor import 1.17.1

Release notes at
    https://www.nlnetlabs.nl/news/2023/Jan/12/unbound-1.17.1-released/.

Approved by: re (cperciva)

Merge commit '7699e1386a16236002b26107ffd2dcbde375e197' into main

(cherry picked from commit 1838dec31895fd4752fa8631322ab93be0705a66)
(cherry picked from commit 26ba9518ffeccd0b64d2f610e731989193844814)

14 months agoping: Fix unsigned integer underflow resuling in a ping -R segfault
Cy Schubert [Thu, 23 Feb 2023 05:43:17 +0000 (21:43 -0800)]
ping: Fix unsigned integer underflow resuling in a ping -R segfault

ping -R (F_RROUTE) will loop at ping.c:1381 until it segfaults or
the unsigned int hlen happens to be less than the size of an IP header:

slippy$ ping -R 192.168.0.101
PING 192.168.0.101 (192.168.0.101): 56 data bytes
64 bytes from 192.168.0.101: icmp_seq=0 ttl=63 time=1.081 ms
RR:  192.168.0.1
192.168.0.101
192.168.0.101
10.1.1.254
10.1.1.91
unknown option bb
unknown option 32
unknown option 6
...
unknown option 96
unknown option 2d
Segmentation fault

The reason for this is while looping through loose source routing (LSRR)
and strict source routing (SSRR), hlen will become smaller than the IP
header. It may even become negative. This should terminate the loop.
However, when hlen is unsigned, an integer underflow occurs becoming a
large number causing the loop to continue virtually forever until hlen
is either by chance smaller than the lenghth of an IP header or it
segfaults.

Approved by: re (cperciva)
Reviewed by: asomers
Fixes: 46d7b45a267b
Differential Revision: https://reviews.freebsd.org/D38744

(cherry picked from commit 70960bb86a3ba5b6f5c4652e613e6313a7ed1ac1)
(cherry picked from commit 18936d3526f3090e4164b8155762bf5bd54038a8)

14 months agoUpdate leap-seconds to latest leap-seconds.3676924800 (expires 2023-12-28)
Dimitry Andric [Fri, 24 Feb 2023 12:17:16 +0000 (13:17 +0100)]
Update leap-seconds to latest leap-seconds.3676924800 (expires 2023-12-28)

Approved by: re (cperciva)
Obtained from: ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800
MFC after: 3 days

(cherry picked from commit df2fbbfa71b8ecc9e9e75ce85a635aade9c691cb)
(cherry picked from commit 0196b0944430916d5aaf0bb87571626b391c3138)

14 months agolinux(4): Fixup the interface name translation in netlink
Dmitry Chagin [Thu, 23 Feb 2023 08:01:18 +0000 (11:01 +0300)]
linux(4): Fixup the interface name translation in netlink

Netlink should translate a FreeBSD interface name to a Linux
interface name.

Approved by: re (cperciva)
Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D38715
MFC after: 3 days

(cherry picked from commit e55e4a6ba3f4cd31d47b74574ea7370d5ab14b48)
(cherry picked from commit 123ca9ab11896f356245537ee41207fb6943fccd)

14 months agolinux(4): Consolidate a FreeBSD interface names translation code
Dmitry Chagin [Thu, 23 Feb 2023 08:00:29 +0000 (11:00 +0300)]
linux(4): Consolidate a FreeBSD interface names translation code

We have some amount of interface names translation functions which are
differs by bugs implementation. Consolidates it in a one place.

Fixup loopback interface names translation and use ifnet methods and
accessors, where possible.

Approved by: re (cperciva)
Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D38714
MFC after: 3 days
X-MFC with: 32fdc75fe7

(cherry picked from commit 3ab3c9c29cf0e5df8dbbaaf2003456445534bad8)
(cherry picked from commit a83551a52d1cfa8a756ef8dd298cab8042e27437)

14 months agolinux(4): Move use_real_names knob to the linux.c
Dmitry Chagin [Tue, 14 Feb 2023 14:46:32 +0000 (17:46 +0300)]
linux(4): Move use_real_names knob to the linux.c

MI linux.[c|h] are the module independent in terms of the Linux emulation
layer (ie, intended for both ISA - 32 & 64 bit), analogue of MD linux.h.
There must be a code here that cannot be placed into the corresponding by
common sense MI source and header files, i.e., code is machine independent,
but ISA dependent.
For the use_real_names knob, the code must be placed into the
linux_socket.[c|h], however linux_socket is ISA dependent.

Approved by: re (cperciva)
MFC after: 2 weeks

(cherry picked from commit 32fdc75fe7276083d446964055b0de0e29970b7c)
(cherry picked from commit 884ea80d4ebbd2d8ff03d56eddc1dc64d49be908)

14 months agoRevert "netlink: add NETLINK to GENERIC."
Alexander V. Chernikov [Mon, 27 Feb 2023 15:43:41 +0000 (15:43 +0000)]
Revert "netlink: add NETLINK to GENERIC."

This is a Direct commit to releng/13.2.

Requested by: re (cperciva)
Approved by: re (cperciva)

This reverts commit 6058f6cc48f5ec02476bf46693673bd71291a5c0.
This reverts commit 692e19cf519578176d51d4c1001b01b1f355c1de.

14 months agonetlink: fix addition of blackhole/reject routes.
Alexander V. Chernikov [Thu, 23 Feb 2023 17:38:18 +0000 (17:38 +0000)]
netlink: fix addition of blackhole/reject routes.

* Make nhop_set_blackhole() set all necessary properties for the
 nexthop
* Make nexthops blackhole/reject based on the rtm_type netlink
 property instead of using rtflags.

Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
MFC after: 3 days
Approved by: re(cperciva)

(cherry picked from commit d2deebe21b591336fbd8915b37d409b25da54d4d)
(cherry picked from commit f054a56ef3e8dc30ba0904d43cf7ec7b3e6e0ed4)

14 months agonetlink: clear IPv6 embedded scope when dumping route gateways.
Alexander V. Chernikov [Tue, 21 Feb 2023 12:25:58 +0000 (12:25 +0000)]
netlink: clear IPv6 embedded scope when dumping route gateways.

Reported by: zarychtam@plan-b.pwste.edu.pl
MFC after: 3 days
Approved by: re(cperciva)

(cherry picked from commit b9b2184322da85e1f4d52e3b0a6322dd214210ec)
(cherry picked from commit d101991d8dcc1e056d1c06ca83b88826f4d65ae5)

14 months agonetlink: fix IPv6 route addition with link-local gateway
Alexander V. Chernikov [Mon, 20 Feb 2023 14:24:01 +0000 (14:24 +0000)]
netlink: fix IPv6 route addition with link-local gateway

Currently kernel assumes that IPv6 gateway address is in "embedded"
 form - that is, for the link-local IPv6 addresses, interface index
 is embedded in bytes 2 and 3 of the address.
Fix address embedding in netlink by wrapping nhop_set_gw() in the
 netlink-specific nl_set_nexthop_gw(), which does such embedding
 automatically.

Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
MFC after: 3 days
Approved by: re(cperciva)

(cherry picked from commit c7c348162101a70b1f99299578dabe1d3b100e48)
(cherry picked from commit 240ee0183fa190502a5e1f163c49f336f8f10cd4)

14 months agovm_fault: Fix a race in vm_fault_soft_fast()
Mark Johnston [Mon, 13 Feb 2023 21:24:40 +0000 (16:24 -0500)]
vm_fault: Fix a race in vm_fault_soft_fast()

When vm_fault_soft_fast() creates a mapping, it release the VM map lock
before unbusying the top-level object.  Without the map lock, however,
nothing prevents the VM object from being deallocated while still busy.

Fix the problem by unbusying the object before releasing the VM map
lock.  If vm_fault_soft_fast() fails to create a mapping, the VM map
lock is not released, so those cases don't need to change.

Approved by: re (cperciva)
Reported by: syzkaller
Reviewed by: kib (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D38527

(cherry picked from commit d0991948182a1a149ee84f1b9c4d3e30450c8f0b)
(cherry picked from commit 2f57ef2d3b8f776a28e195cd780a3bb4924570be)

14 months ago13.2: update to BETA3
Colin Percival [Fri, 24 Feb 2023 07:50:45 +0000 (23:50 -0800)]
13.2: update to BETA3

Approved by: re (implicit)
Sponsored by: https://www.patreon.com/cperciva

14 months agoLinuxKPI: return an address string in pci_name()
Val Packett [Mon, 6 Feb 2023 21:50:13 +0000 (21:50 +0000)]
LinuxKPI: return an address string in pci_name()

amdgpu's virtual display feature uses pci_name() to match a module parameter
string, and the documentation shows an example of `0000:26:00.0` for the name.
In our case the name was just `drmn`, which is not actually unique across
devices.

The other consumers are wireless drivers, which will benefit from this
change.

Generate the expected string for pci_name() to return.

Related to: https://github.com/freebsd/drm-kmod/issues/134
Sponsored by: https://www.patreon.com/valpackett
Reviewed by: bz, hselasky, manu (earlier)
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D34248

(cherry picked from commit 393b0ba25f1a54dcc3f94244933c665f1c471d1a)
(cherry picked from commit 30960c51e646c51134fcb72e0adc881f36a41c38)

14 months agoLinuxKPI: pci: add more functions
Bjoern A. Zeeb [Sat, 28 Jan 2023 15:02:51 +0000 (15:02 +0000)]
LinuxKPI: pci: add more functions

Add a dummy pci_assign_resource() and an implementation of
pci_irq_vector() returning the irq for MSI-X, MSI, and legacy interrupt.
Both are needed by wirless drivers.

Sponsored by: The FreeBSD Foundation
Reviewed by: jhb
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D38237

(cherry picked from commit fd1a2f3dfc0e8fb20d0d397d586000bb918aab47)
(cherry picked from commit 7b65e6f377ca0005a986c59f1e31a0421d92660f)

14 months agoLinuxKPI: PCI: implement support for more than 1 MSI vector
Bjoern A. Zeeb [Fri, 27 Jan 2023 15:34:42 +0000 (15:34 +0000)]
LinuxKPI: PCI: implement support for more than 1 MSI vector

Following e9715b1c4474333ff119aba3a9a74bff91f72372 and
4b56afaf7bf4fa37bae5b26fd93ee1ff5969c1bb, implement support
for up-to 32 MSI vectors.  This is used by wireless drivers.
This also switches msi_desc to an array in order to store
per-vector information.

Sponsored by: The FreeBSD Foundation
Discussed with: grehan (in Dec)
Reviewed by: jhb
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D38222

(cherry picked from commit b15491b4773af99ce2470144ef6bcd9146cc9a98)
(cherry picked from commit 03a85378b81fcaffae5f8efdd75e2b8e10094e6a)

14 months agoLinuxKPI: implement irq_get_msi_desc()
Bjoern A. Zeeb [Mon, 28 Nov 2022 18:27:03 +0000 (18:27 +0000)]
LinuxKPI: implement irq_get_msi_desc()

Add irq_get_msi_desc() as a wrapper around a PCI function which will
allocate a single cached value (see comment on struct) for the
msi_desc requested if it doesn't exist yet and handle freeing it
when the PCI device goes away.  We take the values from the ivars of
the native (FreeBSD) device.

While changing struct pci_dev also add the msi_cap field requested by
a wireless driver.

Reviewed by: hselasky (earlier version)
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D37523

(cherry picked from commit 4b56afaf7bf4fa37bae5b26fd93ee1ff5969c1bb)
(cherry picked from commit 7d23664b35a2611dc4fea56f7cfd2b99f91626a0)

14 months agoLinuxKPI: 802.11: basic implementation of *queue(s)/*txq*
Bjoern A. Zeeb [Tue, 31 Jan 2023 16:17:14 +0000 (16:17 +0000)]
LinuxKPI: 802.11: basic implementation of *queue(s)/*txq*
LinuxKPI: 802.11: deal with stopped queues

Very basic implementations of ieee80211_{wake,stop}_queue[s],
as well as ieee80211_txq_schedule_start(), ieee80211_next_txq(),
and ieee80211_schedule_txq().
Various combinations of these are used by different wireless
drivers, incl. iwlwifi.

Following 5a9a0d7803382321b5f9fff1deae5fb08463cf1a initialize the
queue values explicitly and deal with a stopped queue in
ieee80211_tx_dequeue().

Sponsored by: The FreeBSD Foundation (parts of this work)
Approved by: re (cperciva)

(cherry picked from commit 5a9a0d7803382321b5f9fff1deae5fb08463cf1a)
(cherry picked from commit 0cbcfa1964de89cd346ee6f79437c6ab83a3b716)
(cherry picked from commit 9f9d047405778b2d2aca829a2037532b8ae8ed5d)

14 months agoLinuxKPI: 802.11: fix indent in lkpi_wake_tx_queues()
Bjoern A. Zeeb [Tue, 31 Jan 2023 23:12:30 +0000 (23:12 +0000)]
LinuxKPI: 802.11: fix indent in lkpi_wake_tx_queues()

Fix indentation in lkpi_wake_tx_queues().
No functional changes.

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)

(cherry picked from commit b0ddb44fd427d44b8153781ce9c461e393771aff)
(cherry picked from commit 9e782bfab9042aed12c36746534b1e4e4ec6d597)

14 months agoLinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT
Bjoern A. Zeeb [Tue, 31 Jan 2023 23:00:28 +0000 (23:00 +0000)]
LinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT

Add code (currently disabled by #ifdef) for HT and VHT to
lkpi_scan_ies_add().  Switch to a local variable for ic given
the new code also needs the value.

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)

(cherry picked from commit 3dd980267f4e53df259eb6d322e7332a8bc5bb0a)
(cherry picked from commit 28fbc0caa49b0fb119cc34a704d5437d63f479a3)

14 months agoLinuxKPI: 802.11: implement ieee80211_is_pspoll()
Bjoern A. Zeeb [Tue, 31 Jan 2023 16:36:24 +0000 (16:36 +0000)]
LinuxKPI: 802.11: implement ieee80211_is_pspoll()

Implement ieee80211_is_pspoll() and move it up to the set of implemented
ieee80211_is_*() functions.

There are no further changes (git diff just looks weird).

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)

(cherry picked from commit ff76cbc81d57ffc4bbc9bc20fd22325b2a8c2028)
(cherry picked from commit 2336248a8ba9763ad38074db40f32e117edd86f5)
(cherry picked from commit 16dc23caf17f8ffa21e365a1f2fe1a72d7fecbe8)

14 months agoLinuxKPI: 802.11: implement ieee80211_tx_status_ext()
Bjoern A. Zeeb [Tue, 31 Jan 2023 15:35:59 +0000 (15:35 +0000)]
LinuxKPI: 802.11: implement ieee80211_tx_status_ext()

Add an implementation of ieee80211_tx_status_ext() extending the
internal linuxkpi_ieee80211_tx_status() implementation.

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)

(cherry picked from commit a839757109891573123d8777b539fafa2d2198bb)
(cherry picked from commit df109ed24233e367ef7060a25ab1b55e2afcddc8)

14 months agoLinuxKPI: 802.11: extend linuxkpi_ieee80211_rx()
Bjoern A. Zeeb [Tue, 31 Jan 2023 15:05:30 +0000 (15:05 +0000)]
LinuxKPI: 802.11: extend linuxkpi_ieee80211_rx()

Extend linuxkpi_ieee80211_rx() by another argument for
the ieee80211_rx_list() implementation (even though the argument
is currently ignored).

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)

(cherry picked from commit e30e05d3ab3979a148068235298e1a6f73b675f0)
(cherry picked from commit e420c65378a04c5b9cde34013cab78188bc5a4c2)

14 months agoLinuxKPI: 802.11: fix types and whitespace
Bjoern A. Zeeb [Tue, 31 Jan 2023 13:39:04 +0000 (13:39 +0000)]
LinuxKPI: 802.11: fix types and whitespace

Correct struct member types, fix whitespace, and remove superfluous
return statements in void functions.

No functional changes.

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)

(cherry picked from commit a3baca22d0b7789a040a60f389e3c132b6e1755b)
(cherry picked from commit d282e777d7c9721614f110a1de66c7d88d0a6ea8)

14 months agoLinuxKPI: skbuff: implement skb_free_frag()
Bjoern A. Zeeb [Sat, 28 Jan 2023 15:33:12 +0000 (15:33 +0000)]
LinuxKPI: skbuff: implement skb_free_frag()

Using the work from 55038a6306a570c9f2df89f5ad076de0f7d98152 implement
skb_free_frag() calling page_frag_free().

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)

(cherry picked from commit dbbf46ebba78770c2c3a1d7983e92e79ca67abc0)
(cherry picked from commit 8a6a4122e6dd91489e48de50a3080f82d00e8715)

14 months agoLinuxKPI: add more dummy header files
Bjoern A. Zeeb [Sun, 29 Jan 2023 18:16:00 +0000 (18:16 +0000)]
LinuxKPI: add more dummy header files

Add more empty header files wireless drivers try to include but
we do not (yet) need for any implementation.

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D38271

(cherry picked from commit 52c28b99034bd32c86e6c058f68cfbf11c8f76c3)
(cherry picked from commit 8a091335fc63c86b80704abf58055f53c0621740)

14 months agoLinuxKPI: pm.h: add dummy pm_wakeup_event()
Bjoern A. Zeeb [Sat, 28 Jan 2023 15:53:03 +0000 (15:53 +0000)]
LinuxKPI: pm.h: add dummy pm_wakeup_event()

Add a dummy implementation of pm_wakeup_event() which is used to notify
the power management system about a wakeup (which we currently do not
implement yet).

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D38239

(cherry picked from commit 934cb7a3316609380fdea8da73233759f6dfff43)
(cherry picked from commit fbc5dea2a3af8edf1f22603605f78fe9f9b71494)

14 months agoLinuxKPI: device: add device_set_wakeup_enable()
Bjoern A. Zeeb [Sat, 28 Jan 2023 15:18:24 +0000 (15:18 +0000)]
LinuxKPI: device: add device_set_wakeup_enable()

Add a dummy device_set_wakeup_enable() which is used for WoWLAN which we
do not (yet) support and device_wakeup_enable() which is a wrapper to the
former with the enable argument being true.

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D38238

(cherry picked from commit ffdf10fb9cf13464801f2d78d3e1470201394812)
(cherry picked from commit b45e9a172d3830bed00018325eaa73c04a0b3a13)

14 months agoLinuxKPI: const argument to irq_set_affinity_hint()
Bjoern A. Zeeb [Sat, 28 Jan 2023 16:15:19 +0000 (16:15 +0000)]
LinuxKPI: const argument to irq_set_affinity_hint()

irq_set_affinity_hint() takes a const mask argument and some drivers
pass it in as such where earlier implementations were more lenient.
Deal with it and __DECONST() the argument when passed to intr_setaffinity().

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D38242

(cherry picked from commit 4c72d075a57e9a3215639aede16df4df29e1c1da)
(cherry picked from commit 4724e1867e81ab5de2c6b5a6819998b660f3e96d)

14 months agoLinuxKPI: mm.h: implement virt_to_head_page()
Bjoern A. Zeeb [Sat, 28 Jan 2023 16:00:55 +0000 (16:00 +0000)]
LinuxKPI: mm.h: implement virt_to_head_page()

Implement virt_to_head_page().

Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D38240

(cherry picked from commit 70b97048a051958be37b650b8a67c89203fd6b70)
(cherry picked from commit 1984e6e4f1583ad1a44b6913e8722121fabe8967)

14 months agoLinuxKPI: interrupt.h: add disable_irq_nosync(), irq_set_status_flags()
Bjoern A. Zeeb [Sat, 28 Jan 2023 16:11:59 +0000 (16:11 +0000)]
LinuxKPI: interrupt.h: add disable_irq_nosync(), irq_set_status_flags()

Add a dummy irq_set_status_flags() along with #defines passed by the driver.
Add disable_irq_nosync() as another wrapper to lkpi_disable_irq().
Those are used by wireless drivers.

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D38241

(cherry picked from commit bc81a2b788f5644ece58defa30880b69c9894981)
(cherry picked from commit 75727a02155af29167a6d460de5ce6a9d52e26d8)

14 months agoLinuxKPI: linux_pci.c: fix whitespace
Bjoern A. Zeeb [Fri, 27 Jan 2023 15:18:44 +0000 (15:18 +0000)]
LinuxKPI: linux_pci.c: fix whitespace

Properly indent a line.  No functional change.

Sponsored by: The FreeBSD Foundation
Approved by: re (cperciva)

(cherry picked from commit 68b1d162505149b8629f7e22cecf298cea2ff1f9)
(cherry picked from commit 069f504a8c4f9873ca32637cf0df1b0390b69b6a)

14 months agoloader: always install help files
Mitchell Horne [Thu, 11 Feb 2021 14:29:00 +0000 (10:29 -0400)]
loader: always install help files

Address two issues with current help file logic:

The existing condition prevents the common help file from being
installed when there are no additional help files defined. This results
in no loader.help on EFI platforms, for example.

Second, due to the fact that we build and install multiple loader types,
each successive install will clobber the previous loader.help. The
result is that we could lose type-specific commands, or possibly list
them in loaders that do not have such commands.

Instead, give each loader type a uniquely named help file. The EFI
loader will look for /boot/loader.help.efi, userboot will look for
/boot/loader.help.userboot, etc. The interpreter variant has no effect
on which help file is loaded.

This leaves the old /boot/loader.help unused.

Some credit for the final approach goes to Mathieu <sigsys@gmail.com>
for their version of the fix in https://reviews.freebsd.org/D22951.

Approved by: re (cperciva)
PR: 267134
Reported by: Daniel O'Connor <darius@dons.net.au>
Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28591

(cherry picked from commit 8859960436f5727f163a7b3468e08710c5e6d874)
(cherry picked from commit a2b4abce0e30e014b2c08c0bdc34b368aa9c7a6f)

14 months agonproc: denote an incompatiblity with Linux
Mateusz Guzik [Wed, 15 Feb 2023 20:17:27 +0000 (20:17 +0000)]
nproc: denote an incompatiblity with Linux

On Linux _NPROCESSORS_CONF reports CPU threads disabled by the kernel,
while it does not on FreeBSD.

Flip _NPROCESSORS_ONLN to _NPROCESSORS_CONF. While it keeps reporting
the same value, it will automagically unbreak should someone change the
above.

Approved by: re (cperciva)
(cherry picked from commit 059320b8c8de73a90514879cd1e2da397584cfde)
(cherry picked from commit 117d4cafdcb806407e38266de44aebe0b4e62b6f)

14 months agoAdd nproc(1)
Mateusz Guzik [Sat, 4 Feb 2023 23:33:48 +0000 (23:33 +0000)]
Add nproc(1)

This program prints the number of CPU threads it can run on, while
respecting cpusets (or not, depending on switches).

It aims to be compatible with nproc as found in GNU coreutils.

Approved by: re (cperciva)
Reviewed by: des
Reviewed by: pstef
Differential Revision: https://reviews.freebsd.org/D38386

(cherry picked from commit 48bfd3597654490cdc43bf0f591a539d3a28b590)
(cherry picked from commit 31f9db72a35bb20ad01d792eaaa1d6048252ab38)

14 months agovmm: Fix AP startup compatibility for old bhyve executables
Mark Johnston [Thu, 9 Feb 2023 20:52:35 +0000 (15:52 -0500)]
vmm: Fix AP startup compatibility for old bhyve executables

These changes unbreak AP startup when using a 13.1-RELEASE bhyve
executable with a newer kernel:
- Correct the destination mask for the VM_EXITCODE_IPI message generated
  by an INIT or STARTUP IPI in vlapic_icrlo_write_handler().
- Only initialize vlapics on active vCPUs.  13.1-RELEASE bhyve activates
  AP vCPUs only after the BSP starts them with an IPI, and vmm now
  allocates vcpu structures lazily, so the STARTUP handling in
  vm_handle_ipi() could trigger a page fault.
- Fix an off-by-one setting the vcpuid in a VM_EXITCODE_SPINUP_AP
  message.

Approved by: re (cperciva)
Fixes: 7c326ab5bb9a ("vmm: don't lock a mtx in the icr_low write handler")
Reviewed by: jhb, corvink
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38446

(cherry picked from commit b265a2e0d76422f4007e96dd7295ed0aeb846e2d)
(cherry picked from commit 577a666c3c33def1d4b996575dc43f8567fdac5c)

14 months agoMFV: zlib 1.2.13.
Xin LI [Fri, 17 Feb 2023 07:57:24 +0000 (23:57 -0800)]
MFV: zlib 1.2.13.

Relnotes: yes
Approved by: re (cperciva)

(cherry picked from commit e37bb444aa945ed0725766e986698a09bd61b1b2)
(cherry picked from commit 3a7d654ed82bc2b379549f8b2ac1e8ac6a638fa5)

14 months agoFix per-jail zfs.mount_snapshot setting
Allan Jude [Sat, 18 Feb 2023 01:44:34 +0000 (01:44 +0000)]
Fix per-jail zfs.mount_snapshot setting

When jail.conf set the nopersist flag during startup, it was
incorrectly destroying the per-jail ZFS settings.

PR: 260160
Reviewed by: imp (previous version), mm (upstream), freqlabs (upstream)
Approved by: re (cperciva)
Sponsored by: Modirum MDPay
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38662

(cherry picked from commit 8b04c1cbfc1cb71a1ce53b3a7855f1d45866fcfb)
(cherry picked from commit 426ed00525409d084e97dc44397722aff2cc0bb3)

14 months agoixl(4): Fix MAC/VLAN filters accounting
Krzysztof Galazka [Wed, 15 Feb 2023 22:28:01 +0000 (14:28 -0800)]
ixl(4): Fix MAC/VLAN filters accounting

- Account for a filter required to enable reception of untagged frames
while registering and unregistering VLANs to avoid trying to add more
filters than HW supports

- While adding MAC/VLAN filters, pre-set matching method field in the
Admin Queue Command response buffer to expected error value to work
around an issue with some FW versions, which do not update that field if
operation fails, and be able correctly track which filters were
configured in HW.

- Remove unused IXL_MAX_FILTERS macro definition

- Update number of available MAC/VLAN filters as in newer FW versions it
was decreased by one.

- Simplify i40e_dma_mem structure

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: erj@
Tested by: Gowtham Kumar Ks <gowtham.kumar.ks@intel.com>
Approved by: re (cperciva)
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D37457

(cherry picked from commit 1d02c6b1b859e9f611bc8fe27ca3d2c16ec128c1)
(cherry picked from commit a6fa27eb5267bfaceb626d90ead84b4d9a4f5655)

14 months agoixgbe(4): Filter out spurious link up indication
Krzysztof Galazka [Wed, 15 Feb 2023 22:35:40 +0000 (14:35 -0800)]
ixgbe(4): Filter out spurious link up indication

Extend SFP+ cage crosstalk fix by re-checking link state after 5ms delay
to filter out spurious link up indication by transceiver with no fiber
cable connected.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: erj@
Tested by: Gowtham Kumar Ks <gowtham.kumar.ks@intel.com>
Approved by: re (cperciva)
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D38395

(cherry picked from commit 04a5e6d7cadd06b10169c3c3a560649e7dc7444c)
(cherry picked from commit 25d43e3c6b365c3fb68c594fe1b9a40b98bf4f00)

14 months agoice(4): Update to 1.37.7-k
Piotr Kubaj [Tue, 14 Feb 2023 01:29:44 +0000 (17:29 -0800)]
ice(4): Update to 1.37.7-k

Notable changes include:

- DSCP QoS Support (leveraging support added in
  rG9c950139051298831ce19d01ea5fb33ec6ea7f89)
- Improved PFC handling and TC queue assignments (now all remaining
  queues are assigned to TC 0 when more than one TC is enabled and the
  number of available queues does not evenly divide between them)
- Support for dumping the internal FW state for additional debugging by
  Intel support
- Support for allowing "No FEC" to be a valid state for the LESM to
  negotiate when using non-standard compliant modules

Also includes various bug fixes and smaller enhancements, too.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: erj@
Tested by: Jeff Pieper <jeffrey.pieper@intel.com>
Approved by: re (cperciva)
Relnotes: yes
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D38109

(cherry picked from commit 8923de59054358980102ea5acda6c6dd58273957)
(cherry picked from commit ebc914f942f6655ff4c27f8717630f81c74624cb)

14 months agoice_ddp: Update package to 1.3.30.0
Eric Joyner [Tue, 24 Jan 2023 22:01:57 +0000 (14:01 -0800)]
ice_ddp: Update package to 1.3.30.0

This updated DDP is intended to be used with the forthcoming ice(4)
driver update to 1.37.7-k. (But it will still work with the current
version.)

Co-authored-by: Piotr Kubaj <pkubaj@FreeBSD.org>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Approved by: re (cperciva)
Sponsored by: Intel Corporation

(cherry picked from commit 2508da22cd6f0904fe55d2d5f6cab7c6011f918c)
(cherry picked from commit cd280c60a5b85875b8aeff8d522793914e60d19d)

14 months agoirdma: fix LINT-NOIP/NOINET/NOINET6 builds
Mitchell Horne [Mon, 30 May 2022 20:47:32 +0000 (17:47 -0300)]
irdma: fix LINT-NOIP/NOINET/NOINET6 builds

This module depends on the presence of both INET and INET6 options in
order to compile.

Reviewed by: erj
Fixes: cdcd52d41e24 ("irdma: Add RDMA driver for Intel(R) Ethernet...")
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D35343

(cherry picked from commit acdfbc6cbe0a8a976d446216be84994c8ee8d5c1)
(cherry picked from commit 7333d34e5ec96db747648ab7b245d814d3140738)

14 months agokern: physmem: improve region coalescing logic
Kyle Evans [Thu, 28 Oct 2021 04:40:08 +0000 (23:40 -0500)]
kern: physmem: improve region coalescing logic

The existing logic didn't take into account newly inserted mappings
wholly contained by an existing region (or vice versa), nor did it
account for weird overlap scenarios.  The latter is probably unlikely
to happen, but the former may happen in UEFI: BootServicesData allocated
within a large chunk of ConventionalMemory.  This situation blows up vm
initialization.

While we're here, remove the "exact match" logic as it's likely wrong;
if an exact match exists with conflicting flags, for instance, then we
should probably be doing something else.  The new logic takes into
account exact matches as part of the overlapping efforts.

Reviewed by: kib, mhorne (both earlier version)
Approved by: re (cperciva)

(cherry picked from commit 7771f2a0c94fc2f7b9ce1565a49e52dba1e7381d)
(cherry picked from commit 13f1d1bd86476393b8a2ec2c79cb0b1637fcdec6)

14 months agocleanvar: Be more careful when cleaning up /var.
Xin LI [Mon, 13 Feb 2023 04:56:17 +0000 (20:56 -0800)]
cleanvar: Be more careful when cleaning up /var.

The cleanvar script uses find -delete to remove stale files under /var,
which could lead to unwanted removal of files in some unusual scenarios.
For example, when a mounted fdescfs(5) is present under /var/run/samba/fd,
find(1) could descend into a directory that is out of /var/run and remove
files that should not be removed.

To mitigate this, modify the script to use find -x, which restricts the
find scope to one file system only instead of descending into mounted
file systems.

PR: 269213
Approved by: re (cperciva)

(cherry picked from commit 39e8c2a29a860bdb69ffcfbc06de4d4ad103b458)
(cherry picked from commit 0699f0d43416776d87d20d7953b7d686f1e2e572)

14 months agollvm: make sure to use ELFv2 ABI on powerpc64
Piotr Kubaj [Thu, 16 Feb 2023 23:49:43 +0000 (00:49 +0100)]
llvm: make sure to use ELFv2 ABI on powerpc64

Currently LLVM is more or less set up to use ELFv2, but it still defaults to
ELFv1 in some places. This causes lld to generate broken binaries when used
with LTO.

PR: 269455
Approved by: dim, re (cpercival)
MFC after: 3 days

(cherry picked from commit a1ffc2fe9ce54a498c410dcab86495569dbaa7cc)
(cherry picked from commit 8f39cbf4f30c9a8cd3f593dc2b373a289785d4b6)

14 months agonetlink: validate rtable value in RTM_<NEW|DEL|GET>ROUTE.
Alexander V. Chernikov [Fri, 17 Feb 2023 17:31:40 +0000 (17:31 +0000)]
netlink: validate rtable value in RTM_<NEW|DEL|GET>ROUTE.

Reported by: Stefan Grundmann <sg2342@googlemail.com>
Approved by:    re(cperciva)
MFC after: 1 day

(cherry picked from commit f2f7911c5513096e46422ad7756bc90c13c6e6d8)
(cherry picked from commit e9296dc1bcd21cd9d719389cd04235ce4513e84d)

14 months agorouting: always pass rtentry to add_route_flags().
Alexander V. Chernikov [Fri, 17 Feb 2023 17:20:38 +0000 (17:20 +0000)]
routing: always pass rtentry to add_route_flags().

add_route_flags() uses `rt` prefix data to lookup the the current
 rtentry from the routing table. Update rib_add_route_px() to
 always pass rtentry regardless of the op_flags.

Reported by: Stefan Grundmann <sg2342@googlemail.com>
Approved by:    re(cperciva)
MFC after: 1 day

(cherry picked from commit a0aa160b6d261f67b29a25c7cc5e04668fb6faf7)
(cherry picked from commit 45ced2987df29a8587df2ad3c9ea0ddb1998aa16)

14 months agonetlink: use ifmedia to provide vlan interface operstate.
Alexander V. Chernikov [Wed, 15 Feb 2023 20:22:47 +0000 (20:22 +0000)]
netlink: use ifmedia to provide vlan interface operstate.

Netlink customers rely on admin and operational state when
 working with interfaces. The current implementation retuns
 "unknown" operstate for all interface types except IFT_ETHER
 and IFT_LOOP.

This change updates the code to fetch vlan operstate in the same way
 as for the ether interfaces. For the rest of the interface types,
 operstate is now mapped to the admin state.

Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Approved by:    re(cperciva)
MFC after: 3 days

(cherry picked from commit 5dd48f718433959c283a8a4d6e46512426f1e200)
(cherry picked from commit c169fb625ee0800ad1e6046440d67eef598581c2)

14 months agonetlink: fix if_allocdescr() malloc options argument.
Alexander V. Chernikov [Fri, 17 Feb 2023 17:35:28 +0000 (17:35 +0000)]
netlink: fix if_allocdescr() malloc options argument.

The current value was based on the initial revision of D37566 and
 was not updated afterwards.

MFC after: 1 day
Approved by:    re(cperciva)

(cherry picked from commit 6694cb1f5784d6ceacd684d29b3e3012e1e4e4d5)
(cherry picked from commit 8c60d469d3faa98f6b0e49173f16a8603c4c4654)

14 months agonetlink: add forgotten pru_rcvd handler.
Alexander V. Chernikov [Sat, 18 Feb 2023 11:48:40 +0000 (11:48 +0000)]
netlink: add forgotten pru_rcvd handler.

There were changes in -HEAD domain/protosw setup logic and
 .pru_rcvd netlink handler was missed when performing the merge.
Lack of this handler resulted in userland being waiting forever
 when performing large dumps of data.

This change restores the handler as direct commit to stable/13.

Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Approved by:    re(cperciva)

(cherry picked from commit 4a081cc5a44e97794df5dae3df4a49c177b9ae4b)

14 months agonetlink: Zero-initialize writer structures allocated on the stack
Mark Johnston [Thu, 26 Jan 2023 15:46:19 +0000 (10:46 -0500)]
netlink: Zero-initialize writer structures allocated on the stack

The prevailing pattern seems to be to simply initialize all fields to
zero.  Without this, it's possible to trigger a branch on uninitialized
memory, specifically, when testing nw->ignore_limit in
nlmsg_refill_buffer().

Initialize the writer structure in a couple of functions where this is
necessary.

Reported by: KMSAN
Reviewed by: melifaro
Approved by:    re(cperciva)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38213

(cherry picked from commit 7a78ae88659e0f6a901574d17672d1ccdc3e971b)
(cherry picked from commit 2de541757e0a2e25ce974b3c4c29bc8b753b8b6a)

14 months agonetlink: Zero-initialize mbuf messages
Mark Johnston [Tue, 17 Jan 2023 14:36:54 +0000 (09:36 -0500)]
netlink: Zero-initialize mbuf messages

Some users of nlmsg_reserve_object() and nlmsg_reserve_data() are not
careful to fully initialize pad and reserved fields, allowing
uninitialized bytes to leak to userspace.  For example, dump_nhgrp()
doesn't set nhm->resvd = 0.

Meanwhile, nlmsg_get_ns_buf() and nlmsg_get_ns_lbuf() zero-initialize
the buffer, so nlmsg_get_ns_mbuf() is inconsistent.  Let's just make
them all behave the same here.

Reported by: KMSAN
Reviewed by: melifaro
Approved by: re(cperciva)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38098

(cherry picked from commit d91be0f1211b0196a0087cdfa237a6a0d2a43b65)
(cherry picked from commit 13e997289240c4697536f904167720a29abf7a58)

14 months agofusefs: fix some resource leaks
Alan Somers [Sat, 11 Feb 2023 23:43:30 +0000 (16:43 -0700)]
fusefs: fix some resource leaks

fusefs would leak tickets in three cases:
* After FUSE_CREATE, if the server returned a bad inode number.
* After a FUSE_FALLOCATE operation during VOP_ALLOCATE
* After a FUSE_FALLOCATE operation during VOP_DEALLOCATE

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38526

(cherry picked from commit 1bdf879b97b686a8f36fdba050b68f9e7493f363)

MFC Note: changes to VOP_DEALLOCATE are not MFCed, because that VOP does
not exist in stable/13.

Approved by: re (cperciva)

(cherry picked from commit 57756461548b813c288e190900de31e847e412f9)

14 months agoefivar: Really look for labels for the provider with right efimedia
Warner Losh [Thu, 16 Feb 2023 16:36:03 +0000 (09:36 -0700)]
efivar: Really look for labels for the provider with right efimedia

The prior code mistakently thought that the g_consumer that hung off the
provider we found were the right thing to use to find all the glabel
aliases for this node. However, the only way to find that is to iterate
through all the geoms that belong to the glabel geom class, looking for
those geoms with the same name as the provider with the right efimedia.
Do this in a way that caches glabel class, and allows for it to be
absent. Tighten the filter for mounted filesystems to only look
for the ones that are mounted on /dev/.. since the rest of the code
assumes that.

MFC After: 3 days
Sponsored by: Netflix
Reviewed by: corvink, asomers
Differential Revision: https://reviews.freebsd.org/D38619
Approved by: re@ (cperciva)

(cherry picked from commit 2b460910326c4f39068fe2158a0726dc3d362f68)
(cherry picked from commit f4d711e7209073404c821c9c26c7c17b87b61997)

14 months agoefibootmgr: Add --efidev (-u) to discover UEFI's device path to a dev or file
Warner Losh [Thu, 16 Feb 2023 16:36:03 +0000 (09:36 -0700)]
efibootmgr: Add --efidev (-u) to discover UEFI's device path to a dev or file

"efibootmgr --efidev unix-path" will return the UEFI device-path to the
file or device specified by unix-path. It's useful for debugging, but
may also be useful for scripting.

Sponsored by: Netflix
Reviewed by: corvink, manu
Differential Revision: https://reviews.freebsd.org/D38617
Approved by: re@ (cperciva)

(cherry picked from commit 9a7915299484a767fbffc7234b8dc45c29954cca)
(cherry picked from commit 8ab17c6dd1d8e8056e5354390f29e0f36cf4e406)

14 months agoefivar: support device paths as well as mounted paths in path_to_dp
Warner Losh [Thu, 16 Feb 2023 16:36:03 +0000 (09:36 -0700)]
efivar: support device paths as well as mounted paths in path_to_dp

In path_to_dp, allow passing in either the actual device path "eg
/dev/foo/bar" or the path where the device is mounted (say
/mnt/baz/bing). In the former case we'll assume the path within the
device is nothing (the relpath). In the latter, we'll take from the
mount point on down as the relpath.

Sponsored by: Netflix
Reviewed by: corvink, manu, asomers
Differential Revision: https://reviews.freebsd.org/D38616
Approved by: re@ (cperciva)

(cherry picked from commit 57d5ca4eeba6192e91044aad86fca4429966cfac)
(cherry picked from commit bae5c36257ec5289631abf49b33a4041acc84e3c)

14 months agoefivar: Allow NULL paths in build_dp
Warner Losh [Thu, 16 Feb 2023 16:36:03 +0000 (09:36 -0700)]
efivar: Allow NULL paths in build_dp

Allow there to be NULL paths in buildp. This lets us return the device
path to the partition, as well as to files on the partition.

Sponsored by: Netflix
Reviewed by: corvink, manu, asomers
Differential Revision: https://reviews.freebsd.org/D38615
Approved by: re@ (cperciva)

(cherry picked from commit 49fd6affdbfe6af53f119ebb27ff5e5e292e1f67)
(cherry picked from commit 82c0aea8f3c270c6d20b093cf711d4bb1472237c)

14 months agoefivar: Try harder to find label's efimedia
Warner Losh [Thu, 16 Feb 2023 16:36:03 +0000 (09:36 -0700)]
efivar: Try harder to find label's efimedia

If there's no efimedia attribute on the provider, and the provider's a
glabel, then find the 'parent' geom. In this case, the provider's name
is label-type/name, but the geom's label will that of the underlying
device (eg ada0p1). If it is, recurisvely call find_geom_efimedia with
the geom's name, which shuold have the efimedia attribute.

Sponsored by: Netflix
Reviewed by: corvink, manu, asomers
Differential Revision: https://reviews.freebsd.org/D38614
Approved by: re@ (cperciva)

(cherry picked from commit ccf2121d59ac51e1a0287d75262d48018d09cad6)
(cherry picked from commit 9ad4c0468f1924cf7bdb9830bb781de9ca095c61)

14 months agosys/_endian.h: Move powerpc workaround into _endian.h
Warner Losh [Thu, 16 Feb 2023 16:58:33 +0000 (09:58 -0700)]
sys/_endian.h: Move powerpc workaround into _endian.h

Powerpc compilers often define _BIG_ENDIAN or _LITTLE_ENDIAN depending
on the byte order of the target. This interfers with the endian.h and
sys/endian.h APIs which expect those two to be 4321 or 1234.
Unconditionally undefine these two before we define them to work around
this issue. By including endian.h, the programmer is saying they want
this API not the native one. This matches historic practice as well.

Fixes: e35448a901aa
Sponsored by: Netflix
Noticed by: powerpc, powerpc64 CI jobs
Approved by: re (cperciva)

(cherry picked from commit 6f23df1ae7f6ec3cd06a15c87f0aaaa770b2941b)
(cherry picked from commit 07e39710b170859ef6a57185f9a775973f3eeffe)

14 months agopowerpc: Drop old workaround for old gcc
Warner Losh [Thu, 16 Feb 2023 16:58:33 +0000 (09:58 -0700)]
powerpc: Drop old workaround for old gcc

Very old versions of gcc defined _BIG_ENDIAN and _LITTLE_ENDIAN. So to
work around that, we undefined them here. However, that causes problems
for programs that do:

(and many other variations on that theme). Since this often is the
result of weirdly nested includes in the ports world that are hard to
unwind, drop this workaround to help more ports build out of the box.
If there's still an issue here (and my testing hasn't shown it), we'll
fix the issue in a brand-new way once I have a reproducer.

This fixes the mesa-devel build, and others

Sponsored by: Netflix
Tested by: pkubaj
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D38564
Approved by: re (cperciva)

(cherry picked from commit e35448a901aa56aa232efbc4fe7a73a9bdac3511)
(cherry picked from commit a86b9ed22ece362331f44a933bbf5426a06f527a)

14 months agocdce: add to cdce.4 information about NCM network mode
Michael Paepcke [Thu, 16 Feb 2023 16:58:33 +0000 (09:58 -0700)]
cdce: add to cdce.4 information about NCM network mode

add a new section how to use NCM network mode and specify the required
kernel modules

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/646
Approved by: re (cperciva)

(cherry picked from commit 58e1d01022415e29d3e08c4d3936b6631c27406c)
(cherry picked from commit 6c9ad7b8bc7dbc17f41ddab6779548fb2728608a)

14 months agou3g: add huawei device id
Michael Paepcke [Thu, 16 Feb 2023 16:58:32 +0000 (09:58 -0700)]
u3g: add huawei device id

Add missing entry for E3372h Model already in NCM mode

Noticed by: David BOYER
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/645
Approved by: re (cperciva)

(cherry picked from commit 08ecb40e88a0d34cf6a177218a22f07431cadf3c)
(cherry picked from commit 38a2e8fff2f7ede285fa66b765e5387026d779f6)

14 months agousb/u3g: Add support for QUECTEL EP06-E 4G modem
ev [Thu, 16 Feb 2023 16:58:32 +0000 (09:58 -0700)]
usb/u3g: Add support for QUECTEL EP06-E 4G modem

Add QUECTEL EP06-E modem support via USB for FreeBSD.
Tested and works like a ppp on FreeBSD-13.

Reviewed by: imp
PR: 269326
Approved by: re (cperciva)

(cherry picked from commit 0cec5b99b3c0484925f3cc0813040c160987bd45)
(cherry picked from commit 1256ad9b27b2eb34a066640e63039975ab4f8492)

14 months agou3g: Add new 4G Huawei devices
Michael Paepcke [Thu, 16 Feb 2023 16:58:32 +0000 (09:58 -0700)]
u3g: Add new 4G Huawei devices

New 4G devices. Longer description of new modes to follow.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633
Approved by: re (cperciva)

(cherry picked from commit 75d41cb6967bef0e534afd6d20ea5eeeb2435e36)
(cherry picked from commit 9786ac44efd689018ee8dafa4fb231cdba366e94)

14 months agousb: Remove obsolete Huawei 3G from usbdevs
Michael Paepcke [Thu, 16 Feb 2023 16:58:31 +0000 (09:58 -0700)]
usb: Remove obsolete Huawei 3G from usbdevs

- remove Huawei 3G E3131 (E3131_INIT):
- frees up 0x1505/0x14fe shared IDs => product is EOL (since...)
- 3G networks are shutdown/scheduled
- E3131 devices will still work the same via scsi_huawei_eject2
- new 4G devices will switch & report correctly now

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633
Approved by: re (cperciva)

(cherry picked from commit 848ac8451b08d09a81de7bac8ff8fbe0d35df8cb)
(cherry picked from commit b9ddd053e800af8e8a4b06b96128f505d45f532f)

14 months agousb: add support for Huawei E5573Cs322
Michael Paepcke [Thu, 16 Feb 2023 16:58:31 +0000 (09:58 -0700)]
usb: add support for Huawei E5573Cs322

Switch the now added E5573Cs322_ECM (0x14db) as well per default to NCM.
With this patch we default all devices to simple NCM mode to avoid the
problem and get a consistent reliable behavior. No matter what firmware
version and provider mix are involved.

Rationale:
Even the bigger SOC shows under complex load in ECM (double-nat) mode
the same performance drop from 25Mbit to 2Mbit Line Speed, similar to E3372h.
Reason: Thermal problems (reported via serial debug interface in ACM Mode)
after 2-3 minutes load.

Fix the root cause and bundle a working firmware is out of reach because
Huawei sells the same hardware, different (crippled) firmware versions
at different price points in different markets as strategy.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633
Approved by: re (cperciva)

(cherry picked from commit e66352013a67183dfeec14b2a22913305c26e838)
(cherry picked from commit 623346ecb9b3f4390e9f13df4b19e6e41c4e53ee)

14 months agousb: add new scsi_huawei eject3 & eject4 driver support
Michael Paepcke [Thu, 16 Feb 2023 16:58:31 +0000 (09:58 -0700)]
usb: add new scsi_huawei eject3 & eject4 driver support

Add initialization for new Huawei 4G E3372_NCM, E3372v153_NCM,
E5573Cs322_NCM, E5573Cs322_ECM, and E5573Cs322_ACM.

Remove now-obsolete Huawei 3G E3131 init sequence. These devices are
obsolete, share IDs with new devices and the 3G networks are shutdown.
These old devices work correctly via the 4G code while still allowing
the shared IDs to work differently for the new devices.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633
Approved by:re (cperciva)

(cherry picked from commit 1997d3a4a9f20a846cf762306fd5193526a1d603)
(cherry picked from commit e20b6a8ec68e3f6805a5281d2691c2ac97f6bb93)

14 months agousb: add new scsi_huawei eject3 & eject4 sequences
Michael Paepcke [Thu, 16 Feb 2023 16:58:30 +0000 (09:58 -0700)]
usb: add new scsi_huawei eject3 & eject4 sequences

Add new Huawei eject3 and eject4 command sequences.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633
Approved by: re (cperciva)

(cherry picked from commit 7d4b2b5834dba66732596d68d7f817d18affb67f)
(cherry picked from commit 356e03eace327e3b255834d4a1e6a7278663ce85)