]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agofb: Add new FBTYPE_EFIFB
Emmanuel Vadot [Wed, 1 Dec 2021 15:13:09 +0000 (16:13 +0100)]
fb: Add new FBTYPE_EFIFB

Currently the type isn't set in the fbtype struct so any userland
program that call the FBIOGTYPE ioctl will think it's a FBTYPE_SUN1BW
which is far from the truth.
No app that I found find checks the type but at least now it's correct.

Reviewed by: emaste, tsoome
MFC after: 2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33221

2 years agofb: Remove some unused ioctls
Emmanuel Vadot [Wed, 1 Dec 2021 10:57:42 +0000 (11:57 +0100)]
fb: Remove some unused ioctls

6d1699583d7e added the FBIOGXINFO,FBIOMONINFO and FBIOPUTCMAPI/FBIOGETCMAPI
ioctls and said that implementation in driver will come later.
Since it was in 2001 I think we can remove this.

Reviewed by: emaste, imp, tsoome
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33218
Differential Revision: https://reviews.freebsd.org/D33219
Differential Revision: https://reviews.freebsd.org/D33220

2 years agofb: Remove unused cursors ioctls
Emmanuel Vadot [Wed, 1 Dec 2021 10:56:26 +0000 (11:56 +0100)]
fb: Remove unused cursors ioctls

The cursors related ioctls were added in 1994 with the 4.4 Lite import
but were never implemented in either sc(4), fb(4) or vt(4).
Remove it.

Reviewed by: emaste, tsoome
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33217

2 years agofb: Remove unused FBIOVERTICAL ioctl
Emmanuel Vadot [Wed, 1 Dec 2021 10:53:03 +0000 (11:53 +0100)]
fb: Remove unused FBIOVERTICAL ioctl

Commit 6d1699583d7e added the FBIOVERTICAL ioctl and said that implementation
in driver will come later.
Since it was in 2001 I think we can remove this.

MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG

2 years agofb: Remove unused FBIOSVIDEO/FBIOGVIDEO ioctls
Emmanuel Vadot [Wed, 1 Dec 2021 10:51:17 +0000 (11:51 +0100)]
fb: Remove unused FBIOSVIDEO/FBIOGVIDEO ioctls

The FBIOSVIDEO/FBIOGVIDEO ioctls were added in 1994 with the 4.4 Lite import
but were never implemented in either sc(4), fb(4) or vt(4).
Remove it.

Reviewed by: emaste, tsoome
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33216

2 years agofb: Remove unused FBIOSATTR/FBIOGATTR ioctls
Emmanuel Vadot [Wed, 1 Dec 2021 10:49:57 +0000 (11:49 +0100)]
fb: Remove unused FBIOSATTR/FBIOGATTR ioctls

The FBIOSATTR/FBIOGATTR ioctls were added in 1994 with the 4.4 Lite import
but were never implemented in either sc(4), fb(4) or vt(4).
Remove it.

Reviewed by: emaste, tsoome
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33215

2 years agofb: Remove unused code
Emmanuel Vadot [Wed, 1 Dec 2021 10:43:46 +0000 (11:43 +0100)]
fb: Remove unused code

The FBIOGINFO ioctl was added in 1994 with the 4.4 Lite import but was commented.
Remove it.

Reviewed by: emaste
MFC after:      2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33211

2 years agovmxnet3: skip zero-length descriptor in the middle of a packet
Andriy Gapon [Mon, 6 Dec 2021 07:59:28 +0000 (09:59 +0200)]
vmxnet3: skip zero-length descriptor in the middle of a packet

Passing up such descriptors to iflib is obviously wasteful.
But the main conern is that we may overrun iri_frags array because of
them.  That's been observed in practice.

Also, assert that the number of fragments / descriptors / segments is
less than IFLIB_MAX_RX_SEGS.

Reviewed by: gallatin, pkelsey
MFC after: 3 weeks
Sponsored by: Panzura LLC
Differential Revision: https://reviews.freebsd.org/D33189

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
MFC after: 1 week

2 years agocam/iosched: fix off by one error
Warner Losh [Mon, 6 Dec 2021 05:57:50 +0000 (22:57 -0700)]
cam/iosched: fix off by one error

Set the bucket size to be SBT_1US/50000 + 1 to be the first number >
20us. I had this uncommitted in my three when I pushed 2283206935b8
since kern.cam.iosched.bucket_base_us was reporting 19us.

Fixes: 2283206935b8
Sponsored by: Netflix

2 years agocam-iosched: Publish parameters of the latency buckets
Warner Losh [Mon, 6 Dec 2021 04:54:42 +0000 (21:54 -0700)]
cam-iosched: Publish parameters of the latency buckets

Add sysctls to publish the latency bucket size, number, and stride. Move
to putting all the iosched stuff under kern.cam.iosched as well and move
kern.cam.do_dynamic_iosched to kern.cam.iosched.dynamic. In addition, move
kern.cam.io_sched_alpha_bits to kern.cam.iosched.alpha_bits. Publish
kern.cam.iosched.bucket_base (the smallest bucket time), .bucket_ratio
(the geometric progression factor * 100), and .buckets (the total number
of buckets).

Move to publishing 20 buckets, starting at 20us. This allows us to get
better resolution on the short end and detect preformance degredation of
the NVMe drives I've tested on, even with the uncertainty of bucketing.

Sponsored by: Netflix

2 years agosysctl: Small style fix
Warner Losh [Mon, 6 Dec 2021 04:36:43 +0000 (21:36 -0700)]
sysctl: Small style fix

Slightly reorder to make this look better. No functional change.

Sponsored by: Netflix

2 years agoamd64/pmap: fix user page table page accounting
Alan Cox [Sun, 5 Dec 2021 23:40:53 +0000 (17:40 -0600)]
amd64/pmap: fix user page table page accounting

When a superpage mapping is destroyed and the original page table page
containing 4KB mappings that was being held in reserve is deallocated,
the recently introduced user page table page count was not being
decremented.  Consequentially, the count was wrong and would grow over
time.  For example, after multiple iterations of "buildworld", I was
seeing implausible counts, like the following:

vm.pmap.kernel_pt_page_count: 2184
vm.pmap.user_pt_page_count: 2280849
vm.pmap.pv_page_count: 106

With this change, I now see:

vm.pmap.kernel_pt_page_count: 2183
vm.pmap.user_pt_page_count: 344
vm.pmap.pv_page_count: 105

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D33276

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

2 years agoFix "set but not used" in kern_cpu.c
Scott Long [Sun, 5 Dec 2021 22:33:04 +0000 (15:33 -0700)]
Fix "set but not used" in kern_cpu.c

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

2 years agoFix "set but not used" in opencrypto, with a correction for the previous
Scott Long [Sun, 5 Dec 2021 22:30:36 +0000 (15:30 -0700)]
Fix "set but not used" in opencrypto, with a correction for the previous
commit.

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

2 years agoFix "set but not used" in opencrypto
Scott Long [Sun, 5 Dec 2021 22:23:47 +0000 (15:23 -0700)]
Fix "set but not used" in opencrypto

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

2 years agoFIx "set but not used" in the isp driver.
Scott Long [Sun, 5 Dec 2021 22:19:56 +0000 (15:19 -0700)]
FIx "set but not used" in the isp driver.

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

2 years agoFix "set but not used" in cardbus
Scott Long [Sun, 5 Dec 2021 22:14:35 +0000 (15:14 -0700)]
Fix "set but not used" in cardbus

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

2 years agoFix "set but not used" in the x86 pci driver.
Scott Long [Sun, 5 Dec 2021 22:09:24 +0000 (15:09 -0700)]
Fix "set but not used" in the x86 pci driver.

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

2 years agosys/bitset.h: reduce visibility of BIT_* macros
Stefan Eßer [Sun, 5 Dec 2021 21:27:33 +0000 (22:27 +0100)]
sys/bitset.h: reduce visibility of BIT_* macros

Add two underscore characters "__" to names of BIT_* and BITSET_*
macros to move them to the implementation name space and to prevent
a name space pollution due to BIT_* macros in 3rd party programs with
conflicting parameter signatures.

These prefixed macro names are used in kernel header files to define
macros in e.g. sched.h, sys/cpuset.h and sys/domainset.h.

If C programs are built with either -D_KERNEL (automatically passed
when building a kernel or kernel modules) or -D_WANT_FREENBSD_BITSET
(or this macros is defined in the source code before including the
bitset macros), then all macros are made visible with their previous
names, too. E.g., both __BIT_SET() and BIT_SET() are visible with
either of _KERNEL or _WANT_FREEBSD_BITSET defined.

The main reason for this change is that some 3rd party sources
including sched.h have been found to contain conflicting BIT_*
macros.

As a work-around, parts of shed.h have been made conditional and
depend on _WITH_CPU_SET_T being set when sched.h is included.
Ports that expect the full functionality provided by sched.h need
to be built with -D_WITH_CPU_SET_T. But this leads to conflicts if
BIT_* macros are defined in that program, too.

This patch set makes all of sched.h visible again without this
parameter being passed and without any name space pollution due
to BIT_* macros becoming visible when sched.h is included.

This patch set will be backported to the STABLE branches, but ports
will need to use -D_WITH_CPU_SET_T as long as there are supported
releases that do not contain these patches.

Reviewed by: kib, markj
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D33235

2 years agoahci: Add Intel Comet Lake RAID/RST controller PCI ID
Adrian Chadd [Sun, 5 Dec 2021 21:28:39 +0000 (21:28 +0000)]
ahci: Add Intel Comet Lake RAID/RST controller PCI ID

This is needed on my ASUS motherboard / Intel Comet Lake i5-10500
desktop machine.

This with some work arounds for nvme behind the RST controller
boots and works.

Reviewed by: cognet

2 years agoin_pcb: delay crfree() down into UMA dtor
Gleb Smirnoff [Sun, 5 Dec 2021 16:47:24 +0000 (08:47 -0800)]
in_pcb: delay crfree() down into UMA dtor

inpcb lookups, which check inp_cred, work with pcbs that potentially went
through in_pcbfree().  So inp_cred should stay valid until SMR guarantees
its invisibility to lookups.

While here, put the whole inpcb destruction sequence of in_pcbfree(),
inpcb_dtor() and inpcb_fini() sequentially.

Submitted by: markj
Differential revision: https://reviews.freebsd.org/D33273

2 years agouma: remove unused *item argument from cache_free()
Gleb Smirnoff [Sun, 5 Dec 2021 16:37:56 +0000 (08:37 -0800)]
uma: remove unused *item argument from cache_free()

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D33272

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

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
MFC after: 1 week

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
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33250

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

2 years agoRemove riscv workaround in sys.netgraph.hub.loop test
Mitchell Horne [Fri, 3 Dec 2021 18:26:35 +0000 (14:26 -0400)]
Remove riscv workaround in sys.netgraph.hub.loop test

The test case now passes on this architecture. This reverts commits
d5fd5cdc0638 and 168b579a4884.

Reviewed by: lwhsu, imp
Differential Revision: https://reviews.freebsd.org/D33252

2 years agoRevert "ffs(3): Fix a typo in a sysctl description"
Gordon Bergling [Sun, 5 Dec 2021 12:45:47 +0000 (13:45 +0100)]
Revert "ffs(3): Fix a typo in a sysctl description"

It should be

- s/contigous/contiguous/ not continuous

Reported by: tuexen@

This reverts commit 42efe994ece337929b6f9937829f7970e620db9b.

2 years agostress2: This test runs for hours with ASLR enabled
Peter Holm [Sun, 5 Dec 2021 05:43:29 +0000 (05:43 +0000)]
stress2: This test runs for hours with ASLR enabled

2 years agox86: Make AMD elvtX dump more compact.
Alexander Motin [Sun, 5 Dec 2021 02:45:20 +0000 (21:45 -0500)]
x86: Make AMD elvtX dump more compact.

MFC after: 2 weeks

2 years agonfsd: Fix Verify for attributes like FilesAvail
Rick Macklem [Sat, 4 Dec 2021 22:38:55 +0000 (14:38 -0800)]
nfsd: Fix Verify for attributes like FilesAvail

When the Verify operation calls nfsv4_loadattr(), it provides
the "struct statfs" information that can be used for doing a
compare for FilesAvail, FilesFree, FilesTotal, SpaceAvail,
SpaceFree and SpaceTotal.  However, the code erroneously
used the "struct nfsstatfs *" argument that is NULL.
This patch fixes these cases to use the correct argument
structure.  For the case of FilesAvail, the code in
nfsv4_fillattr() was factored out into a separate function
called nfsv4_filesavail(), so that it can be called from
nfsv4_loadattr() as well as nfsv4_fillattr().

In fact, most of the code in nfsv4_filesavail() is old
OpenBSD code that does not build/run on FreeBSD, but I
left it in place, in case it is of some use someday.

I am not aware of any extant NFSv4 client that does Verify
on these attributes.

Reported by: rtm@lcs.mit.edu
Tested by: rtm@lcs.mit.edu
PR: 260176
MFC after: 2 weeks

2 years agonfsd: Sanity check the Layouttype count
Rick Macklem [Sat, 4 Dec 2021 22:18:48 +0000 (14:18 -0800)]
nfsd: Sanity check the Layouttype count

Reported by: rtm@lcs.mit.edu
Tested by: rtm@lcs.mit.edu
PR: 260155
MFC after: 2 weeks

2 years agoswapoff(8): add -f flag
Konstantin Belousov [Mon, 29 Nov 2021 16:30:09 +0000 (18:30 +0200)]
swapoff(8): add -f flag

to force swapout by ignoring the heuristic that calculates amount of
allocated memory against total of RAM plus remaining swap.

Reviewed by: markj
Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33165

2 years agoswapoff(2): document extended syscall arguments
Konstantin Belousov [Thu, 2 Dec 2021 03:17:40 +0000 (05:17 +0200)]
swapoff(2): document extended syscall arguments

Reviewed by: markj
Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33165

2 years agoswapoff(2): add a SWAPOFF_FORCE flag
Konstantin Belousov [Mon, 29 Nov 2021 16:28:19 +0000 (18:28 +0200)]
swapoff(2): add a SWAPOFF_FORCE flag

The flag requests skipping the heuristic which tries to avoid leaving
system with more allocated memory than available from RAM and remanining
swap.

Reviewed by: markj
Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33165

2 years agoswapoff(2): replace special device name argument with a structure
Konstantin Belousov [Mon, 29 Nov 2021 16:26:31 +0000 (18:26 +0200)]
swapoff(2): replace special device name argument with a structure

For compatibility, add a placeholder pointer to the start of the
added struct swapoff_new_args, and use it to distinguish old vs. new
style of syscall invocation.

Reviewed by: markj
Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33165

2 years agoswap_pager.c: Remove MPSAFE and ARGSUSED annotations
Konstantin Belousov [Fri, 3 Dec 2021 08:45:42 +0000 (10:45 +0200)]
swap_pager.c: Remove MPSAFE and ARGSUSED annotations

Reviewed by: markj
Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33165

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

2 years agoMAC/priority module for realtime privilege group
Florian Walpen [Sat, 4 Dec 2021 16:17:29 +0000 (18:17 +0200)]
MAC/priority module for realtime privilege group

This is a MAC policy module that grants scheduling privileges based on
group membership.  Users or processes in the group realtime (gid 47) are
allowed to run threads and processes with realtime scheduling priority.
For timing-sensitive, low-latency software like audio/jack, running with
realtime priority helps to avoid stutter and gaps.

PR: 239125
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D33191

2 years agosctp: unbreak NOINET6 builds.
Michael Tuexen [Sat, 4 Dec 2021 18:13:28 +0000 (19:13 +0100)]
sctp: unbreak NOINET6 builds.

PR: 260119
Reported by: kostikbel
MFC after: 1 week

2 years agoFix "set but not used" for hptmv
Scott Long [Sat, 4 Dec 2021 18:06:33 +0000 (11:06 -0700)]
Fix "set but not used" for hptmv

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

2 years agoFix "set but not used" for hptiop
Scott Long [Sat, 4 Dec 2021 18:05:45 +0000 (11:05 -0700)]
Fix "set but not used" for hptiop

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

2 years agonhop: hash ifnet pointer instead of if_index
Gleb Smirnoff [Sat, 4 Dec 2021 18:05:46 +0000 (10:05 -0800)]
nhop: hash ifnet pointer instead of if_index

Yet another problem created by VIMAGE/if_vmove/epair design that
relocates ifnet between vnets and changes if_index.  Since if_index
changes, nhop hash values also changes, unlink_nhop() isn't able to
find entry in hash and leaks the nhop.  Since nhop references ifnet,
the latter is also leaked.  As result running network tests leaks
memory on every single test that creates vnet jail.

While here, rewrite whole hash_priv() to use static initializer,
per Alexander's suggestion.

Reviewed by: melifaro

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

MFC after: 1 week
Sponsored by: Netflix, Inc.

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

MFC after: 1 week
Sponsored by: Netflix, Inc.

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.

MFC after: 1 week
Sponsored by: Netflix, Inc.

2 years agoipfilter: Avoid more null if-then-else blocks
Cy Schubert [Wed, 20 Oct 2021 03:11:40 +0000 (20:11 -0700)]
ipfilter: Avoid more null if-then-else blocks

As in 73db3b64f167, when WITHOUT_INET6 is selected, null if-then-else
blocks are generated because #if statements are incorrectly placed.
Moving the #if statements reduces unnecessary runtime comparisons or
compiler optimizations.

MFC after: 3 days

2 years agoipfilter: Correct a comment and add notation
Cy Schubert [Wed, 20 Oct 2021 02:33:02 +0000 (19:33 -0700)]
ipfilter: Correct a comment and add notation

Correct a comment to accurately reflect what is being done. While
we're at it document the next step in the process.

MFC after: 3 days

2 years agoipfilter: Correct function description
Cy Schubert [Tue, 19 Oct 2021 00:14:43 +0000 (17:14 -0700)]
ipfilter: Correct function description

As of 874b1a35486b, ip_proxy_check() return codes have been simplified.
The original comment was also incorrect in the first place.

MFC after: 3 days

2 years agoipfilter: Add DTrace SDT probe
Cy Schubert [Tue, 5 Oct 2021 04:26:58 +0000 (21:26 -0700)]
ipfilter: Add DTrace SDT probe

Add an SDT probe, using the newly created DT5 macro, in similar vein
to DEBUG_PARSE printf for when FTP junk is anticipated and ok. This
will assist in debugging port (active) FTP proxy issues.

MFC after: 3 days

2 years agoipfilter: New DT5 DTrace macro
Cy Schubert [Tue, 5 Oct 2021 04:18:42 +0000 (21:18 -0700)]
ipfilter: New DT5 DTrace macro

Define a new DT5 DTrace macro used to call DTRACE_PROBE5, for use with
SDT probes with five arguments.

MFC after: 3 days

2 years agoipfilter: Whitespace cleanup
Cy Schubert [Tue, 5 Oct 2021 04:16:16 +0000 (21:16 -0700)]
ipfilter: Whitespace cleanup

Clean up whitespace from compaction of DTn macro definitions.

MFC after: 3 days

2 years agoipfilter: Compat and simplify DTrace macro definitions
Cy Schubert [Tue, 5 Oct 2021 04:13:47 +0000 (21:13 -0700)]
ipfilter: Compat and simplify DTrace macro definitions

Use a compound #if to simplify and compact DTn DTRACE_PROBEn macros
used by ipfilter.

MFC after: 3 days

2 years agoipfilter: Save a word of stack space
Cy Schubert [Mon, 4 Oct 2021 18:36:15 +0000 (11:36 -0700)]
ipfilter: Save a word of stack space

Rather than save the return code into an intermediate variable, which BTW
is optimized out anyway, explicitly remove the return code from the stack.

MFC after: 3 days

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

MFC after: 1 week
Sponsored by: Netflix, Inc.

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.

MFC after: 1 week
Sponsored by: Netflix, Inc.

2 years agoffs(3): Fix a typo in a sysctl description
Gordon Bergling [Sat, 4 Dec 2021 11:15:34 +0000 (12:15 +0100)]
ffs(3): Fix a typo in a sysctl description

- s/contigous/continuous/

MFC after: 3 days

2 years agoomap4: Fix a few typos in source code comments
Gordon Bergling [Sat, 4 Dec 2021 11:13:27 +0000 (12:13 +0100)]
omap4: Fix a few typos in source code comments

- s/addresss/address/

MFC after: 3 days

2 years agoipfilter(4): Fix a typo in an error message
Gordon Bergling [Sat, 4 Dec 2021 11:10:39 +0000 (12:10 +0100)]
ipfilter(4): Fix a typo in an error message

- s/addresss/address/

This is a direct commit to contrib since the upstream is
no longer active.

MFC after: 3 days

2 years agonet80211(4): Fix a typo in a sysctl description
Gordon Bergling [Sat, 4 Dec 2021 11:09:17 +0000 (12:09 +0100)]
net80211(4): Fix a typo in a sysctl description

- s/travelse/traversal/

MFC after: 3 days

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

2 years agoFix "set but not used" in mrsas. This includes removing unnecessary cdevsw
Scott Long [Sat, 4 Dec 2021 07:08:27 +0000 (00:08 -0700)]
Fix "set but not used" in mrsas.  This includes removing unnecessary cdevsw
methods.

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

2 years agoFix "set but not used" for geom
Scott Long [Sat, 4 Dec 2021 06:40:24 +0000 (23:40 -0700)]
Fix "set but not used" for geom

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

2 years agoFix "set but not used" for bge
Scott Long [Sat, 4 Dec 2021 06:29:51 +0000 (23:29 -0700)]
Fix "set but not used" for bge

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

2 years agoipsec: fix a panic with INVARIANTS
Robert Wing [Fri, 3 Dec 2021 23:22:23 +0000 (14:22 -0900)]
ipsec: fix a panic with INVARIANTS

When adding an SPD entry that already exists, a refcount wraparound
panic is encountered. This was caused from dropping a reference on the
wrong security policy.

Fixes: 4920e38fecc3 ("ipsec: fix race condition in key.c")
Reviewed by: wma
Sponsored by:   Klara Inc.
Differential Revision: https://reviews.freebsd.org/D33100

2 years agoFix "set but not used" in the tws driver
Scott Long [Fri, 3 Dec 2021 22:40:29 +0000 (15:40 -0700)]
Fix "set but not used" in the tws driver

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

2 years agoFix "set but not used" for the ti driver
Scott Long [Fri, 3 Dec 2021 22:31:14 +0000 (15:31 -0700)]
Fix "set but not used" for the ti driver

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

2 years agoFix "set but not used" in arcmsr
Scott Long [Fri, 3 Dec 2021 22:22:47 +0000 (15:22 -0700)]
Fix "set but not used" in arcmsr

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

2 years agoFix "set but not used" in busdma_bounce.
Scott Long [Fri, 3 Dec 2021 22:20:42 +0000 (15:20 -0700)]
Fix "set but not used" in busdma_bounce.

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

2 years agoFix "set but not used" for the sym driver.
Scott Long [Fri, 3 Dec 2021 22:18:39 +0000 (15:18 -0700)]
Fix "set but not used" for the sym driver.

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

2 years agosctp: inherit IP level socket options from listening socket
Michael Tuexen [Fri, 3 Dec 2021 21:40:52 +0000 (22:40 +0100)]
sctp: inherit IP level socket options from listening socket

Ensure that TTL and TOS values set on a listener get inheritet
to the accepted sockets.

PR: 260119
MFC after: 1 week

2 years agotcp_ccalgounload(): initialize the inpcb iterator when curvnet is set
Gleb Smirnoff [Fri, 3 Dec 2021 20:39:56 +0000 (12:39 -0800)]
tcp_ccalgounload(): initialize the inpcb iterator when curvnet is set

Pointy hat to: glebius
Fixes: de2d47842e88

2 years agoin_pcb: limit the effect of wraparound in TCP random port allocation check
Peter Lei [Fri, 3 Dec 2021 20:38:12 +0000 (12:38 -0800)]
in_pcb: limit the effect of wraparound in TCP random port allocation check

The check to see if TCP port allocation should change from random to
sequential port allocation mode may incorrectly cause a false positive
due to negative wraparound.
Example:
    V_ipport_tcpallocs = 2147483585 (0x7fffffc1)
    V_ipport_tcplastcount = 2147483553 (0x7fffffa1)
    V_ipport_randomcps = 100
The original code would compare (2147483585 <= -2147483643) and thus
incorrectly move to sequential allocation mode.

Compute the delta first before comparing against the desired limit to
limit the wraparound effect (since tcplastcount is always a snapshot
of a previous tcpallocs).

2 years agosctp: use the correct traffic class when sending SCTP/IPv6 packets
Michael Tuexen [Fri, 3 Dec 2021 20:28:47 +0000 (21:28 +0100)]
sctp: use the correct traffic class when sending SCTP/IPv6 packets

When sending packets the stcb was used to access the inp and then
access the endpoint specific IPv6 level options. This fails when
there exists an inp, but no stcb yet. This is the case for sending
an INIT-ACK in response to an INIT when no association already
exists. Fix this by just providing the inp instead of the stcb.

PR: 260120
MFC after: 1 week

2 years agoin_pcb: fix TCP local ephemeral port accounting
Peter Lei [Fri, 3 Dec 2021 20:30:21 +0000 (12:30 -0800)]
in_pcb: fix TCP local ephemeral port accounting

Fix logic error causing UDP(-Lite) local ephemeral port bindings
to count against the TCP allocation counter, potentially causing
TCP to go from random to sequential port allocation mode prematurely.

2 years agoiavf(4): Include RSS header file when RSS is defined
Eric Joyner [Fri, 3 Dec 2021 20:02:42 +0000 (12:02 -0800)]
iavf(4): Include RSS header file when RSS is defined

This should unbreak the kernel build when "options RSS" is
defined in the kernel configuration, and make the feature work.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reported by: adrian@
Sponsored by: Intel Corporation

2 years agolibrtld_db: Handle shlibs with discontiguous mappings.
Chuck Silvers [Fri, 3 Dec 2021 19:03:32 +0000 (11:03 -0800)]
librtld_db: Handle shlibs with discontiguous mappings.

Some shared libraries specify mappings that leave a gap (actually a
MAP_GUARD mapping) in between the file mappings (libcrypto.so was
the one I found), and this would cause rd_loadobj_iter() to report
the mapping info incorrectly, leaving out rdl_path and misreporting
rdl_offset for file mappings after the gap.  Fix rd_loadobj_iter()
to handle this situation.

Reviewed by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D32950

2 years agong_l2tp: use callout_reset() instead of ng_callout()
Gleb Smirnoff [Fri, 3 Dec 2021 16:57:23 +0000 (08:57 -0800)]
ng_l2tp: use callout_reset() instead of ng_callout()

The previous commit to this node falsely stated that locked callouts
are compatible with netgraph ng_callout KPI.  They are not.  An item
can be queued instead of being applied to the node, which results in
a mutex leak to the callout thread and later unlocked call into function
that expects to be called locked.

Potentially netgraph can be taught to handle locked callouts, but that
would bring a lot of complexity in it.  Instead lets question necessity
of ng_callout() instead of callout_reset().  It protects against node
going away while callout is scheduled.  But a node that drains all
callouts in the shutdown method (ng_l2tp does) is already protected.

Fixes: 89042ff77668

2 years agofstab.5: spell encryption correctly
Fabian Keil [Fri, 3 Dec 2021 16:27:55 +0000 (16:27 +0000)]
fstab.5: spell encryption correctly

PR: 260189
MFC after: 2 weeks

2 years agoSuport Q-in-Q for mvneta.
Arnaud Ysmal [Tue, 19 Oct 2021 08:07:47 +0000 (10:07 +0200)]
Suport Q-in-Q for mvneta.

2 years agoExpand comment explaining reasons for automatic swapoff on shutdown
Konstantin Belousov [Mon, 29 Nov 2021 19:11:33 +0000 (21:11 +0200)]
Expand comment explaining reasons for automatic swapoff on shutdown

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

2 years agounbount: Vendor import 1.14.0rc1
Cy Schubert [Fri, 3 Dec 2021 06:11:04 +0000 (22:11 -0800)]
unbount: Vendor import 1.14.0rc1

This vendor import was requested by glebius@ as it should fix unbound
crashes.

Reported by: glebius
MFC after: 1 week

2 years agounbound: Vendor import 1.14.0rc1
Cy Schubert [Fri, 3 Dec 2021 05:35:06 +0000 (21:35 -0800)]
unbound: Vendor import 1.14.0rc1

This vendor import was requested by glebius@ as it should fix unbound
crashes.

Reported by: glebius

2 years agotcp_drain(): initialize the inpcb iterator when curvnet is set
Gleb Smirnoff [Fri, 3 Dec 2021 05:08:30 +0000 (21:08 -0800)]
tcp_drain(): initialize the inpcb iterator when curvnet is set

Reported by: cy
Pointy hat to: glebius
Fixes: de2d47842e88

2 years agoudp_detach(): fix set but not used warning
Gleb Smirnoff [Fri, 3 Dec 2021 04:12:40 +0000 (20:12 -0800)]
udp_detach(): fix set but not used warning

2 years agoudp_multi_input(): the UDP header is only needed for probes
Gleb Smirnoff [Fri, 3 Dec 2021 04:12:40 +0000 (20:12 -0800)]
udp_multi_input(): the UDP header is only needed for probes

Reported by: kib
Fixes: de2d47842e88

2 years agoxhci: add PCI IDs for USB controllers found on Supermicro M12SWA-TF
Gleb Smirnoff [Fri, 3 Dec 2021 04:12:33 +0000 (20:12 -0800)]
xhci: add PCI IDs for USB controllers found on Supermicro M12SWA-TF

2 years agofusefs: better debugging for FUSE_RENAME in the tests
Alan Somers [Fri, 3 Dec 2021 03:26:27 +0000 (20:26 -0700)]
fusefs: better debugging for FUSE_RENAME in the tests

MFC after: 2 weeks

2 years agoOnly use OLD_LIBS with shared libraries.
John Baldwin [Fri, 3 Dec 2021 01:30:00 +0000 (17:30 -0800)]
Only use OLD_LIBS with shared libraries.

Use OLD_FILES for a few symbolic links and static libraries previously
included in OLD_LIBS.

Add a missing shared library major number to an old libroken entry.

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

2 years agoOptionalObsoleteFiles.inc: Add rc.d/zfskeys
Herbert J. Skuhra [Fri, 3 Dec 2021 00:44:55 +0000 (01:44 +0100)]
OptionalObsoleteFiles.inc: Add rc.d/zfskeys

While here, sort the etc/rc.d entries.

PR: 256483
Reviewed by: allanjude
Approved by: allanjude (src)
MFC after: 3 days
Sponsored by: Modirum MDPay
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D33238

2 years agowpa: Redo import wpa_supplicant/hostapd commit 14ab4a816
Cy Schubert [Thu, 2 Dec 2021 23:00:32 +0000 (15:00 -0800)]
wpa: Redo import wpa_supplicant/hostapd commit 14ab4a816

This is the November update to vendor/wpa committed upstream 2021-11-26.

MFC after: 1 month

2 years agoAPEI: Improve multiple error sources handling.
Alexander Motin [Thu, 2 Dec 2021 23:01:02 +0000 (18:01 -0500)]
APEI: Improve multiple error sources handling.

Some AMD systems I have report 8 NMI and 3591 polled error sources.
Previous code could handle only one NMI source and used separate
callout for each polled source.  New code can handle multiple NMIs
and groups polled sources by power of 2 of the polling period.

MFC after: 2 weeks

2 years agoprocstat_getfiles_sysctl: do not require non-null ki_fd
Konstantin Belousov [Thu, 2 Dec 2021 18:03:01 +0000 (20:03 +0200)]
procstat_getfiles_sysctl: do not require non-null ki_fd

ki_fd is legitimately NULL when 32bit process requests process data
from 64bit host kernel.  The field is not used by the code for sysctl
case;  procstat_getfiles_kvm() checks ki_fd.

PR: 260174
Reported by: Damjan Jovanovic <damjan.jov@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agoStyle
Konstantin Belousov [Thu, 2 Dec 2021 18:02:26 +0000 (20:02 +0200)]
Style

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agoRevert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816"
Cy Schubert [Thu, 2 Dec 2021 22:45:04 +0000 (14:45 -0800)]
Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816"

This reverts commit 266f97b5e9a7958e365e78288616a459b40d924a, reversing
changes made to a10253cffea84c0c980a36ba6776b00ed96c3e3b.

A mismerge of a merge to catch up to main resulted in files being
committed which should not have been.

2 years agowpa: Import wpa_supplicant/hostapd commit 14ab4a816
Cy Schubert [Thu, 2 Dec 2021 21:35:14 +0000 (13:35 -0800)]
wpa: Import wpa_supplicant/hostapd commit 14ab4a816

This is the November update to vendor/wpa committed upstream 2021-11-26.

MFC after:      1 month

2 years agomps(4): Fix unmatched devq release.
Warner Losh [Thu, 2 Dec 2021 20:53:44 +0000 (13:53 -0700)]
mps(4): Fix unmatched devq release.

Port 9781c28c6d63 and a8837c77efd0 to the mps driver.  Before this
change devq was frozen only if some command was sent to the target after
reset started, but release was called always.  This change freezes the
devq immediately, leaving mprsas_action_scsiio() check only to cover
race condition due to different lock devq use.

This should also avoid unnecessary requeue of the commands, creating
additional log noise and confusing some broken apps. It also avoids a
'busy' requeue of I/Os failing when we're doing recovery that takes
longer than the normal busy timeout. These I/Os failing can lead to
filesystems being unmounted in the force unmount case for I/O errors.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D33228