]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agovfs_mountroot: Check for root dev before waiting
Colin Percival [Mon, 20 Dec 2021 17:55:36 +0000 (09:55 -0800)]
vfs_mountroot: Check for root dev before waiting

If GEOM is idle but the root device is not yet present when we enter
vfs_mountroot_wait_if_necessary, we call vfs_mountroot_wait to wait
for root holds (e.g. CAM or USB initialization).  Upon returning from
vfs_mountroot_wait, we wait 100 ms at a time until the root device
shows up.

Since the root device most likely appeared during vfs_mountroot_wait
-- waiting for subsystems which may be responsible for the root
device is the whole purpose of that function -- it makes sense to
check if the device is now present rather than printing a warning
and pausing for 100 ms before checking.

Reviewed by: trasz
Fixes: a3ba3d09c248 Make root mount wait mechanism smarter
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D33593

2 years agovfs_mountroot: Wait for GEOM idle post root holds
Colin Percival [Mon, 20 Dec 2021 17:51:34 +0000 (09:51 -0800)]
vfs_mountroot: Wait for GEOM idle post root holds

In the case of a root hold related to the initialization of a disk
device, a flurry of GEOM tasting is likely to take place as soon as
the device is initialized and the root hold is released.  If we
don't wait for GEOM idle it's easy for vfs_mountroot to "win" the
race and proceed before the root filesystem GEOM is ready.

Reviewed by: imp
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D33592

2 years agovfs_mountroot: Skip 'Root mount waiting' < 1 s
Colin Percival [Mon, 20 Dec 2021 15:17:25 +0000 (07:17 -0800)]
vfs_mountroot: Skip 'Root mount waiting' < 1 s

While the message is technically correct, it's not particularly
helpful in the case where we're only waiting a few ms; this case
occurs frequently on EC2 arm64 instances with CAM initialization
racing to release its root hold before vfs_mountroot reaches this
point.  Only print the message if we end up waiting for more than
one second.

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

2 years agoreadelf: add Go Build ID ELF note support
Ed Maste [Fri, 10 Dec 2021 20:11:45 +0000 (15:11 -0500)]
readelf: add Go Build ID ELF note support

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

2 years agoar: deprecate -T option
Ed Maste [Wed, 29 Dec 2021 19:59:06 +0000 (14:59 -0500)]
ar: deprecate -T option

Other ar implementations (GNU, LLVM) use -T to mean thin archive
rather than use only the first fifteen characters of the archive member
name.  We support both -T and -f for this, with -f documented as an
alias of -T.

An exp-run showed that the ports invoking `ar -T` expect thin archives,
not truncated names.  Switch -f to be the documented flag for this
behaviour, and emit a warning when -T is used.

The warning will be changed to an error in the future (in main), once
ports no longer use -T.

PR: 260523 [exp-run]
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agoMove libc++ from /usr/lib to /lib
Ed Maste [Wed, 29 Dec 2021 19:50:03 +0000 (14:50 -0500)]
Move libc++ from /usr/lib to /lib

As with other runtime components like libc or libcxxrt.

If desired we can stop linking devd statically after this change (to
achive approximately no net change in required root filesystem size).

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

2 years agovm_phys: hide vm_phys_set_pool
Doug Moore [Wed, 29 Dec 2021 17:10:31 +0000 (11:10 -0600)]
vm_phys: hide vm_phys_set_pool

It is only called in the file that defines it, so make it static and
remove the declaration from the header.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D33688

2 years agobhyve: passthru: enable BARs before possibly mmap(2)ing them
Bjoern A. Zeeb [Thu, 23 Dec 2021 14:59:49 +0000 (14:59 +0000)]
bhyve: passthru: enable BARs before possibly mmap(2)ing them

The first time we start bhyve with a passthru device everything is fine
as on boot we do enable BARs.  If a driver (unload) inside bhyve disables
the BAR(s) as some Linux drivers do, we need to make sure we re-enable
them on next bhyve start.

If we are trying to mmap a disabled BAR for MSI-X (PCIOCBARMMAP)
the kernel will give us an EBUSY.
While we were re-enabling the BAR(s) in the current code loop
cfginit() was writing the changes out too late to the real hardware.

Move the call to init_msix_table() after the register on the real
hardware was updated.  That way the kernel will be happy and the
mmap will succeed and bhyve will start.
Also simplify the code given the last argument to init_msix_table()
is unused we do not need to do checks for each bar. [1]

MFC after: 3 days
PR: 260148
Pointed out by: markj [1]
Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D33628

2 years agoigc: Remove redundant IFCAP_VLAN_HWTAGGING check
Kevin Bowling [Wed, 29 Dec 2021 16:37:34 +0000 (09:37 -0700)]
igc: Remove redundant IFCAP_VLAN_HWTAGGING check

Match igb(4) as in f7926a6d0c10. From Vincenzo, this check is redundant
to setup providing us an IGC_RXD_STAT_VP bit and would make for an
unexpected condition if IFCAP_VLAN_HWTAGGING were not set but the tag
was stripped, which would be passed up the stack breaking isolation.

PR: 260068
Approved by: vmaffione
MFC after: 1 month

2 years agoMove fork_rfppwait() check into ast()
Edward Tomasz Napierala [Sun, 26 Dec 2021 17:22:16 +0000 (17:22 +0000)]
Move fork_rfppwait() check into ast()

This will always sleep at least once, so it's a slow path by definition.

Reviewed By: kib
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D33387

2 years agoLet powerpc64le live as not experimental architecture.
Piotr Kubaj [Tue, 21 Dec 2021 23:10:09 +0000 (00:10 +0100)]
Let powerpc64le live as not experimental architecture.

Summary: It's currently just as stable as powerpc64, with more ports working.

Reviewers: alfredo, bdragon, luporl, jhibbits, #manpages

Subscribers: imp

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

2 years agoAdd the missing terminator to the bcm_xhci methods
Andrew Turner [Wed, 29 Dec 2021 12:18:10 +0000 (12:18 +0000)]
Add the missing terminator to the bcm_xhci methods

Sponsored by: The FreeBSD Foundation

2 years agoocs_fc: Updated man page date.
Ram Kishore Vegesna [Wed, 29 Dec 2021 10:45:13 +0000 (16:15 +0530)]
ocs_fc: Updated man page date.

MFC after: 3 days

2 years agoocs_fc: Add lancer G7 to the supported hardware in the man page.
Ram Kishore Vegesna [Fri, 24 Dec 2021 07:24:27 +0000 (12:54 +0530)]
ocs_fc: Add lancer G7 to the supported hardware in the man page.

Reviewed by: mav
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D33668

2 years agombuf_tags: use explicitly sized type for 'type' parameter
Roger Pau Monné [Tue, 28 Dec 2021 08:13:57 +0000 (09:13 +0100)]
mbuf_tags: use explicitly sized type for 'type' parameter

Functions manipulating mbuf tags are using an int type for passing the
'type' parameter, but the internal tag storage is using a 16bit
integer to store it. This leads to the following code:

t = m_tag_alloc(...,0xffffffff,...,...);
m_tag_prepend(m, t);
r = m_tag_locate(m ,...,0xffffffff, NULL);

Returning r == NULL because m_tag_locate doesn't truncate the type
parameter when doing the match. This is unexpected because the type of
the 'type' parameter is int, and the caller doesn't need to know about
the internal truncations.

Fix this by making the 'type' parameter of type uint16_t in order to
match the size of its internal storage and make it obvious to the
caller the actual size of the parameter.

While there also use uint uniformly replacing the existing u_int
instances.

Reviewed by: kp, donner, glebius
Differential revision: https://reviews.freebsd.org/D33680

2 years agocxgbe(4): Fix panic on driver detach after a partially failed attach.
Navdeep Parhar [Wed, 29 Dec 2021 00:46:09 +0000 (16:46 -0800)]
cxgbe(4): Fix panic on driver detach after a partially failed attach.

sge->ctrlq is not always allocated during attach (eg. if firmware
initialization fails) and detach should be able to deal with this.

MFC after: 1 week
Sponsored by: Chelsio Communications

2 years agoiscsid: Always free the duplicated address in resolve_addr().
John Baldwin [Wed, 29 Dec 2021 00:40:04 +0000 (16:40 -0800)]
iscsid: Always free the duplicated address in resolve_addr().

If a "raw" IPv6 address (denoted by a leading '[') is used as a target
address, then 'arg' is incremented by one to skip over the '['.
However, this meant that at the end of the function the wrong address
was passed to free().  With malloc junking enabled and given suitably
small strings, malloc() would happily overwrite the correct number of
bytes with junk, but off by one byte overwriting the byte after the
allocation.

This manifested as the first byte of the 'HeaderDigest' key being
overwritten causing the key name on the wire to be sent as
'\x5eaderDigest' which the target rejected.

Reported by: Jithesh Arakkan @ Chelsio
Found with: ASAN (via WITH_ASAN=yes)
Sponsored by: Chelsio Communications

2 years agoClarify the description of the EINTEGRITY error in intro(2).
Kirk McKusick [Wed, 29 Dec 2021 00:38:43 +0000 (16:38 -0800)]
Clarify the description of the EINTEGRITY error in intro(2).

Requested by: pauamma_gundo.com
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18765

2 years agoarm64: Simplify pmap_ts_referenced
Alan Cox [Tue, 28 Dec 2021 00:27:52 +0000 (18:27 -0600)]
arm64: Simplify pmap_ts_referenced

Use pmap_pte_exists() in place of multiple KASSERT()s.

Eliminate an unnecessary NULL check.

MFC after: 1 week

2 years agoarm64: Enhance pmap_pte_exists()'s error reporting
Alan Cox [Tue, 28 Dec 2021 23:17:42 +0000 (17:17 -0600)]
arm64: Enhance pmap_pte_exists()'s error reporting

Report the descriptor type and level at which the page table does not
match the caller's expectations.

MFC after: 1 week

2 years agox86: Do not attempt to calibrate the LAPIC timer if no APIC is present
Mark Johnston [Tue, 28 Dec 2021 22:44:57 +0000 (17:44 -0500)]
x86: Do not attempt to calibrate the LAPIC timer if no APIC is present

Reported and tested by: Michael Butler <imb@protected-networks.net>
Reviewed by: jhb, kib
Fixes: 62d09b46ad75 ("x86: Defer LAPIC calibration until after timecounters are available")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33669

2 years agox86: Check for APIC presence only if DEV_ATPIC is defined
Mark Johnston [Tue, 28 Dec 2021 22:42:12 +0000 (17:42 -0500)]
x86: Check for APIC presence only if DEV_ATPIC is defined

We only attempt to gracefully handle absence of an APIC if "device
atpic" is defined in the kernel configuration.

Suggested by: kib
Reviewed by: jhb, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agoSimplify swi for bus_dma.
John Baldwin [Tue, 28 Dec 2021 21:51:25 +0000 (13:51 -0800)]
Simplify swi for bus_dma.

When a DMA request using bounce pages completes, a swi is triggered to
schedule pending DMA requests using the just-freed bounce pages.  For
a long time this bus_dma swi has been tied to a "virtual memory" swi
(swi_vm).  However, all of the swi_vm implementations are the same and
consist of checking a flag (busdma_swi_pending) which is always true
and if set calling busdma_swi.  I suspect this dates back to the
pre-SMPng days and that the intention was for swi_vm to serve as a
mux.  However, in the current scheme there's no need for the mux.

Instead, remove swi_vm and vm_ih.  Each bus_dma implementation that
uses bounce pages is responsible for creating its own swi (busdma_ih)
which it now schedules directly.  This swi invokes busdma_swi directly
removing the need for busdma_swi_pending.

One consequence is that the swi now works on RISC-V which had previously
failed to invoke busdma_swi from swi_vm.

Reviewed by: imp, kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D33447

2 years agosys/xdr: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:43:26 +0000 (09:43 -0800)]
sys/xdr: Use C99 fixed-width integer types.

No functional change.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D33642

2 years agosys/vm: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:43:21 +0000 (09:43 -0800)]
sys/vm: Use C99 fixed-width integer types.

No functional change.

Reviewed by: imp, kib, emaste
Differential Revision: https://reviews.freebsd.org/D33641

2 years agosys/rpc: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:43:15 +0000 (09:43 -0800)]
sys/rpc: Use C99 fixed-width integer types.

No functional change.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D33640

2 years agosys/ofed: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:43:09 +0000 (09:43 -0800)]
sys/ofed: Use C99 fixed-width integer types.

No functional change.

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

2 years agosys/nlm: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:42:42 +0000 (09:42 -0800)]
sys/nlm: Use C99 fixed-width integer types.

No functional change.

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

2 years agosys/libkern: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:42:11 +0000 (09:42 -0800)]
sys/libkern: Use C99 fixed-width integer types.

No functional change.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D33637

2 years agosys/isa: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:41:57 +0000 (09:41 -0800)]
sys/isa: Use C99 fixed-width integer types.

No functional change.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D33636

2 years agosys/geom: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:41:51 +0000 (09:41 -0800)]
sys/geom: Use C99 fixed-width integer types.

No functional change.

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

2 years agosys/ddb: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:41:47 +0000 (09:41 -0800)]
sys/ddb: Use C99 fixed-width integer types.

No functional change.

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

2 years agosys/crypto: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:41:38 +0000 (09:41 -0800)]
sys/crypto: Use C99 fixed-width integer types.

No functional change.

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

2 years agosys/compat: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:41:33 +0000 (09:41 -0800)]
sys/compat: Use C99 fixed-width integer types.

No functional change.

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

2 years agodtrace: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:41:25 +0000 (09:41 -0800)]
dtrace: Use C99 fixed-width integer types.

No functional change.

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

2 years agosys/kern: Use C99 fixed-width integer types.
John Baldwin [Tue, 28 Dec 2021 17:41:08 +0000 (09:41 -0800)]
sys/kern: Use C99 fixed-width integer types.

No functional change.

Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D33630

2 years agotcp_usr_shutdown: don't cast inp_ppcb to tcpcb before checking inp_flags
Gleb Smirnoff [Tue, 28 Dec 2021 16:50:02 +0000 (08:50 -0800)]
tcp_usr_shutdown: don't cast inp_ppcb to tcpcb before checking inp_flags

While here move out one more erroneous condition out of the epoch and
common return.  The only functional change is that if we send control
on a shut down socket we would get EINVAL instead of ECONNRESET.

Reviewed by: tuexen
Reported by: syzbot+8388cf7f401a7b6bece6@syzkaller.appspotmail.com
Fixes: f64dc2ab5be38e5366271ef85ea90d8cb1c7841a

2 years agonet: iflib: fix vlan processing in the drivers
Vincenzo Maffione [Tue, 28 Dec 2021 11:05:31 +0000 (11:05 +0000)]
net: iflib: fix vlan processing in the drivers

The logic that sets iri_vtag and M_VLANTAG does not handle the
case where the 802.11q VLAN tag is 0. Fix this issue across
the iflib drivers. While there, also improve and align the
VLAN tag check extraction, by moving it outside the RX descriptor
loop, eliminating a local variable and additional checks.

PR:             260068
Reviewed by:    kbowling, gallatin
Reported by: erj
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D33156

2 years agonet: iflib: let the drivers use isc_capenable
Vincenzo Maffione [Tue, 28 Dec 2021 11:00:32 +0000 (11:00 +0000)]
net: iflib: let the drivers use isc_capenable

Since isc_capenable (private copy of ifp->if_capenable) is
now synchronized to if_capenable, use it in the drivers
when checking the IFCAP_* bits.
This results in better cache usage and avoids indirection
through the ifp pointer.

PR:             260068
Reviewed by:    kbowling, gallatin
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D33156

2 years agonet: iflib: sync isc_capenable to if_capenable
Vincenzo Maffione [Tue, 28 Dec 2021 10:47:13 +0000 (10:47 +0000)]
net: iflib: sync isc_capenable to if_capenable

On SIOCSIFCAP, some bits in ifp->if_capenable may be toggled.
When this happens, apply the same change to isc_capenable, which
is the iflib private copy of if_capenable (for a subset of the
IFCAP_* bits). In this way the iflib drivers can check the bits
using isc_capenable rather than if_capenable. This is convenient
because the latter access requires an additional indirection
through the ifp, and it is also less likely to be in cache.

PR: 260068
Reviewed by: kbowling, gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33156

2 years agosctp: minor improvements in sctp_get_frag_point
Michael Tuexen [Tue, 28 Dec 2021 09:23:31 +0000 (10:23 +0100)]
sctp: minor improvements in sctp_get_frag_point
MFC after: 3 days

2 years agosctp: check that the computed frag point is a multiple of 4
Michael Tuexen [Tue, 28 Dec 2021 08:40:52 +0000 (09:40 +0100)]
sctp: check that the computed frag point is a multiple of 4

Reported by: syzbot+5da189fc1fe80b31f5bd@syzkaller.appspotmail.com
MFC after: 3 days

2 years agoipq4018_usb_phy: remove old debugging routine
Adrian Chadd [Tue, 28 Dec 2021 02:33:06 +0000 (18:33 -0800)]
ipq4018_usb_phy: remove old debugging routine

This isn't needed anymore, I know that these work!

2 years agoqcom_dwc3: add initial Qualcomm SoC DWC3 controller glue
Adrian Chadd [Tue, 28 Dec 2021 02:25:32 +0000 (18:25 -0800)]
qcom_dwc3: add initial Qualcomm SoC DWC3 controller glue

This adds some very simple DWC3 glue for the IPQ4018/IPQ4019.
Other chipsets introduce reset line iteration, some further
clock line iteration and some customisations; I'll look at adding
those later.

This is enough to finally bring up USB 3.0 on my IPQ4018 ASUS
RT-58U router.

2 years agoipq4018_usb_phy: add USB 2.0 and 3.0 PHY support
Adrian Chadd [Tue, 28 Dec 2021 02:21:36 +0000 (18:21 -0800)]
ipq4018_usb_phy: add USB 2.0 and 3.0 PHY support

This adds the USB 2.0 and 3.0 PHY support for the IPQ4018/IPQ4019.

All it really needs to do is gate the relevant clocks on/off in the
right order with the right delays.

2 years agoGEOM: Minor polishing in geom_event.
Alexander Motin [Tue, 28 Dec 2021 01:52:59 +0000 (20:52 -0500)]
GEOM: Minor polishing in geom_event.

 - Remove timeouts from msleep()'s.  Those should always be woken up.
 - Move wakeup() under the lock to not call on possibly freed pointer.
 - Remove some dead code.

MFC after: 2 weeks

2 years agoFix pmap_is_prefaultable() on arm64 and riscv
Alan Cox [Sat, 25 Dec 2021 03:54:01 +0000 (21:54 -0600)]
Fix pmap_is_prefaultable() on arm64 and riscv

The current implementations never correctly return TRUE. In all cases,
when they currently return TRUE, they should have returned FALSE.  And,
in some cases, when they currently return FALSE, they should have
returned TRUE.  Except for its effects on performance, specifically,
additional page faults and pointless calls to pmap_enter_quick() that
abort, this error is harmless.  That is why it has gone unnoticed.

Add a comment to the amd64, arm64, and riscv implementations
describing how their return values are computed.

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

2 years agoitimers: strip unused bits from struct itimer and struct itimers
Konstantin Belousov [Mon, 27 Dec 2021 18:29:22 +0000 (20:29 +0200)]
itimers: strip unused bits from struct itimer and struct itimers

Reviewed by: imp, markj, mav
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33670

2 years agoitimers_alloc: no need to initialize its_timers array
Konstantin Belousov [Mon, 27 Dec 2021 18:32:01 +0000 (20:32 +0200)]
itimers_alloc: no need to initialize its_timers array

struct itimers is allocated with M_ZERO, setting all members to NULL
is tautological.

Reviewed by: imp, markj, mav
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33670

2 years agotcp_usr_shutdown: don't cast inp_ppcb to tcpcb before checking inp_flags
Gleb Smirnoff [Tue, 28 Dec 2021 00:58:09 +0000 (16:58 -0800)]
tcp_usr_shutdown: don't cast inp_ppcb to tcpcb before checking inp_flags

Fixes: f64dc2ab5be38e5366271ef85ea90d8cb1c7841a

2 years agoqcom_tcsr: add initial top control and status register (TCSR) support
Adrian Chadd [Mon, 27 Dec 2021 23:45:40 +0000 (15:45 -0800)]
qcom_tcsr: add initial top control and status register (TCSR) support

The Qualcomm TCSR is some top level glue between multiple IP blocks,
both for doing configuration of said IP blocks, some IPC between
them (mostly between multiple execution environments - eg trustzone
and non-TZ), and interrupt status bits for them.

However, for the IPQ4018/IPQ4019, it only is used as a small subset
of IP block configuration.  As for what it actually gets used as
for other Qualcomm chipsets?  Well, that'll have to wait.

It's a bit of a mess in linux and openwrt.  See, every different
SoC support branch ends up with some different TCSR code for it.

So instead, I'm going to land a single TCSR driver that I'm going
to use for the IPQ4018/IPQ4019.  When I add the next chipset, I'll
figure out how to organise things so there's a single TCSR driver
that works for multiple platforms.

2 years agoqcom_qup: add initial v1/v2 QUP SPI driver
Adrian Chadd [Mon, 27 Dec 2021 23:27:29 +0000 (15:27 -0800)]
qcom_qup: add initial v1/v2 QUP SPI driver

The Qualcomm Universal Peripherals Engine (QUP) is a unified SPI and I2C
peripheral that ships with a variety of Qualcomm SoCs.

It supports three transfer modes - single PIO, block PIO and DMA.

This driver only supports the single PIO mode, which is enough to
bootstrap the rest of the SPI NAND/NOR support and means I can do
things like read the Wifi calibration data from NOR.  It has some
hardware support code for the other transfer modes as well as
some support for split transfers (ie, transfers with no read or
write phase), but I haven't yet implemented those.

This driver is based on four sources - the linux driver, the u-boot
driver, some initial work done for APQ8064 by mmel@, and the APQ8064
Technical Reference Manual which is surprisingly free and open to
read.  The linux and u-boot drivers approach a variety of things
completely differently, from how PIO is done, the hardware support
for re-ordering bytes in a transfer word and how the CS lines
are used.

Tested:

* IPQ4018, SPI to NAND/NOR flash, PIO only

2 years agosctp: cleanup the SCTP_MAXSEG socket option.
Michael Tuexen [Mon, 27 Dec 2021 22:40:31 +0000 (23:40 +0100)]
sctp: cleanup the SCTP_MAXSEG socket option.

This patch makes the handling of the SCTP_MAXSEG socket option
compliant with RFC 6458 (SCTP socket API) and fixes an issue
found by syzkaller.

Reported by: syzbot+a2791b89ab99121e3333@syzkaller.appspotmail.com
MFC after: 3 days

2 years agoqca: add cpufreq into the build
Adrian Chadd [Mon, 27 Dec 2021 21:13:38 +0000 (13:13 -0800)]
qca: add cpufreq into the build

Now that the clock drivers are in the tree, the cpufreq driver will
"just work".

Tested:

* IPQ4018, testing performance of dd from /dev/zero->/dev/null at
  each frequency step.

2 years agoAdd support for qualcomm clock nodes the the IPQ4018/IPQ4019 clock tree.
Adrian Chadd [Sun, 26 Dec 2021 17:08:57 +0000 (09:08 -0800)]
Add support for qualcomm clock nodes the the IPQ4018/IPQ4019 clock tree.

Summary: I've tested this with cpufreq_dt, SPI and USB.  They all seem to work fine.

Test Plan: * IPQ4018, boot

Subscribers: imp, andrew

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

2 years agoqcom_clk: add the qualcomm clock nodes for the IPQ4018
Adrian Chadd [Sun, 26 Dec 2021 17:07:21 +0000 (09:07 -0800)]
qcom_clk: add the qualcomm clock nodes for the IPQ4018

These clock nodes are used by the IPQ4018/IPQ4019 and derivatives.
They're also used by other 32 and 64 bit qualcomm parts; so it's
best to put these nodes here in a single qcom_clk driver and add
to it as we grow new Qualcomm SoC support.

Tested:

* IPQ4018, boot

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

2 years agoiwlwifi: attach to the build
Bjoern A. Zeeb [Mon, 27 Dec 2021 18:46:04 +0000 (18:46 +0000)]
iwlwifi: attach to the build

Add iwlwifi and iwlwififw to the module builds.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoiwlwifi: plug memory modified after free
Bjoern A. Zeeb [Mon, 27 Dec 2021 17:42:51 +0000 (17:42 +0000)]
iwlwifi: plug memory modified after free

In certain situations we saw a memory modified after free.  This was
tracked down to a pointer not NULLed after free and used in a different
code path.  It is unclear how the race happens pending further
investigation but setting the pointer to NULL after free and adding a
check in the 2nd code path handling the case gracefully helps for now.

While here improve another debug messge in sta handling.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoiwlwifi: cherry-pick fixes from upstream iwlwifi-next
Bjoern A. Zeeb [Mon, 27 Dec 2021 17:41:19 +0000 (17:41 +0000)]
iwlwifi: cherry-pick fixes from upstream iwlwifi-next

Cherry-pick f973795a8d19cbf3d03807704eb7c6ff65788d5a (Fix a double free
in iwl_txq_dyn_alloc_dma), db66abeea3aefed481391ecc564fb7b7fb31d742
(synchronize with FW after multicast commands),
d5d8ee526d1401173ad1261c3b6388a4f947e0a3 (remove session protection
upon station removal), and 8e967c137df3b236d2075f9538cb888129425d1a
(avoid clearing a just saved session protection id).

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoiwlwifi: add man pages
Bjoern A. Zeeb [Mon, 27 Dec 2021 17:40:02 +0000 (17:40 +0000)]
iwlwifi: add man pages

Add and hook up man pages for iwlwifi and iwlwififw and install a copy
of the firmware license to /usr/share/docs/legal so it will always be
shipped with the installed system.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoiwlwifi: turn off broadcast filtering for now
Bjoern A. Zeeb [Mon, 27 Dec 2021 17:37:41 +0000 (17:37 +0000)]
iwlwifi: turn off broadcast filtering for now

Turn off broadcast filtering in iwlwifi for now as it gives me
or rather the firmware headaches.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoiwlwifi: also depend on linuxkpi_wlan
Bjoern A. Zeeb [Mon, 27 Dec 2021 17:36:04 +0000 (17:36 +0000)]
iwlwifi: also depend on linuxkpi_wlan

The 802.11 compat code is split off linuxkpi.ko into linuxkpi_wlan.ko
in case it is built as a module.  Depend on that.
While here adjust our module to a longer version to avoid conflicts.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoiwlwifi: remove copyright and license from Makefiles
Bjoern A. Zeeb [Mon, 27 Dec 2021 17:34:40 +0000 (17:34 +0000)]
iwlwifi: remove copyright and license from Makefiles

We do not generally protect the Makefiles like this.
Remove the details and go with project style.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
X-MFC with: bfcc09ddd422c95a1a2e4e794b63ee54c4902398
X-MFC with: f4c129f5fb1669b284d76a838b1e509f97c2d299

2 years agoLinuxKPI: add 802.11 compat code
Bjoern A. Zeeb [Sun, 26 Dec 2021 18:52:51 +0000 (18:52 +0000)]
LinuxKPI: add 802.11 compat code

Add 802.11 compat code for mac80211 and to a minimal degree cfg80211.
This allows us to compile and use basic functionality of wireless
drivers such as iwlwifi.

This is a constant work in progress but having it in the tree will
allow others to test and more easy to track changes and avoid having
snapshots no longer applying to branches.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: import beginning of a new version of netdevice.h
Bjoern A. Zeeb [Sun, 26 Dec 2021 18:29:29 +0000 (18:29 +0000)]
LinuxKPI: import beginning of a new version of netdevice.h

Import a netdevice update complementing the last remaining bits of
the old ifnet derived implementation.  Along add a (for now) task
based NAPI implementation.

This is the minimal set of chnages which are needed for the initial
support of wireless drivers.  The NAPI implementation has an option to
still switch to "direct dispatch" as it had been used by these drivers
before not relying on a deferred context along with some printf tracing.
This has been helpful in the last weeks for debugging and will be
cleaned once we have had broader testing and are sure this is fine as-is.
Should we need a more time-sensitive or load-sensitive response
in the future we can always switch to something more sophisticated.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
X-Differential Revision: D33075 (abandoned without feedback a while ago)

2 years agoLinuxKPI: add a work-in-progress skbuff implementation
Bjoern A. Zeeb [Sun, 26 Dec 2021 18:26:26 +0000 (18:26 +0000)]
LinuxKPI: add a work-in-progress skbuff implementation

This is a work-in-progress implementation of sk_buff compat code
used for wireless drivers only currently.
Bring in this version of the code as it has proven to be good enough
to have packets going for a few months.

The current implementation has several drawbacks including the need
for us to copy data between sk_buffs and mbufs.
Do not rely on the internals of this implementation.  They are highly
likely to change as we will improve the integration to FreeBSD mbufs.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agotcp_usr_rcvd: don't cast inp_ppcb to tcpcb before checking inp_flags
Gleb Smirnoff [Mon, 27 Dec 2021 18:41:51 +0000 (10:41 -0800)]
tcp_usr_rcvd: don't cast inp_ppcb to tcpcb before checking inp_flags

Fixes: f64dc2ab5be38e5366271ef85ea90d8cb1c7841a

2 years agoarm64: Fix "set-but-not-used" warnings in the pmap
Alan Cox [Mon, 27 Dec 2021 17:37:04 +0000 (11:37 -0600)]
arm64: Fix "set-but-not-used" warnings in the pmap

MFC after: 1 week

2 years agosctp: cleanup, on functional change intended.
Michael Tuexen [Mon, 27 Dec 2021 17:28:44 +0000 (18:28 +0100)]
sctp: cleanup, on functional change intended.

MFC after: 3 days

2 years agosctp: apply limit for socket buffers as indicated in comment
Michael Tuexen [Mon, 27 Dec 2021 17:15:29 +0000 (18:15 +0100)]
sctp: apply limit for socket buffers as indicated in comment

MFC after: 3 days

2 years agonfscommon: Return NFSERR_ATTRNOTSUPP for AUDIT/ALARM ACEs
Rick Macklem [Mon, 27 Dec 2021 16:03:41 +0000 (08:03 -0800)]
nfscommon: Return NFSERR_ATTRNOTSUPP for AUDIT/ALARM ACEs

FreeBSD only supports Allow/Deny ACEs in NFSv4 ACLs.
As such, it does not make sense to parse Audit/Alarm
ACEs.  Modify nfsrv_dissectace() so that it returns
NFSERR_ATTRNOTSUPP if an Audit/Alarm ACE is found in
the ACL being parsed.  The code has been #ifdef notnow'd,
since Audit/Alarm ACEs might be supported someday.

This should not have significant impact, since FreeBSD
reports to clients that only Allow/Deny ACEs are
supported and an attempt to set one would have failed
anyhow.

MFC after: 2 weeks

2 years agokldxref: add R_PPC64_ADDR64 handler
Alfredo Dal'Ava Junior [Mon, 27 Dec 2021 18:29:50 +0000 (15:29 -0300)]
kldxref: add R_PPC64_ADDR64 handler

Implements R_PPC64_ADDR64 handler for kldxref, addressing
"kldxref: unhandled relocation type 38" when running
"kldxref /boot/kernel"

Reviewed by: jhibbits
MFC after: 1 week
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D33615

2 years agotests/libalias: Portrange
Lutz Donnerhacke [Sat, 3 Jul 2021 22:28:20 +0000 (00:28 +0200)]
tests/libalias: Portrange

Test ranges of allowed ports for aliasing.
 - Explicit default like ipfw(8) is doing
 - Regular range
 - Exhausting a very small range
 - Recovery

Includes a fix of an utility macro, which was not used before.

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

2 years agoipfilter userland: Revert the ipmon part of a6fb9bbea731
Cy Schubert [Mon, 27 Dec 2021 09:10:52 +0000 (01:10 -0800)]
ipfilter userland: Revert the ipmon part of a6fb9bbea731

a6fb9bbea731 caused incorrect formatting of ipmon log output.

Fixes: a6fb9bbea7318e993dfe0f8a7f00821f79850b26
MFC after: immediately

2 years agoipfilter userland: Path fixup no longer required
Cy Schubert [Mon, 27 Dec 2021 08:18:49 +0000 (00:18 -0800)]
ipfilter userland: Path fixup no longer required

Since the move of ipfilter from contrib to sbin adjusting the source path
is no longer required.

Fixes: 41edb306f05651fcaf6c74f9e3557f59f80292e1
MFC after: 1 month

2 years agokern: Remove CTLFLAG_NEEDGIANT from some more sysctls.
Alexander Motin [Mon, 27 Dec 2021 04:07:33 +0000 (23:07 -0500)]
kern: Remove CTLFLAG_NEEDGIANT from some more sysctls.

MFC after: 2 weeks

2 years agosound: Remove CTLFLAG_NEEDGIANT from some sysctls.
Alexander Motin [Mon, 27 Dec 2021 01:37:55 +0000 (20:37 -0500)]
sound: Remove CTLFLAG_NEEDGIANT from some sysctls.

While there, remove some dead code.

MFC after: 2 weeks

2 years agonfscommon: Add arguments for support of the dacl attribute
Rick Macklem [Mon, 27 Dec 2021 00:37:02 +0000 (16:37 -0800)]
nfscommon: Add arguments for support of the dacl attribute

NFSv4.1/4.2 has an alternative to the acl attribute, called
dacl, that includes support for the ACL_ENTRY_INHERITED flag,
called NFSV4ACE_INHERITED in NFSv4.

This patch adds a dacl argument to nfsrv_buildacl(),
nfsrv_dissectacl() and nfsrv_dissectace(), so that they
will handle NFSV4ACE_INHERITED when dacl == true.

Since these functions are always called with dacl == false
for this patch, semantics should not have changed.
A future patch will add support for dacl.

MFC after: 2 weeks

2 years agonetgraph: Remove CTLFLAG_NEEDGIANT from sysctl.
Alexander Motin [Mon, 27 Dec 2021 00:42:53 +0000 (19:42 -0500)]
netgraph: Remove CTLFLAG_NEEDGIANT from sysctl.

MFC after: 2 weeks

2 years agoacpi_support: Remove CTLFLAG_NEEDGIANT from sysctls.
Alexander Motin [Mon, 27 Dec 2021 00:37:08 +0000 (19:37 -0500)]
acpi_support: Remove CTLFLAG_NEEDGIANT from sysctls.

MFC after: 2 weeks

2 years agoacpica: Remove CTLFLAG_NEEDGIANT from most sysctls.
Alexander Motin [Mon, 27 Dec 2021 00:17:52 +0000 (19:17 -0500)]
acpica: Remove CTLFLAG_NEEDGIANT from most sysctls.

MFC after: 2 weeks

2 years agoclk: rename clknode_try_freq to clknode_test_freq
Adrian Chadd [Sun, 26 Dec 2021 14:16:02 +0000 (06:16 -0800)]
clk: rename clknode_try_freq to clknode_test_freq

This brings it in line with what the clk_*_freq routines are named.

2 years agoin_pcb: use jenkins hash over the entire IPv6 (or IPv4) address
Gleb Smirnoff [Sun, 26 Dec 2021 18:47:28 +0000 (10:47 -0800)]
in_pcb: use jenkins hash over the entire IPv6 (or IPv4) address

The intent is to provide more entropy than can be provided
by just the 32-bits of the IPv6 address which overlaps with
6to4 tunnels.  This is needed to mitigate potential algorithmic
complexity attacks from attackers who can control large
numbers of IPv6 addresses.

Together with: gallatin
Reviewed by: dwmalone, rscheff
Differential revision: https://reviews.freebsd.org/D33254

2 years agojail: network epoch protection for IP address lists
Gleb Smirnoff [Sun, 26 Dec 2021 18:45:50 +0000 (10:45 -0800)]
jail: network epoch protection for IP address lists

Now struct prison has two pointers (IPv4 and IPv6) of struct
prison_ip type.  Each points into epoch context, address count
and variable size array of addresses.  These structures are
freed with network epoch deferred free and are not edited in
place, instead a new structure is allocated and set.

While here, the change also generalizes a lot (but not enough)
of IPv4 and IPv6 processing. E.g. address family agnostic helpers
for kern_jail_set() are provided, that reduce v4-v6 copy-paste.

The fast-path prison_check_ip[46]_locked() is also generalized
into prison_ip_check() that can be executed with network epoch
protection only.

Reviewed by: jamie
Differential revision: https://reviews.freebsd.org/D33339

2 years agoclk: add call for nodes to get the programmed/decided frequency passed back
Adrian Chadd [Tue, 14 Dec 2021 18:01:08 +0000 (10:01 -0800)]
clk: add call for nodes to get the programmed/decided frequency passed back

Summary:

The existing call can only really be used for a node wishing to
configure its parent, but as we don't pass in a pointer to the freq,
we can't set it to what it would be for a DRY_RUN pass.

So for clock nodes that wish to try setting parent frequencies to see
which would be the best for its own target frequency, we really do need
a way to call in and pass in a flag /and/ a pointer to freq so it can be
updated for us as the clock tree is recursed through.

Reviewers: manu

Approved by: manu

Subscribers: imp

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

2 years agovm_reserv: fix zero-boundary error
Doug Moore [Sun, 26 Dec 2021 17:40:27 +0000 (11:40 -0600)]
vm_reserv: fix zero-boundary error

Handle specially the boundary==0 case of vm_reserv_reclaim_config,
by turning off boundary adjustment in that case.

Reviewed by: alc
Tested by: pho, madpilot

2 years agonet80211: adjust a printf to toeee80211_note
Bjoern A. Zeeb [Sun, 26 Dec 2021 17:26:58 +0000 (17:26 +0000)]
net80211: adjust a printf to toeee80211_note

Throughout net80211 there are multiple ways to log (debugging)
information.  Start to clenaup one as I kept hitting it to harmonize
the output.  The more we get away from printfs into either wrapper
functions or macros the more likely we can use holistic systematic
tracing in the future.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agonet80211: add debugging information
Bjoern A. Zeeb [Sun, 26 Dec 2021 17:25:57 +0000 (17:25 +0000)]
net80211: add debugging information

Add more STATE / DEBUG probes and enhance the output of one in order
to track state changes triggered by "ack" (or not).
This helped to narrow down causes from drivers or the LinuxKPI 802.11
compat framework which kept us in a scan -> auth -> scan loop.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agonet80211: format debug functions as single line
Bjoern A. Zeeb [Sun, 26 Dec 2021 17:24:04 +0000 (17:24 +0000)]
net80211: format debug functions as single line

Making use of the debug output was hard given debug lines were run in
parts through vlog (if_printf) and in (multiple) parts through printf(s).

Like some of the functions alreay have, use a local buffer to format
the string and then use a single if_printf;  in addition given these
functions are debug-only, add an extra printf in case we find our
buffers still to be too small so we can adjust for the future.
We already found that 128 characters are to short for some log messages.
Bump the buffer sizes collectively to 256 characters which also is
the maximum of if_vlog() so getting longer would need further changes
elsewhere.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agokern: Remove CTLFLAG_NEEDGIANT from some sysctls.
Alexander Motin [Sun, 26 Dec 2021 17:02:28 +0000 (12:02 -0500)]
kern: Remove CTLFLAG_NEEDGIANT from some sysctls.

MFC after: 2 weeks

2 years agotcp: remove delayed drop KPI
Gleb Smirnoff [Sun, 26 Dec 2021 16:48:24 +0000 (08:48 -0800)]
tcp: remove delayed drop KPI

No longer needed after tcp_output() can ask caller to drop.

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

2 years agotcp: TCP output method can request tcp_drop
Gleb Smirnoff [Sun, 26 Dec 2021 16:48:19 +0000 (08:48 -0800)]
tcp: TCP output method can request tcp_drop

The advanced TCP stacks (bbr, rack) may decide to drop a TCP connection
when they do output on it.  The default stack never does this, thus
existing framework expects tcp_output() always to return locked and
valid tcpcb.

Provide KPI extension to satisfy demands of advanced stacks.  If the
output method returns negative error code, it means that caller must
call tcp_drop().

In tcp_var() provide three inline methods to call tcp_output():
- tcp_output() is a drop-in replacement for the default stack, so that
  default stack can continue using it internally without modifications.
  For advanced stacks it would perform tcp_drop() and unlock and report
  that with negative error code.
- tcp_output_unlock() handles the negative code and always converts
  it to positive and always unlocks.
- tcp_output_nodrop() just calls the method and leaves the responsibility
  to drop on the caller.

Sweep over the advanced stacks and use new KPI instead of using HPTS
delayed drop queue for that.

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

2 years agorack: rack_do_compressed_ack_processing() can call tcp_drop()
Gleb Smirnoff [Sun, 26 Dec 2021 16:48:15 +0000 (08:48 -0800)]
rack: rack_do_compressed_ack_processing() can call tcp_drop()

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

2 years agorack: drop connection synchronously, when we can
Gleb Smirnoff [Sun, 26 Dec 2021 16:48:10 +0000 (08:48 -0800)]
rack: drop connection synchronously, when we can

For all functions that are leaves of tcp_input() call
ctf_do_dropwithreset_conn() instead of ctf_do_dropwithreset(), cause
we always got tp and we want it to be dropped.

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

2 years agobbr: drop packet synchronously in ctf_do_dropwithreset_conn()
Gleb Smirnoff [Sun, 26 Dec 2021 16:48:06 +0000 (08:48 -0800)]
bbr: drop packet synchronously in ctf_do_dropwithreset_conn()

This function is always called from tcp_do_segment() method, that
can drop tcpcb and return unlocked.

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

2 years agotcp: mechanically substitute call to tfb_tcp_output to new method.
Gleb Smirnoff [Sun, 26 Dec 2021 16:47:59 +0000 (08:47 -0800)]
tcp: mechanically substitute call to tfb_tcp_output to new method.

Made with sed(1) execution:

sed -Ef sed -i "" $(grep --exclude tcp_var.h -lr tcp_output sys/)

sed:
s/tp->t_fb->tfb_tcp_output\(tp\)/tcp_output(tp)/
s/to tfb_tcp_output\(\)/to tcp_output()/

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

2 years agotcp: welcome back tcp_output() as the right way to run output on tcpcb.
Gleb Smirnoff [Sun, 26 Dec 2021 16:47:42 +0000 (08:47 -0800)]
tcp: welcome back tcp_output() as the right way to run output on tcpcb.

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

2 years agoIPv4: fix redirect sending conditions
Bjoern A. Zeeb [Sun, 26 Dec 2021 15:33:48 +0000 (15:33 +0000)]
IPv4: fix redirect sending conditions

RFC792,1009,1122 state the original conditions for sending a redirect.
RFC1812 further refine these.
ip_forward() still sepcifies the checks originally implemented for these
(we do slightly more/different than suggested as makes sense).
The implementation added in 8ad114c082a159c0dde95aa35d2e3e108aa30a75
to ip_tryforward() however is flawed and may send a "multi-hop"
redirects (to a host not on the directly connected network).

Do proper checks in ip_tryforward() to stop us from sending redirects
in situations we may not.  Keep as much logic out of ip_tryforward()
and in ip_redir_alloc() and only do the mbuf copy once we are sure we
will send a redirect.

While here enhance and fix comments as to which conditions are handled
for sending redirects in various places.

Reported by: pi (on net@ 2021-12-04)
MFC after: 3 days
Sponsored by: Dr.-Ing. Nepustil & Co. GmbH
Reviewed by: cy, others (earlier versions)
Differential Revision: https://reviews.freebsd.org/D33274

2 years agonetstat: fix nhop prepend printing.
Alexander V. Chernikov [Sun, 26 Dec 2021 15:02:06 +0000 (15:02 +0000)]
netstat: fix nhop prepend printing.

If present, print nexthop L2 prepend data in hex.

MFC after: 1 week

2 years agotcp: virtualise net.inet.tcp.msl sysctl.
Alexander V. Chernikov [Sat, 4 Dec 2021 22:02:44 +0000 (22:02 +0000)]
tcp: virtualise net.inet.tcp.msl sysctl.

VNET teardown waits 2*MSL (60 seconds by default) before expiring
 tcp PCBs. These PCBs holds references to nexthops, which, in turn,
 reference ifnets. This chain results in VNET interfaces being destroyed
 and moved to default VNET only after 60 seconds.
Allow tcp_msl to be set in jail by virtualising net.inet.tcp.msl sysctl,
 permitting more predictable VNET tests outcomes.

MFC after: 1 week
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D33270