]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
17 months agovfs: validate that vop vectors provide all or none fplookup vops
Mateusz Guzik [Wed, 3 Nov 2021 20:26:41 +0000 (21:26 +0100)]
vfs: validate that vop vectors provide all or none fplookup vops

In order to prevent later susprises.

17 months agodeadfs: consistently return EOPNOTSUPP for fplookup vops
Mateusz Guzik [Wed, 3 Nov 2021 21:04:16 +0000 (22:04 +0100)]
deadfs: consistently return EOPNOTSUPP for fplookup vops

17 months agovfs: add missing vop_fplookup ops to syncer
Mateusz Guzik [Thu, 6 Apr 2023 13:52:20 +0000 (13:52 +0000)]
vfs: add missing vop_fplookup ops to syncer

17 months agovfs: whack spurious comments from syncer's vop_vector
Mateusz Guzik [Thu, 6 Apr 2023 13:51:16 +0000 (13:51 +0000)]
vfs: whack spurious comments from syncer's vop_vector

17 months agoufs: add missing vop_fplookup ops
Mateusz Guzik [Thu, 6 Apr 2023 13:45:48 +0000 (13:45 +0000)]
ufs: add missing vop_fplookup ops

17 months agozfs: add missing vop_fplookup_vexec assignments
Mateusz Guzik [Wed, 3 Nov 2021 20:25:01 +0000 (21:25 +0100)]
zfs: add missing vop_fplookup_vexec assignments

This happens to be a nop right now.

17 months agowpa_supplicant/hostapd: Fix uninitialized packet pointer on error
Cy Schubert [Thu, 6 Apr 2023 04:07:15 +0000 (21:07 -0700)]
wpa_supplicant/hostapd: Fix uninitialized packet pointer on error

The packet pointer (called packet) will remain uninitialized when
pcap_next_ex() returns an error. This occurs when the wlan
interface is shut down using ifconfig destroy. Adding a NULL
assignment to packet duplicates what pcap_next() does.

The reason we use pcap_next_ex() in this instance is because with
pacp_next() when we receive a null pointer if there was an error
or if no packets were read. With pcap_next_ex() we can differentiate
between an error and legitimately no packets were received.

PR: 270649
Reported by: Robert Morris <rtm@lcs.mit.edu>
Fixes: 6e5d01124fd4
MFC after: 3 days

17 months agollvm-objcopy: link man page as strip.1 when WITH_LLVM_BINUTILS is set
Ed Maste [Wed, 5 Apr 2023 15:07:14 +0000 (11:07 -0400)]
llvm-objcopy: link man page as strip.1 when WITH_LLVM_BINUTILS is set

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39429

17 months agopci_vendors: update to 2023.04.01
Baptiste Daroussin [Thu, 6 Apr 2023 12:58:42 +0000 (14:58 +0200)]
pci_vendors: update to 2023.04.01

17 months agomakefs(8): do not print comma after the last super-block
Christos Margiolis [Wed, 5 Apr 2023 22:25:19 +0000 (18:25 -0400)]
makefs(8): do not print comma after the last super-block

Reviewed by: markj, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39430

17 months agonetmap: Handle packet batches in generic mode
Mark Johnston [Wed, 5 Apr 2023 20:52:41 +0000 (16:52 -0400)]
netmap: Handle packet batches in generic mode

ifnets are allowed to pass batches of multiple packets to if_input,
linked by the m_nextpkt pointer.  iflib_rxeof() sometimes does this, for
example.  Netmap's generic mode did not handle this and would only
deliver the first packet in the batch, leaking the rest.

PR: 270636
Reviewed by: vmaffione
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39426

17 months agopmc: Keep a list sorted.
Joseph Koshy [Wed, 5 Apr 2023 18:36:55 +0000 (19:36 +0100)]
pmc: Keep a list sorted.

Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D39439

17 months agomakefs: remove CD9660MAXPATH #define
Ed Maste [Fri, 31 Mar 2023 16:57:15 +0000 (12:57 -0400)]
makefs: remove CD9660MAXPATH #define

It was used only in constructing the host path that contains file
content, which is not related to anything CD9660-specific.  PATH_MAX is
the appropriate limit.  See OpenBSD commit 299d8950f319.

Obtained from: OpenBSD
Sponsored by: The FreeBSD Foundation

17 months agosrc.conf.5: Expand WITH_LLVM_BINUTILS description
Ed Maste [Wed, 5 Apr 2023 15:21:26 +0000 (11:21 -0400)]
src.conf.5: Expand WITH_LLVM_BINUTILS description

List the specific tools that are controlled by WITH_LLVM_BINUTILS, and
mention the tools that are always or never taken from LLVM.  Tools come
from one of three sources (LLVM, ELF Tool Chain, bespoke base system)
and it is useful to be explicit.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39428

17 months agonetmap: Fix queue stalls with generic interfaces
Mark Johnston [Wed, 5 Apr 2023 16:12:30 +0000 (12:12 -0400)]
netmap: Fix queue stalls with generic interfaces

In emulated mode, the FreeBSD netmap port attempts to perform zero-copy
transmission.  This works as follows: the kernel ring is populated with
mbuf headers to which netmap buffers are attached.  When transmitting,
the mbuf refcount is initialized to 2, and when the counter value has
been decremented to 1 netmap infers that the driver has freed the mbuf
and thus transmission is complete.

This scheme does not generalize to the situation where netmap is
attaching to a software interface which may transmit packets among
multiple "queues", as is the case with bridge or lagg interfaces.  In
that case, we would be relying on backing hardware drivers to free
transmitted mbufs promptly, but this isn't guaranteed; a driver may
reasonably defer freeing a small number of transmitted buffers
indefinitely.  If such a buffer ends up at the tail of a netmap transmit
ring, further transmits can end up blocked indefinitely.

Fix the problem by removing the zero-copy scheme (which is also not
implemented in the Linux port of netmap).  Instead, the kernel ring is
populated with regular mbuf clusters into which netmap buffers are
copied by nm_os_generic_xmit_frame().  The refcounting scheme is
preserved, and this lets us avoid allocating a fresh cluster per
transmitted packet in the common case.  If the transmit ring is full, a
callout is used to free the "stuck" mbuf, avoiding the queue deadlock
described above.

Furthermore, when recycling mbuf clusters, be sure to fully reinitialize
the mbuf header instead of simply re-setting M_PKTHDR.  Some software
interfaces, like if_vlan, may set fields in the header which should be
reset before the mbuf is reused.

Reviewed by: vmaffione
MFC after: 1 month
Sponsored by: Zenarmor
Sponsored by: OPNsense
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38065

17 months agomlx5ib(4): Mark driver knows net epoch
Zhenlei Huang [Wed, 5 Apr 2023 16:06:15 +0000 (00:06 +0800)]
mlx5ib(4): Mark driver knows net epoch

This driver has already been EPOCH(9) aware since e48813009c6a.

Reviewed by: hselasky
Tested by: hselasky
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D39406

17 months agoinfiniband: Opt-in for net epoch
Zhenlei Huang [Wed, 5 Apr 2023 16:05:02 +0000 (00:05 +0800)]
infiniband: Opt-in for net epoch

This is counterpart to e87c4940156c, which did the same for ethernet.

Suggested by: hselasky
Reviewed by: hselasky, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D39405

17 months agonetisr: Remove the now-unused NETISR_EPAIR queue index
Mark Johnston [Wed, 5 Apr 2023 15:40:45 +0000 (11:40 -0400)]
netisr: Remove the now-unused NETISR_EPAIR queue index

No functional change intended.

Fixes: 3dd5760aa5f8 ("if_epair: rework")
MFC after: 1 week
Sponsored by: Klara, Inc.

17 months agosrc.conf.5: regen for WITHOUT_NETLINK_SUPPORT
Ed Maste [Wed, 5 Apr 2023 15:39:32 +0000 (11:39 -0400)]
src.conf.5: regen for WITHOUT_NETLINK_SUPPORT

Commit 64dfea86515e added a description for WITHOUT_NETLINK_SUPPORT.

17 months agobridge: Try to make the GRAB_OUR_PACKETS macro a bit more readable
Mark Johnston [Wed, 5 Apr 2023 14:37:00 +0000 (10:37 -0400)]
bridge: Try to make the GRAB_OUR_PACKETS macro a bit more readable

- Let the compiler use constant folding to eliminate conditionals.
- Fix some inconsistent whitespace.

No functional change intended.

Reviewed by: zlei
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38410

17 months agotcp_hpts: plug a compiler warn
Mateusz Guzik [Wed, 5 Apr 2023 14:32:13 +0000 (14:32 +0000)]
tcp_hpts: plug a compiler warn

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

17 months agozfs: fix null ap->a_fsizetd NULL pointer derefernce
Martin Matuska [Wed, 5 Apr 2023 07:30:15 +0000 (09:30 +0200)]
zfs: fix null ap->a_fsizetd NULL pointer derefernce

Submitted by: rmacklem
Reported by: cy
Tested by: cy, mm
Reviewed by: pjd, mm
Differential revision: https://reviews.freebsd.org/D39418

17 months agobhyve: introduce acpi_device_emul struct
Corvin Köhne [Fri, 22 Jul 2022 08:00:10 +0000 (10:00 +0200)]
bhyve: introduce acpi_device_emul struct

It'll be easier to add new properties to the ACPI device emulation if we
have a struct which holds all device specific properties. In some future
commits the acpi_device_emul struct will be expanded to include some
device specific functions to build ACPI tables.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39319

17 months agoChange kqueue1() to be compatible with NetBSD
Konstantin Belousov [Fri, 31 Mar 2023 22:31:41 +0000 (01:31 +0300)]
Change kqueue1() to be compatible with NetBSD

by making it accept some open(2) flags.  More precisely, only
O_CLOEXEC is supported, the flag is translated into the KQUEUE_CLOEXEC flag
for kqueuex(2), and O_NONBLOCK is silently ignored.

Reported and tested by: vishwin
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D39377

17 months agorack: fix build on powerpc
Gleb Smirnoff [Tue, 4 Apr 2023 23:35:36 +0000 (16:35 -0700)]
rack: fix build on powerpc

17 months agolinux(4): Implement close_range over native
Dmitry Chagin [Tue, 4 Apr 2023 20:24:04 +0000 (23:24 +0300)]
linux(4): Implement close_range over native

Handling of the CLOSE_RANGE_UNSHARE flag is not implemented due to
difference in fd unsharing mechanism in the Linux and FreeBSD.

Reviewed by: mjg
Differential revision: https://reviews.freebsd.org/D39398
MFC after: 2 weeks

17 months agolinux(4): Regen for close_range syscall
Dmitry Chagin [Tue, 4 Apr 2023 20:23:37 +0000 (23:23 +0300)]
linux(4): Regen for close_range syscall

MFC after: 2 weeks

17 months agolinux(4): Modify close_range syscall to match Linux
Dmitry Chagin [Tue, 4 Apr 2023 20:23:24 +0000 (23:23 +0300)]
linux(4): Modify close_range syscall to match Linux

MFC after: 2 weeks

17 months agoUpdate rack to the latest code used at NF.
Randall Stewart [Tue, 4 Apr 2023 20:05:46 +0000 (16:05 -0400)]
Update rack to the latest code used at NF.

There have been many changes to rack over the last couple of years, including:
     a) Ability when switching stacks to have one stack query another.
     b) Internal use of micro-second timers instead of ticks.
     c) Many changes to pacing in forms of
        1) Improvements to Dynamic Goodput Pacing (DGP)
        2) Improvements to fixed rate paciing
        3) A new feature called hybrid pacing where the requestor can
           get a combination of DGP and fixed rate pacing with deadlines
           for delivery that can dynamically speed things up.
     d) All kinds of bugs found during extensive testing and use of the
        rack stack for streaming video and in fact all data transferred
        by NF

Reviewed by: glebius, gallatin, tuexen
Sponsored By: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D39402

17 months agotcp_hpts: remove dead code tcp_drop_in_pkts()
Gleb Smirnoff [Tue, 4 Apr 2023 19:55:27 +0000 (12:55 -0700)]
tcp_hpts: remove dead code tcp_drop_in_pkts()

Should have gone in f971e791391.

17 months agomlxfw: fix potential NULL pointer dereference
Eric van Gyzen [Thu, 30 Mar 2023 23:27:06 +0000 (18:27 -0500)]
mlxfw: fix potential NULL pointer dereference

Reported by: Coverity (an internal run at Dell)
Reviewed by: kib
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D39348

17 months agocap_dns, cap_net: fix host and service buffer handling
Eric van Gyzen [Thu, 30 Mar 2023 22:54:01 +0000 (17:54 -0500)]
cap_dns, cap_net: fix host and service buffer handling

If a malicious casper process sent a host or service string that was
too long, cap_getnameinfo would overrun the caller's buffer by one byte.

The backends for this function needlessly allocated one extra byte
for these buffers.  This was harmless, but could be confusing to readers.

Reported by: Coverity (an internal run at Dell)
Reviewed by: oshogbo, emaste
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D39347

17 months agolibdtrace: Do not set SHF_ALLOC on SUNW_dof relocation sections
Mark Johnston [Tue, 4 Apr 2023 15:21:51 +0000 (11:21 -0400)]
libdtrace: Do not set SHF_ALLOC on SUNW_dof relocation sections

The section will contain static relocations which do not need to be
preserved after linking, and moreover these relocations may reference
symbols that end up getting removed.

Do not set SHF_ALLOC and instead let the linker decide what needs to be
done.

PR: 258872
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

17 months agoRevert "zfs: fall back if block_cloning feature is disabled"
Martin Matuska [Tue, 4 Apr 2023 14:34:34 +0000 (16:34 +0200)]
Revert "zfs: fall back if block_cloning feature is disabled"

This reverts commit 8ee579abe09ec1fe15c588fc9a08370b83b81cd6.

17 months agokqueue: add close() calls to man page example
Ed Maste [Fri, 31 Mar 2023 18:50:26 +0000 (14:50 -0400)]
kqueue: add close() calls to man page example

There is no real need to close descriptors before a process exits, but
these close calls demonstrate by example that kqueue descriptors occupy
the same namespace as other file descriptors.

Reviewed by: fernape, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39376

17 months agoRegen
Konstantin Belousov [Fri, 31 Mar 2023 22:28:25 +0000 (01:28 +0300)]
Regen

17 months agoRename kqueue1(2) to kqueuex(2) to avoid compat issues with NetBSD
Konstantin Belousov [Fri, 31 Mar 2023 22:27:00 +0000 (01:27 +0300)]
Rename kqueue1(2) to kqueuex(2) to avoid compat issues with NetBSD

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D39377

17 months agoFixes in the tcp infrastructure with respect to stack changes as well as other infras...
Randall Stewart [Sat, 1 Apr 2023 05:46:38 +0000 (01:46 -0400)]
Fixes in the tcp infrastructure with respect to stack changes as well as other infrastructure updates for incoming rack features.

So stack switching as always been a bit of a issue. We currently use a break before make setup which means that
if something goes wrong you have to try to get back to a stack. This patch among a lot of other things changes that so
that it is a make before break. We also expand some of the function blocks in prep for new features in rack that will allow
more controlled pacing. We also add other abilities such as the pathway for a stack to query a previous stack to acquire from
it critical state information so things in flight don't get dropped or mis-handled when switching stacks. We also add the
concept of a timer granularity. This allows an alternate stack to change from the old ticks granularity to microseconds and
of course this even gives us a pathway to go to nanosecond timekeeping if we need to (something for the data center to consider
for sure).

Once all this lands I will then update rack to begin using all these new features.

Reviewed by: tuexen
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D39210

17 months agolinuxkpi: Add a few more dummy includes
Emmanuel Vadot [Tue, 4 Apr 2023 12:10:46 +0000 (14:10 +0200)]
linuxkpi: Add a few more dummy includes

Needed by drm-kmod.

Sponsored by: Beckhoff Automation GmbH & Co. KG

17 months agozfs: fall back if block_cloning feature is disabled
Martin Matuska [Tue, 4 Apr 2023 11:40:41 +0000 (13:40 +0200)]
zfs: fall back if block_cloning feature is disabled

If block_cloning is disabled, or other errors from zfs_clone_range()
return an EXDEV we should fall back to vn_generic_copy_file_range().

This fixes issues when copying files on the same dataset with
block_cloning disabled.

Upstreamed as pull request to OpenZFS.

Reviewed by: Mateusz Guzik <mjguzik@gmail.com>
OpenZFS pull request: 14713

17 months agobhyve: add missing include to qemu_fwcfg.c
Corvin Köhne [Tue, 4 Apr 2023 11:22:58 +0000 (13:22 +0200)]
bhyve: add missing include to qemu_fwcfg.c

Fixes: e46be58cca6bd180dadfb36e98a673ae6d8d2cd1 ("bhyve: add QEMU_FWCFG_INDEX_NB_CPUS item")
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG

17 months agolinuxkpi: Add linux/agp_backend.h
Emmanuel Vadot [Tue, 4 Apr 2023 09:48:45 +0000 (11:48 +0200)]
linuxkpi: Add linux/agp_backend.h

It declares the structs needed by drm code for AGP.

Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG

17 months agolinuxkpi: Add linux/stddef.h
Emmanuel Vadot [Tue, 4 Apr 2023 09:38:30 +0000 (11:38 +0200)]
linuxkpi: Add linux/stddef.h

It simply include sys/stdef.h

Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG

17 months agolinuxkpi: Include linux/types.h in linux/mod_devicetable.h
Emmanuel Vadot [Tue, 4 Apr 2023 08:44:51 +0000 (10:44 +0200)]
linuxkpi: Include linux/types.h in linux/mod_devicetable.h

It's done like this in linux too.

Sponsored by:   Beckhoff Automation GmbH & Co. KG

17 months agolinuxkpi: Include linux/math64.h in linux/time.h
Emmanuel Vadot [Tue, 4 Apr 2023 08:27:04 +0000 (10:27 +0200)]
linuxkpi: Include linux/math64.h in linux/time.h

It's done like this in linux too.

Sponsored by: Beckhoff Automation GmbH & Co. KG

17 months agoroute: fix route get netlink translation.
Alexander V. Chernikov [Tue, 4 Apr 2023 08:37:14 +0000 (08:37 +0000)]
route: fix route get netlink translation.

route.c uses newroute() to handle the "route get" command. The logic
 inside newroute() adds RTF_GATEWAY flag if "-interface" flag is not
 specified. That results in the inconsistent RTM_GET message with
 RTF_GATEWAY set but no RTAX_GATEWAY provided. Address this in the
 translation code by checking if the gateway is actually provided.

17 months agobhyve: add QEMU_FWCFG_INDEX_NB_CPUS item
Corvin Köhne [Mon, 27 Jun 2022 09:05:42 +0000 (11:05 +0200)]
bhyve: add QEMU_FWCFG_INDEX_NB_CPUS item

Requested-by: OVMF (qemu)
Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39316

17 months agoIf copy_file_range(2) fails with EXDEV, use fall-back.
Poul-Henning Kamp [Tue, 4 Apr 2023 07:39:59 +0000 (07:39 +0000)]
If copy_file_range(2) fails with EXDEV, use fall-back.

17 months agoFix pcie phy enabling codes for RK3568 SoC.
Ganbold Tsagaankhuu [Tue, 4 Apr 2023 02:50:29 +0000 (02:50 +0000)]
Fix pcie phy enabling codes for RK3568 SoC.

Handle data-lanes property for pcie phy and set it accordingly.
This makes devices attached to pcie3 work properly.
For some RK3568 based boards, RTL8125B based device is
connected it. So with this, realtek-re-kmod driver attaches
and works.

Partially obtained from OpenBSD.
Tested on NanoPI-R5S, FireFly Station P2 boards.

17 months agosetkey(8): ansify parser
Konstantin Belousov [Mon, 3 Apr 2023 02:00:25 +0000 (05:00 +0300)]
setkey(8): ansify parser

Sponsored by: NVidia networking
MFC after: 1 week

17 months agosetkey(8): remove redundand returns
Konstantin Belousov [Mon, 3 Apr 2023 01:59:07 +0000 (04:59 +0300)]
setkey(8): remove redundand returns

Sponsored by: NVidia networking
MFC after: 1 week

17 months agolibipsec: ansify
Konstantin Belousov [Mon, 3 Apr 2023 01:18:40 +0000 (04:18 +0300)]
libipsec: ansify

Sponsored by: Nvidia networking
MFC after: 1 week

17 months agoipsec_strerror.c: style, drop redundand return
Konstantin Belousov [Mon, 3 Apr 2023 01:16:03 +0000 (04:16 +0300)]
ipsec_strerror.c: style, drop redundand return

Sponsored by: Nvidia networking
MFC after: 1 week

17 months agosetkey(8): add -e option to take script from the command line
Konstantin Belousov [Mon, 3 Apr 2023 01:03:50 +0000 (04:03 +0300)]
setkey(8): add -e option to take script from the command line

Reviewed by: ae
Sponsored by: Nvidia networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D39393

17 months agollvm/lld: damage control threading
Mateusz Guzik [Sun, 2 Apr 2023 12:38:49 +0000 (12:38 +0000)]
llvm/lld: damage control threading

See the comment inside.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D39389

17 months agozfs: merge openzfs/zfs@431083f75
Martin Matuska [Mon, 3 Apr 2023 14:49:30 +0000 (16:49 +0200)]
zfs: merge openzfs/zfs@431083f75

Notable upstream pull request merges:
  #12194 Fix short-lived txg caused by autotrim
  #13368 ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced()
  #13392 Implementation of block cloning for ZFS
  #13741 SHA2 reworking and API for iterating over multiple implementations
  #14282 Sync thread should avoid holding the spa config write lock
         when possible
  #14283 txg_sync should handle write errors in ZIL
  #14359 More adaptive ARC eviction
  #14469 Fix NULL pointer dereference in zio_ready()
  #14479 zfs redact fails when dnodesize=auto
  #14496 improve error message of zfs redact
  #14500 Skip memory allocation when compressing holes
  #14501 FreeBSD: don't verify recycled vnode for zfs control directory
  #14502 partially revert PR 14304 (eee9362a7)
  #14509 Fix per-jail zfs.mount_snapshot setting
  #14514 Fix data race between zil_commit() and zil_suspend()
  #14516 System-wide speculative prefetch limit
  #14517 Use rw_tryupgrade() in dmu_bonus_hold_by_dnode()
  #14519 Do not hold spa_config in ZIL while blocked on IO
  #14523 Move dmu_buf_rele() after dsl_dataset_sync_done()
  #14524 Ignore too large stack in case of dsl_deadlist_merge
  #14526 Use .section .rodata instead of .rodata on FreeBSD
  #14528 ICP: AES-GCM: Refactor gcm_clear_ctx()
  #14529 ICP: AES-GCM: Unify gcm_init_ctx() and gmac_init_ctx()
  #14532 Handle unexpected errors in zil_lwb_commit() without ASSERT()
  #14544 icp: Prevent compilers from optimizing away memset()
         in gcm_clear_ctx()
  #14546 Revert zfeature_active() to static
  #14556 Remove bad kmem_free() oversight from previous zfsdev_state_list
         patch
  #14563 Optimize the is_l2cacheable functions
  #14565 FreeBSD: zfs_znode_alloc: lock the vnode earlier
  #14566 FreeBSD: fix false assert in cache_vop_rmdir when replaying ZIL
  #14567 spl: Add cmn_err_once() to log a message only on the first call
  #14568 Fix incremental receive silently failing for recursive sends
  #14569 Restore ASMABI and other Unify work
  #14576 Fix detection of IBM Power8 machines (ISA 2.07)
  #14577 Better handling for future crypto parameters
  #14600 zcommon: Refactor FPU state handling in fletcher4
  #14603 Fix prefetching of indirect blocks while destroying
  #14633 Fixes in persistent error log
  #14639 FreeBSD: Remove extra arc_reduce_target_size() call
  #14641 Additional limits on hole reporting
  #14649 Drop lying to the compiler in the fletcher4 code
  #14652 panic loop when removing slog device
  #14653 Update vdev state for spare vdev
  #14655 Fix cloning into already dirty dbufs
  #14678 Revert "Do not hold spa_config in ZIL while blocked on IO"

Obtained from: OpenZFS
OpenZFS commit: 431083f75bdd3efaee992bdd672625ec7240d252

17 months agoFix driver name.
Ganbold Tsagaankhuu [Mon, 3 Apr 2023 14:20:28 +0000 (14:20 +0000)]
Fix driver name.

Submitted by: Tyuryukanov S.Y.

17 months agoAdd non-posted device memory to the arm64 mem map
Andrew Turner [Fri, 31 Mar 2023 15:58:57 +0000 (16:58 +0100)]
Add non-posted device memory to the arm64 mem map

Add VM_MEMATTR_DEVICE_NP to the arm64 vm.pmap.kernel_maps sysctl.

Reviewed by: markj
Sponsored by: Arm Ltd
 Differential Revision: https://reviews.freebsd.org/D39371

17 months agolinsysfs(4): Reimplement listnics() using ifAPI
Dmitry Chagin [Mon, 3 Apr 2023 08:22:16 +0000 (11:22 +0300)]
linsysfs(4): Reimplement listnics() using ifAPI

Handle if arrival/departure events and VNETs.

Differential Revision: https://reviews.freebsd.org/D38901
MFC after: 1 month
XMFC with: ifAPI, pseudofs

17 months agostress2: Add comment about problem found. Disable run of this test
Peter Holm [Mon, 3 Apr 2023 07:33:03 +0000 (09:33 +0200)]
stress2: Add comment about problem found.  Disable run of this test

17 months agoLinuxKPI: 802.11: remove extra spaces
Bjoern A. Zeeb [Sun, 2 Apr 2023 22:25:28 +0000 (22:25 +0000)]
LinuxKPI: 802.11: remove extra spaces

Remove two extra spaces.  No functional change.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

17 months agoifconfig: Improve VLAN identifier parsing
Zhenlei Huang [Sun, 2 Apr 2023 17:54:31 +0000 (01:54 +0800)]
ifconfig: Improve VLAN identifier parsing

VLAN identifier 0xFFF is reserved. It must not be configured or
transmitted.

Also validate during parsing to prevent potential integer overflow.

Reviewed by: #network, melifaro
Fixes: c7cffd65c5d85 Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39282

17 months agolagg(4): Tap traffic after protocol processing
Zhenlei Huang [Sun, 2 Apr 2023 17:01:51 +0000 (01:01 +0800)]
lagg(4): Tap traffic after protocol processing

Different lagg protocols have different means and policies to process incoming
traffic. For example, for failover protocol, by default received traffic is only
accepted when they are received through the active port. For lacp protocol, LACP
control messages are tapped off, also traffic will be dropped if they are
received through the port which is not in collecting state or is not joined to
the active aggregator. It confuses if user dump and see inbound traffic on
lagg(4) interfaces but they are actually silently dropped and not passed into
the net stack.

Tap traffic after protocol processing so that user will have consistent view of
the inbound traffic, meanwhile mbuf is set with correct receiving interface and
bpf(4) will diagnose the right direction of inbound packets.

PR: 270417
Reviewed by: melifaro (previous version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39225

17 months agoinfiniband: Widen NET_EPOCH coverage
Zhenlei Huang [Sun, 2 Apr 2023 16:51:49 +0000 (00:51 +0800)]
infiniband: Widen NET_EPOCH coverage

From static code analysis, some device drivers (cxgbe, mlx4, mthca, and qlnx)
do not enter net epoch before lagg_input_infiniband(). If IPoIB interface is a
member of lagg(4) interface, and after returning from lagg_input_infiniband()
the receiving interface of mbuf is set to lagg(4) interface, then when
concurrently destroying the lagg(4) interface, there is a small window that the
interface gets destroyed and becomes invalid before infiniband_input() re-enter
net epoch, thus leading use-after-free.

Widen NET_EPOCH coverage to prevent use-after-free.

Thanks hselasky@ for testing with mlx5 devices.

Reviewed by: hselasky
Tested by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39275

17 months agonetlink: add NETLINK to the DEFAULTS for each architecture
Alexander V. Chernikov [Sun, 2 Apr 2023 11:50:04 +0000 (11:50 +0000)]
netlink: add NETLINK to the DEFAULTS for each architecture

NETLINK is going to replace rtsock and a number of other ioctl/sysctl interfaces.
In-base utilies such as route(8), netstat(8) and soon ifconfig(8)
 are being converted to use netlink sockets as a transport between
 kernel and userland.
In the current configuration, it still possible have the kernel
 without NETLINK (`nooptions NETLINK`) and use the aforementioned
 utilies by buidling the world with `WITHOUT_NETLINK` src.conf knob.
However, this approach does not cover the cases when person unintentionally
 builds a custom kernel without netlink and tries to use the standard userland.

This change adds `option NETLINK` to the default options for each
 architecture, fixing the custom kernel issue.
For arm, this change uses `std.armv6` and `std.armv7` (netlink already in)
 instead of DEFAULTS.

Reviewed By: imp
Differential Revision: https://reviews.freebsd.org/D39339

17 months agolinuxkpi: hdmi: Remove wrong dependency on wlan
Emmanuel Vadot [Sun, 2 Apr 2023 14:56:23 +0000 (16:56 +0200)]
linuxkpi: hdmi: Remove wrong dependency on wlan

Copy-paste mistake.

Reported by: Alastair Hogge <agh@riseup.net>
Fixes: f1d7ae31d4aa ("linuxkpi: Add hdmi helpers")

17 months agoping: fix failing test_pinger[_3_1_verbose_false] test.
Alexander V. Chernikov [Sun, 2 Apr 2023 14:10:16 +0000 (14:10 +0000)]
ping: fix failing test_pinger[_3_1_verbose_false] test.

17 months agoroute: add support for exact-prefix-match via netlink.
Alexander V. Chernikov [Sun, 2 Apr 2023 13:50:05 +0000 (13:50 +0000)]
route: add support for exact-prefix-match via netlink.

17 months agonetlink: allow exact-match route lookups via RTM_GETROUTE.
Alexander V. Chernikov [Sun, 2 Apr 2023 13:47:10 +0000 (13:47 +0000)]
netlink: allow exact-match route lookups via RTM_GETROUTE.

Use already-existing RTM_F_PREFIX rtm_flag to indicate that the
 request assumes exact-prefix lookup instead of the
 longest-prefix-match.

MFC after: 2 weeks

17 months agonetlink: fix NULL check in the default route snl(3) parser.
Alexander V. Chernikov [Sun, 2 Apr 2023 12:44:20 +0000 (12:44 +0000)]
netlink: fix NULL check in the default route snl(3) parser.

CID: 1506959
MFC after: 2 weeks

17 months agonetlink: fix snl_read_reply_multi().
Alexander V. Chernikov [Sun, 2 Apr 2023 12:41:04 +0000 (12:41 +0000)]
netlink: fix snl_read_reply_multi().

CID: 1506956
MFC after: 2 weeks

17 months agotests: fix utils import in netlink tests
Alexander V. Chernikov [Sun, 2 Apr 2023 10:17:37 +0000 (10:17 +0000)]
tests: fix utils import in netlink tests

MFC after: 2 weeks

17 months agopseudofs: Simplify pfs_visible_proc
Dmitry Chagin [Sun, 2 Apr 2023 08:24:10 +0000 (11:24 +0300)]
pseudofs: Simplify pfs_visible_proc

Reviewed by: des
Differential revision: https://reviews.freebsd.org/D39383
MFC after: 1 month

17 months agopseudofs: Allow vis callback to be called for a named node
Dmitry Chagin [Sun, 2 Apr 2023 08:21:15 +0000 (11:21 +0300)]
pseudofs: Allow vis callback to be called for a named node

This will be used later in the linsysfs module to filter out VNETs.

Reviewed by: des
Differential revision: https://reviews.freebsd.org/D39382
MFC after: 1 month

17 months agopseudofs: Microoptimize struct pfs_node
Dmitry Chagin [Sun, 2 Apr 2023 08:20:07 +0000 (11:20 +0300)]
pseudofs: Microoptimize struct pfs_node

Since 81167243b the size of struct pfs_node is 280 bytes, so the kernel
memory allocator takes memory from 384 bytes sized bucket. However, the
length of the node name is mostly short, e.g., for Linux emulation layer
it is up to 16 bytes. The size of struct pfs_node w/o pfs_name is 152
bytes, i.e., we have 104 bytes left to fit the node name into the 256
bytes-sized bucket.

Reviewed by: des
Differential revision: https://reviews.freebsd.org/D39381
MFC after: 1 month

17 months agoheimdal: Do not build a redundant source file
Cy Schubert [Sat, 1 Apr 2023 03:43:10 +0000 (20:43 -0700)]
heimdal: Do not build a redundant source file

Heimdal's lib/hdb/db3.c is only built if DB3 is enabled, i.e. #if HAVE_DB3.
FreeBSD's bdb is DB1. Therefore the entire db3.c file is #ifdef'd out.
Let's avoid building a file that results in a useless object file.

MFC after: 1 week

17 months agocxgbetool(8): Add support for tracing loopback traffic for a port.
Navdeep Parhar [Sun, 2 Apr 2023 00:43:20 +0000 (17:43 -0700)]
cxgbetool(8): Add support for tracing loopback traffic for a port.

Use lo<n> to tap the loopback for port <n>.

MFC after: 1 week
Sponsored by: Chelsio Communications

17 months agocxgbe(4): Allow tracing filters on loopback ports.
Navdeep Parhar [Sun, 2 Apr 2023 00:16:02 +0000 (17:16 -0700)]
cxgbe(4): Allow tracing filters on loopback ports.

Each physical port has an associated loopback tx channel and anything
transmitted over that channel by the driver is looped back internally by
the hardware as if received on that physical port.  This change allows
tracing filters to be installed in this loopback path.

MFC after: 1 week
Sponsored by: Chelsio Communications

17 months agocxgbe/iw_cxgbe: Always set a vnet around calls to IN_LOOPBACK.
Navdeep Parhar [Thu, 13 Oct 2022 22:34:56 +0000 (15:34 -0700)]
cxgbe/iw_cxgbe: Always set a vnet around calls to IN_LOOPBACK.

This is catch up with efe58855f3ea.

MFC after: 1 week
Sponsored by: Chelsio Communications

17 months agonfscommon: Add support for an NFSv4 operation bitmap
Rick Macklem [Sat, 1 Apr 2023 21:22:26 +0000 (14:22 -0700)]
nfscommon: Add support for an NFSv4 operation bitmap

NFSv4.1/4.2 uses operation bitmaps for various operations,
such as the SP4_MACH_CRED case for ExchangeID.
This patch adds support for operation bitmaps so that
support for SP4_MACH_CRED can be added to the NFSv4.1/4.2
server in a future commit.

This commit should not change any NFSv4.1/4.2 semantics.

MFC after: 3 months

17 months agotests: refactor atf_python a bit
Alexander V. Chernikov [Sat, 1 Apr 2023 19:40:54 +0000 (19:40 +0000)]
tests: refactor atf_python a bit

* Move more logic from conftest.py to the actual atf_pytest handler
* Move nodeid_to_method_name() to the utils.py so it can be shared

MFC after: 2 weeks

17 months agotests: add support for parsing generic netlink families.
Alexander V. Chernikov [Fri, 31 Mar 2023 15:37:32 +0000 (15:37 +0000)]
tests: add support for parsing generic netlink families.

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

17 months agotests: split netlink.py into multiple files to impove maintainability.
Alexander V. Chernikov [Fri, 31 Mar 2023 09:55:36 +0000 (09:55 +0000)]
tests: split netlink.py into multiple files to impove maintainability.

This diff does not contain any functional changes.
Its sole purpose is splitting netlink.py into smaller chunks.
The new code simplifies the upcoming generic netlink support
introduction.

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

17 months agoAdd myself (cc) as a src commiter.
Cheng Cui [Fri, 31 Mar 2023 10:06:52 +0000 (06:06 -0400)]
Add myself (cc) as a src commiter.

Summary: Adding mentor relationships for cc when committing new diffs.

Reviewed by: rscheff (mentor), tuexen (mentor)
Approved by: rscheff (mentor), tuexen (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39368

17 months agoarcmsr(4): Fix reading buffer empty length error.
黃清隆 [Sat, 1 Apr 2023 05:43:43 +0000 (22:43 -0700)]
arcmsr(4): Fix reading buffer empty length error.

MFC after: 2 weeks

17 months agoComplete my mentees list.
Rene Ladan [Sat, 1 Apr 2023 04:39:48 +0000 (13:39 +0900)]
Complete my mentees list.

Originally submitted by rnagy.

17 months agoLinuxKPI: 802.11: adjust locking
Bjoern A. Zeeb [Fri, 31 Mar 2023 19:52:19 +0000 (19:52 +0000)]
LinuxKPI: 802.11: adjust locking

Split up the lhw lock and the scan lock.  The latter is a mtx
while the former changes from mtx to sx as mac80211 downcalls may
sleep (and the ic lock is not usable in that case either and a larger
project to fix).
This will also enforce some lookups under lock (mostly scan) as well
as general protection for more compat code and avoid a possible
deadlock with one of the upcoming callbacks from driver into the
compat code.

Sponsored by: The FreeBSD Foundation
MFC after: 7 days

17 months agolibpcap: Update to 1.10.3
Joseph Mingrone [Fri, 31 Mar 2023 19:01:44 +0000 (16:01 -0300)]
libpcap: Update to 1.10.3

Local changes:

- In contrib/libpcap/pcap/bpf.h, do not include pcap/dlt.h.  Our system
  net/dlt.h is pulled in from net/bpf.h.
- sys/net/dlt.h: Incorporate changes from libpcap 1.10.3.
- lib/libpcap/Makefile: Update for libpcap 1.10.3.

Changelog: https://git.tcpdump.org/libpcap/blob/95691ebe7564afa3faa5c6ba0dbd17e351be455a:/CHANGES
Reviewed by: emaste
Obtained from: https://www.tcpdump.org/release/libpcap-1.10.3.tar.gz
Sponsored by: The FreeBSD Foundation

17 months agokqueue: tidy up indentation in man page example
Ed Maste [Fri, 31 Mar 2023 18:45:04 +0000 (14:45 -0400)]
kqueue: tidy up indentation in man page example

Fixes: e07b0c12ba64 ("[patch][doc] Fix EXAMPLE in kqueue(2)")
Sponsored by: The FreeBSD Foundation

17 months agoamd64 loader: plug hard hang with serial console enabled
Gleb Smirnoff [Fri, 31 Mar 2023 18:19:25 +0000 (11:19 -0700)]
amd64 loader: plug hard hang with serial console enabled

The hang basically bricks a physical box and it can be recovered
only if you are able to boot from alternate media.  This isn't a
perfect fix, but throw it in before loader experts decide on
proper one.

Submitted by: whu
Fixes: 927358dd98cb902160093e0dc0bac002d6b43858

17 months agofuse: Remove set but unused cr_gid variable.
John Baldwin [Fri, 31 Mar 2023 17:57:13 +0000 (10:57 -0700)]
fuse: Remove set but unused cr_gid variable.

Reviewed by: asomers
Reported by: GCC
Differential Revision: https://reviews.freebsd.org/D39350

17 months agoLinuxKPI: Appease -Wunused-but-set-variable warnings from GCC.
John Baldwin [Fri, 31 Mar 2023 17:56:33 +0000 (10:56 -0700)]
LinuxKPI: Appease -Wunused-but-set-variable warnings from GCC.

- Mark assert dummy variables as __unused.

- Use a dummy (void) cast of the flags argument passed to
  spin_unlock_irqrestore so it gets treated as used.

Reviewed by: manu, hselasky
Differential Revision: https://reviews.freebsd.org/D39349

17 months agonanobsd: Remove MIPS configurations.
John Baldwin [Fri, 31 Mar 2023 17:55:22 +0000 (10:55 -0700)]
nanobsd: Remove MIPS configurations.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D39332

17 months agolacp: Use C99 bool for boolean return value
Zhenlei Huang [Fri, 31 Mar 2023 17:48:36 +0000 (01:48 +0800)]
lacp: Use C99 bool for boolean return value

This improves readability.

No functional change intended.

MFC after: 1 week

17 months agoarm64/gicv3: correct the size of the distributor resource
Mitchell Horne [Fri, 31 Mar 2023 15:32:39 +0000 (12:32 -0300)]
arm64/gicv3: correct the size of the distributor resource

Use the GICD_SIZE macro (0x10000), which is half the size of the current
fixed-sized mapping (128 * 1024 == 0x20000).

In ARM64 Hyper-V instances, it seems the Distributor's registers are
located immediately preceding a range of physical memory in the bus
address space. Thus, when ram0 is attaching and attempts to reserve
SYS_RES_MEMORY resources corresponding to its physmem ranges, it fails,
because the first 0x10000 bytes of this range are already owned by gic0.

PR: 270415
Reported by: whu
Tested by: whu
Differential Revision: https://reviews.freebsd.org/D39260

17 months agoarm64: Move the initial kernel stack out of the init_pagetables section
Mark Johnston [Fri, 31 Mar 2023 15:04:37 +0000 (11:04 -0400)]
arm64: Move the initial kernel stack out of the init_pagetables section

init_pagetables is mapped into the segment containing the BSS, but does
not get zeroed by locore.  It is used for bootstrap page table pages.

It happens that the bootstrap kernel stack is also placed in that
section, but there's no reason it shouldn't live in the BSS, so move it
there.  No functional change intended.

Reviewed by: andrew
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D39367

17 months agoMove arm64 EENTRY uses before ENTRY
Andrew Turner [Fri, 31 Mar 2023 12:34:51 +0000 (13:34 +0100)]
Move arm64 EENTRY uses before ENTRY

The ENTRY macro adds instructions to the start of a function but not
EENTRY. To use these instructions in both functions move the EENTRY
use before the ENTRY use.

Sponsored by: Arm Ltd

17 months agobectl: Improve error message when ZFS root is not found.
Andrew Gallatin [Thu, 30 Mar 2023 21:57:26 +0000 (17:57 -0400)]
bectl: Improve error message when ZFS root is not found.

When recovering a system that is unbootable due to some
problem with the active BE, it is likely you'll be booted
from a rescue image running UFS.  In this case, bectl
needs help finding the zpool root that you want to operate
on.  In this case, improve the error message to suggest
specifying a root, rather than just emitting a generic
error message that might imply, to the naive user, that
there is a ZFS compatibility issue between the rescue
image and the on-disk ZFS pool.

Reviewed by: imp, kevans
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D39346

17 months agomakefs: improve some cd9660 error messages
Ed Maste [Thu, 30 Mar 2023 23:36:37 +0000 (19:36 -0400)]
makefs: improve some cd9660 error messages

Obtained from: OpenBSD
Sponsored by: The FreeBSD Foundation

17 months agoRevert "Add myself (cc) as a src commiter."
Cheng Cui [Fri, 31 Mar 2023 06:53:16 +0000 (02:53 -0400)]
Revert "Add myself (cc) as a src commiter."

Summary: This reverts commit 134ced89c4ca7852f2a56b91e9fc848ce4d4fab0.

Reviewers: rscheff, tuexen
Subscribers: imp
Approved by: tuexen (mentor)
Differential Revision: https://reviews.freebsd.org/D39363