]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agofusefs: update atime on reads when using cached attributes
Alan Somers [Mon, 29 Nov 2021 01:53:31 +0000 (18:53 -0700)]
fusefs: update atime on reads when using cached attributes

When using cached attributes, whether or not the data cache is enabled,
fusefs must update a file's atime whenever it reads from it, so long as
it wasn't mounted with -o noatime.  Update it in-kernel, and flush it to
the server on close or during the next setattr operation.

The downside is that close() will now frequently trigger a FUSE_SETATTR
upcall.  But if you care about performance, you should be using
-o noatime anyway.

Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D33145

(cherry picked from commit 91972cfcddf950d7a9c33df5a9171ada1805a144)

fusefs: fix 32-bit build of the tests after 91972cfcddf

(cherry picked from commit d109559ddbf7afe311c1f1795ece137071406db8)

2 years agofusefs: fix copy_file_range when extending a file
Alan Somers [Mon, 29 Nov 2021 01:35:58 +0000 (18:35 -0700)]
fusefs: fix copy_file_range when extending a file

When copy_file_range extends a file, it must update the cached file
size.

Reviewed by: rmacklem, pfg
Differential Revision: https://reviews.freebsd.org/D33151

(cherry picked from commit 65d70b3bae0c70798b0a2b8ed129bc146fed1cce)

2 years agofusefs: delete a redundant getnanouptime
Alan Somers [Sun, 28 Nov 2021 23:05:30 +0000 (16:05 -0700)]
fusefs: delete a redundant getnanouptime

It's been redundant since SVN r346060 added another getnanouptime just
above.

(cherry picked from commit 8fbae6c7bd63fca64b898843f63cb24269a7dd46)

2 years agosbin/mount_fusefs/mount_fusefs.8: Fix typos
Elyes HAOUAS [Fri, 8 Oct 2021 16:44:48 +0000 (18:44 +0200)]
sbin/mount_fusefs/mount_fusefs.8: Fix typos

"expicitly" --> "explicitly"
"uknown" --> "unknown"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/552

(cherry picked from commit c8a45820e0d94892c1a632d49ccfddd8f559801e)

2 years agofusefs: fix intermittency in the dev_fuse_poll test
Alan Somers [Sat, 25 Sep 2021 16:16:20 +0000 (10:16 -0600)]
fusefs: fix intermittency in the dev_fuse_poll test

The DevFusePoll::access/select test would occasionally segfault.  The
cause was a file descriptor that was shared between two threads.  The
first thread would kill the second and close the file descriptor.  But
it was possible that the second would read the file descriptor before it
shut down.  That did not cause problems for kqueue, poll, or blocking
operation, but it triggered segfaults in select's macros.

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

(cherry picked from commit f44a448709d3b77508fd59ee28201ae1666387c2)

2 years agoif_epair: MFC: fix module build outside of kernel build environment
Eugene Grosbein [Sat, 11 Dec 2021 04:07:50 +0000 (11:07 +0700)]
if_epair: MFC: fix module build outside of kernel build environment

(cherry picked from commit 7a382e744b0b0ba9b51dc34bfa0cd1515f744f25)

2 years agoRevert "Switch to Arm Optimized Routines for mem* & str*"
Andrew Turner [Tue, 14 Dec 2021 12:34:09 +0000 (12:34 +0000)]
Revert "Switch to Arm Optimized Routines for mem* & str*"

The Arm Optimized Routines don't exist in 13. I missed this as my
builds succeeded, likely due to stale depends files.

This reverts commit bfd10d146ba4f8dc26e8b9bb9013a9316105f11a.

2 years agoRemove redundant declarations
Andrew Turner [Tue, 23 Nov 2021 17:26:35 +0000 (17:26 +0000)]
Remove redundant declarations

These are already defined in the same file.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit dd978721a223e3f9d35a7be5407c52a281fcec8f)

2 years agoMove the arm64 identify_cpu SYSINIT earlier
Andrew Turner [Mon, 22 Nov 2021 10:25:01 +0000 (10:25 +0000)]
Move the arm64 identify_cpu SYSINIT earlier

It is used by late ifunc resolvers so needs to be at an earlier stage
of the boot. Previously it was at the same stage so may not have run
before the ifunc resolvers.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 44ca3690519b653c7293c2366b6c47d8f510ff26)

2 years agoUse a builtin where possible in msun
Andrew Turner [Tue, 2 Nov 2021 11:31:17 +0000 (11:31 +0000)]
Use a builtin where possible in msun

Some of the functions in msun can be implemented using a compiler
builtin function to generate a small number of instructions. Implement
this support in fma, fmax, fmin, and sqrt on arm64.

Care must be taken as the builtin can be implemented as a function
call on some architectures that lack direct support. In these cases
we need to use the original code path.

As we don't set errno on failure build with -fno-math-errno so the
toolchain doesn't convert a builtin into a function call when it
detects a failure, e.g. gcc will add a call to sqrt when the input
is negative leading to an infinite loop.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32801

(cherry picked from commit b2e843161dc3b79777e873183447c92ed9c3703a)

2 years agoSwitch to Arm Optimized Routines for mem* & str*
Andrew Turner [Mon, 1 Nov 2021 13:06:56 +0000 (13:06 +0000)]
Switch to Arm Optimized Routines for mem* & str*

These are the updated version of the older Cortex Strings Library we
previously used. The Arm Optimized Routines also support CPU features
that are currently in development on FreeBSD, e.g. Branch Target
Identification (BTI). Rather than add BTI support to the old code it's
easier to just use the maintained version.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32774

(cherry picked from commit 2e8ff4d1d5b9d32b29287efb414449121733544a)

2 years agoMove KHELP_DECLARE_MOD_UMA later in the boot
Andrew Turner [Fri, 12 Nov 2021 18:28:18 +0000 (18:28 +0000)]
Move KHELP_DECLARE_MOD_UMA later in the boot

Both KHELP_DECLARE_MOD_UMA and the kernel linker SYSINIT to find
in-kernel modules run at SI_SUB_KLD, SI_ORDER_ANY. As the former
depends on the latter running first move it later in the boot,
to the new SI_SUB_KHELP. This ensures KHELP_DECLARE_MOD_UMA
module SYSINIT functions will be after the kernel linker.

Previously we may have received a panic similar to the following if
the order was incorrect:

panic: module_register_init: module named ertt not found

Reported by: bob prohaska <fbsd AT www.zefox.net>
Discussed with: imp, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ae062ff2695f61e43e23e144db62cb251b2cf599)

2 years agoPrint the correct register for the arm64 elr
Andrew Turner [Mon, 1 Nov 2021 11:19:57 +0000 (11:19 +0000)]
Print the correct register for the arm64 elr

In 7ec86b6609912 ("Also print symbols when printing arm64 registers")
a new function was created to print most registers. Unfortunately the
Link Register (LR) was being printed when we should have printed the
Exception Link Register (ELR).

Fix this by adding the missing 'e'.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 62cbc00d2f57785c747632b1a5ba7571281d17c4)

2 years agoOnly change the fadt revision in acpidump on i386
Andrew Turner [Wed, 20 Oct 2021 09:19:55 +0000 (10:19 +0100)]
Only change the fadt revision in acpidump on i386

There is a workaround in acpidump for an old IBM laptop. This is being
hit on a modern arm64 system causing acpidump to use the wrong field
when reading a later address.

As the laptop has a 32-bit CPU the only FreeBSD support for it is i386.
As such limit the workaround to that architecture.

Reviewed by: emaste, jkim, jhb (all earlier version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32573

(cherry picked from commit 01593a0ff9f16e2cb23ab2ebc4ca3b8bd2434425)

2 years agoPass the ACPI ID when reading the ACPI domain
Andrew Turner [Mon, 18 Oct 2021 09:04:06 +0000 (10:04 +0100)]
Pass the ACPI ID when reading the ACPI domain

The ACPI ID may not be the same as the FreeBSD CPU id. Use the former
when finding the CPU domain as there is no requirement for it to be
identical to the latter.

Reported by: dch, kevans
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32546

(cherry picked from commit 4fb002805e0dc0d08825bce65a0f4e533c53ec54)

2 years agoStop reading the arm64 domain when it's known
Andrew Turner [Tue, 12 Oct 2021 11:39:14 +0000 (12:39 +0100)]
Stop reading the arm64 domain when it's known

There is no need to read the domain on arm64 when there is only one
in the ACPI tables. This can also happen when the table is missing
as it is unneeded.

Reported by: dch
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 0906563718d35643789fc2b3c4cf1fc6884755e5)

2 years agoAllocate arm64 per-CPU data in the correct domain
Andrew Turner [Wed, 6 Oct 2021 15:08:04 +0000 (15:08 +0000)]
Allocate arm64 per-CPU data in the correct domain

To minimise NUMA traffic allocate the pcpu, dpcpu, and boot stacks in
the correct domain when possible.

Submitted by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32338

(cherry picked from commit a90ebeb5feea63c9d8377cbc74e0442156a0ed15)

2 years agoSet uninitialized popmap bits in vm_reserv_init
Doug Moore [Sun, 5 Dec 2021 23:17:25 +0000 (17:17 -0600)]
Set uninitialized popmap bits in vm_reserv_init

In vm_reserv_init, set all the marker popmap bits in vm_reserv_init,
and not just the bits of the first popmap entry.

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

(cherry picked from commit 9f32cb5b1c81ceed28491c031cd109811a5f5d7a)

2 years agoipfilter printfieldhdr: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:51:01 +0000 (20:51 -0800)]
ipfilter printfieldhdr: remove set-but-not-unused vars

(cherry picked from commit edcdd4f6445ad50c8f7c6e974d0216c5be9356d5)

2 years agoipft_pc: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:48:17 +0000 (20:48 -0800)]
ipft_pc: remove set-but-not-unused vars

(cherry picked from commit 712b938661f98a66180832632550060c7ba387df)

2 years agoipft_tx: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:49:22 +0000 (20:49 -0800)]
ipft_tx: remove set-but-not-unused vars

(cherry picked from commit 9018f7fa45c0bc66cfdd4496e695218be3d37a33)

2 years agoip_log: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 05:11:45 +0000 (21:11 -0800)]
ip_log: remove set-but-not-unused vars

(cherry picked from commit 664882ab168f7328c23ceaadb473dab794f835d8)

2 years agoipfcomp: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:56:10 +0000 (20:56 -0800)]
ipfcomp: remove set-but-not-unused vars

(cherry picked from commit fe5b077c9efcbcc9e92d0d7d877d1e16afc563ce)

2 years agoipft_hx: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:46:11 +0000 (20:46 -0800)]
ipft_hx: remove set-but-not-unused vars

(cherry picked from commit ece1946c1fbd8d42d621fd59028488a3e71aae65)

2 years agoippool: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 05:01:14 +0000 (21:01 -0800)]
ippool: remove set-but-not-unused vars

Display of stats from a kernel core dump was never fully implemented.
Remove the dangling vars and remove the documentation.

(cherry picked from commit 2169572e743edf05696c04c641a6413a474cbf12)

2 years agoamd64: Only build aout.ko when COMPAT_FREEBSD32 is enabled
Konstantin Belousov [Mon, 6 Dec 2021 23:11:10 +0000 (01:11 +0200)]
amd64: Only build aout.ko when COMPAT_FREEBSD32 is enabled

(cherry picked from commit 0f2d88d1ebbba796adb0492781b683cbfe25bd2d)

2 years agoTag zfs-2.1.2
Tony Hutter [Mon, 13 Dec 2021 23:00:39 +0000 (15:00 -0800)]
Tag zfs-2.1.2

META file and changelog updated.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
2 years agozfs-dkms rpm: Fix scriptlets dependencies
Till Maas [Sun, 12 Dec 2021 19:15:25 +0000 (20:15 +0100)]
zfs-dkms rpm: Fix scriptlets dependencies

To ensure that the necessary packages are available during the %post and
%preun scriptlets, require them properly.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Till Maas <opensource@till.name>
Closes #12822
Closes #12832

2 years agoApply only the libadd/libnames part of dbf05458e3bd
Dimitry Andric [Mon, 13 Dec 2021 21:23:44 +0000 (22:23 +0100)]
Apply only the libadd/libnames part of dbf05458e3bd

Add libz to the dependencies for libdwarf. Otherwise, building older
branches on recent -CURRENT might fail in the cross-tools stage with:

ld: error: undefined symbol: uncompress
>>> referenced by libdwarf_elf_init.c:233 (/usr/src/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c:233)
>>>               libdwarf_elf_init.o:(_dwarf_elf_init) in archive /usr/lib/libdwarf.a

Direct commit to stable/13, since dbf05458e3bd has other libdwarf
changes to support compressed ELF sections, which are more intrusive.

2 years agoFreeBSD: Add vop_standard_writecount_nomsync
Ryan Moeller [Fri, 10 Dec 2021 14:15:27 +0000 (14:15 +0000)]
FreeBSD: Add vop_standard_writecount_nomsync

https://cgit.freebsd.org/src/commit?id=3ffcfa599e29686cf2b3c1a6087408c37acaed78

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org>
Closes #12828

2 years agoFreeBSD: Catch up with more VFS changes
Ryan Moeller [Thu, 9 Dec 2021 18:04:56 +0000 (18:04 +0000)]
FreeBSD: Catch up with more VFS changes

Unused thread argument was removed from NDINIT*

https://cgit.freebsd.org/src/commit?id=7e1d3eefd410ca0fbae5a217422821244c3eeee4

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org>
Closes #12828

2 years agoFix several bugs in the FreeBSD rename VOP implementation
Mark Johnston [Fri, 19 Nov 2021 22:26:39 +0000 (17:26 -0500)]
Fix several bugs in the FreeBSD rename VOP implementation

- To avoid a use-after-free, zfsvfs->z_log needs to be loaded after the
  teardown lock is acquired with ZFS_ENTER().
- Avoid leaking vnode locks in zfs_rename_relock() and zfs_rename_()
  when the ZFS_ENTER() macros forces an early return.

Refactor the rename implementation so that ZFS_ENTER() can be used
safely.  As a bonus, this lets us use the ZFS_VERIFY_ZP() macro instead
of open-coding its implementation.

Reported-by: Peter Holm <pho@FreeBSD.org>
Tested-by: Peter Holm <pho@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Sponsored-by: The FreeBSD Foundation
Closes #12717

2 years agoRemove (now unused) td argument from zfs_lookup()
Pawel Jakub Dawidek [Sat, 13 Nov 2021 01:06:44 +0000 (17:06 -0800)]
Remove (now unused) td argument from zfs_lookup()

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #12748

2 years agoExit the teardown section later in rename on FreeBSD
Mark Johnston [Thu, 28 Oct 2021 17:25:26 +0000 (13:25 -0400)]
Exit the teardown section later in rename on FreeBSD

We have to hold the teardown lock while dereferencing zfsvfs->z_os and,
I believe, when committing to the ZIL.

Note that jumping to the "out" label, "error" is always non-zero.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Closes #12704

2 years agoFix potential use-after-frees in FreeBSD getpages and setattr VOPs
Mark Johnston [Thu, 28 Oct 2021 15:58:57 +0000 (11:58 -0400)]
Fix potential use-after-frees in FreeBSD getpages and setattr VOPs

The objset object is reallocated during certain dataset operations, such
as rollbacks, so the objset pointer must be loaded after acquiring the
teardown lock.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Closes #12704

2 years agopf tests: more thorough pfsync defer test
Kristof Provost [Thu, 2 Dec 2021 17:47:40 +0000 (18:47 +0100)]
pf tests: more thorough pfsync defer test

Add a somewhat more extensive pfsync defer mode test. Ensure that pfsync
actually delays the state creating packet until after it has sent the
pfsync update and given the peer time to create the state.

Ideally the test should validate the pfsync state update and generate an
ack message, but to keep the test simple we rely on the timeout of the
deferred packet instead.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33245

(cherry picked from commit 60a3a371afa73ddbc085a7af044a4a860a998c57)

2 years agopfsync: fix incorrect enabling of defer mode
Kristof Provost [Thu, 2 Dec 2021 17:39:23 +0000 (18:39 +0100)]
pfsync: fix incorrect enabling of defer mode

When we exposed the PFSYNCF_OK flag to userspace in 5f5bf88949d we
unintentionally caused defer mode to always be enabled.
The ioctl check only looked for nonzero, not for the PFSYNCF_DEFER flag.

Fix this check and ensure ifconfig sets the flag.

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33244

(cherry picked from commit 73fd0eaf5930c5b8844ca122dd3068145ccef02c)

2 years agopfsync: locking fixes
Kristof Provost [Thu, 2 Dec 2021 16:42:56 +0000 (17:42 +0100)]
pfsync: locking fixes

 * Ensure we unlock the pfsync lock in pfsync_defer()
 * We must hold the bucket lock when calling pfsync_push()
 * The pfsync_defer_tmo() callout locks the bucket lock, not the pfsync
   lock

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33243

(cherry picked from commit 41c4f1987243cefe81adcc31d5401e7a80a0428c)

2 years agopfsync: fix defer timeout
Kristof Provost [Thu, 2 Dec 2021 16:30:36 +0000 (17:30 +0100)]
pfsync: fix defer timeout

Don't use a fixed number of ticks, but take hz into account so we have a
consistent timeout, regardless of what hz is set up.
Use a 20ms timeout, becaues that's what OpenBSD uses.

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33242

(cherry picked from commit 93a3fa41dcff274180133712a13392d17a3e75a1)

2 years agopfsync: check IFF_DRV_RUNNING in the correct field
Kristof Provost [Thu, 2 Dec 2021 13:36:12 +0000 (14:36 +0100)]
pfsync: check IFF_DRV_RUNNING in the correct field

This flag is stored in if_drv_flags, not if_flags.

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33241

(cherry picked from commit 7b02a551f78ed5c4bd55d3b33da55524cd2317a6)

2 years agopfsync: NULL check sc before using it
Kristof Provost [Thu, 2 Dec 2021 13:32:21 +0000 (14:32 +0100)]
pfsync: NULL check sc before using it

In pfsync_defer() we must wait to lock sc until we've ensured it's not
NULL.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33240

(cherry picked from commit 27bd812c5c92af9e7acdbf100bd98166a717bb76)

2 years agodepend-cleanup.sh: Make the output message more precise
Mark Johnston [Tue, 7 Dec 2021 18:01:05 +0000 (13:01 -0500)]
depend-cleanup.sh: Make the output message more precise

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 73db11a4d1e1940b6be65e72bb02bb0d4a701b95)

2 years agodepend-cleanup.sh: Handle commit cbdec8db18b5
Mark Johnston [Tue, 7 Dec 2021 16:18:45 +0000 (11:18 -0500)]
depend-cleanup.sh: Handle commit cbdec8db18b5

That commit changed libc to use the MI pdfork implementation, but with
an incremental build the object file for the pdfork.S stub lingers and
causes a linker error.

Cleaning the depend file is not enouch, so modify clean_deps() to remove
object files as well, and add a call to ensure that pdfork.*o is
cleaned.  The new file is _pdfork.o.

Reported by: jhb
Reviewed by: emaste
Fixes: cbdec8db18b5 ("libc: Add pdfork to the list of interposed system calls")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 187fe192ce0ab1fc9787840ddb4f721a72de5942)

2 years agolibc: Add pdfork to the list of interposed system calls
Mark Johnston [Mon, 6 Dec 2021 23:02:25 +0000 (18:02 -0500)]
libc: Add pdfork to the list of interposed system calls

Otherwise the asm stub is used and libthr interposition does not work.

Reviewed by: kib
Fixes: 21f749da82e7 ("libthr: wrap pdfork(2), same as fork(2).")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit cbdec8db18b533f6d7be329da151d6b61df3f98b)

2 years agovm_page: Tighten the object lock assertion in vm_page_invalid()
Mark Johnston [Sun, 5 Dec 2021 15:39:58 +0000 (10:39 -0500)]
vm_page: Tighten the object lock assertion in vm_page_invalid()

A page must not become invalid while vm_fault_soft_fast() is attempting
to map unbusied pages for reading.

Note that all callers hold the object write lock already, and
vm_page_set_invalid() asserts the object write lock.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 39a7396f5d0c3eac4401229e1b24fb8b89efc862)

2 years agong_ubt: Avoid attaching to several newer Intel controllers
Mark Johnston [Sun, 5 Dec 2021 15:45:12 +0000 (10:45 -0500)]
ng_ubt: Avoid attaching to several newer Intel controllers

Like other Intel controllers, these require firmware to be loaded, and
generic ng_ubt attach causes them to lock up until a power cycle.
However, their firmware interface for querying version info and loading
operational firmware is different from that implemented by ng_ubt_intel
and iwmbtfw, so they are not usable yet.  Just disable attach for now to
avoid stalls during USB device enumeration.

PR: 260161
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b25ba58adc04ca475df1e8125d2a16a07d68b49d)

2 years agortwn/usb: add product ID for Asus USB N10 Nano Rev. B1
Andreas Wetzel [Mon, 6 Dec 2021 07:21:38 +0000 (09:21 +0200)]
rtwn/usb: add product ID for Asus USB N10 Nano Rev. B1

According to information found on the internet the following products
use exactly the same hardware but probably different USB IDs:
- Edimax EW-7811Un V2 (v2)
- Edimax EW-7811GLN 2.0A (v2)
I am not adding them as I cannot verify.

PR: 254280

(cherry picked from commit cd6f0b47692cb004b1e52a28cbd853f251b99c93)

2 years agoxhci: Add PCI IDs for Thunderbolt 3/4 USB controllers.
Alexander Motin [Mon, 29 Nov 2021 02:29:26 +0000 (21:29 -0500)]
xhci: Add PCI IDs for Thunderbolt 3/4 USB controllers.

MFC after: 2 weeks

(cherry picked from commit cfb0e4d76cc61b81ef367337676a7fc51c3b062d)

2 years agosbin: build ping if at least one of INET & INET6 is enabled
Ed Maste [Sun, 28 Nov 2021 17:50:13 +0000 (12:50 -0500)]
sbin: build ping if at least one of INET & INET6 is enabled

It does not build (and serves no purpose) if neither is true (i.e.,
building WITHOUT_INET and WITHOUT_INET6).  Also add an explicit error
in ping to make this case clear.

PR: 260082
Sponsored by: The FreeBSD Foundation

(cherry picked from commit a4ef9e58bc0c07110a54ba0fa88eb118c5377e6f)

OptionalObsoleteFiles: remove ping with INET & INET6 disabled

Reported by: kevans
Fixes: a4ef9e58bc0c ("sbin: build ping if at least one of...")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 0179739a0096c62cb3c9665d68246046255ab849)

2 years agoping: fix parsing of options including '4' and '6'
Alan Somers [Wed, 6 Oct 2021 22:54:59 +0000 (16:54 -0600)]
ping: fix parsing of options including '4' and '6'

ping uses a two-pass option parser.  The first pass determines whether
ipv4 or ipv6 is desired, and the second parses the rest of the options.
But the first pass wrongly detects a '4' or '6' in an option's value as
a request to use ipv6 or ipv6 respectively, for example in an invocation
like "ping -c6 1.2.3.4".

Fix this confusion by including all options in the first round of
parsing, but ignoring those unrelated to ipv4/ipv6 selection.

PR: 258048
Reported by: ghuckriede@blackberry.com
Submitted by: ghuckriede@blackberry.com
MFC after: 2 weeks
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D32344

(cherry picked from commit 9ce201f2ee3ca340032d9cc71d91a36b3b45a4c3)

2 years agoinetd: Use the synopsis from the manual page
Mateusz Piotrowski [Mon, 6 Dec 2021 21:09:32 +0000 (22:09 +0100)]
inetd: Use the synopsis from the manual page

Also, document -s in the usage message.

MFC after: 7 days

(cherry picked from commit 648b9ce80e0a65258213e36bc2437e1b25fe9bde)

2 years agogmultipath.8: Fix a typo
Mateusz Piotrowski [Fri, 10 Dec 2021 13:32:33 +0000 (14:32 +0100)]
gmultipath.8: Fix a typo

It's Word Wide Port Name, not World Word Port Name.

MFC after: 3 days

(cherry picked from commit 58d60030ff24fa818e3e2b0e5551503b7279b8cc)

2 years agokern.pre.mk: allow to use and customize elfdump during kernel build
Konstantin Belousov [Wed, 1 Dec 2021 00:51:01 +0000 (02:51 +0200)]
kern.pre.mk: allow to use and customize elfdump during kernel build

(cherry picked from commit 9b135747a326080f0ffc96ddc3e0d7a4fbc1dfe1)

2 years agokern.pre.mk: trim space at EoL
Konstantin Belousov [Mon, 6 Dec 2021 23:10:12 +0000 (01:10 +0200)]
kern.pre.mk: trim space at EoL

(cherry picked from commit 610173c59380e5ddbad4977c119da47f969f087c)

2 years agortld: extract header validation into new helper check_elf_headers()
Konstantin Belousov [Thu, 11 Nov 2021 17:51:26 +0000 (19:51 +0200)]
rtld: extract header validation into new helper check_elf_headers()

(cherry picked from commit 63fc4e820c86f5dedb80cc31b7918deb284b455e)

2 years agoStyle
Konstantin Belousov [Wed, 8 Dec 2021 19:01:14 +0000 (21:01 +0200)]
Style

(cherry picked from commit c37c6f994fca1474a0e73f437056e5ca6a766b49)

2 years agofcntl(2): be more precise about third arg type
Konstantin Belousov [Mon, 6 Dec 2021 20:14:25 +0000 (22:14 +0200)]
fcntl(2): be more precise about third arg type

(cherry picked from commit 97722455cce4f8398f6411eaaa80d595dcb5fb3c)

2 years agofcntl(2): add F_KINFO operation
Konstantin Belousov [Sun, 5 Dec 2021 18:45:50 +0000 (20:45 +0200)]
fcntl(2): add F_KINFO operation

(cherry picked from commit 794d3e8e63f4a6ebc8926030b6c937109ddc5485)

2 years agoAdd declaration for static export_file_to_kinfo()
Konstantin Belousov [Mon, 6 Dec 2021 17:42:20 +0000 (19:42 +0200)]
Add declaration for static export_file_to_kinfo()

(cherry picked from commit 6e51d61a96c09d7c6785844602d0bb67d30b7f21)

2 years agoRemove FREEBSD-vendor files
Ed Maste [Mon, 6 Dec 2021 21:27:48 +0000 (16:27 -0500)]
Remove FREEBSD-vendor files

These files were intended to track version and perhaps maintainership
information for contrib software.  However, they were never used beyond
bzip2, netcat, and OpenSSH, and generally haven't been kept up to date
recently (my OpenSSH 8.7p1 update notwithstanding).  Just remove them to
avoid having confusing or outdated information.

Suggested by: des
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit bdcfd222ce6369e7aeaceb9a92ffdde84bdbf6cd)

2 years agoCirrus-CI: add a manually triggered arm64 task
Ed Maste [Wed, 23 Jun 2021 19:24:36 +0000 (15:24 -0400)]
Cirrus-CI: add a manually triggered arm64 task

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

(cherry picked from commit 8cba2003e85b49a482ca623945209ca537374229)

2 years agoCI: add arm64 support to ci-qemu-test.sh
Ed Maste [Wed, 23 Jun 2021 19:24:23 +0000 (15:24 -0400)]
CI: add arm64 support to ci-qemu-test.sh

Reviewed by: imp (earlier)
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30907

(cherry picked from commit bba96bb143bb803968036543b76e062445cc9834)

2 years agolibc: Use musl's optimized strchr and strchrnul
Ed Maste [Tue, 2 Mar 2021 01:57:36 +0000 (20:57 -0500)]
libc: Use musl's optimized strchr and strchrnul

Parentheses added to HASZERO macro to avoid a GCC warning, and formatted
with clang-format as we have adopted these and don't consider them
'contrib' code.

Obtained from: musl (snapshot at commit 4d0a82170a25)
Reviewed by: kib (libc integration), mjg (both earlier)
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17630

(cherry picked from commit 7f72497ef756ff7d03d5560c2d1c1f92f73fcb52)

2 years agobxe: tag files to skip clang-format formatting
Ed Maste [Thu, 25 Jun 2020 00:42:10 +0000 (20:42 -0400)]
bxe: tag files to skip clang-format formatting

bxe contains three files which are sets of constants or other data, and
might be auto-generated or have an upstream.  They are rather large
files and clang-format takes quite some time when run against them, so
just skip formatting.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27806

(cherry picked from commit c3295781fd5d58b6de2a2e0360b0b67b94dde1ff)

2 years agolibradius: fix no SSL build
Cy Schubert [Wed, 2 Jun 2021 18:31:00 +0000 (11:31 -0700)]
libradius: fix no SSL build

int alen is only used with SSL.

(cherry picked from commit 48b11217bf7e605e1c386e316cd6e935aceb4927)

libradius: fix WITHOUT_OPENSSL build

int alen is used only with SSL.

Reported by: Michael Dexter, Build Option Survey
MFC after: 3 days
Fixes: 8d5c7813061d ("libradius: Fix input validation bugs")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit a901f2af587f9cb068e2fca6b62f324bdde471d8)

2 years agousr.bin/elfctl: Allow for cross-endian operations.
Marcin Wojtas [Fri, 21 May 2021 09:19:31 +0000 (11:19 +0200)]
usr.bin/elfctl: Allow for cross-endian operations.

Detect if host endian is different than target endian and swap
byte order of ELF note fields instead of failing.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Reviewed by: imp
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D29550

(cherry picked from commit 4a27bf128b108d90412190c06a54ebac36a8ca2e)

2 years agonet tests: fix if_stf:6to4
Kristof Provost [Wed, 10 Nov 2021 11:02:34 +0000 (12:02 +0100)]
net tests: fix if_stf:6to4

This test needs to have the loopback interface enabled, or route lookups
for our own IP addresses will fail.

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33041

(cherry picked from commit 67573b7a39b19e39536a68563fed0d940604e573)

2 years agoif_pflog: fix packet length
Kristof Provost [Thu, 2 Dec 2021 07:22:34 +0000 (08:22 +0100)]
if_pflog: fix packet length

There were two issues with the new pflog packet length.
The first is that the length is expected to be a multiple of
sizeof(long), but we'd assumed it had to be a multiple of
sizeof(uint32_t).

The second is that there's some broken software out there (such as
Wireshark) that makes incorrect assumptions about the amount of padding.
That is, Wireshark assumes there's always three bytes of padding, rather
than however much is needed to get to a multiple of sizeof(long).

Fix this by adding extra padding, and a fake field to maintain
Wireshark's assumption.

Reported by: Ozkan KIRIK <ozkan.kirik@gmail.com>
Tested by: Ozkan KIRIK <ozkan.kirik@gmail.com>
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33236

(cherry picked from commit 6d4baa0d011cb3e78b4b08415568e71c0aab00fe)

2 years agoif_epair: Also mark the flag of pair b with IFF_KNOWSEPOCH
Zhenlei Huang [Wed, 1 Dec 2021 14:54:23 +0000 (15:54 +0100)]
if_epair: Also mark the flag of pair b with IFF_KNOWSEPOCH

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33210

(cherry picked from commit 73d41cc730858aa1fe273c36f3653afd16791091)

2 years agoxhci: Add PCI IDs from recent Intel CPUs.
Alexander Motin [Sat, 27 Nov 2021 01:35:12 +0000 (20:35 -0500)]
xhci: Add PCI IDs from recent Intel CPUs.

MFC after: 2 weeks

(cherry picked from commit 83d7b2f335b4e21e6b63a86864ac5e76f4c8efd3)

2 years agonfscl: Sanity check the Sequence slotid in reply
Rick Macklem [Sat, 27 Nov 2021 23:02:04 +0000 (15:02 -0800)]
nfscl: Sanity check the Sequence slotid in reply

The slotid in the Sequence reply must be the same as
in the request.  Check that it is the same and log
a console message if it is not, plus set it to the
correct value.

PR: 260071

(cherry picked from commit 1c15c8c0e935f3f7def7b03e9546f7d6790f465e)

2 years agonfsd: Sanity check the len argument for ListXattr
Rick Macklem [Fri, 26 Nov 2021 23:56:29 +0000 (15:56 -0800)]
nfsd: Sanity check the len argument for ListXattr

The check for the original len being >= retlen needs to
be done before the "if (nd->nd_repstat == 0)" code, so
that it can be reported as too small.

PR: 260046

(cherry picked from commit 5b430a132330bd4a4ea37780807947f3800d009e)

2 years agoEC2: Turn off IPv6 DAD
Colin Percival [Tue, 23 Nov 2021 04:16:34 +0000 (20:16 -0800)]
EC2: Turn off IPv6 DAD

Disable Duplicate Address Detection in EC2 instances.  The networking
configuration in EC2, with IPv6 addresses assigned by DHCPv6 and
host egress filtering, makes "duplicate addresses" impossible.

This speeds up the boot process in EC2 by 2 seconds.

Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D33091

(cherry picked from commit 81075203a057c9ba3467a7f90ea1e9469d7f7723)

2 years agoMove _p.a profiling archives under MK_INSTALLLIB
Ed Maste [Thu, 2 Dec 2021 15:27:12 +0000 (10:27 -0500)]
Move _p.a profiling archives under MK_INSTALLLIB

_p.a are just a special case of .a archives, and should not be installed
if WITHOUT_INSTALLLIB is set.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit fc073e6743a989c9d0b8f619ce0f903271c0db2e)

2 years agostyle.mdoc: Prefer Ql to Dq Li for literal display
Mateusz Piotrowski [Thu, 2 Dec 2021 11:39:45 +0000 (12:39 +0100)]
style.mdoc: Prefer Ql to Dq Li for literal display

The Li macros has been deprecated by mdoc some time ago. Recommend the
use of Ql instead.

Reviewed by: debdrup
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33232

(cherry picked from commit 5e077e08ef87126765b5a818def6cb99314ab192)

2 years agoApply fix for clang crashing on invalid -Wa,-march= values
Dimitry Andric [Sun, 5 Dec 2021 17:54:13 +0000 (18:54 +0100)]
Apply fix for clang crashing on invalid -Wa,-march= values

Merge commit df08b2fe8b35 from llvm git (by Dimitry Andric):

  [AArch64] Avoid crashing on invalid -Wa,-march= values

  As reported in https://bugs.freebsd.org/260078, the gnutls Makefiles
  pass -Wa,-march=all to compile a number of assembly files. Clang does
  not support this -march value, but because of a mistake in handling
  the arguments, an unitialized Arg pointer is dereferenced, which can
  cause a segfault.

  Work around this by adding a check if the local WaMArch variable is
  initialized, and if so, using its value in the diagnostic message.

  Reviewed By: tschuett

  Differential Revision: https://reviews.llvm.org/D114677

PR: 260078
Reported by: bz
MFC after: 3 days

(cherry picked from commit a9cd5c30d64e213c537c76c2a261f7a222f348bf)

2 years agoRemove references to sio(4) from NOTES
Mitchell Horne [Mon, 6 Dec 2021 19:14:43 +0000 (15:14 -0400)]
Remove references to sio(4) from NOTES

Also zs(4) and sab(4), which have similarly been removed.

Reviewed by: imp, jhb, emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D33279

(cherry picked from commit 339ef8277350884079d7b8c46f21b5bdb63afac0)

2 years agoucom: s/sio/ucom/
Mitchell Horne [Mon, 6 Dec 2021 14:09:54 +0000 (10:09 -0400)]
ucom: s/sio/ucom/

Seems like a copy-paste error, or at least this made more sense when the
sio(4) driver still existed. This modifies the debug port name displayed
at boot, but otherwise has no functional change.

Reviewed by: hselasky
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D33278

(cherry picked from commit e43d081f352c97c0cd1c2395f3780601cec09abf)

2 years agox86: remove unused T_USER flag
Mitchell Horne [Sun, 5 Dec 2021 15:11:55 +0000 (11:11 -0400)]
x86: remove unused T_USER flag

It stopped being used in 3c256f5395aa, when trap() was reorganized to
have separate switch statements for user and kernel traps. Remove the
two leftover references and the flag itself.

Reviewed by: kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D33253

(cherry picked from commit 03b3d7bbec99742910e2d0d5e7c23754eca9b2c4)

2 years agokernel: partially revert e9efb1125a15, default inet mask
Mike Karels [Wed, 10 Nov 2021 21:35:33 +0000 (15:35 -0600)]
kernel: partially revert e9efb1125a15, default inet mask

When no mask is supplied to the ioctl adding an Internet interface
address, revert to using the historical class mask rather than a
single default.  Similarly for the NFS bootp code.

(cherry picked from commit 2f35e7d9fa03f27543f347cd6277af5bfc6a7e95)

2 years agosystat: clean up code assuming network classes
Mike Karels [Thu, 28 Oct 2021 23:39:43 +0000 (18:39 -0500)]
systat: clean up code assuming network classes

Similar to netstat, clean up code that uses inet_lnaof() to check for
binding to "host 0" (lowest host on network) as a "network" bind.
Such things don't happen, and current networks are seldom if ever
found in /etc/networks.

(cherry picked from commit a2e7dfca86497e535039a42cfc44cfc48209abf5)

2 years agosockstat: change check for wildcard sockets to avoid historical classes
Mike Karels [Wed, 27 Oct 2021 03:12:24 +0000 (22:12 -0500)]
sockstat: change check for wildcard sockets to avoid historical classes

sockstat was checking whether a bound address was "host 0", the lowest
host on a network, using inet_lnaof().  This only works for class A/B/C.
However, it isn't useful to bind such an address unless it is really
the unspecified address INADDR_ANY.  Change the check to to use that.

(cherry picked from commit 64acb29b7d9699c301a55a5431d94374391e4f30)

2 years agonetstat: reduce use of historical Internet classes
Mike Karels [Wed, 27 Oct 2021 03:39:10 +0000 (22:39 -0500)]
netstat: reduce use of historical Internet classes

When attempting to characterize bound addresses, netstat was checking
for host 0 on a (historical) net using inet_lnaof().  Such addresses
are not normally bound, as they would not work, with the exception
of the unspecified address, INADDR_ANY.  Check for that explicitly.
Similarly, don't check bound addresses for a match to a network name.

(cherry picked from commit bd27c71c4573e14916ccd27e545a69606f0a8192)

2 years agomountd: deprecate exports to a network without mask
Mike Karels [Wed, 27 Oct 2021 03:48:23 +0000 (22:48 -0500)]
mountd: deprecate exports to a network without mask

The exports file format allows export to a network using an explicit
mask or prefix length (CIDR).  It also allows a network with just
a dotted address, in which case the historical mask was used.
Deprecate this usage, and warn when it is used.  Document that this
is deprecated.

(cherry picked from commit 92aebdeaff57091c77398912accb4c758c6a0fcb)

2 years agores_init: remove unused inet_makeaddr with IN_LOOPBACKNET
Mike Karels [Wed, 27 Oct 2021 03:33:36 +0000 (22:33 -0500)]
res_init: remove unused inet_makeaddr with IN_LOOPBACKNET

Remove code that is ifdefed out on USELOOPBACK, which uses historical
class.  No functional change intended.

(cherry picked from commit 0bf7f99b2a1f50fa68e167269a633b4b5451fa35)

2 years agoman pages: deprecate Internet Class A/B/C
Mike Karels [Wed, 27 Oct 2021 03:25:09 +0000 (22:25 -0500)]
man pages: deprecate Internet Class A/B/C

Mark functions inet_netof(), inet_lnaof(), and inet_makeaddr() as
deprecated, as they assume Class A/B/C.  inet_makeaddr() mostly works
when networks are a multiple of 8 bits, but warn for anything other
than historical classes.  Reduce other mentions of network classes.

(cherry picked from commit 12bd931d8c64ad2d5e78c7ab917efbff326152ca)

2 years agoifconfig: warn if setting an Internet address without mask
Mike Karels [Thu, 28 Oct 2021 14:32:31 +0000 (09:32 -0500)]
ifconfig: warn if setting an Internet address without mask

Add a postproc function for af_inet, and add interface flags as a
parameter.  Check there if setting an address without a mask unless
the interface is loopback or point-to-point, where mask is not really
meaningful; warn if so.  This will hopefully be an error in the future.

(cherry picked from commit d8237b95552807e937fc389c7e2237679ef0c984)

2 years agokernel: deprecate Internet Class A/B/C
Mike Karels [Wed, 27 Oct 2021 03:01:09 +0000 (22:01 -0500)]
kernel: deprecate Internet Class A/B/C

Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is defined;
define it for user level.  Define IN_MULTICAST separately from IN_CLASSD,
and use it in pf instead of IN_CLASSD.  Stop using class for setting
default masks when not specified; instead, define new default mask
(24 bits).  Warn when an Internet address is set without a mask.

(cherry picked from commit 20d59403961d531467cfab22163f49c131cc8b55)

2 years agoiflib_stop: drain rx tasks to prevent any data races
Andriy Gapon [Fri, 19 Nov 2021 07:56:30 +0000 (09:56 +0200)]
iflib_stop: drain rx tasks to prevent any data races

iflib_stop modifies iflib data structures that are used by _task_fn_rx,
most prominently the free lists.  So, iflib_stop has to ensure that the
rx task threads are not active.

This should help to fix a crash seen when iflib_if_ioctl (e.g.,
SIOCSIFCAP) is called while there is already traffic flowing.

The crash has been seen on VMWare guests with vmxnet3 driver.

My guess is that on physical hardware the couple of 1ms delays that
iflib_stop has after disabling interrupts are enough for the queued work
to be completed before any iflib state is touched.

But on busy hypervisors the guests might not get enough CPU time to
complete the work, thus there can be a race between the taskqueue
threads and the work done to handle an ioctl, specifically in iflib_stop
and iflib_init_locked.

PR: 259458

(cherry picked from commit 1bfdb812c786ac2607a82633f9c84a5d16f54079)

2 years agotwsi: unify error handling, explicitly handle more conditions
Andriy Gapon [Fri, 26 Nov 2021 07:44:30 +0000 (09:44 +0200)]
twsi: unify error handling, explicitly handle more conditions

twsi_error() is a new function that stops the current transfer and sets
up softc when an error condition is detected.
TWSI_STATUS_DATA_WR_NACK, TWSI_STATUS_BUS_ERROR and
TWSI_STATUS_ARBITRATION_LOST are now handled explicitly rather than
via the catch-all unknown status.

Also, twsi_intr() now calls wakeup() in a single place when the
transfer is finished.

(cherry picked from commit a4fe8922085dfc1e5e6a6bac73ccc738e373165f)

2 years agotwsi: improve a handful of debug messages
Andriy Gapon [Fri, 26 Nov 2021 07:34:28 +0000 (09:34 +0200)]
twsi: improve a handful of debug messages

- use 0x prefix for hex values
- print indexes and counts as decimals
- break too long lines

(cherry picked from commit 578707ed4efda4ec1c91ab1a8f1bace6b1eb714a)

2 years agotwsi: do not attempt transfer if bus is not idle
Andriy Gapon [Fri, 26 Nov 2021 07:30:38 +0000 (09:30 +0200)]
twsi: do not attempt transfer if bus is not idle

(cherry picked from commit cb167e1ae95473d836393a07456d8dbcfbb7f758)

2 years agotwsi: remove redundant enabling of the controller
Andriy Gapon [Fri, 26 Nov 2021 07:28:18 +0000 (09:28 +0200)]
twsi: remove redundant enabling of the controller

(cherry picked from commit bc02583c4dd65275da89838a723bd3514cb316cf)

2 years agotwsi: protect interaction between twsi_transfer and twsi_intr
Andriy Gapon [Fri, 26 Nov 2021 07:25:01 +0000 (09:25 +0200)]
twsi: protect interaction between twsi_transfer and twsi_intr

All accesses to softc are now done under a mutex to prevent data races
between the open context and the interrupt handler.
Additionally, the wait time in twsi_transfer is bounded now.
Previously we could get stuck there forever if an interrupt got lost.

(cherry picked from commit 69cfa60ddd4df814b507699f9bb7253ece054f40)

2 years agoHyper-V: hn: Enter network epoch when required
Michael Tuexen [Thu, 26 Aug 2021 17:27:04 +0000 (19:27 +0200)]
Hyper-V: hn: Enter network epoch when required

PR: 254695
(cherry picked from commit 26d79d40a74fc804c76acd88a1f8f10f9827a2b3)

2 years agotcpdrop: tweak comments
Michael Tuexen [Sat, 4 Dec 2021 14:08:01 +0000 (15:08 +0100)]
tcpdrop: tweak comments

Sponsored by: Netflix, Inc.

(cherry picked from commit c2b53b107e0ee1da69921df106a37fffa44bebc5)

2 years agotcpdrop: explicitly choose TCP as the transport protocol
Michael Tuexen [Sat, 4 Dec 2021 14:03:29 +0000 (15:03 +0100)]
tcpdrop: explicitly choose TCP as the transport protocol

Sponsored by: Netflix, Inc.

(cherry picked from commit 8ea363c8c648fd6b9c353bd37551ebb9d25cdd83)

2 years agotcpdrop: allow TCP connections to be filtered by cc-algo
Michael Tuexen [Sat, 4 Dec 2021 14:00:05 +0000 (15:00 +0100)]
tcpdrop: allow TCP connections to be filtered by cc-algo

In addition to filtering by stack and state, allow filtering
by the congestion control module used.  Choose the command line
options to be consistent with the ones of sockstat.

Sponsored by: Netflix, Inc.

(cherry picked from commit 31537ea583c0965fe22498d52831ced4b4f4fc5e)

2 years agotcpdrop: update man page, since the fastack stack has been removed
Michael Tuexen [Sat, 4 Dec 2021 13:27:46 +0000 (14:27 +0100)]
tcpdrop: update man page, since the fastack stack has been removed

Sponsored by: Netflix, Inc.

(cherry picked from commit 7ef45bd3cfa490b0e7b4503ea121d2b2d809cf3a)

2 years agotcpdrop: use a better name of a variable.
Michael Tuexen [Sat, 4 Dec 2021 12:46:43 +0000 (13:46 +0100)]
tcpdrop: use a better name of a variable.

No functional change intended.

Sponsored by: Netflix, Inc.

(cherry picked from commit 300914a0ffb8b18ace16e6d40fc41270e6039b2e)