]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agovxlan: Add support for socket ioctls SIOC[SG]TUNFIB
Zhenlei Huang [Fri, 8 Jul 2022 18:12:14 +0000 (18:12 +0000)]
vxlan: Add support for socket ioctls SIOC[SG]TUNFIB

Submitted by: Luiz Amaral <email@luiz.eng.br>
PR: 244004
Differential Revision: https://reviews.freebsd.org/D32820
MFC after: 2 weeks

2 years agotest: Update boot universe build architectures
Warner Losh [Fri, 8 Jul 2022 17:07:39 +0000 (11:07 -0600)]
test: Update boot universe build architectures

We build lua by default, so we don't need another build to build it
enabled w/o FORTH. That gives little value over the without forth
builds. Remove all mips, they are no longer relevant. Build aarch64
everywhere we build amd64 (except firewire which is x86 only). Build a
few more architectures once so we have at least one of every arch we
support in at least the default build. This should increase coverage
and still take less time than before.

Sponsored by: Netflix

2 years agostand: Add comment about CFLAGS pollution
Warner Losh [Fri, 8 Jul 2022 16:34:44 +0000 (10:34 -0600)]
stand: Add comment about CFLAGS pollution

Add a note that veriexec / bearssl builds will pollute the CFLAGS in a
way that's somewhat hard to fix, so I'm just noting it for now.

Sponsored by: Netflix

2 years agostand: constrain zlib/gzip CFLAGS better
Warner Losh [Fri, 8 Jul 2022 16:29:25 +0000 (10:29 -0600)]
stand: constrain zlib/gzip CFLAGS better

Define ZLIB_CFLAGS and use it only for the sources that are in ZLIB or
that include it.

Sponsored by: Netflix

2 years agostand: Confine BZIP defines to bzip files
Warner Losh [Fri, 8 Jul 2022 16:19:39 +0000 (10:19 -0600)]
stand: Confine BZIP defines to bzip files

Sponsored by: Netflix

2 years agostand: geli CFLAGS tightening
Warner Losh [Fri, 8 Jul 2022 16:02:17 +0000 (10:02 -0600)]
stand: geli CFLAGS tightening

Only add -DWEAK_REFS to sha256.c and sha512.c instead of
everything. Remove redundant include that's not needed.
Minor formatting tweak.

Sponsored by: Netflix

2 years agostans: Narrow the scope of includes and other flags
Warner Losh [Fri, 8 Jul 2022 15:42:34 +0000 (09:42 -0600)]
stans: Narrow the scope of includes and other flags

CFLAGS+= here affects *ALL* libsa files being built. However, this is
only needed for zfs.c, so define it only for this. Also, use the defines
from defs.mk. Move all the zfs.c include hacks together. Also, move the
-Wformat -Wall warnings that were added to CFLAGS+= to the individual
files instead for the same reason.

Sponsored by: Netflix

2 years agostand: Use a for loop for all the common ZSTD files
Warner Losh [Fri, 8 Jul 2022 15:13:50 +0000 (09:13 -0600)]
stand: Use a for loop for all the common ZSTD files

Also add comments about why we're not using the BMI instructions when
vailable.

Sponsored by: Netflix

2 years agostand: Separate out ZSTD sources from ZFS sources
Warner Losh [Fri, 8 Jul 2022 15:07:41 +0000 (09:07 -0600)]
stand: Separate out ZSTD sources from ZFS sources

Sponsored by: Netflix

2 years agostand: Don't reuse ZFSSRC
Warner Losh [Fri, 8 Jul 2022 15:03:45 +0000 (09:03 -0600)]
stand: Don't reuse ZFSSRC

ZFSSRC is the top level directory where the ZFS sources come from. Don't
reuse it for a list of ZFS sources. Instead, use ZFS_SRC

Sponsored by: Netflix

2 years agowtap(4): Rename interface name
En-Wei Wu [Fri, 8 Jul 2022 17:29:15 +0000 (01:29 +0800)]
wtap(4): Rename interface name

The original interface created by wtap is named "wlan%d", which is the
same as the name of the vap created by wlan(4) and cause ifconfig(8)
may output like this:

    wlan0:
            parent interface: wlan0

Rename the interface created by wtap(4) to "wtap%d" to avoid confusing.

Reviewed by: adrian
Sponsored by: Google, Inc. (GSoC 2022)
Differential Revision: https://reviews.freebsd.org/D35751

2 years agozfs: fix powerpc64le build
Piotr Kubaj [Fri, 8 Jul 2022 15:21:53 +0000 (17:21 +0200)]
zfs: fix powerpc64le build

PR: 265003
Reviewed by: alfredo (on IRC)

2 years agonfscl: Fix setting of nfsess_defunct for nfscl_hasexpired()
Rick Macklem [Fri, 8 Jul 2022 14:37:36 +0000 (07:37 -0700)]
nfscl: Fix setting of nfsess_defunct for nfscl_hasexpired()

Commit a7bb120f8b87 added a printf for the case where recovery
has not marked the session defunct by setting nfsess_defunct
to 1.  It turns out that nfscl_hasexpired() calls
nfsrpc_setclient() directly, without setting nfsess_defunct.
This patch replaces the printf with code that sets
nfsess_defunct to 1 to handle this case.

If SIGTERM is issued to a process when it is doing I/O on
an "intr" mount, the NFSv4 server may reply NFSERR_BADSTATEID,
due to the Open being prematurely closed.
This can result in a call to nfscl_hasexpired() to do a
recovery.

This would explain at least one hang described in the PR.

PR: 260011
MFC after: 2 weeks

2 years agondp(8): add structured output formatting via libxo
Alexander V. Chernikov [Mon, 4 Jul 2022 08:05:58 +0000 (08:05 +0000)]
ndp(8): add structured output formatting via libxo

Differential Revision: https://reviews.freebsd.org/D35677
MFC after: 2 weeks

2 years agonetinet6: simplify selectroute()
Alexander V. Chernikov [Mon, 4 Jul 2022 18:05:38 +0000 (18:05 +0000)]
netinet6: simplify selectroute()

Effectively selectroute() addresses two different cases:
 providing interface info for multicast destinations and providing
 nexthop data for unicast ones. Current implementation intertwines
 handling of both cases, especially in the error handling part.
Factor out all route lookup logic in a separate function,
 lookup_route() to simplify the code.
Ensure consistent KPI: no error means *retifp is set and otherwise.

Differential Revision: https://reviews.freebsd.org/D35711
MFC after: 2 weeks

2 years agonetinet6: factor out cached route lookups from selectroute().
Alexander V. Chernikov [Mon, 4 Jul 2022 15:56:56 +0000 (15:56 +0000)]
netinet6: factor out cached route lookups from selectroute().

Currently selectroute() contains two nearly-identical versions of
 the route lookup logic - one for original destination and another
for the case when IPV6_NEXTHOP option was set on the socket.

Factor out handling these route lookups in a separation function to
 improve readability.
This change also fixes handling of link-local IPV6_NEXTHOPs.

Differential Revision: https://reviews.freebsd.org/D35710
MFC after: 2 weeks

2 years agonetinet6: add ip6_output() scope tests
Alexander V. Chernikov [Thu, 7 Jul 2022 13:08:35 +0000 (13:08 +0000)]
netinet6: add ip6_output() scope tests

Differential Revision: https://reviews.freebsd.org/D35742

2 years agojail.conf.5: List configuration and example files
Mateusz Piotrowski [Fri, 8 Jul 2022 08:43:37 +0000 (10:43 +0200)]
jail.conf.5: List configuration and example files

MFC after: 3 days

2 years agorc.subr: Make sure oomprotect protects existing children
Mike Walker [Thu, 7 Jul 2022 20:28:37 +0000 (22:28 +0200)]
rc.subr: Make sure oomprotect protects existing children

The rc(8) framework support protecting services from OOM killer.
The current implementation applies the protection after the service has
already started. This works fine if only the main process is to be
protected (*_oomprotect=yes). However, the current implementation fails
to protect existing children when children are also to be protected
(*_oomprotect=all). This patch fixes that.

Note: it is not easy to apply the protectoin earlier because we want to
support both the services which use the "command" variable and those
that use the "start_cmd" variable.

PR: 256148
Approved by: adrian, osogbo
Tested by: Jamie Landeg-Jones <jamie@catflap.org>
Fixes: 3bead71e959d - Add a global option where we can protect
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35747

2 years agoipmi: fix a use-after-free bug in error handling
Philip Paeps [Fri, 8 Jul 2022 03:49:54 +0000 (11:49 +0800)]
ipmi: fix a use-after-free bug in error handling

18db96dbfd4a09063a0abcefd51fa8d2aeb115d6 introduced a use-after-free bug
in the error handling of the IPMICTL_RECEIVE_MSG ioctl.

Reported by:    Coverity (CID 1490456) (via vangyzen)
Differential Revision: https://reviews.freebsd.org/D35605

2 years agozfs: merge openzfs/zfs@cb01da680
Martin Matuska [Thu, 7 Jul 2022 21:58:33 +0000 (23:58 +0200)]
zfs: merge openzfs/zfs@cb01da680

Notable upstream pull request merges:
  #12438 Avoid panic with recordsize > 128k, raw sending and no large_blocks
  #13015 Fix dnode byteswapping
  #13256 Add a "zstream decompress" subcommand
  #13555 Scrub mirror children without BPs
  #13576 Several sorted scrub optimizations
  #13579 Fix and disable blocks statistics during scrub
  #13582 Several B-tree optimizations
  #13591 Avoid two 64-bit divisions per scanned block
  #13606 Avoid memory copies during mirror scrub
  #13613 Avoid memory copy when verifying raidz/draid parity

Obtained from: OpenZFS
OpenZFS commit: cb01da68057dcb9e612e8d2e97d058c46c3574af

2 years agocsu: test: explicitly add libm as build parameter
Alfredo Dal'Ava Junior [Fri, 1 Jul 2022 15:13:04 +0000 (12:13 -0300)]
csu: test: explicitly add libm as build parameter

CSU tests build fails with '/usr/lib/libgcc_s.so: undefined reference to
fma' when built with LLVM 14 for powerpcspe, so '-lm' is being added
explicitly.

It may be linked to https://reviews.llvm.org/D77558

Reviewed by: imp (earlier version)
MFC after: 2 days
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D35691

2 years agoSimplify conditional guards for libclang_rt.
John Baldwin [Thu, 7 Jul 2022 20:54:57 +0000 (13:54 -0700)]
Simplify conditional guards for libclang_rt.

All supported architectures can build libclang_rt now.

Reviewed by: dim
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D35740

2 years agoCall nvlist_free before return
Finix1979 [Thu, 7 Jul 2022 18:43:58 +0000 (02:43 +0800)]
Call nvlist_free before return

Fixes a small kernel memory leak which would occur if a pool failed
to import because the `DMU_POOL_VDEV_ZAP_MAP` key can't be read from
a presumably damaged MOS config.  In the case of a missing key there
was no leak.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Finix1979 <yancw@info2soft.com>
Closes #13629

2 years agorc.conf.5: Add /etc/rc.conf.d/ to FILES
Mateusz Piotrowski [Thu, 7 Jul 2022 18:07:43 +0000 (20:07 +0200)]
rc.conf.5: Add /etc/rc.conf.d/ to FILES

While here, fix the -width argument.

MFC after: 3 days

2 years agorc.conf.5: Improve documentation of <name>_oomprotect
Mateusz Piotrowski [Thu, 7 Jul 2022 18:01:57 +0000 (20:01 +0200)]
rc.conf.5: Improve documentation of <name>_oomprotect

Apart from improving readability, this commit mentions that
<name>_oomprotect is ignored in a jail environment. Also, replace
${name}_cmd with the correct ${argument}_cmd and point the reader to
rc.subr(8).

MFC after: 1 week

2 years agoprotect.1: Improve synopsis
Mateusz Piotrowski [Thu, 7 Jul 2022 13:12:50 +0000 (15:12 +0200)]
protect.1: Improve synopsis

While here, make the list's -width argument a bit shorter for
readability.

MFC after: 3 days

2 years agoe6000sw: add readphy and writephy wrappers
Albert Jakiela [Wed, 6 Jul 2022 14:40:20 +0000 (16:40 +0200)]
e6000sw: add readphy and writephy wrappers

New functions take lock and give lock after operation.
Removed locking and unlocking within other methods,
to prevent from recursive locking on non recursive lock.

Tested on EspressoBin.

Reviewed by: mw
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D35656

2 years agoipfilter: Support only jails in VNET
Cy Schubert [Thu, 17 Mar 2022 18:05:05 +0000 (11:05 -0700)]
ipfilter: Support only jails in VNET

Jails without VNET have complete access to the ipfilter rules, NAT,
pools and logs. This is insecure. Only allow jails to manipulate
ipfilter rules, NAT tables and ippools if the jail has its own VNET.
Otherwise a jail can affect the global system.

This patch brings ipfilter in line with ipfw's support of VNET jails and
non-support of non-VNET jails.

MFC after: 1 week

2 years agosqlite3: Vendor import of sqlite3 3.39.0
Cy Schubert [Thu, 7 Jul 2022 13:04:21 +0000 (06:04 -0700)]
sqlite3: Vendor import of sqlite3 3.39.0

Changes at https://www.sqlite.org/releaselog/3_39_0.html.

Obtained from https://www.sqlite.org/2022/sqlite-autoconf-3390000.tar.gz

MFC after:      1 month

Merge commit '2380f7c9781e64d137f0712a8fb185dee648ed8c' into new_merge

2 years agonetinet6: add ip6_output() tests.
Alexander V. Chernikov [Thu, 7 Jul 2022 10:09:28 +0000 (10:09 +0000)]
netinet6: add ip6_output() tests.

Differential Revision: https://reviews.freebsd.org/D35708

2 years agotesting: add ability to specify multi-vnet topologies in the pytest framework.
Alexander V. Chernikov [Thu, 7 Jul 2022 10:05:06 +0000 (10:05 +0000)]
testing: add ability to specify multi-vnet topologies in the pytest framework.

Notable amount of tests related to the packet IO require two VNET jails
 for proper testing and avoiding side effects for the host system.
Additionally, it is often required to run actions in the jails seme-sequentially
- waiting for the listener initialisation can be an example of such
  dependency.

This change extends pytest vnet framework to allow defining multi-vnet
 multi-epair topologies in declarative style, without any need to bother
 about jail or repair names. All jail creation/teardown, interface
 creation/teardown and address assignments are handled automatically.

Example:

TOPOLOGY = {
  "vnet1": {"ifaces": ["if1", "if2", "if3"]},
  "vnet2": {"ifaces": ["if1", "if2", "if3"]},
  "if1": {"prefixes6": [("2001:db8:a::1/64", "2001:db8:a::2/64")]},
  "if2": {"prefixes6": [("2001:db8:b::1/64", "2001:db8:b::2/64")]},
  "if3": {"prefixes6": [("2001:db8:c::1/64", "2001:db8:c::2/64")]},
}
def vnet2_handler(self, vnet, obj_map, pipe):
  ss = VerboseSocketServer("::", self.DEFAULT_PORT)
  pipe.send("READY")

def test_output6_base(self):
  self.wait_object(second_vnet.pipe)

The definitions above will create 2 vnets ("jail_test_output6_base",
 "jail_test_output6_base_2"), 3 epairs, attached to both first and
 second jails, set up the IP addresses for each epair, spawn another
 process for vnet2_handler and pass control to vnet2_handler and
 test_output6_base. Both processes can pass objects between each
 other using pre-created pipes.

Differential Revision: https://reviews.freebsd.org/D35708

2 years agoOnly add gicv3 fdt children with a compatible property
Andrew Turner [Wed, 6 Jul 2022 17:04:53 +0000 (18:04 +0100)]
Only add gicv3 fdt children with a compatible property

Not all gicv3 fdt children have a compatible property. Those that don't
are configuration data rather than something that should have a driver
attach.

Sponsored by: The FreeBSD Foundation

2 years agovnet: make VNET_FOREACH() always be a loop
Kristof Provost [Wed, 6 Jul 2022 09:13:52 +0000 (11:13 +0200)]
vnet: make VNET_FOREACH() always be a loop

VNET_FOREACH() is a LIST_FOREACH if VIMAGE is set, but empty if it's
not. This means that users of the macro couldn't use 'continue' or
'break' as one would expect of a loop.

Change VNET_FOREACH() to be a loop in all cases (although one that is
fixed to one iteration if VIMAGE is not set).

Reviewed by: karels, melifaro, glebius
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35739

2 years agostress2: Added a mount(8) test scenario
Peter Holm [Thu, 7 Jul 2022 07:44:55 +0000 (09:44 +0200)]
stress2: Added a mount(8) test scenario

2 years agosqlite3: Vendor import of sqlite3 3.39.0
Cy Schubert [Thu, 7 Jul 2022 06:15:38 +0000 (23:15 -0700)]
sqlite3: Vendor import of sqlite3 3.39.0

Changes at https://www.sqlite.org/releaselog/3_39_0.html.

Obtained from https://www.sqlite.org/2022/sqlite-autoconf-3390000.tar.gz

2 years agosockstat(1): print PID adjusted to the right
Gleb Smirnoff [Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)]
sockstat(1): print PID adjusted to the right

This allows for easy copy-and-paste of a unix(4) peer name for lookup.
With current implementation it is guaranteed that a peer listed could be
found in the output.

Differential revision: https://reviews.freebsd.org/D35727

2 years agosockstat(1): print out full connection graph for unix(4) sockets
Gleb Smirnoff [Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)]
sockstat(1): print out full connection graph for unix(4) sockets

Kernel provides us with enough information to display all possible
connections between UNIX sockets.

o Store unp_conn, xu_firstref and xu_nextref in the faddr of a UNIX sock.
o Build tree of file descriptors, indexed by the socket pointer.
o In displaysock() print out all possible information:
  1) if socket is bound, print name of this socket
  2) if socket has connected to a peer with a name, print peers name
  3) if socket has connected to a peer without a name, print [pid fd]
  4) if a bound socket has received connections, print list of them
     as [pid fd]
  Previously, only 1) either 2) were printed.

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D35726

2 years agosockstat(1): widen the FD printing format
Gleb Smirnoff [Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)]
sockstat(1): widen the FD printing format

Three digit file descriptors are very common these days.  So let the
columns not break with them.

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D35725

2 years agosockstat(1): use tree(3) rbtree instead of hash
Gleb Smirnoff [Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)]
sockstat(1): use tree(3) rbtree instead of hash

o Use tree to lookup by socket kvaddr. The size of hash is too big for a
  small virtual machine and at the same time too little for a large
  production server.  A tree would better fit here.
o For those pcbs, that don't have a socket associated, use a list.
o Provide a second tree to lookup by pcb kvaddr.  These removes full hash
  traversal when printing every unix(4) socket.

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D35724

2 years agosockstat(1): we don't need kernel struct unpcb
Gleb Smirnoff [Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)]
sockstat(1): we don't need kernel struct unpcb

Fixes: 0e229f343f4e8791f84a7acc6300f0bd1476c7b5

2 years agotree(3): allow the compare function to return any signed type
Gleb Smirnoff [Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)]
tree(3): allow the compare function to return any signed type

This allows to write very short comparison function when we are
comparing just pointer values:

return ((intptr_t)((uintptr_t)a->ptr/2 - (uintptr_t)b->ptr/2));

Reviewed by: dougm, alc
Differential revision: https://reviews.freebsd.org/D35722

2 years agotcp: remove a condition in tcp_usr_detach() that never happens
Gleb Smirnoff [Thu, 7 Jul 2022 04:09:45 +0000 (21:09 -0700)]
tcp: remove a condition in tcp_usr_detach() that never happens

The comment from Robert Watson doubts that this condition ever happens.
Our analysis confirm that.  Also, we found that if you manage to create
such a connection with help of some other bug, then after the "second
case" code is executed, the kernel will panic in other part of the stack.

Reviewed by: rrs, tuexen
Differential revision: https://reviews.freebsd.org/D35714

2 years agoBug fix to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Wed, 6 Jul 2022 21:38:19 +0000 (14:38 -0700)]
Bug fix to UFS/FFS superblock integrity checks when reading a superblock.

Older versions of growfs(8) failed to correctly update fs_dsize.
Filesystems that have been grown fail the test for fs_dsize's correct
value. For now we exclude the fs_dsize test from the requirements.

Reported by: Edward Tomasz Napiera
Tested by:   Edward Tomasz Napiera
Tested by:   Peter Holm
MFC after:   1 month (with 076002f24d35)
Differential Revision: https://reviews.freebsd.org/D35219

2 years agoBug fix to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Wed, 6 Jul 2022 21:31:00 +0000 (14:31 -0700)]
Bug fix to UFS/FFS superblock integrity checks when reading a superblock.

The original check verified that if an alternate superblock has not
been selected that the superblock is located in its standard location.
For UFS1 the with a 65536 block size, the first backup superblock
is at the same location as the UFS2 superblock. Since SBLOCK_UFS2
is the first location checked, the first backup is the superblock
that will be used for a UFS1 filesystems with a 65536 block size.
This patch allows the use of the first backup superblock in that
situation.

Reported by: Peter Holm
Tested by:   Peter Holm
MFC after:   1 month (with 076002f24d35)
Differential Revision: https://reviews.freebsd.org/D35219

2 years agoBug fix to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Wed, 6 Jul 2022 20:28:07 +0000 (13:28 -0700)]
Bug fix to UFS/FFS superblock integrity checks when reading a superblock.

The tests for number of cylinder groups (fs_ncg), inodes per cylinder
group (fs_ipg), and the size and layout of the cylinder group summary
information (fs_csaddr and fs_cssize) were overly restrictive and
would exclude some valid filesystems. These updates avoid precluding
valid fiesystems while still detecting rogue values that can crash or
hang the kernel.

Reported by: Chuck Silvers
Tested by:   Peter Holm
MFC after:   1 month (with 076002f24d35)
Differential Revision: https://reviews.freebsd.org/D35219

2 years agotesting: provide meaningful error when pytest is not available
Alexander V. Chernikov [Wed, 6 Jul 2022 19:55:48 +0000 (19:55 +0000)]
testing: provide meaningful error when pytest is not available

atf format does not provide any way of signalling any error message
 back to the atf runner when listing tests. Work this around by
 reporting "__test_cases_list_pytest_binary_not_found__" test instead.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D35721

2 years agolibpmc: add armv8 pmu-event aliases
Mitchell Horne [Wed, 6 Jul 2022 17:30:03 +0000 (14:30 -0300)]
libpmc: add armv8 pmu-event aliases

These are all "standard microarchitectural events", which in theory are
supported by every ARMv8 processor. In practice, it depends on the
pmu-event definitions being complete and accurate, which they are not
for every processor. Still, these aliases should be functional on the
majority of systems.

PR: 254532
Reported by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35550

2 years agolibpmc: import updated pmu-events for arm64
Mitchell Horne [Wed, 6 Jul 2022 17:29:55 +0000 (14:29 -0300)]
libpmc: import updated pmu-events for arm64

Thanks to the recently updated import of the jevents utility by mav@, we
can now compile the latest version of these event definitions. This
should support a wider set of common ARMv8 processors, for example, the
Cortex-A72 in the Raspberry Pi 4.

This brings this folder in sync with Linux commit 62e6eb8d5454.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35549

2 years agoena: Update driver version to v2.6.1
Michal Krawczyk [Mon, 4 Jul 2022 07:12:57 +0000 (09:12 +0200)]
ena: Update driver version to v2.6.1

Minor version update which improves styling of a printouts, fixes
the KASAN and KMSAN kernel builds and LLQ reconfiguration after the
device reset.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

2 years agoena: Fix LLQ descriptor reconfiguration
Michal Krawczyk [Tue, 5 Jul 2022 10:59:25 +0000 (12:59 +0200)]
ena: Fix LLQ descriptor reconfiguration

After the device reset, the LLQ configuration descriptor wasn't passed
to the hardware. On a 6-generation AWS instances (like C6gn), it is
required to pass the LLQ descriptor after the device reset, otherwise
the hardware will be missing the LLQ configuration resulting in
performance degradation.

This patch reconfigures the LLQ each time the ena_device_init() is
called. This means that the LLQ descriptor will be passed during the
initial configuration and after a reset.

The ena_map_llq_mem_bar() function call was moved before the
ena_device_init() call, to make sure that the mem bar is available.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

2 years agoena: Align req_id and qid print order
Michal Krawczyk [Mon, 4 Jul 2022 07:03:54 +0000 (09:03 +0200)]
ena: Align req_id and qid print order

In most places, the req_id is printed first, and the qid is printed as a
second. To align the driver, one printout was reworked and the print
order of those variables was changed.

Suggested by: rpokala
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

2 years agocddl/*: add a WITH(OUT)_DTRACE option
Brooks Davis [Wed, 6 Jul 2022 13:03:48 +0000 (14:03 +0100)]
cddl/*: add a WITH(OUT)_DTRACE option

Add an option to enable/disable DTrace without disabling ZFS.  New
architectures such as CHERI may support ZFS before they support DTrace
and the old model of WITHOUT_CDDL disabling both wasn't helpful.

For compatiblity, the CDDL option remains and WITHOUT_CDDL implies
WITHOUT_DTRACE.  WITHOUT_DTRACE also implies WITHOUT_CTF.

As part of this change, largely convert cddl/*/Makefile to using the
more compact SUBDIR.${MK_<FOO>}+= form rather than using intermediate
variables.

Reviewed by: markj
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D35718

2 years agoufs_rename(): revert the bump of fvp nlink count in case of EMLINK for tdvp
Konstantin Belousov [Mon, 4 Jul 2022 10:28:49 +0000 (13:28 +0300)]
ufs_rename(): revert the bump of fvp nlink count in case of EMLINK for tdvp

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agoufs_rename(): do not treat ERELOOKUP specially
Konstantin Belousov [Sat, 2 Jul 2022 13:15:57 +0000 (16:15 +0300)]
ufs_rename(): do not treat ERELOOKUP specially

Delegate handling of it to the top VFS layer, as it is done everywhere.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agonetstat -i: do not truncate interface names
Mike Karels [Sat, 2 Jul 2022 16:03:36 +0000 (11:03 -0500)]
netstat -i: do not truncate interface names

The field for interface names for netstat -i was 5 characters by
default, which is no longer sufficient with names like "vlan1234"
and "vtnet0".  netstat -iW computed the necessary field width, but
also enlarged the address field by a lot (especially with IPv6 enabled).
Make netstat -i compute the field width for interface names with or
without -W.  Note that the existing default output does not fit in
80 columns in any case.  Update the man page accordingly, documenting
the remaining effect of -W with -i.  Also add -W to the list of
General Options, as there are numerous pointers to this.

Reported by: Chris Ross
Reviewed by: melifaro, rgrimes, cy
Differential Revision: https://reviews.freebsd.org/D35703
MFC after: 1 week

2 years agodwc3: add ACPI attachment
Bjoern A. Zeeb [Tue, 5 Jul 2022 01:07:07 +0000 (01:07 +0000)]
dwc3: add ACPI attachment

Split the current FDT-only implementation up into an FDT and an
ACPI part reusing and sharing as much code as possible (thanks mw!).

This makes the Synopsis XHCI root hubs attach correctly on SolidRun's
HoenyComb instead of just the generic XHCI root and this means we
are also doing proper chip setup and applying the quirk needed there [1].

There is one problem with ACPI attachment in that it uses the generic
XHCI PNP ID.  So we need to do extra checks in order to not claim
all xhci, which means we check for a known quirk to be present
in acpi_probe.  Long term this isn't scaling and this was discussed
in SolidRun's Discord Channel in 2021 with the intend that "jnettlet"
will take this to a steering committee.  Since then ACPI has kind-of
become a technology non grata (due to not getting changes into Linux
timely) so it is unclear if this will ever happen.  If there will be
further hardware with dwc3/ACPI we should go and make sure this problem
gets solved.

[1] https://github.com/SolidRun/edk2-platforms/blob/24698f90b79facfbbfc4067b39a4ddf8c7fdfa88/Silicon/NXP/LX2160A/AcpiTables/Dsdt/Usb.asl

Reviewed by: manu, mw
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D32256

2 years agoAvoid memory copy when verifying raidz/draid parity
Alexander Motin [Tue, 5 Jul 2022 23:27:29 +0000 (19:27 -0400)]
Avoid memory copy when verifying raidz/draid parity

Before this change for every valid parity column raidz_parity_verify()
allocated new buffer and copied there existing data, then recalculated
the parity and compared the result with the copy.  This patch removes
the memory copy, simply swapping original buffer pointers with newly
allocated empty ones for parity recalculation and comparison. Original
buffers with potentially incorrect parity data are then just freed,
while new recalculated ones are used for repair.

On a pool of 12 4-wide raidz vdevs, storing 1.5TB of 16MB blocks, this
change reduces memory traffic during scrub by 17% and total unhalted
CPU time by 25%.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #13613

2 years agoAvoid memory copies during mirror scrub
Alexander Motin [Tue, 5 Jul 2022 23:26:20 +0000 (19:26 -0400)]
Avoid memory copies during mirror scrub

Issuing several scrub reads for a block we may use the parent ZIO
buffer for one of child ZIOs.  If that read complete successfully,
then we won't need to copy the data explicitly.  If block has only
one copy (typical for root vdev, which is also a mirror inside),
then we never need to copy -- succeed or fail as-is.  Previous
code also copied data from buffer of every successfully completed
child ZIO, but that just does not make any sense.

On healthy N-wide mirror this saves all N+1 (or even more in case
of ditto blocks) memory copies for each scrubbed block, allowing
CPU to focus mostly on check-summing.  For other vdev types it
should save one memory copy per block copy at root vdev.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #13606

2 years agodevinfo: xref devctl
Warner Losh [Tue, 5 Jul 2022 21:15:08 +0000 (15:15 -0600)]
devinfo: xref devctl

devctl has ways to get the different locator's paths to devices, while
devinfo does not. xref devctl in devinfo(8) as a hint.

Sponsored by: Netflix

2 years agoif_ovpn: deal with short packets
Kristof Provost [Tue, 5 Jul 2022 17:27:00 +0000 (19:27 +0200)]
if_ovpn: deal with short packets

If we receive a UDP packet (directed towards an active OpenVPN socket)
which is too short to contain an OpenVPN header ('struct
ovpn_wire_header') we wound up making m_copydata() read outside the
mbuf, and panicking the machine.

Explicitly check that the packet is long enough to copy the data we're
interested in. If it's not we will pass the packet to userspace, just
like we'd do for an unknown peer.

Extend a test case to provoke this situation.

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agodummynet: fix ip_dn_vnet_init() / dummynet_task() race
Kristof Provost [Mon, 4 Jul 2022 20:36:43 +0000 (22:36 +0200)]
dummynet: fix ip_dn_vnet_init() / dummynet_task() race

If dummynet_task() is run on a vnet where dummynet is still initialising
(i.e. still running ip_dn_vnet_init()) we can attempt to use an
uninitialised mutex.

We can use the existing init_done field to check if the per-vnet
V_dn_cfg is fully set up, if we ensure that it's only set to 1 when
we've done all of the init work.

Reported by: Alfredo Dal'Ava Júnior <alfredo@freebsd.org>
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35716

2 years agoOpenSSL: Regen assembly file for OpenSSSL 1.1.1q
Jung-uk Kim [Tue, 5 Jul 2022 16:06:50 +0000 (12:06 -0400)]
OpenSSL: Regen assembly file for OpenSSSL 1.1.1q

2 years agoOpenSSL: Regen manual pages for OpenSSL 1.1.1q
Jung-uk Kim [Tue, 5 Jul 2022 16:01:07 +0000 (12:01 -0400)]
OpenSSL: Regen manual pages for OpenSSL 1.1.1q

2 years agoOpenSSL: Merge OpenSSL 1.1.1q
Jung-uk Kim [Tue, 5 Jul 2022 15:47:01 +0000 (11:47 -0400)]
OpenSSL: Merge OpenSSL 1.1.1q

Merge commit 'f874e59ffcd8b5ecd018ad8311d78e866340f3e9'

2 years agoImport OpenSSL 1.1.1q
Jung-uk Kim [Tue, 5 Jul 2022 15:27:51 +0000 (11:27 -0400)]
Import OpenSSL 1.1.1q

2 years agoxargs: fix description of strnsubst return value
Tom Jones [Tue, 5 Jul 2022 15:27:15 +0000 (16:27 +0100)]
xargs: fix description of strnsubst return value

Reported by: oshogbo
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35574

2 years agoxargs: terminate if line replacement cannot be constructed
Tom Jones [Tue, 5 Jul 2022 15:03:51 +0000 (16:03 +0100)]
xargs: terminate if line replacement cannot be constructed

If the line with replacement cannot be constructed xargs should
terminate as documented in the man page

We encounter this error, but gnu/xargs doesn't because they have a much
larger limit for created outputs (~10000 lines).

Reviewed by: oshogbo
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35574

2 years agoDB_COMMAND(9): fix a typo
Mitchell Horne [Tue, 5 Jul 2022 15:14:44 +0000 (12:14 -0300)]
DB_COMMAND(9): fix a typo

Fixes: b83d53cb687e

2 years agoDB_COMMAND(9): update to mention additional macros
Mitchell Horne [Tue, 5 Jul 2022 14:55:18 +0000 (11:55 -0300)]
DB_COMMAND(9): update to mention additional macros

Document the existing alias definitions, and augment the example with
one of these. Also, describe the purpose of the newly added _FLAGS
variations of these command definitions.

Make some small style improvements to appease mandoc -Tlint.

Reviewed by: markj
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35664

2 years agoddb: use _FLAGS command macros where appropriate
Mitchell Horne [Tue, 5 Jul 2022 14:47:55 +0000 (11:47 -0300)]
ddb: use _FLAGS command macros where appropriate

Some command definitions were forced to use DB_FUNC in order to specify
their required flags, CS_OWN or CS_MORE. Use the new macros to simplify
these.

Reviewed by: markj, jhb
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35582

2 years agoddb: add _FLAGS command variants
Mitchell Horne [Thu, 30 Jun 2022 15:58:22 +0000 (12:58 -0300)]
ddb: add _FLAGS command variants

Provide _FLAGS variants of the various command definition macros, in
anticipation of adding a new flag. This can also be used for some
existing commands which require special flag values.

Reviewed by: markj
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35581

2 years agodb_command.c: use designated initializers
Mitchell Horne [Tue, 5 Jul 2022 14:45:47 +0000 (11:45 -0300)]
db_command.c: use designated initializers

Provide separate helper macros for regular commands and next-level table
commands as they are mutually exclusive. This ensures proper
initialization of each element and allows us to exclude some redundant
fields, such as specifying .more = NULL for every regular command.

Reviewed by: markj, jhb
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35580

2 years agodb_command.c: style
Mitchell Horne [Tue, 5 Jul 2022 14:44:36 +0000 (11:44 -0300)]
db_command.c: style

Reviewed by: jhb
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35368

2 years agoriscv: implement db_show_mdpcpu()
Mitchell Horne [Mon, 4 Oct 2021 20:47:49 +0000 (17:47 -0300)]
riscv: implement db_show_mdpcpu()

This prints the machine-dependent members of struct pcpu when executing
the 'show pcpu' or 'show all pcpu' ddb(4) commands.

MFC after: 3 days

2 years agosesutil.8: Polish
Mateusz Piotrowski [Tue, 5 Jul 2022 14:37:18 +0000 (16:37 +0200)]
sesutil.8: Polish

- Use right mdoc macros
- Fix synopsis. Some of the optional command modifiers were not optional
  after all.
- Sort options

MFC after: 1 week

2 years agorc.8: Reference the article about rc scripting
Mateusz Piotrowski [Mon, 4 Jul 2022 10:54:57 +0000 (12:54 +0200)]
rc.8: Reference the article about rc scripting

MFC after: 3 days

2 years agonetinet6: perform out-of-bounds check for loX multicast statistics
Alexander V. Chernikov [Mon, 4 Jul 2022 20:03:06 +0000 (20:03 +0000)]
netinet6: perform out-of-bounds check for loX multicast statistics

Currently, some per-mbuf multicast statistics is stored in
 the per-interface ip6stat.ip6s_m2m[] array of size 32 (IP6S_M2MMAX).
Check that loopback ifindex falls within 0.. IP6S_M2MMAX-1 range to
 avoid silent data corruption. The latter cat happen with large
 number of VNETs.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D35715
MFC after: 2 weeks

2 years agodiff3: make the eflag logic easier to follow
Tom Jones [Tue, 5 Jul 2022 11:33:55 +0000 (12:33 +0100)]
diff3: make the eflag logic easier to follow

Discussed with: dim
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35324

2 years agoarp(8): use getifaddrs(3) instead of ioctl(SIOCGIFCONF)
KUROSAWA Takahiro [Tue, 5 Jul 2022 03:56:29 +0000 (20:56 -0700)]
arp(8): use getifaddrs(3) instead of ioctl(SIOCGIFCONF)

The original code had used a fixed-size buffer for ioctl(SIOCGIFCONF),
that might cause the target ifreq spilled from the buffer.  Use the handy
getifaddrs(3) to fix the problem.

Reviewed by: glebius
Differential revision: https://reviews.freebsd.org/D35536

2 years agodwc3: fix from not working
Bjoern A. Zeeb [Tue, 5 Jul 2022 00:53:42 +0000 (00:53 +0000)]
dwc3: fix from not working

During the review of 09cdf4878c621be4cd229fa88cdccdcdc8c101f7 we
switched from cached registers to reading them as needed.
One read of the two reads was moved after the softreset got triggered
and as a result returned 0 rather than the proper register value.
Moving the read before the softreset gets initiated seems to make
things work again and xhci.c no longer complains about
"Controller does not support 4K page size.".

MFC after: 10 days
X-MFC with: 09cdf4878c621be4cd229fa88cdccdcdc8c101f7
Pointy hat to: bz

2 years agolinux(4): Use saved cpu feature bits
Dmitry Chagin [Mon, 4 Jul 2022 20:42:07 +0000 (23:42 +0300)]
linux(4): Use saved cpu feature bits

MFC after: 3 days

2 years agolinux(4): Implement __vdso_time
Dmitry Chagin [Mon, 4 Jul 2022 20:41:32 +0000 (23:41 +0300)]
linux(4): Implement __vdso_time

PR: 240769
MFC after: 3 days

2 years agosockets: use only soref()/sorele() as socket reference count
Gleb Smirnoff [Mon, 4 Jul 2022 19:40:51 +0000 (12:40 -0700)]
sockets: use only soref()/sorele() as socket reference count

o Retire SS_FDREF as it is basically a debug flag on top of already
  existing soref()/sorele().
o Convert SS_PROTOREF into soref()/sorele().
o Change reference model for the listen queues, see below.
o Make sofree() private.  The correct KPI to use is only sorele().
o Make soabort() respect the model and sorele() instead of sofree().

Note on listening queues.  Until now the sockets on a queue had zero
reference count.  And the reference were given only upon accept(2).  The
assumption was that there is no way to see the queued socket from anywhere
except its head.  This is not true, since queued sockets already have pcbs,
which are linked at least into the global pcb lists.  With this change we
put the reference right in the sonewconn() and on accept(2) path we just
hand the existing reference to the file descriptor.

Differential revision: https://reviews.freebsd.org/D35679

2 years agosockets: use positive flag for file descriptor socket reference
Gleb Smirnoff [Mon, 4 Jul 2022 19:40:51 +0000 (12:40 -0700)]
sockets: use positive flag for file descriptor socket reference

Rename SS_NOFDREF to SS_FDREF and flip all bitwise operations.
Mark sockets created by socreate() with SS_FDREF.

This change is mostly illustrative. With it we see that SS_FDREF
is a debugging flag, since:
* socreate() takes a reference with soref().
* on accept path solisten_dequeue() takes a reference
  with soref() and then soaccept() sets SS_FDREF.
* soclose() checks SS_FDREF, removes it and does sorele().

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D35678

2 years agotcp: use a TCP flag to check if connection has been close(2)d
Gleb Smirnoff [Mon, 4 Jul 2022 19:40:51 +0000 (12:40 -0700)]
tcp: use a TCP flag to check if connection has been close(2)d

The flag SS_NOFDREF is a private flag of the socket layer.  It also
is supposed to be read with SOCK_LOCK(), which we don't own here.

Reviewed by: rrs, tuexen
Differential revision: https://reviews.freebsd.org/D35663

2 years agopca954x: harmonize pca9547 and pca954x and add pca9540 support
Bjoern A. Zeeb [Sat, 2 Jul 2022 23:33:32 +0000 (23:33 +0000)]
pca954x: harmonize pca9547 and pca954x and add pca9540 support

The two implementations for the pca9548 switch and the pca9547 mux
seemed close enough so we can put them together and with a bit more
abstraction add pca9540 support.

While here apply a bit of consistency in variable and driver naming and
use device_has_property instead of the FDT-only OF_ variant.

This disconnects pca9547 from the build but does not yet delete it.

MFC after: 2 weeks
Reviewed by: mmel (earlier version), avg
Differential Revision: https://reviews.freebsd.org/D35701

2 years agorb_tree: fine-tune rebalancing code
Doug Moore [Mon, 4 Jul 2022 17:28:35 +0000 (12:28 -0500)]
rb_tree: fine-tune rebalancing code

Change parts of RB_INSERT_COLOR and RB_REMOVE_COLOR to reduce the
number of operations, by, in some cases, flipping two color bits at a
time instead of flipping each individually, in separate operations,
and by using a switch statement to replace a sequence of if-elses.
Rewrite RB_SET_PARENT to generate fewer instructions.  These changes
reduce the code size by over 100 bytes on some architectures.

Also, allow RB users to define a preprocessor symbol to generate
RB_REMOVE_COLOR code that matches the implementation described in the
original weak-AVL paper in one particular case, instead of the still
correct, but slightly more efficient implementation of that case
currently implemented.

Reviewed by: alc
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D35524

2 years agopmcstat: fix log analysis
Andrew Gallatin [Mon, 4 Jul 2022 16:40:35 +0000 (12:40 -0400)]
pmcstat: fix log analysis

pmcstat has been broken for analyzing logs since D35342 / b6e28991bf3aadb.

This is because the pmc for the first CPU is not added when reading logs
because unlike its clones, its event id is not invalid. That causes us
to fail the assertion at lib/libpmcstat/libpmcstat_logging.c:293
when encountering samples from cpu0.

Fix this by removing the check that the PMC is invalid

Reviewed by: tsoome
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D35709

2 years agoAdd Rockchip PCIe cleanup on attach faulure
Andrew Turner [Thu, 30 Jun 2022 18:16:34 +0000 (19:16 +0100)]
Add Rockchip PCIe cleanup on attach faulure

We should clean up on failure as it may panic the kernel later, e.g.
if we crate the rman, but fail to destroy it on attach faulure.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35682

2 years agoFix ofw pcib when it rman_init fails
Andrew Turner [Thu, 30 Jun 2022 18:12:46 +0000 (19:12 +0100)]
Fix ofw pcib when it rman_init fails

rman_fini assumes rman_init has been called successfully. Clean up
init faulure by only calling rman_fini when rman_init has succeeded.

While here add ofw_pcib_fini that can be used by a sub-class to clean
up.

Reviewed by: bz, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35681

2 years agoSupport decoding mem32 memory in the rk pcie driver
Andrew Turner [Thu, 30 Jun 2022 18:08:32 +0000 (19:08 +0100)]
Support decoding mem32 memory in the rk pcie driver

This is needed with some dtb files.

While here use a switch statement as the two options are mutually
exclusive in any iteration of the loop.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35680

2 years agoe6000sw: Fix direct register write logic
Kornel Dulęba [Mon, 4 Jul 2022 06:53:41 +0000 (08:53 +0200)]
e6000sw: Fix direct register write logic

When accessing a register directly from etherswitchcfg one must specify
a register group(e.g. registers of portN) and the register offset within
the group. The latter is passed as the 5 least significant bits.
Extract the former by dividing the register address by 32, not by 5.

Approved by: mw(mentor)
Obtained from: Semihalf
Sponsored by: Stormshield
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35672

2 years agolockstat: Fix construction of comparision predicates
Kornel Dulęba [Mon, 4 Jul 2022 06:48:52 +0000 (08:48 +0200)]
lockstat: Fix construction of comparision predicates

Passing "0x%p" to sprintf results in double "0x" being printed.
This causes a dtrace script compilation failure when "-d" flag
is specified.
Fix that by removing the extraneous "0x".

Reviewed by: markj
Approved by: mw(mentor)
Obtained from: Semihalf
Sponsored by: Alstom
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35690

2 years agomountd startup: enable NFSv4 if needed on restart
Mike Karels [Sun, 3 Jul 2022 23:04:41 +0000 (18:04 -0500)]
mountd startup: enable NFSv4 if needed on restart

The mountd script in rc.d sets vfs.nfsd.server_max_nfsvers correctly
when it is run at system startup, relying on the kernel default.
However, if NFSv4 was enabled in /etc/rc.conf later, and the script
was re-run to restart mountd, the sysctl was still set to 3.
Set the sysctl to the right value in all cases.

Reviewed by: rmacklem
MFC after: 1 week

2 years agorouting: hide notify_add and notify_del behind ROUTE_MPATH
Mateusz Guzik [Mon, 4 Jul 2022 08:38:13 +0000 (08:38 +0000)]
routing: hide notify_add and notify_del behind ROUTE_MPATH

Fixes a warn about unused routines without the option.

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoipmi: do not omit lun in BMC addresses
Yuri [Mon, 4 Jul 2022 06:29:52 +0000 (14:29 +0800)]
ipmi: do not omit lun in BMC addresses

Some systems put sensors on non-0 lun, so we should not omit it.  This
was the only difference with the Linux driver, where DIMM sensors could
be queried, but not on FreeBSD.

See this report[1] on the FreeBSD forums:
https://forums.freebsd.org/threads/freebsd-cannot-get-dimm-temperature-sensor-value.85166/

Reviewed by: philip
Tested by: Andrey Lanin[1]
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35612

2 years agoipmi: correctly handle ipmb requests
Yuri [Mon, 4 Jul 2022 04:55:18 +0000 (12:55 +0800)]
ipmi: correctly handle ipmb requests

Handle IPMB requests using SEND_MSG (sent as driver request as we do not
need to return anything back to userland for this) and GET_MSG (sent as
usual request so we can return the data for RECEIVE_MSG ioctl) pair.

This fixes fetching complete sensor data from boards (e.g. HP ProLiant
DL380 Gen10).

Reviewed by: philip
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35605

2 years agofile: upgrade to 5.42.
Xin LI [Mon, 4 Jul 2022 00:07:28 +0000 (17:07 -0700)]
file: upgrade to 5.42.

MFC after: 2 weeks

2 years agoVendor import of file 5.42.
Xin LI [Mon, 4 Jul 2022 00:05:11 +0000 (17:05 -0700)]
Vendor import of file 5.42.