]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
19 months agoObsoleteFiles.inc: fix a silly typo
Philip Paeps [Sun, 25 Sep 2022 06:02:30 +0000 (14:02 +0800)]
ObsoleteFiles.inc: fix a silly typo

Remove /usr/share/zoneinfo/SystemV, not /usr/share/zoneinfo.
The former was clearly wishful thinking. :-)

MFC after: 3 days
Pointy hat to:  philip

19 months agoshare/zoneinfo: don't build obsolete SystemV zones
Philip Paeps [Sun, 25 Sep 2022 05:42:18 +0000 (13:42 +0800)]
share/zoneinfo: don't build obsolete SystemV zones

The /usr/share/zoneinfo/SystemV directory has been empty on FreeBSD
since 2006.  The upstream source file was removed in 2020.  Also stop
passing yearisdate to zic(8).  This has not been necessary for years.
The script has been removed upstream since 2020.

MFC after: 3 days

19 months agocontrib/tzdata: import tzdata 2022d
Philip Paeps [Sun, 25 Sep 2022 05:50:36 +0000 (13:50 +0800)]
contrib/tzdata: import tzdata 2022d

Changes: https://github.com/eggert/tz/blob/2022d/NEWS

MFC after: 3 days

19 months agoImport tzdata 2022d
Philip Paeps [Sun, 25 Sep 2022 05:04:27 +0000 (13:04 +0800)]
Import tzdata 2022d

19 months agofile: upgrade to 5.43.
Xin LI [Sun, 25 Sep 2022 02:16:39 +0000 (19:16 -0700)]
file: upgrade to 5.43.

MFC after: 3 days

19 months agomount_nfs.8: Fix the RFC number now that it exists
Rick Macklem [Sat, 24 Sep 2022 22:05:21 +0000 (15:05 -0700)]
mount_nfs.8: Fix the RFC number now that it exists

The RFC for this finally got published and, therefore,
now has a number.  This patch puts this RFC number
in the man page.

This is a content change.

MFC after: 1 week

19 months agoifp: add if_setdescr() / if_freedesrt() methods
Alexander V. Chernikov [Sat, 24 Sep 2022 19:37:29 +0000 (19:37 +0000)]
ifp: add if_setdescr() / if_freedesrt() methods

Add methods for setting and removing the description from the interface,
 so the external users can manage it without using ioctl API.

MFC after:      2 weeks

19 months agoif_clone: add ifc_link_ifp() / ifc_unlink_ifp() to the KPI
Alexander V. Chernikov [Sat, 24 Sep 2022 19:17:27 +0000 (19:17 +0000)]
if_clone: add ifc_link_ifp() / ifc_unlink_ifp() to the KPI

Factor cloner ifp addition/deletion into separate functions and
 make them public. This change simlifies the current cloner code
 and paves the way to the other upcoming cloner / epair changes.

MFC after: 2 weeks

19 months agotmpfs: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE
Konstantin Belousov [Sun, 18 Sep 2022 13:27:28 +0000 (16:27 +0300)]
tmpfs: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE

PR: 164793
Reviewed by: asomers, jah, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36625

19 months agomsdosfs: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE
Konstantin Belousov [Sun, 18 Sep 2022 11:51:33 +0000 (14:51 +0300)]
msdosfs: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE

PR: 164793
Reviewed by: asomers, jah, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36625

19 months agoFFS: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE
Konstantin Belousov [Sun, 18 Sep 2022 11:48:40 +0000 (14:48 +0300)]
FFS: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE

PR: 164793
Reviewed by: asomers, jah, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36625

19 months agoAdd vn_rlimit_fsizex() and vn_rlimit_fsizex_res()
Konstantin Belousov [Sun, 18 Sep 2022 11:46:19 +0000 (14:46 +0300)]
Add vn_rlimit_fsizex() and vn_rlimit_fsizex_res()

The vn_rlimit_fsizex() function:
- checks that the write does not exceed RLIMIT_FSIZE limit and fs
  maximum supported file size
- truncates write length if it exceeds the RLIMIT_FSIZE or max file size,
  but there are some bytes to write
- sends SIGXFSZ if RLIMIT_FSIZE would be exceed otherwise

POSIX mandates the truncated write in case when some bytes can be
written but whole write request fails the RLIMIT_FSIZE check.

The function is supposed to be used from VOP_WRITE()s. Due to
pecularity in the VFS generic write syscall layer, uio_resid must
correctly reflect the written amount (noted by markj). Provide the dual
vn_rlimit_fsizex_res() function to correct uio_resid after the clamp
done in vn_rlimit_fsizex() on VOP_WRITE() return.

PR: 164793
Reviewed by: asomers, jah, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36625

19 months agotmpfs: disallow truncation to set file size past RLIMIT_FSIZE
Konstantin Belousov [Sun, 18 Sep 2022 13:28:11 +0000 (16:28 +0300)]
tmpfs: disallow truncation to set file size past RLIMIT_FSIZE

PR: 164793
Reviewed by: asomers, jah, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36625

19 months agomsdosfs: disallow truncation to set file size past RLIMIT_FSIZE
Konstantin Belousov [Sun, 18 Sep 2022 11:51:03 +0000 (14:51 +0300)]
msdosfs: disallow truncation to set file size past RLIMIT_FSIZE

PR: 164793
Reviewed by: asomers, jah, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36625

19 months agoUFS: disallow truncation to set file size past RLIMIT_FSIZE
Konstantin Belousov [Sun, 18 Sep 2022 11:49:57 +0000 (14:49 +0300)]
UFS: disallow truncation to set file size past RLIMIT_FSIZE

This is mandated by POSIX.

PR: 164793
Reviewed by: asomers, jah, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36625

19 months agoAdd vn_rlimit_trunc()
Konstantin Belousov [Sun, 18 Sep 2022 19:52:13 +0000 (22:52 +0300)]
Add vn_rlimit_trunc()

Reviewed by: asomers, jah, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36625

19 months agofilesystems: return error from vn_rlimit_fsize() instead of EFBIG
Konstantin Belousov [Sun, 18 Sep 2022 14:44:49 +0000 (17:44 +0300)]
filesystems: return error from vn_rlimit_fsize() instead of EFBIG

Reviewed by: asomers, jah, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36625

19 months agotmpfs_subr.c: some style
Konstantin Belousov [Sun, 18 Sep 2022 13:20:24 +0000 (16:20 +0300)]
tmpfs_subr.c: some style

Use 'td' as the local thread name.
Wrap long lines.
Remove unneeded blank lines.

Reviewed by: asomers, jah, markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36625

19 months agoarm64: Ignore 1GB mappings in pmap_advise()
Mark Johnston [Sat, 24 Sep 2022 13:26:54 +0000 (09:26 -0400)]
arm64: Ignore 1GB mappings in pmap_advise()

For the same reason as commit 4c224f8e5f36cfad5a9af8db7c7acdecc3d4c7b5.

MFC after: 1 week

19 months agoamd64: Ignore 1GB mappings in pmap_advise()
Mark Johnston [Sat, 24 Sep 2022 13:20:48 +0000 (09:20 -0400)]
amd64: Ignore 1GB mappings in pmap_advise()

This assertion can be triggered by usermode since vm_map_madvise()
doesn't force advice to be applied to an entire largepage mapping.  I
can't see any reason not to permit it, however, since MADV_DONTNEED and
_FREE are advisory and we can simply do nothing when a 1GB mapping is
encountered.

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36675

19 months agoamd64: Handle 1GB mappings in pmap_enter_quick_locked()
Mark Johnston [Sat, 24 Sep 2022 13:20:29 +0000 (09:20 -0400)]
amd64: Handle 1GB mappings in pmap_enter_quick_locked()

This code path can be triggered by applying MADV_WILLNEED to a 1GB
mapping.

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36674

19 months agoamd64: Make it possible to grow the KERNBASE region of KVA
Mark Johnston [Sat, 24 Sep 2022 13:19:21 +0000 (09:19 -0400)]
amd64: Make it possible to grow the KERNBASE region of KVA

pmap_growkernel() may be called when mapping a region above KERNBASE,
typically for a kernel module.  If we have enough PTPs left over from
bootstrap, pmap_growkernel() does nothing.  However, it's possible to
run out, and in this case pmap_growkernel() will try to grow the kernel
map all the way from kernel_vm_end to somewhere past KERNBASE, which can
easily run the system out of memory.  This happens with large kernel
modules such as the nvidia GPU driver.  There is also a WIP dtrace
provider which needs to map KVA in the region above KERNBASE (to provide
trampolines which allow a copy of traced kernel instruction to be
executed), and its allocations could potentially trigger this scenario.

This change modifies pmap_growkernel() to manage the two regions
separately, allowing them to grow independently.  The end of the
KERNBASE region is tracked by modifying "nkpt".

PR: 265019
Reviewed by: alc, imp, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36673

19 months agosmr: Fix synchronization in smr_enter()
Mark Johnston [Sat, 24 Sep 2022 13:18:04 +0000 (09:18 -0400)]
smr: Fix synchronization in smr_enter()

smr_enter() must publish its observed read sequence number before
issuing any subsequent memory operations.  The ordering provided by
atomic_add_acq_int() is insufficient on some platforms, at least on
arm64, because it permits reordering of subsequent loads with the store
to c_seq.

Thus, use atomic_thread_fence_seq_cst() to issue a store-load barrier
after publishing the read sequence number.

On x86, take advantage of the fact that memory operations are not
reordered with locked instructions to improve code density: we can store
the observed read sequence and provide a store-load barrier with a
single operation.

Based on a patch from Pierre Habouzit <pierre@habouzit.net>.

PR: 265974
Reviewed by: alc
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36370

19 months agoVendor import of file 5.43.
Xin LI [Sat, 24 Sep 2022 04:20:34 +0000 (21:20 -0700)]
Vendor import of file 5.43.

19 months agosched_4bsd: Fix a racy thread state modification
Mark Johnston [Fri, 23 Sep 2022 23:41:30 +0000 (19:41 -0400)]
sched_4bsd: Fix a racy thread state modification

When a thread switching off-CPU is migrating to a remote CPU,
sched_switch() may trigger a rescheduling of the thread currently
running on that CPU.  When doing so, it must ensure that that thread is
locked before modifying thread state.  If the thread's lock is not the
scheduler lock, then the thread is in the process of switching off-CPU
and no extra effort is needed, and the initiator does not hold the
thread's lock and thus should not modify any thread state.

Reported and tested by: Steve Kargl
MFC after: 1 week

19 months agorpc.tlsclntd.8: Fix the RFC number now that it exists
Rick Macklem [Fri, 23 Sep 2022 23:59:29 +0000 (16:59 -0700)]
rpc.tlsclntd.8: Fix the RFC number now that it exists

The RFC for this finally got published and, therefore,
now has a number.  This patch puts this RFC number
in the man page.

This is a content change.

MFC after: 1 week

19 months agorpc.tlsservd.8: Fix the RFC number now that it exists
Rick Macklem [Fri, 23 Sep 2022 23:53:36 +0000 (16:53 -0700)]
rpc.tlsservd.8: Fix the RFC number now that it exists

The RFC for this finally got published and, therefore,
now has a number.  This patch puts this RFC number
in the man page.

This is a content change.

MFC after: 1 week

19 months agonfscl: Fix parameter order in the calls to MGET().
Zhenlei Huang [Fri, 23 Sep 2022 21:04:36 +0000 (15:04 -0600)]
nfscl: Fix parameter order in the calls to MGET().

Reviewed by: imp, rmacklem
Differential Revision: https://reviews.freebsd.org/D36644

19 months agoarm64: don't loop forever if first option in kern.cfg.order not available
Warner Losh [Fri, 23 Sep 2022 21:02:53 +0000 (15:02 -0600)]
arm64: don't loop forever if first option in kern.cfg.order not available

strchr returns a pointer to the ',', so if the first option in the list
isn't available, we need to step over the , to look at the next
option. So if kern.cfg.order="acpi,fdt" and we have no acpi, we'd loop
forever with order=',fdt'.

Sponsored by: Netflix
Reviewed by: andrew, jhb
Differential Revision: https://reviews.freebsd.org/D36682

19 months agocpuset(9): Refer to CPU_SETSIZE not MAXCPU
Brooks Davis [Fri, 23 Sep 2022 20:20:52 +0000 (21:20 +0100)]
cpuset(9): Refer to CPU_SETSIZE not MAXCPU

The maximum CPU number of a cpuset_t is determined by CPU_SETSIZE. In
the kernel this is MAXCPU, but in userspace it is CPU_MAXSIZE unless
CPU_SETSIZE is defined before including sys/_cpuset.h. CPU_MAXSIZE is
256 and in userspace MAXCPU is generally 1 because it being set to a
larger MD value is gated on SMP being defined (not generally the case in
userspace).

Reported by: Nathaniel Wesley Filardo <nwfilardo@gmail.com>
Reviewed by: cem, jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D36679

19 months agorelease: Use standard mount points for arm MBR boot images
Warner Losh [Fri, 23 Sep 2022 15:48:26 +0000 (09:48 -0600)]
release: Use standard mount points for arm MBR boot images

Traditionally, we've used /boot/msdos for the MBR mount point for the SD
images that we produced. For GPT and bsdinstall, we've used
/boot/efi. Migrate to using /boot/efi for MBR as well and add a
/boot/msdos -> /boot/efi symlink for compatibility (which may disappear
before 14.0, but will remain on the stable branches).

When we first created the arm images, there was no EFI booting and the
FAT partion on an MBR image was used to hold the firmware, uboot.bin,
SoC config files and ubldr.  When we transitioned to uboot with EFI, we
put the loader files in the same partition. Later we standardized on
/boot/efi at about the same time we added GPT support to the RE produced
images. We left the MRB case as /boot/msdos for legacy reasons and since
it wasn't always EFI. Later, we dropped support of non-EFI booting on
the RE produced images, so the duality of /boot/msdos diminished even
more. Since so little secondary meaning remains, putting it all in
/boot/efi standardizes the location and reflects the RE images
better as using efi-only booting.

In addition, always label the msdosfs partion 'efi'. While a small
misnomer on some systems that store other files in the ESP, it was
requested in review for more consistency for similar reasons to the
mountpoint rename. There was no way to have an 'alias' or 'second label'
here, so this breaks compatibility. Since the images are self-contained,
this was judged to be an acceptable change.

Sponsored by: Netflix
Reviewed by: manu, allanjude, emaste, gjb
Differential Revision: https://reviews.freebsd.org/D36635

19 months agoFix the spelling of interrupt in the GICv3 driver
Andrew Turner [Fri, 23 Sep 2022 11:06:45 +0000 (12:06 +0100)]
Fix the spelling of interrupt in the GICv3 driver

Reported by: jrtc27
Sponsored by: Innovate UK

19 months agoMake adding children consistant in the GICv3 drivers
Andrew Turner [Fri, 23 Sep 2022 11:05:10 +0000 (12:05 +0100)]
Make adding children consistant in the GICv3 drivers

Reorder statements to make them consistant between the ACPI and FDT
GICv3 attachments.

Reported by: jrtc27
Sponsored by: Innovate UK

19 months agoTeach the GICv3 driver to translate memory ranges
Andrew Turner [Thu, 22 Sep 2022 12:09:02 +0000 (13:09 +0100)]
Teach the GICv3 driver to translate memory ranges

As with the GICv1/2 driver teach the GICv3 driver to translate memory
ranges of children. This allows us to create a common
bus_alloc_resource implementation for bot hACPI and FDT attachments.

Sponsored by: The FreeBSD Foundation

19 months agoMove the GICv3 bus_print_child function to the parent
Andrew Turner [Thu, 22 Sep 2022 10:50:15 +0000 (11:50 +0100)]
Move the GICv3 bus_print_child function to the parent

This should be common for both ACPI and FDT. Move this to the common
part of the driver.

Sponsored by: The FreeBSD Foundation

19 months agoAdd bus_get_resource_list functions to the GICv3 driver
Andrew Turner [Thu, 22 Sep 2022 10:17:45 +0000 (11:17 +0100)]
Add bus_get_resource_list functions to the GICv3 driver

This will be used to reduce code duplication between the ACPI and FDT
attachments.

Sponsored by: The FreeBSD Foundation

19 months agoibcore: The use of IN_LOOPBACK() now requires a valid VNET context.
Hans Petter Selasky [Wed, 31 Aug 2022 10:37:28 +0000 (12:37 +0200)]
ibcore: The use of IN_LOOPBACK() now requires a valid VNET context.

Make sure the VNET is set before using this macro.

Fixes: efe58855f3ea2cfc24cb705aabce3bc0fe1fb6d5
PR: 266054
MFC after: 1 week
Sponsored by: NVIDIA Networking

19 months agoTrack removal of Tokenring and FDDI media types from devd.cc.
Pau Amma [Thu, 22 Sep 2022 19:55:11 +0000 (19:55 +0000)]
Track removal of Tokenring and FDDI media types from devd.cc.

Fixes: eec02418d83b Remove support for FDDI and token ring media types in userland utilities.

Reviewed by: brooks, gjb, imp

Approved by: brooks (src), gjb (mentor, src), imp (src)

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

MFC after: 3 days

19 months agoipfilter/libipf: printpool_live() consumer ignores return code
Cy Schubert [Thu, 22 Sep 2022 18:26:23 +0000 (11:26 -0700)]
ipfilter/libipf: printpool_live() consumer ignores return code

The single consumer of printpool_live() ignores the return code.
Avoid wasting resources on this.

MFC after: 2 weeks

19 months agoipfilter/ippool: Return error code when listing a pool fails
Cy Schubert [Thu, 22 Sep 2022 13:00:09 +0000 (06:00 -0700)]
ipfilter/ippool: Return error code when listing a pool fails

When an internal or other error occurs during the listing of a pool,
return an error code when extiting ippool(8). Printing an error to
stderr without returning an error code is useless in shell scripts.

MFC after: 2 weeks

19 months agoipfilter/ippool: Dump a copy of ippool in ippool.conf format
Cy Schubert [Wed, 21 Sep 2022 15:33:11 +0000 (08:33 -0700)]
ipfilter/ippool: Dump a copy of ippool in ippool.conf format

Add an ippool(8) option to dump a copy of the inm-memory ippool tables
in an ippool(5) format so that it can be reloaded using ippool -f.

MFC after: 2 weeks

19 months agoiwlwifi.4: typo fixed
Maxim Konovalov [Thu, 22 Sep 2022 22:35:16 +0000 (22:35 +0000)]
iwlwifi.4: typo fixed

PR: 266554

19 months agoBump __FreeBSD_version for pmap_unmap*() and kmem_*() API changes.
John Baldwin [Thu, 22 Sep 2022 22:10:03 +0000 (15:10 -0700)]
Bump __FreeBSD_version for pmap_unmap*() and kmem_*() API changes.

Sponsored by: DARPA

19 months agokmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers.
John Baldwin [Thu, 22 Sep 2022 22:09:19 +0000 (15:09 -0700)]
kmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers.

Reviewed by: kib, markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D36549

19 months agopmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t.
John Baldwin [Thu, 22 Sep 2022 22:08:52 +0000 (15:08 -0700)]
pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t.

This matches the return type of pmap_mapdev/bios.

Reviewed by: kib, markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D36548

19 months agocxgbe(4): Fix potential integer overflow in t4_tstmp_to_ns.
Navdeep Parhar [Thu, 22 Sep 2022 15:57:25 +0000 (08:57 -0700)]
cxgbe(4): Fix potential integer overflow in t4_tstmp_to_ns.

Coverity flagged this in its latest run but it is not a problem in
practice as the card's core clock would have to be > 4.2GHz for any
overflow to occur.

CID 1498303:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
Potentially overflowing expression "sc->params.vpd.cclk * 1000U" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned).

Reported by: Coverity Scan (CID 1498303)
Sponsored by: Chelsio Communications

19 months agoBump __FreeBSD_version after LinuxKPI changes.
Bjoern A. Zeeb [Thu, 22 Sep 2022 15:11:41 +0000 (15:11 +0000)]
Bump __FreeBSD_version after LinuxKPI changes.

19 months agoLinuxKPI: cache.h add L1_CACHE_ALIGN()
Bjoern A. Zeeb [Wed, 21 Sep 2022 19:46:17 +0000 (19:46 +0000)]
LinuxKPI: cache.h add L1_CACHE_ALIGN()

Sponsored by: The FreeBSD Foundation
MFC after: 7 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36655

19 months agoLinuxKPI: pci.h split up pcim_iomap_regions_request_all()
Bjoern A. Zeeb [Wed, 21 Sep 2022 19:41:37 +0000 (19:41 +0000)]
LinuxKPI: pci.h split up pcim_iomap_regions_request_all()

Factor out parts of pcim_iomap_regions_request_all() into
pcim_iomap_regions() now needed for a driver.

Sponsored by: The FreeBSD Foundation
MFC after: 7 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36654

19 months agoLinuxKPI: if_ether.h add more constants
Bjoern A. Zeeb [Wed, 21 Sep 2022 19:51:52 +0000 (19:51 +0000)]
LinuxKPI: if_ether.h add more constants

In addition to the ones added last year add more found in modern
drivers.

Sponsored by: The FreeBSD Foundation
MFC after: 7 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36656

19 months agoLinuxKPI: io.h constify arguments and add more functions
Bjoern A. Zeeb [Wed, 21 Sep 2022 19:55:47 +0000 (19:55 +0000)]
LinuxKPI: io.h constify arguments and add more functions

Constify "*from" arguments and add __ioread32_copy() and
__ioread64_copy() based on the already existing implementations.

Sponsored by: The FreeBSD Foundation
MFC after: 7 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36657

19 months agoLinuxKPI: dma-mapping: add dmam_alloc_coherent()
Bjoern A. Zeeb [Wed, 21 Sep 2022 20:58:05 +0000 (20:58 +0000)]
LinuxKPI: dma-mapping: add dmam_alloc_coherent()

Add the devres version dmam_alloc_coherent() of dma_alloc_coherent()
along with the ancillary free function.

Sponsored by: The FreeBSD Foundation
MFC after: 7 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36661

19 months agoLinuxKPI: tracepoint.h add more defines
Bjoern A. Zeeb [Wed, 21 Sep 2022 20:06:44 +0000 (20:06 +0000)]
LinuxKPI: tracepoint.h add more defines

Add some more defines used in drivers to make it easier to compile.

MFC after: 7 days
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D36660

19 months agoLinuxKPI: pci_ids.h Add more Vendor IDs.
Bjoern A. Zeeb [Wed, 21 Sep 2022 20:02:00 +0000 (20:02 +0000)]
LinuxKPI: pci_ids.h  Add more Vendor IDs.

Add PCI vendor IDs found in ath and mt76 drivers.  This should make it
easier for me and others not having to re-define them locally.

MFC after: 7 days
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D36659

19 months agoLinuxKPI: lockdep.h add lockdep_{,un}register_key()
Bjoern A. Zeeb [Thu, 22 Sep 2022 15:03:36 +0000 (15:03 +0000)]
LinuxKPI: lockdep.h add lockdep_{,un}register_key()

Add NOPs for lockdep_{,un}register_key().

Sponsored by: The FreeBSD Foundation
MFC after: 7 days
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D36658

19 months agoLinuxKPI: pci.h add more defines and functions
Bjoern A. Zeeb [Wed, 21 Sep 2022 19:39:01 +0000 (19:39 +0000)]
LinuxKPI: pci.h add more defines and functions

Add #defines for PCI_DEVICE_ID and repoint the PCI_VENDOR_ID one.
Add dev_is_pci().
Add pcie_capability_clear_word() according to similar implementations.

Sponsored by: The FreeBSD Foundation
MFC after: 7 days
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D36653

19 months agoLinuxKPI: device.h add devm_kmemdup()
Bjoern A. Zeeb [Wed, 21 Sep 2022 19:33:30 +0000 (19:33 +0000)]
LinuxKPI: device.h add devm_kmemdup()

Add devm_kmemdup() as needed by a networking driver.

Sponsored by: The FreeBSD Foundation
MFC after: 7 days
eviewed by:  hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D36652

19 months agoif_clone: migrate some consumers to the new KPI.
Alexander V. Chernikov [Thu, 22 Sep 2022 12:30:09 +0000 (12:30 +0000)]
if_clone: migrate some consumers to the new KPI.

Convert most of the cloner customers who require custom params
 to the new if_clone KPI.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D36636
MFC after: 2 weeks

19 months agotcp: fix cwnd restricted SACK retransmission loop
Richard Scheffenegger [Thu, 22 Sep 2022 10:55:25 +0000 (12:55 +0200)]
tcp: fix cwnd restricted SACK retransmission loop

While doing the initial SACK retransmission segment while heavily cwnd
constrained, tcp_ouput can erroneously send out the entire sendbuffer
again. This may happen after an retransmission timeout, which resets
snd_nxt to snd_una while the SACK scoreboard is still populated.

Reviewed By: tuexen, #transport
PR: 264257
PR: 263445
PR: 260393
MFC after: 3 days
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36637

19 months agoldd: remove '[preloaded]' marker for the preloaded objects
Konstantin Belousov [Sun, 18 Sep 2022 00:49:30 +0000 (03:49 +0300)]
ldd: remove '[preloaded]' marker for the preloaded objects

for the default output.  For '-a' (per-object needed printout) the
[preloaded] banner is kept.

Instead, use special format2 for printing the preloaded objects (and
vdso), which does not include DT_NEEDED, since there is no object
needing the printed one.

In this way, the output is more compatible with glibc.

Example:
LD_PRELOAD=/lib/libthr.so.3 LD_TRACE_LOADED_OBJECTS=1 /libexec/ld-elf.so.1 /bin/ls
        libutil.so.9 => /lib/libutil.so.9 (0x801099000)
        libncursesw.so.9 => /lib/libncursesw.so.9 (0x8010b0000)
        libc.so.7 => /lib/libc.so.7 (0x801123000)
        [vdso] (0x7ffffffff000)
        /lib/libthr.so.3 (0x80106c000)
Note the absense of the part before and including '=>' for preloaded
libthr.so.3, and for vdso.

PR: 265750
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36616

19 months agoif_clone: rework cloning KPI
Alexander V. Chernikov [Thu, 22 Sep 2022 09:37:37 +0000 (09:37 +0000)]
if_clone: rework cloning KPI

The current cloning KPI does not provide a way of creating interfaces
 with parameres from within kernel. The reason is that those parameters
 are passed as an opaque pointer and it is not possible to specify whether
 this pointer references kernel-space or user-space.
Instead of just adding a flag, generalise the KPI to simplify the
 extension process. Unify current notion of `SIMPLE` and `ADVANCED` users
 by leveraging newly-added IFC_C_AUTOUNIT flag to automatically pick
 unit number, which is a primary feature of the "SIMPLE" KPI.
Use extendable structures everywhere instead of passing function
 pointers or parameters.
Isolate all parts of the oldKPI under `CLONE_COMPAT_13` so it can be safely
 merged back to 13. Old KPI will be removed after the merge.

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

19 months agotcp: send ACKs when requested
Michael Tuexen [Thu, 22 Sep 2022 10:12:11 +0000 (12:12 +0200)]
tcp: send ACKs when requested

When doing Limited Transmit send an ACK when needed by the protocol
processing (like sending ACKs with a DSACK block).

PR: 264257
PR: 263445
PR: 260393
Reviewed by: rscheff@
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D36631

19 months agozfs: fix powerpc build broken in c7046f76c2
Martin Matuska [Thu, 22 Sep 2022 09:59:31 +0000 (11:59 +0200)]
zfs: fix powerpc build broken in c7046f76c2

The breakage was introduced in OpenZFS commit 48cf170d5.
When a (different) fix solving this issue gets upstreamed
it will replace the current fix in the next merge from OpenZFS.

19 months agoepair: deduplicate interface allocation code #1
Alexander V. Chernikov [Thu, 22 Sep 2022 09:01:03 +0000 (09:01 +0000)]
epair: deduplicate interface allocation code #1

Simplify epair_clone_create() and epair_clone_destroy() by
 factoring out epair softc allocation / desctruction and
 interface setup/teardown into separate functions.

Reviewed By: kp, zlei.huang_gmail.com
Differential Revision: https://reviews.freebsd.org/D36614
MFC after: 2 weeks

19 months agotcp: increment tcpstats in tcp_respond()
Gleb Smirnoff [Wed, 21 Sep 2022 21:03:33 +0000 (14:03 -0700)]
tcp: increment tcpstats in tcp_respond()

tcp_respond() crafts a packet and sends it directly to ip[6]output(),
bypassing tcp_output().  Hence it must increment TCP send statistics.

Reviewed by: rscheff, tuexen, rrs (implicitly)
Differential revision: https://reviews.freebsd.org/D36641

19 months agotcp: fix simultaneous open and refine e80062a2d43
Gleb Smirnoff [Wed, 21 Sep 2022 21:02:49 +0000 (14:02 -0700)]
tcp: fix simultaneous open and refine e80062a2d43

- The soisconnected() call on transition from SYN_RCVD to ESTABLISHED
  is also necessary for a half-synchronized connection.  Fix that
  just setting the flag, when we transfer SYN-SENT -> SYN-RECEIVED.
- Provide a comment that explains at what conditions the call to
  soisconnected() is necessary.
- Hence mechanically rename the TF_INCQUEUE flag to TF_SONOTCONN.
- Extend the change to the BBR and RACK stacks.

Note: the interaction between the accept_filter(9) and the socket layer
is not fully consistent, yet.  For most accept filters this call to
soisconnected() will not move the connection from the incomplete queue
to the complete.  The move would happen only when the filter has received
the desired data, and soisconnected() would be called once again from
sorwakeup().  Ideally, we should mark socket as connected only there,
and leave the soisconnected() from SYN_RCVD->ESTABLISHED only for the
simultaneous open case.  However, this doesn't yet work.

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

19 months agolio: Remove unneeded include.
Zhenlei Huang [Wed, 21 Sep 2022 20:52:00 +0000 (14:52 -0600)]
lio: Remove unneeded include.

Reviewed by: adiran, imp
Differential Revision: https://reviews.freebsd.org/D36501

19 months agoif_ovpn: fix memory leak on unload
Kristof Provost [Wed, 21 Sep 2022 15:23:51 +0000 (17:23 +0200)]
if_ovpn: fix memory leak on unload

When we're unloading the if_ovpn module we sometimes end up only freeing
the softc after the module is unloaded and the M_OVPN malloc type no
longer exists.

Don't return from ovpn_clone_destroy() until the epoch callbacks have
been called, which ensures that we've freed the softc before we destroy
M_OVPN.

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

19 months agoif_ovpn: remove incorrect rounding up of packet sizes
Kristof Provost [Wed, 21 Sep 2022 10:17:34 +0000 (12:17 +0200)]
if_ovpn: remove incorrect rounding up of packet sizes

The ciphers used by OpenVPN (DCO) do not require data to be block-sized.
Do not round up to AES_BLOCK_LEN, as this can lead to issues with
fragmented packets.

Reported by: Gert Doering <gert@greenie.muc.de>
Sponsored by: Rubicon Communications, LLC ("Netgate")

19 months agoLinuxKPI: device.h remove duplicate #include
Bjoern A. Zeeb [Wed, 21 Sep 2022 17:25:34 +0000 (17:25 +0000)]
LinuxKPI: device.h remove duplicate #include

linux/types.h is included twice; reduce to the first.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

19 months agoLinuxKPI: 802.11: add more header compat bits
Bjoern A. Zeeb [Wed, 21 Sep 2022 17:12:48 +0000 (17:12 +0000)]
LinuxKPI: 802.11: add more header compat bits

First part adding more bits in order to synch up drivers to the same
level and enable a new ones.

MFC after: 3 days

19 months agocxgbe: fix kernel build without TCP_OFFLOAD or RATELIMIT
Konstantin Belousov [Wed, 21 Sep 2022 09:53:53 +0000 (12:53 +0300)]
cxgbe: fix kernel build without TCP_OFFLOAD or RATELIMIT

Reviewed by: np
Fixes: e398922eaf6
Sponsored by: Nvidia networking
Differential revision: https://reviews.freebsd.org/D36648

19 months agoDeprecate telnet daemon
Brooks Davis [Wed, 21 Sep 2022 15:17:04 +0000 (16:17 +0100)]
Deprecate telnet daemon

The telnetd codebase is old, unmaintained, and has a number of quality
issues.  Users wishing to provide telnetd service should find a
maintained implementation.  The telnet client is NOT deprecated as it
is lower risk.

Reviewed by: pauamma, kevans, kp, melifaro
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D36619

19 months agozfs: merge openzfs/zfs@c629f0bf6
Martin Matuska [Wed, 21 Sep 2022 12:17:13 +0000 (14:17 +0200)]
zfs: merge openzfs/zfs@c629f0bf6

Notable upstream pull request merges:
  #13725 Fix BLAKE3 tuneable and module loading on Linux and FreeBSD
  #13756 FreeBSD: Organize sysctls
  #13773 FreeBSD: add kqfilter support for zvol cdev
  #13781 Importing from cachefile can trip assertion
  #13794 Apply arc_shrink_shift to ARC above arc_c_min
  #13798 Improve too large physical ashift handling
  #13799 Revert "Avoid panic with recordsize > 128k, raw sending and
         no large_blocks"
  #13802 Add zfs.sync.snapshot_rename
  #13831 zfs_enter rework
  #13855 zfs recv hangs if max recordsize is less than received
         recordsize

Obtained from: OpenZFS
OpenZFS commit: c629f0bf62e351355716f9870d6c2e377584b016

19 months agodebugnet: Fix parameter order in the calls to m_get()
Zhenlei Huang [Wed, 21 Sep 2022 10:55:20 +0000 (06:55 -0400)]
debugnet: Fix parameter order in the calls to m_get()

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

19 months agoUse DEFINE_CLASS_0 in the arm generic timer
Andrew Turner [Tue, 20 Sep 2022 16:07:27 +0000 (17:07 +0100)]
Use DEFINE_CLASS_0 in the arm generic timer

Rather than defining the structure manually use the DEFINE_CLASS_0
macro. As we have both an ACPI and FDT attachment we need to use the
_0 variant of the macro as DEFINE_CLASS would create two structures
with the same name.

Sponsored by: The FreeBSD Foundation

19 months agoTeach the GICv3 driver about a vgic child
Andrew Turner [Wed, 14 Sep 2022 16:29:29 +0000 (17:29 +0100)]
Teach the GICv3 driver about a vgic child

This will be used by bhyve to attach a virtual GIC driver.

Sponsored by: Innovate UK
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36590

19 months agoCreate macros for the Arm timer IRQ indexes
Andrew Turner [Wed, 14 Sep 2022 16:29:29 +0000 (17:29 +0100)]
Create macros for the Arm timer IRQ indexes

Rather than hard coding these values use a macro to document which
interrupt is being used.

Reviewed by: emaste
Obtained from: https://github.com/FreeBSD-UPB/freebsd-src (earlier version)
Sponsored by: Innovate UK
Sponsored by: The FreeBSD Foundation
Sponsored by: University Politehnica of Bucharest
Differential Revision: https://reviews.freebsd.org/D36600

19 months agoMFV 66082b6c88b9: libbsdxml (expat) 2.4.9
Xin LI [Wed, 21 Sep 2022 06:54:38 +0000 (23:54 -0700)]
MFV 66082b6c88b9: libbsdxml (expat) 2.4.9

19 months agoVendor import of expat 2.4.9.
Xin LI [Wed, 21 Sep 2022 06:53:08 +0000 (23:53 -0700)]
Vendor import of expat 2.4.9.

19 months agostress2: Added two syzkaller reproducers
Peter Holm [Wed, 21 Sep 2022 05:40:47 +0000 (07:40 +0200)]
stress2: Added two syzkaller reproducers

19 months agoUse 0 and 1, not false and true, in tree.h changes.
Doug Moore [Wed, 21 Sep 2022 04:36:40 +0000 (23:36 -0500)]
Use 0 and 1, not false and true, in tree.h changes.
Reported by: jenkins

19 months agorb_tree: augmentation shortcut
Doug Moore [Wed, 21 Sep 2022 04:21:14 +0000 (23:21 -0500)]
rb_tree: augmentation shortcut

RB-tree augmentation maintains data in each node of the tree that
represents the product of some associative operator applied to all the
nodes of the subtree rooted at that node. If a node in the tree
changes, augmentation data for the node is updated for that node and
all nodes on the path from that node to the tree root. However,
sometimes, augmenting a node changes no data in that node,
particularly if the associated operation is something involving 'max'
or 'min'. If augmentation changes nothing in a node, then the work of
walking to the tree root from that point is pointless, because
augmentation will change nothing in those nodes either. This change
makes it possible to avoid that wasted work.

Define RB_AUGMENT_CHECK as a macro much like RB_AUGMENT, but which
returns a value 'true' when augmentation changes the augmentation data
of a node, and false otherwise. Change code that unconditionally walks
and augments to the top of tree to code that stops once an
augmentation has no effect. In the case of rebalancing the tree after
insertion or deletion, where previously a node rotated into the path
was inevitably augmented on the march to the tree root, now check to
see if it needs augmentation because the march to the tree root
stopped before reaching it.

Change the augmentation function in iommu_gas.c so that it returns
true/false to indicate whether the augmentation had any effect.

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

19 months agoRetire ZFS_TEARDOWN_TRY_ENTER_READ
Mateusz Guzik [Tue, 20 Sep 2022 22:34:41 +0000 (00:34 +0200)]
Retire ZFS_TEARDOWN_TRY_ENTER_READ

There were never any users and it so happens the operation is not even
supported by rrm locks -- the macros were wrong for Linux and FreeBSD
when not using it's RMS locks.

Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #13906

19 months agoAdd membar_sync
Mateusz Guzik [Tue, 20 Sep 2022 22:32:44 +0000 (00:32 +0200)]
Add membar_sync

Provides the missing full barrier variant to the membar primitive set.

While not used right now, this is probably going to change down the
road.

Name taken from Solaris, to follow the existing routines.

Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #13907

19 months agoFix minor issues in namespace delegation support
youzhongyang [Tue, 20 Sep 2022 22:25:21 +0000 (18:25 -0400)]
Fix minor issues in namespace delegation support

get_user_ns() is only done once for each namespace, so put_user_ns()
should be done once too.

Fix two typos in user_namespace/user_namespace_002.ksh and
user_namespace/user_namespace_003.ksh.

Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Youzhong Yang <yyang@mathworks.com>
Closes #13918

19 months agoFreeBSD: handle V_PCATCH
Mateusz Guzik [Tue, 20 Sep 2022 22:22:32 +0000 (00:22 +0200)]
FreeBSD: handle V_PCATCH

See https://cgit.FreeBSD.org/src/commit/?id=a75d1ddd74312f5dd79bc1e965f7077679659f2e

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #13910

19 months agoFreeBSD: catch up to 1400068
Mateusz Guzik [Tue, 20 Sep 2022 22:21:30 +0000 (00:21 +0200)]
FreeBSD: catch up to 1400068

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #13909

19 months agoCall va_end() before return in zpool_standard_error_fmt()
Richard Yao [Tue, 20 Sep 2022 22:20:56 +0000 (18:20 -0400)]
Call va_end() before return in zpool_standard_error_fmt()

Commit ecd6cf800b63704be73fb264c3f5b6e0dafc068d by marks in OpenSolaris
at Tue Jun 26 07:44:24 2007 -0700 introduced a bug where we fail to call
`va_end()` before returning.

The man page for va_start() says:

"Each invocation of va_start() must be matched by a corresponding
invocation of va_end() in the same function."

Coverity complained about this.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Chunwei Chen <david.chen@nutanix.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13904

19 months agoFix potential NULL pointer dereference in zfsdle_vdev_online()
Richard Yao [Tue, 20 Sep 2022 22:20:04 +0000 (18:20 -0400)]
Fix potential NULL pointer dereference in zfsdle_vdev_online()

Coverity complained about this.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Chunwei Chen <david.chen@nutanix.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13903

19 months agoDelay ZFS_PROP_SHARESMB property to handle it for encrypted raw receive
Ameer Hamza [Tue, 20 Sep 2022 22:19:05 +0000 (03:19 +0500)]
Delay ZFS_PROP_SHARESMB property to handle it for encrypted raw receive

For encrypted raw receive, objset creation is delayed until a call to
dmu_recv_stream(). ZFS_PROP_SHARESMB property requires objset to be
populated when calling zpl_earlier_version(). To correctly handle the
ZFS_PROP_SHARESMB property for encrypted raw receive, this change
delays setting the property.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #13878

19 months agoFreeBSD: Cleanup zfs_readdir()
Richard Yao [Tue, 20 Sep 2022 21:50:16 +0000 (17:50 -0400)]
FreeBSD: Cleanup zfs_readdir()

The FreeBSD project's coverity scans found dead code in `zfs_readdir()`.
Also, the comment above `zfs_readdir()` is out of date.

I fixed the comment and deleted all of the dead code, plus additional
dead code that was found upon review.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13924

19 months agoFreeBSD: Fix uninitialized pointer read in spa_import_rootpool()
Richard Yao [Tue, 20 Sep 2022 21:43:03 +0000 (17:43 -0400)]
FreeBSD: Fix uninitialized pointer read in spa_import_rootpool()

The FreeBSD project's coverity scans found this.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13923

19 months agocxgbe: fix the build after e398922eaf66978b5e556f6b4b095693c865f329
Mateusz Guzik [Tue, 20 Sep 2022 21:31:49 +0000 (21:31 +0000)]
cxgbe: fix the build after e398922eaf66978b5e556f6b4b095693c865f329

19 months agolinuxkpi: Resolve duplicate global symbol name to fix LINT kernel build.
Hans Petter Selasky [Tue, 20 Sep 2022 20:36:08 +0000 (22:36 +0200)]
linuxkpi: Resolve duplicate global symbol name to fix LINT kernel build.

seq_printf() is defined in both spl_procfs_list.c and linux_seq_file.c .
Fix this by renaming the LinuxKPI ones and use macros to invoke the
correct function.

Reported by: jfree@
Differential Revision:  https://reviews.freebsd.org/D35883
MFC after: 1 week
Sponsored by: NVIDIA Networking

19 months agoEnable M_TSTMP in Chelsio cxgbe driver by creating a mechanism that can sync the...
Randall Stewart [Tue, 20 Sep 2022 19:13:16 +0000 (15:13 -0400)]
Enable M_TSTMP in Chelsio cxgbe driver by creating a mechanism that can sync the time.

Chelsio has always been recording a timestamp in the mbuf (rcv_tstmp) but
not setting the M_TSTMP bit in the mbuf flags. This is because the timestamp
was just the free running 60bit clock. This change fixes that so that
we keep a synchronization by periodically (every 30 seconds after startup)
getting the timestamp and the current nanosecond time. We always keep
several sets around and the current one we always keep the current pair
and the previous pair of timestamps. This allows us to setup a ratio
between the two so we can correctly translate the time. Note that
we use special care to split the timestamp into seconds (per the clock tick)
and nanoseconds otherwise 64bit math would overflow.

Reviewed by: np
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D36315

19 months agorc.d/var_run: Add needed "shutdown" keyword
Cy Schubert [Tue, 20 Sep 2022 18:44:11 +0000 (11:44 -0700)]
rc.d/var_run: Add needed "shutdown" keyword

The "shutdown" keyword invokes rcorder with the -k flag, for rc scripts
with the keyword at shutdown.

Reported by: bdrewery
Fixes: 27b9777c28b4
MFC after: 3 days
Differential Revision:

19 months agolinuxkpi: drm-kmod debugfs support
Jake Freeland [Tue, 20 Sep 2022 17:41:10 +0000 (19:41 +0200)]
linuxkpi: drm-kmod debugfs support

This diff extends LinuxKPI to support simple attribute files in debugfs.
These simple attributes are an essential component for compiling drm-kmod
with CONFIG_DEBUG_FS enabled.
This will allow for easier graphics driver debugging using
Intel's igt-gpu-tools.

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

19 months agolinuxkpi: Add strndup_user
Jake Freeland [Tue, 20 Sep 2022 17:38:37 +0000 (19:38 +0200)]
linuxkpi: Add strndup_user

Reviewed by: hselasky, markj
Differential Revision: https://reviews.freebsd.org/D36350
Sponsored by: Google, Inc. (GSoC 2022)

19 months agolinuxkpi: Add EPOLL aliases
Jake Freeland [Tue, 20 Sep 2022 17:37:08 +0000 (19:37 +0200)]
linuxkpi: Add EPOLL aliases

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