]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agobhyve.8: Clean up network backends section
Mateusz Piotrowski [Sun, 18 Apr 2021 21:29:30 +0000 (23:29 +0200)]
bhyve.8: Clean up network backends section

- Reformat the format lists, use appropriate mdoc macros for
  readability.
- Add a missing Oxford comma.

MFC after: 2 weeks

3 years agobhyve.8: Improve emulation description of the -s flag
Mateusz Piotrowski [Sun, 18 Apr 2021 21:08:39 +0000 (23:08 +0200)]
bhyve.8: Improve emulation description of the -s flag

- Set width of the list to the longest key word for readability.
- Separate descriptions of amd_hostbridge and hostbridge emulations.
  Also, wordsmith their descriptions for consistency with other entries.
- Use Cm instead of Li for command modifiers.
- Do not stylize AMD with Li, there's no need to do it.
- Mention COM3 and COM4 in the definition of lpc.
- Fix a typo in the definition of ahci-hd ("hard drive" instead of
  "hard-drive").

MFC after: 2 weeks

3 years agobhyve.8: Clean up the slot description of -s
Mateusz Piotrowski [Sun, 18 Apr 2021 20:56:19 +0000 (22:56 +0200)]
bhyve.8: Clean up the slot description of -s

Also, remove the macros of the nested list which contained slot,
emulation and conf. This decreases the indention of the -s description.
It was necessary to clean up the slot description.

MFC after: 2 weeks

3 years agobhyve.8: Clean-up synopsis of -s
Mateusz Piotrowski [Sun, 18 Apr 2021 20:28:47 +0000 (22:28 +0200)]
bhyve.8: Clean-up synopsis of -s

- Document "-s help" separately for readability.
- Use appropriate mdoc macros.

MFC after: 2 weeks

3 years agotcp: keep SACK scoreboard sorted when doing rescue retransmission
Richard Scheffenegger [Sun, 18 Apr 2021 20:14:14 +0000 (22:14 +0200)]
tcp: keep SACK scoreboard sorted when doing rescue retransmission

Reviewed By: tuexen, kbowling, #transport
MFC after: 3 days
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29825

3 years agobhyve.8: Fix indention in the signals table
Mateusz Piotrowski [Sun, 18 Apr 2021 20:06:12 +0000 (22:06 +0200)]
bhyve.8: Fix indention in the signals table

MFC after: 2 weeks

3 years agobhyve.8: Clean up description of -r
Mateusz Piotrowski [Sun, 18 Apr 2021 20:03:40 +0000 (22:03 +0200)]
bhyve.8: Clean up description of -r

There is no need to wrap those flags in Op macros.

MFC after: 2 weeks

3 years agobhyve.8: Fix the synopsis of -p
Mateusz Piotrowski [Sun, 18 Apr 2021 20:01:30 +0000 (22:01 +0200)]
bhyve.8: Fix the synopsis of -p

Use appropriate mdoc macros.

MFC after: 2 weeks

3 years agobhyve.8: Improve the description of the -m flag
Mateusz Piotrowski [Sun, 18 Apr 2021 19:56:13 +0000 (21:56 +0200)]
bhyve.8: Improve the description of the -m flag

- Stylize the synopsis with proper mdoc macros
- Do some wordsmithing on the description for consistency.

MFC after: 2 weeks

3 years agobhyve.8: Improve the description and synopsis of -l
Mateusz Piotrowski [Sun, 18 Apr 2021 19:41:15 +0000 (21:41 +0200)]
bhyve.8: Improve the description and synopsis of -l

- Describe "-l help" separately for readability.
- List all the supported comX devices explicitly
- Use Cm instead of Ar for command modifiers (i.e., literal values a
  user can specify as an argument to the command).
- Explain where to get more information about the possible values of the
  conf argument.

MFC after: 2 weeks

3 years agobhyve.8: Sort the options in the OPTIONS section
Mateusz Piotrowski [Sun, 18 Apr 2021 18:26:04 +0000 (20:26 +0200)]
bhyve.8: Sort the options in the OPTIONS section

No content change intended. Just moving the option descriptions around
to follow the order suggested by style(9).

MFC after: 2 weeks

3 years agobhyve: Improve the option description in the usage message
Mateusz Piotrowski [Sun, 18 Apr 2021 18:13:54 +0000 (20:13 +0200)]
bhyve: Improve the option description in the usage message

- Sort options as suggested by style(9)
- Capitalize some words like CPU and HLT
- Add a missing description for the -G flag

MFC after: 2 weeks

3 years agobhyve: Fix synopsis in the usage message
Mateusz Piotrowski [Sun, 18 Apr 2021 18:04:12 +0000 (20:04 +0200)]
bhyve: Fix synopsis in the usage message

In particular:
- Sort short options to align with style(9)
- Add two missing flags: -G and -r
- Drop unnecessary angle brackets for consistency
- Rename the "vm" argument to vmname for consistency with the manual
  page

MFC after: 2 weeks

3 years agobhyve.8: Make synopsis more readable
Mateusz Piotrowski [Sun, 18 Apr 2021 17:54:45 +0000 (19:54 +0200)]
bhyve.8: Make synopsis more readable

There is no need to squeeze all the possible options into one synopsis
entry. Let "-l help" and "-s help" be listed separately.

While here, keep -s and its arguments on the same line.

MFC after: 2 weeks

3 years agoMinor style tidy: if( -> if (
Warner Losh [Sun, 18 Apr 2021 17:19:15 +0000 (11:19 -0600)]
Minor style tidy: if( -> if (

Fix a few 'if(' to be 'if (' in a few places, per style(9) and
overwhelming usage in the rest of the kernel / tree.

MFC After: 3 days
Sponsored by: Netflix

3 years agoMinor style cleanup
Warner Losh [Sun, 18 Apr 2021 17:10:59 +0000 (11:10 -0600)]
Minor style cleanup

We prefer 'while (0)' to 'while(0)' according to grep and stlye(9)'s
space after keyword rule. Remove a few stragglers of the latter.
Many of these usages were inconsistent within the file.

MFC After: 3 days
Sponsored by: Netflix

3 years agomips/octeon SDK: Fix __cvmx_cmd_queue_lock asm for clang 11
Justin Hibbits [Sun, 18 Apr 2021 16:59:04 +0000 (11:59 -0500)]
mips/octeon SDK: Fix __cvmx_cmd_queue_lock asm for clang 11

The 'ticket' and 'my_ticket' arguments are both read and written within
the same asm block.  Clang is stricter with the constraints than gcc4
was, so accepts the '=r' at face value and will happily overwrite
registers that "should" be preserved.

Mark these operands to not clobber other operands, so they get their own
registers.

This fixes a panic on bringing up the octe interfaces.

3 years agojail.conf(5): emphasize where to find jail parameters
Fernando Apesteguía [Sun, 18 Apr 2021 15:53:42 +0000 (17:53 +0200)]
jail.conf(5): emphasize where to find jail parameters

Some people expect jail.conf(5) to have a list of jail parameters.
jail(8) contains a comprehensive list of all parameters to be used during jail
invocation or in jail.conf.

Highlighting where to look for jail parameters seems a reasonable solution.

PR: 244569
Reported by: joneum@
Approved by: 0mp (manpages, mentor)
Reviewed by: debdrup
Differential Revision: https://reviews.freebsd.org/D28701

3 years agofib algo: do not reallocate datapath index for datapath ptr update.
Alexander V. Chernikov [Sun, 18 Apr 2021 15:03:58 +0000 (16:03 +0100)]
fib algo: do not reallocate datapath index for datapath ptr update.

Fib algo uses a per-family array indexed by the fibnum to store
 lookup function pointers and per-fib data.

Each algorithm rebuild currently requires re-allocating this array
 to support atomic change of two pointers.

As in reality most of the changes actually involve changing only
 data pointer, add a shortcut performing in-flight pointer update.

MFC after: 2 weeks

3 years agoFib algo: extend KPI by allowing algo to set datapath pointers.
Alexander V. Chernikov [Thu, 15 Apr 2021 17:44:11 +0000 (18:44 +0100)]
Fib algo: extend KPI by allowing algo to set datapath pointers.

Some algorithms may require updating datapath and control plane
 algo pointers after the (batched) updates.

Export fib_set_datapath_ptr() to allow setting the new datapath
 function or data pointer from the algo.
Add fib_set_algo_ptr() to allow updating algo control plane
 pointer from the algo.
Add fib_epoch_call() epoch(9) wrapper to simplify freeing old
 datapath state.

Reviewed by: zec
Differential Revision: https://reviews.freebsd.org/D29799
MFC after: 1 week

3 years agotcp: add support for TCP over UDP
Michael Tuexen [Sun, 18 Apr 2021 14:08:08 +0000 (16:08 +0200)]
tcp: add support for TCP over UDP

Adding support for TCP over UDP allows communication with
TCP stacks which can be implemented in userspace without
requiring special priviledges or specific support by the OS.
This is joint work with rrs.

Reviewed by: rrs
Sponsored by: Netflix, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29469

3 years agoc.7: Describe more recent C standards
Faraz Vahedi [Sun, 18 Apr 2021 14:19:33 +0000 (16:19 +0200)]
c.7: Describe more recent C standards

Also, add some MLINKS and fix some typos.

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D28441

3 years agonetmap: use safer defaults for hwbuf_len
Vincenzo Maffione [Sun, 18 Apr 2021 13:36:05 +0000 (13:36 +0000)]
netmap: use safer defaults for hwbuf_len

We must make sure that incoming packets will never overflow the netmap
buffers, even when the user is using the offset feature. In the typical
scenario, the netmap buffer is 2KiB and, with an MTU of 1500, there are
~500 bytes available for user offsets.

Unfortunately, some NICs accept incoming packets even when they are
larger then the MTU. This means that the only way to stop DMA from
overflowing the netmap buffers, when offsets are allowed, is to choose
a hardware buffer length which is smaller than the netmap buffer
length. For most NICs and for 2KiB netmap buffers, this means 1024
bytes, which is unconveniently small.

The current code will select the small hardware buf size even when
offsets are not     in use. The main purpose of this change is to
fix this bug by returning to the normal behavior for the no-offsets
case.

At the same time, the patch pushes the handling of the offset case
to the lower level driver code, so that it can be made NIC-specific
(in future patches).

3 years agoFix zgrep --version
Mateusz Piotrowski [Tue, 13 Apr 2021 10:12:53 +0000 (12:12 +0200)]
Fix zgrep --version

"zgrep --version" is expected to print the version information in the
same way as "zgrep -V". However, the case handling the --version flag
is never reached, so "zgrep --version" prints:
    zgrep: missing pattern
instead of:
    grep (BSD grep, GNU compatible) 2.6.0-FreeBSD

Reviewed by: yuripv
Approved by: yuripv (src)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29813

3 years agogetprogname.3: Add an example
Mateusz Piotrowski [Sat, 17 Apr 2021 21:26:54 +0000 (23:26 +0200)]
getprogname.3: Add an example

It shows the difference between getprogname() and argv[0].

Reviewed by: yuripv
Approved by: yuripv (src)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27204

3 years agospigen.4: Fix typos
Mateusz Piotrowski [Sun, 18 Apr 2021 07:45:18 +0000 (09:45 +0200)]
spigen.4: Fix typos

MFC after: 3 days

3 years agonewbus: style nit: use while<space>(0)
Warner Losh [Sun, 18 Apr 2021 05:45:08 +0000 (23:45 -0600)]
newbus: style nit: use while<space>(0)

Sponsored by: Netflix

3 years agostress2: Added a syzkaller reproducer. A variation of syzkaller32.sh
Peter Holm [Sun, 18 Apr 2021 05:19:07 +0000 (07:19 +0200)]
stress2: Added a syzkaller reproducer. A variation of syzkaller32.sh

3 years agocontrib/wpa: Complete the revert of Import wpa.
Cy Schubert [Sun, 18 Apr 2021 00:28:11 +0000 (17:28 -0700)]
contrib/wpa: Complete the revert of Import wpa.

Remove files added by b51f459a2098622c31ed54f5c1bf0e03efce403b.
The util/config.c conflicts with wpa_supplicant/config.c causing
the linker error.

The proper approach would have been to prepare the wpa build to
build the various subdirectories into .a libraries. SRCS makes no
distinction between files of the same name. The MFV accounted for this
but the revert failed to remove the additional files, including the
conflicting utils/config.c.

3 years agoExplain the newfs naming convention
Mateusz Piotrowski [Wed, 20 Jan 2021 10:40:20 +0000 (11:40 +0100)]
Explain the newfs naming convention

It might be unclear why newfs and newfs_msdos should cross-reference
each other. Add a note explaining it.

This is a follow-up to 74bd20769706041108a573601cf0b61c755bdc56.

Reported by: kib
Reviewed by:    imp, kib, rpokala
MFC after: 3 days

3 years agofork.2: Add a simple use pattern
Mateusz Piotrowski [Sat, 17 Apr 2021 21:10:48 +0000 (23:10 +0200)]
fork.2: Add a simple use pattern

It seems to be a nice idea to show how fork() is usually used in
practice. This may act as a guide to developers who want to quickly
recall how to use the fork() function.

Reviewed by: bcr, yuripv
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27626

3 years agoports.7: Document DEBUG_FLAGS and the process of debugging ports
Mateusz Piotrowski [Sat, 17 Apr 2021 20:51:54 +0000 (22:51 +0200)]
ports.7: Document DEBUG_FLAGS and the process of debugging ports

Loosely based on https://wiki.freebsd.org/BenWoods/DebuggingPorts.

Reviewed by: crees
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27296

3 years agogrep: Fix an incorrect description of the -C flag
Mateusz Piotrowski [Fri, 5 Feb 2021 18:38:09 +0000 (19:38 +0100)]
grep: Fix an incorrect description of the -C flag

It seems that the number of lines is no longer an optional parameter to
the -C flag. Document it accordingly both in the manual page and the
usage message.

Reviewed by: yuripv
Approved by: yuripv
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D28509

3 years agoports.7: Add an example of setting variables for selected ports
Mateusz Piotrowski [Sat, 16 Jan 2021 23:10:44 +0000 (00:10 +0100)]
ports.7: Add an example of setting variables for selected ports

Reviewed by: crees
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28202

3 years agolibpfct: Fix PIC flag
Kristof Provost [Fri, 16 Apr 2021 19:00:51 +0000 (21:00 +0200)]
libpfct: Fix PIC flag

Use ${PICFLAG} rather than hard-adding -fPIC, which removes the
requirement for libnv to be built PIC.

MFC after:      4 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")

3 years agonewbus: Minor update fix.
Warner Losh [Sat, 17 Apr 2021 19:53:01 +0000 (13:53 -0600)]
newbus: Minor update fix.

driver_t was supposed to just be a quick hack for 4.x
compatibility. However, it's been documented now as the preferred API
rather than the replacement kobj_class_t. Drop the note about 4.x since
it's clear we're a bit late to retiring its use through the tree with
almost 1500 references to driver_t.

Sponsored by: Netflix

3 years agorack: Fix ECN on finalizing session.
Richard Scheffenegger [Sat, 17 Apr 2021 18:16:06 +0000 (20:16 +0200)]
rack: Fix ECN on finalizing session.

Maintain code similarity between RACK and base stack
for ECN. This may not strictly be necessary, depending
when a state transition to FIN_WAIT_1 is done in RACK
after a shutdown() or close() syscall.

MFC after: 3 days
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29658

3 years agousr.sbin/wpa: complete the revert of wpa import
Cy Schubert [Sat, 17 Apr 2021 17:48:35 +0000 (10:48 -0700)]
usr.sbin/wpa: complete the revert of wpa import

This completes the revert of b51f459a2098622c31ed54f5c1bf0e03efce403b.

3 years agoRevert wpa import.
Cy Schubert [Sat, 17 Apr 2021 15:44:52 +0000 (08:44 -0700)]
Revert wpa import.

b51f459a2098622c31ed54f5c1bf0e03efce403b resulted in a mismerge
due to having to do a remerge because my tree was over a week out of
date. Changes that were made to fix the build were lost in the remerge
resulting in build errors that were fixed a week ago.

3 years agompt(4): Remove incorrect S/G segments limits.
Alexander Motin [Sat, 17 Apr 2021 14:41:35 +0000 (10:41 -0400)]
mpt(4): Remove incorrect S/G segments limits.

First, two of those four checks are unreachable.
Second, I don't believe there should be ">=" instead of ">".
Third, bus_dma(9) already returns the same EFBIG if ">".

This fixes false I/O errors in worst S/G cases with maxphys >= 2MB.

MFC after: 1 week

3 years agowpa: Import wpa_supplicant/hostapd commit f91680c15
Cy Schubert [Sat, 17 Apr 2021 14:21:12 +0000 (07:21 -0700)]
wpa: Import wpa_supplicant/hostapd commit f91680c15

This is the April update to vendor/wpa committed upstream
2021/04/07.

This is MFV efec8223892b3e677acb46eae84ec3534989971f.

Suggested by: philip
Reviewed by: philip
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D29744

3 years agonetmap: make sure rings are disabled during resets
Vincenzo Maffione [Sat, 17 Apr 2021 14:01:20 +0000 (14:01 +0000)]
netmap: make sure rings are disabled during resets

Explicitly disable ring synchronization before calling
callbacks that may result in a hardware reset.

Before this patch we relied on capturing the down/up events which,
however, may not be issued by all drivers.

3 years agotcp: Rename rfc6675_pipe to sack.revised, and enable by default
Richard Scheffenegger [Sat, 17 Apr 2021 12:59:30 +0000 (14:59 +0200)]
tcp: Rename rfc6675_pipe to sack.revised, and enable by default

As full support of RFC6675 is in place, deprecating
net.inet.tcp.rfc6675_pipe and enabling by default
net.inet.tcp.sack.revised.

Reviewed By: #transport, kbowling, rrs
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D28702

3 years agoixgbe: Clarify index name in ixgbe_mc_filter_apply
Kevin Bowling [Sat, 17 Apr 2021 01:17:43 +0000 (18:17 -0700)]
ixgbe: Clarify index name in ixgbe_mc_filter_apply

"It looks like it would be less confusing to rename 'count' to
something like 'idx', since that's what it's used for in this
function."

Reviewed by: erj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29798

3 years agotcp_respond(): fix assertion, should have been done in 08d9c920275.
Gleb Smirnoff [Fri, 16 Apr 2021 22:19:26 +0000 (15:19 -0700)]
tcp_respond(): fix assertion, should have been done in 08d9c920275.

3 years agoRemove extra space at start of file.
Warner Losh [Fri, 16 Apr 2021 18:40:57 +0000 (12:40 -0600)]
Remove extra space at start of file.

Sponsored by: Netflix

3 years agonewbus: style nit
Warner Losh [Fri, 16 Apr 2021 16:51:20 +0000 (10:51 -0600)]
newbus: style nit

Sponsored by: Netflix

3 years agoopal_console: fix serial console output corruption on powerpc64
Alfredo Dal'Ava Junior [Fri, 16 Apr 2021 22:51:15 +0000 (19:51 -0300)]
opal_console: fix serial console output corruption on powerpc64

Adds OPAL_CONSOLE_WRITE error handling and implements a call to
OPAL_CONSOLE_WRITE_BUFFER_SPACE to verify if there's enough space
before writing to console.

This fixes serial port output getting corrupted on fast writes, like
on "dmesg" output.

Tested on Raptor Blackbird running powerpc64 BE kernel

Reviewed by: luporl
Sponsored by: Eldorado Reserach Institute (eldorado.org.br)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29063

3 years agopms(4): Limit maximum I/O size to 256KB instead of 1MB.
Alexander Motin [Fri, 16 Apr 2021 19:39:01 +0000 (15:39 -0400)]
pms(4): Limit maximum I/O size to 256KB instead of 1MB.

There is a weird limit of AGTIAPI_MAX_DMA_SEGS (128) S/G segments per
I/O since the initial driver import.  I don't know why it was added,
can only guess some hardware limitation, but in worst case it means
maximum I/O size of 508KB.  Respect it to be safe, rounding to 256KB.

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

3 years agopms(4): Do not return CAM_REQ_CMP on errors.
Alexander Motin [Fri, 16 Apr 2021 19:16:09 +0000 (15:16 -0400)]
pms(4): Do not return CAM_REQ_CMP on errors.

It is a direct request for data corruptions, one report of which we
have received.  I am very surprised that only one.

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

3 years agolinux: support AT_EMPTY_PATH flag in fchownat(2)
Edward Tomasz Napierala [Fri, 16 Apr 2021 15:26:43 +0000 (16:26 +0100)]
linux: support AT_EMPTY_PATH flag in fchownat(2)

This fixes rsyslog package installation scripts in Bionic.

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

3 years agolinux: make fstatat(2) handle AT_EMPTY_PATH
Edward Tomasz Napierala [Fri, 16 Apr 2021 07:52:59 +0000 (08:52 +0100)]
linux: make fstatat(2) handle AT_EMPTY_PATH

Without it, Qt5 apps from Focal fail to start, being unable to load
their plugins.  It's also necessary for glibc 2.33, as found in recent
Arch snapshots.

PR: 254112
Reviewed By: kib
Sponsored by: The FreeBSD Foundation, EPSRC
Differential Revision: https://reviews.freebsd.org/D28192

3 years agoipfw: do not use sleepable malloc in callout context.
Andrey V. Elsukov [Fri, 16 Apr 2021 07:22:44 +0000 (10:22 +0300)]
ipfw: do not use sleepable malloc in callout context.

Use M_NOWAIT flag when hash growing is called from callout.

PR:             255041
Reviewed by: kevans
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D29772

3 years agoifconfig: Reuse media state in ifmedia_getstate
Ryan Moeller [Fri, 16 Apr 2021 02:32:25 +0000 (22:32 -0400)]
ifconfig: Reuse media state in ifmedia_getstate

This restores behavior lost in code cleanup, fixing a regression after
2803fa471e77dc8f227fe00bbf075de7feb10022 where changing media options
only applies some of the changes, not all.

Reported by: np
Reviewed by: donner
MFC after: immediately
Differential Revision: https://reviews.freebsd.org/D29741

3 years agomodules: remove stale if_wg reference
Kyle Evans [Fri, 16 Apr 2021 00:59:13 +0000 (19:59 -0500)]
modules: remove stale if_wg reference

This variable isn't being used anywhere, remove it.

3 years agofwip(4): fixing kernel panic when receiving unicast packet
Tai-hwa Liang [Thu, 15 Apr 2021 14:24:14 +0000 (14:24 +0000)]
fwip(4): fixing kernel panic when receiving unicast packet

Wrapping fwip_unicast_input() with NET_EPOCH_{ENTER,EXIT} to avoid a
NET_EPOCH_ASSERT() in netisr_dispatch().

Reviewed by: hselasky
MFC after: 2 weeks

3 years agosyncache.4: fix mandoc in cb8d7c44d6a
Gleb Smirnoff [Thu, 15 Apr 2021 22:50:01 +0000 (15:50 -0700)]
syncache.4: fix mandoc in cb8d7c44d6a

Noticed by: brueffer

3 years agotcp_syncache: add net.inet.tcp.syncache.see_other sysctl
Gleb Smirnoff [Fri, 19 Mar 2021 07:22:36 +0000 (00:22 -0700)]
tcp_syncache: add net.inet.tcp.syncache.see_other sysctl

A security feature from c06f087ccb12 appeared to be a huge bottleneck
under SYN flood. To mitigate that add a sysctl that would make
syncache(4) globally visible, ignoring UID/GID, jail(2) and mac(4)
checks. When turned on, we won't need to call crhold() on the listening
socket credential for every incoming SYN packet.

Reviewed by: bz

3 years agoRevert "nfsd: cut the Linux NFSv4.1/4.2 some slack w.r.t. RFC5661"
Rick Macklem [Thu, 15 Apr 2021 21:08:40 +0000 (14:08 -0700)]
Revert "nfsd: cut the Linux NFSv4.1/4.2 some slack w.r.t. RFC5661"

This reverts commit 9edaceca8165e2864267547311daf145bb520270.

It turns out that the Linux client intentionally does an NFSv4.1
RPC with only a Sequence operation in it and with "seqid + 1"
for the slot.  This is used to re-synchronize the slot's seqid
and the client expects the NFS4ERR_SEQ_MISORDERED error reply.

As such, revert the patch, so that the server remains RFC5661
compliant.

3 years agoAdd batched update support for the fib algo.
Alexander V. Chernikov [Fri, 9 Apr 2021 21:30:10 +0000 (22:30 +0100)]
Add batched update support for the fib algo.

Initial fib algo implementation was build on a very simple set of
 principles w.r.t updates:

1) algorithm is ether able to apply the change synchronously (DIR24-8)
 or requires full rebuild (bsearch, lradix).
2) framework falls back to rebuild on every error (memory allocation,
 nhg limit, other internal algo errors, etc).

This changes brings the new "intermediate" concept - batched updates.
Algotirhm can indicate that the particular update has to be handled in
 batched fashion (FLM_BATCH).
The framework will write this update and other updates to the temporary
 buffer instead of pushing them to the algo callback.
Depending on the update rate, the framework will batch 50..1024 ms of updates
 and submit them to a different algo callback.

This functionality is handy for the slow-to-rebuild algorithms like DXR.

Differential Revision: https://reviews.freebsd.org/D29588
Reviewed by: zec
MFC after: 2 weeks

3 years agoe1000: Restore VF interface random MAC
Kevin Bowling [Thu, 15 Apr 2021 18:45:02 +0000 (11:45 -0700)]
e1000: Restore VF interface random MAC

Restore 525e07418c77 after the iflib conversion of igb(4). This
reenables random MAC address generation when attaching to a VF with a
zeroed MAC.

PR: 253535
Reported by: Balaev PA <mail@void.so>
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29785

3 years agoe1000: fix em_mac_min and 82547 packet buffer
Kevin Bowling [Thu, 15 Apr 2021 16:58:36 +0000 (09:58 -0700)]
e1000: fix em_mac_min and 82547 packet buffer

The boundary differentiating "lem" vs "em" class devices was wrong
after the iflib conversion of lem(4).

The Packet Buffer size for 82547 class chips was not set correctly
after the iflib conversion of lem(4).

These changes restore functionality on an 82547 for the submitter.

PR: 236119
Reported by: Jeff Gibbons <jgibbons@protogate.com>
Reviewed by: markj
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D29766

3 years agoe1000: disable hw.em.sbp debug setting
Kevin Bowling [Thu, 15 Apr 2021 16:48:41 +0000 (09:48 -0700)]
e1000: disable hw.em.sbp debug setting

This is a debugging tunable that shouldn't have retained this setting
after the initial iflib conversion of the driver

PR: 248934
Reported by: Franco Fichtner <franco@opnsense.org>
Reviewed by: markj
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D29768

3 years agoRemove XFAIL from tests/lib/msun/lround_test:main
Alex Richardson [Thu, 15 Apr 2021 15:07:58 +0000 (16:07 +0100)]
Remove XFAIL from tests/lib/msun/lround_test:main

This test no longer fails after 3b00222f156dca5700c839d73e36daf479fa640c.

PR: 205451
MFC after: 1 week

3 years agoRemove amd64 XFAIL from tests/lib/msun/fma_test:infinities
Alex Richardson [Thu, 15 Apr 2021 15:04:19 +0000 (16:04 +0100)]
Remove amd64 XFAIL from tests/lib/msun/fma_test:infinities

This test no longer fails after 3b00222f156dca5700c839d73e36daf479fa640c.

PR: 205448
MFC after: 1 week

3 years agolib/msun: Exclude ignored-pragmas from -Werror
Alex Richardson [Thu, 15 Apr 2021 15:27:52 +0000 (16:27 +0100)]
lib/msun: Exclude ignored-pragmas from -Werror

This avoids build failures due to the clang 12 warning:
    '#pragma FENV_ACCESS' is not supported on this target - ignored

Clang 12 currently emits this warning for all non-x86 architectures.
While this can result in incorrect code generation (e.g. on AArch64 some
exceptions are not raised as expected), this is a pre-existing issue and
we should not fail the build due to this warning.

Reviewed By: dim, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29743

3 years agolinux: implement O_PATH
Edward Tomasz Napierala [Thu, 15 Apr 2021 14:24:51 +0000 (15:24 +0100)]
linux: implement O_PATH

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

3 years agong_ubt: Block attachment of uninitialized Intel Wireless 7265
Vladimir Kondratyev [Thu, 15 Apr 2021 14:26:32 +0000 (17:26 +0300)]
ng_ubt: Block attachment of uninitialized Intel Wireless 7265

As this controller requires firmware patch downloading to operate.
"Intel Wireless 7265" support in iwmbtfw(8) is yet to be done.

Tested by: arrowd et al
PR: 228787
MFC after: 2 weeks

3 years agong_ubt: Use DEFINE_CLASS_1 macro for kobj inheritance.
Vladimir Kondratyev [Thu, 15 Apr 2021 14:25:50 +0000 (17:25 +0300)]
ng_ubt: Use DEFINE_CLASS_1 macro for kobj inheritance.

MFC after: 2 weeks

3 years agong_ubt: Do not clear stall before receiving of HCI command response.
Vladimir Kondratyev [Thu, 15 Apr 2021 14:25:00 +0000 (17:25 +0300)]
ng_ubt: Do not clear stall before receiving of HCI command response.

Unconditional execution of "clear feature" request at SETUP stage was
workaround for probe failures on ng_ubt.ko re-kldloading which is
unnecessary now.

Reviewed by: hselasky
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D29775

3 years agolinux: extend the LINUX_O_ constants to make room for O_PATH
Edward Tomasz Napierala [Thu, 15 Apr 2021 13:38:58 +0000 (14:38 +0100)]
linux: extend the LINUX_O_ constants to make room for O_PATH

No functional changes.

Sponsored By: EPSRC

3 years agoAdd some regression tests for O_PATH and AT_EMPTY_PATH
Mark Johnston [Thu, 15 Apr 2021 13:40:57 +0000 (09:40 -0400)]
Add some regression tests for O_PATH and AT_EMPTY_PATH

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29719

3 years agob_vflags update requries bufobj lock
Konstantin Belousov [Tue, 13 Apr 2021 10:22:56 +0000 (13:22 +0300)]
b_vflags update requries bufobj lock

The trunc_dependencies() issue was reported by Alexander Lochmann
<alexander.lochmann@tu-dortmund.de>, who found the problem by performing
lock analysis using LockDoc, see https://doi.org/10.1145/3302424.3303948.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 years agolpd: Update SYNOPSIS with new flag
Chris Rees [Thu, 15 Apr 2021 12:26:10 +0000 (13:26 +0100)]
lpd: Update SYNOPSIS with new flag

Reported by: 0mp

3 years agoFix build with WITHOUT_AUDIT=yes in src.conf
Emmanuel Vadot [Thu, 15 Apr 2021 12:11:13 +0000 (14:11 +0200)]
Fix build with WITHOUT_AUDIT=yes in src.conf

Always install the audit related includes are some part of the source
always requires them.

Reported by: many
Fixes: 8c3eaf244a417a4

3 years agolpd.8: Chase Dd-- took old value when merging
Chris Rees [Thu, 15 Apr 2021 11:40:16 +0000 (12:40 +0100)]
lpd.8: Chase Dd-- took old value when merging

3 years agolpd: Add -F flag to prevent daemonizing
Chris Rees [Sat, 3 Apr 2021 17:51:56 +0000 (18:51 +0100)]
lpd: Add -F flag to prevent daemonizing

This is necessary for use with supervision, e.g. runit.

I chose -F simply because that is what the folks at LPRng use.

Approved by: pfg, gad, ngie
Differential Revision: https://reviews.freebsd.org/D29566

3 years agoO_PATH: allow vnode kevent filter on such files
Konstantin Belousov [Wed, 7 Apr 2021 18:31:48 +0000 (21:31 +0300)]
O_PATH: allow vnode kevent filter on such files

if VREAD access is checked as allowed during open

Requested by: wulf
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D29323

3 years agoO_PATH: Allow to open symlink
Konstantin Belousov [Wed, 7 Apr 2021 03:23:25 +0000 (06:23 +0300)]
O_PATH: Allow to open symlink

When O_NOFOLLOW is specified, namei() returns the symlink itself.  In
this case, open(O_PATH) should be allowed, to denote the location of symlink
itself.

Prevent O_EXEC in this case, execve(2) code is not ready to try to execute
symlinks.

Reported by: wulf
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D29323

3 years agoMake files opened with O_PATH to not block non-forced unmount
Konstantin Belousov [Sat, 3 Apr 2021 18:55:11 +0000 (21:55 +0300)]
Make files opened with O_PATH to not block non-forced unmount

by only keeping hold count on the vnode, instead of the use count.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D29323

3 years agoopen(2): Implement O_PATH
Konstantin Belousov [Thu, 18 Mar 2021 10:41:47 +0000 (12:41 +0200)]
open(2): Implement O_PATH

Reviewed by: markj
Tested by: pho
Discussed with: walker.aj325_gmail.com, wulf
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D29323

3 years agoAdd AT_EMPTY_PATH for several *at(2) syscalls
Konstantin Belousov [Sun, 7 Mar 2021 14:29:09 +0000 (16:29 +0200)]
Add AT_EMPTY_PATH for several *at(2) syscalls

It is currently allowed to fchownat(2), fchmodat(2), fchflagsat(2),
utimensat(2), fstatat(2), and linkat(2).

For linkat(2), PRIV_VFS_FHOPEN privilege is required to exercise the flag.
It allows to link any open file.

Requested by: trasz
Tested by: pho, trasz
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D29111

3 years agoAT_RESOLVE_BENEATH is bsd-specific
Konstantin Belousov [Thu, 11 Mar 2021 15:07:02 +0000 (17:07 +0200)]
AT_RESOLVE_BENEATH is bsd-specific

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D29111

3 years agovfs_vnops.c: Make vn_statfile() non-static
Konstantin Belousov [Thu, 18 Mar 2021 10:41:07 +0000 (12:41 +0200)]
vfs_vnops.c: Make vn_statfile() non-static

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D29323

3 years agoStyle.
Konstantin Belousov [Thu, 18 Mar 2021 10:40:20 +0000 (12:40 +0200)]
Style.

Add missed spaces, wrap long lines.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D29323

3 years agolink(2): correct descriptor name in AT_RESOLVE_BENEATH description
Konstantin Belousov [Tue, 30 Mar 2021 21:56:28 +0000 (00:56 +0300)]
link(2): correct descriptor name in AT_RESOLVE_BENEATH description

Noted and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D29111

3 years agocache: extend mismatch vnode assert print to include the name
Mateusz Guzik [Thu, 15 Apr 2021 07:55:43 +0000 (07:55 +0000)]
cache: extend mismatch vnode assert print to include the name

3 years agobhyve: implement rdmsr for MSR_IA32_FEATURE_CONTROL
Corvin Köhne [Thu, 15 Apr 2021 03:49:19 +0000 (13:49 +1000)]
bhyve: implement rdmsr for MSR_IA32_FEATURE_CONTROL

Without the -w option, Windows guests crash on boot. This is caused by a rdmsr
of MSR_IA32_FEATURE_CONTROL. Windows checks this MSR to determine enabled VMX
features. This MSR isn't emulated in bhyve, so a #GP exception is injected
which causes Windows to crash.

Fix by returning a rdmsr of MSR_IA32_FEATURE_CONTROL with Lock Bit set and
VMX disabled to informWindows that VMX isn't available.

Reviewed by: jhb, grehan (bhyve)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29665

3 years agoEnsure that the mount command shows "with quotas" when quotas are enabled.
Kirk McKusick [Wed, 14 Apr 2021 22:22:12 +0000 (15:22 -0700)]
Ensure that the mount command shows "with quotas" when quotas are enabled.

When quotas are enabled with the quotaon(8) command, it sets the
MNT_QUOTA flag in the mount structure mnt_flag field. The mount
structure holds a cached copy of the filesystem statfs structure
in mnt_stat that includes a copy of the mnt_flag field in
mnt_stat.f_flags. The mnt_stat structure may not be updated for
hours. Since the mount command requests mount details using the
MNT_NOWAIT option, it gets the mount's mnt_stat statfs structure
whose f_flags field does not yet show the MNT_QUOTA flag being set
in mnt_flag.

The fix is to have quotaon(8) set the MNT_QUOTA flag in both mnt_flag
and in mnt_stat.f_flags so that it will be immediately visible to
callers of statfs(2).

Reported by:  Christos Chatzaras
Tested by:    Christos Chatzaras
PR:           254682
MFC after:    3 days
Sponsored by: Netflix

3 years agohidmap: add missing opt_hid.h to module Makefile
Vladimir Kondratyev [Wed, 14 Apr 2021 19:55:52 +0000 (22:55 +0300)]
hidmap: add missing opt_hid.h to module Makefile

Reported by: pstef
MFC after: 2 weeks

3 years agoRevert "config(8): Correct the mentioned paper in the SEE ALSO section"
Gordon Bergling [Wed, 14 Apr 2021 18:22:48 +0000 (20:22 +0200)]
Revert "config(8): Correct the mentioned paper in the SEE ALSO section"

config(8) was first imported from 4.4BSD.

Reported by: rgrimes

This reverts commit e6ab1e365c06559e964667d2f5a6de856fa28be6.

3 years agouma: Introduce per-domain reclamation functions
Mark Johnston [Wed, 14 Apr 2021 16:57:24 +0000 (12:57 -0400)]
uma: Introduce per-domain reclamation functions

Make it possible to reclaim items from a specific NUMA domain.

- Add uma_zone_reclaim_domain() and uma_reclaim_domain().
- Permit parallel reclamations.  Use a counter instead of a flag to
  synchronize with zone_dtor().
- Use the zone lock to protect cache_shrink() now that parallel reclaims
  can happen.
- Add a sysctl that can be used to trigger reclamation from a specific
  domain.

Currently the new KPIs are unused, so there should be no functional
change.

Reviewed by: mav
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29685

3 years agouma: Split bucket_cache_drain() to permit per-domain reclamation
Mark Johnston [Fri, 9 Apr 2021 13:47:09 +0000 (09:47 -0400)]
uma: Split bucket_cache_drain() to permit per-domain reclamation

Note that the per-domain variant does not shrink the target bucket size.

No functional change intended.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

3 years agodomainset: Define additional global policies
Mark Johnston [Wed, 14 Apr 2021 16:56:39 +0000 (12:56 -0400)]
domainset: Define additional global policies

Add global definitions for first-touch and interleave policies.  The
former may be useful for UMA, which implements a similar policy without
using domainset iterators.

No functional change intended.

Reviewed by: mav
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29104

3 years agoossl(4): Install the man page also for arm64
Gordon Bergling [Wed, 14 Apr 2021 16:32:56 +0000 (18:32 +0200)]
ossl(4): Install the man page also for arm64

In 22bd0c9731d7 ossl(4) was ported to arm64. The manual page was
adapted, but never installed since the ossl(4) manual page was
i386 / amd64 only.

Reviewed by: mhorne
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29762

3 years agoexpand @TPUT@ in ncurses manpages
Yuri Pankov [Wed, 14 Apr 2021 15:16:59 +0000 (18:16 +0300)]
expand @TPUT@ in ncurses manpages

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D29761

3 years agoarm: Add no-cftconvert for sdma-imx6 files
Emmanuel Vadot [Wed, 14 Apr 2021 13:43:37 +0000 (15:43 +0200)]
arm: Add no-cftconvert for sdma-imx6 files

Fixes a warning when building kernel:
ctfconvert: file.c: Couldn't read ehdr: Invalid argument

MFC after: 3 days

3 years agopf tests: Test clearing rules counters
Kristof Provost [Mon, 12 Apr 2021 15:29:19 +0000 (17:29 +0200)]
pf tests: Test clearing rules counters

This was briefly broken, so ensure that we can read and clear rules
counters.

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

3 years agopfctl: Fix clearing rules counters
Kristof Provost [Mon, 12 Apr 2021 15:23:33 +0000 (17:23 +0200)]
pfctl: Fix clearing rules counters

After the migration to libpfctl for rule retrieval we accidentally lost
support for clearing the rules counters.

Introduce a get_clear variant of pfctl_get_rule() which allows rules
counters to be cleared.

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

3 years agozfs: merge openzfs/zfs@3522f57b6 (master)
Martin Matuska [Wed, 14 Apr 2021 10:49:10 +0000 (12:49 +0200)]
zfs: merge openzfs/zfs@3522f57b6 (master)

Notable upstream pull request merges:
  #11742 When specifying raidz vdev name, parity count should match
  #11744 Use a helper function to clarify gang block size
  #11771 Support running FreeBSD buildworld on Arm-based macOS hosts

This is the last update that will be MFCed into stable/13.

From now on, the tracking of OpenZFS branches will be different:
- main continues tracking openzfs/zfs/master
- stable/13 is going to track openzfs/zfs/zfs-2.1-release

Obtained from: OpenZFS
MFC after: 1 week