]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoFix a typo in Gordon's login
Mateusz Piotrowski [Mon, 19 Apr 2021 13:42:31 +0000 (15:42 +0200)]
Fix a typo in Gordon's login

It's gbe, not bge.

Fixes: bffc3fb3c09b Add metor -> mentee information (docs)

3 years agopf tests: Test set keepcounters
Kristof Provost [Thu, 15 Apr 2021 14:53:16 +0000 (16:53 +0200)]
pf tests: Test set keepcounters

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

3 years agopf: Optionally attempt to preserve rule counter values across ruleset updates
Kristof Provost [Thu, 15 Apr 2021 14:12:11 +0000 (16:12 +0200)]
pf: Optionally attempt to preserve rule counter values across ruleset updates

Usually rule counters are reset to zero on every update of the ruleset.
With keepcounters set pf will attempt to find matching rules between old
and new rulesets and preserve the rule counters.

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

3 years agopf: Remove PFRULE_REFS from userspace
Kristof Provost [Thu, 15 Apr 2021 11:41:07 +0000 (13:41 +0200)]
pf: Remove PFRULE_REFS from userspace

PFRULE_REFS should never be used by userspace, so hide it behind #ifdef
_KERNEL.

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

3 years agopf: PFRULE_REFS should not be user-visible
Kristof Provost [Thu, 15 Apr 2021 11:38:56 +0000 (13:38 +0200)]
pf: PFRULE_REFS should not be user-visible

Split the PFRULE_REFS flag from the rule_flag field. PFRULE_REFS is a
kernel-internal flag and should not be exposed to or read from
userspace.

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

3 years agobridge tests: Test STP config BPDU validation
Kristof Provost [Thu, 15 Apr 2021 12:55:00 +0000 (14:55 +0200)]
bridge tests: Test STP config BPDU validation

PR: 254924
Reviewed by: donner
Differential Revision: https://reviews.freebsd.org/D29783

3 years agobridgestp: validate timer values in config BPDU
Jonah Caplan [Thu, 15 Apr 2021 09:28:42 +0000 (11:28 +0200)]
bridgestp: validate timer values in config BPDU

IEEE Std 802.1D-2004 Section 17.14 defines permitted ranges for timers.
Incoming BPDU messages should be checked against the permitted ranges.
The rest of 17.14 appears to be enforced already.

PR: 254924
Reviewed by: kp, donner
Differential Revision: https://reviews.freebsd.org/D29782

3 years agolinux(4): bump osrelease to 4.4.0.
Edward Tomasz Napierala [Mon, 19 Apr 2021 10:37:47 +0000 (11:37 +0100)]
linux(4): bump osrelease to 4.4.0.

This is required for the current Arch Linux binaries to work.

PR: 254112
Reviewed By: emaste
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D29218

3 years agoRevert "lib/libc/net/nsdispatch.c: Fix missing unlock and add locking annotations"
Alex Richardson [Mon, 19 Apr 2021 08:36:47 +0000 (09:36 +0100)]
Revert "lib/libc/net/nsdispatch.c: Fix missing unlock and add locking annotations"

This commit should not have introduced any functional changes, but
apparently it did. This appears to have broken LDAP setups.
Reverting for now. Will reland once I have fixed the breakage.

This reverts commit 5245bf7b92b74e556527b4916a8deba386fe5772.
Reported By: Александр Недоцуков, brd
MFC after: immediately

3 years agoAMD-vi: Fortify IVHD device_identify process
Ka Ho Ng [Mon, 19 Apr 2021 08:07:03 +0000 (16:07 +0800)]
AMD-vi: Fortify IVHD device_identify process

- Use malloc(9) to allocate ivhd_hdrs list. The previous assumption
  that there are at most 10 IVHDs in a system is not true. A counter
  example would be a system with 4 IOMMUs, and each IOMMU is related
  to IVHDs type 10h, 11h and 40h in the ACPI IVRS table.
- Always scan through the whole ivhd_hdrs list to find IVHDs that has
  the same DeviceId but less prioritized IVHD type.

Sponsored by: The FreeBSD Foundation
MFC with: 74ada297e897
Reviewed by: grehan
Approved by: lwhsu (mentor)
Differential Revision: https://reviews.freebsd.org/D29525

3 years ago[ath] Add ath_hal_getnav and ath_hal_setnav so the driver layer
Adrian Chadd [Thu, 1 Apr 2021 04:48:59 +0000 (21:48 -0700)]
[ath] Add ath_hal_getnav and ath_hal_setnav so the driver layer
can check the NAV as appropriate.

3 years ago[ath_hal] Add get/set NAV functions
Adrian Chadd [Wed, 31 Mar 2021 16:38:15 +0000 (09:38 -0700)]
[ath_hal] Add get/set NAV functions

The NAV (network allocation vector) register reflects the current MAC
tracking of NAV - when it will stay quiet before transmitting.

Other devices transmit their frame durations in their 802.11 PHY headers
and all devices that hear a frame - even if it's one in an encoding
they don't understand - will understand the low bitrate PHY header that
includes the frame duration.  So, they'll set NAV to this value so
they'll stay quiet until the transmit completes.

Anyway, sometimes the PHY NAV header is garbled and sometimes, notably
older broadcom devices, will fake a long NAV so they can get "cleaner" air
for local calibration.  When this happens, the hardware will stay quiet
for quite some time and this can lead to missed/stuck beacons, or
(for Very Large Values) a MAC hang.

This code just adds the ability to get/set the NAV; the driver will
need to take care of using it during transmit hangs and beacon misses
to see if it's due to a trash looking NAV.

3 years ago[ath_hal] ar9300: save TSF across full chip reset
Adrian Chadd [Wed, 31 Mar 2021 03:30:24 +0000 (20:30 -0700)]
[ath_hal] ar9300: save TSF across full chip reset

This saves the TSF across a a full reset.  The TSF is otherwise cleared
and subsequent beaconing stops until the TSF catches up to nexttbtt.

3 years agoless: upgrade to v581.
Xin LI [Mon, 19 Apr 2021 02:46:19 +0000 (19:46 -0700)]
less: upgrade to v581.

MFC after: 2 weeks

3 years agoVendor import of less v581.
Xin LI [Mon, 19 Apr 2021 01:15:19 +0000 (18:15 -0700)]
Vendor import of less v581.

3 years agobhyve.8: Fix mandoc -Tlint issues
Mateusz Piotrowski [Sun, 18 Apr 2021 23:53:06 +0000 (01:53 +0200)]
bhyve.8: Fix mandoc -Tlint issues

While here, keep network backends section consistent with other
sections.

MFC after: 2 weeks

3 years agobhyve: Document the format for HD audio backends
Mateusz Piotrowski [Sun, 18 Apr 2021 23:50:29 +0000 (01:50 +0200)]
bhyve: Document the format for HD audio backends

- This change is done for consistency with other backend definitions.

MFC after: 2 weeks

3 years agobhyve.8: Improve AHCI backends documentation
Mateusz Piotrowski [Sun, 18 Apr 2021 23:44:23 +0000 (01:44 +0200)]
bhyve.8: Improve AHCI backends documentation

- Document the backend format.

MFC after: 2 weeks

3 years agobhyve.8: Improve documentation of NVME backend
Mateusz Piotrowski [Sun, 18 Apr 2021 23:16:51 +0000 (01:16 +0200)]
bhyve.8: Improve documentation of NVME backend

- Document the configuration format.
- Document two additional configuration options: eui64 and dsm.

MFC after: 2 weeks

3 years agobhyve.8: Improve framebuffer backends description
Mateusz Piotrowski [Sun, 18 Apr 2021 22:59:44 +0000 (00:59 +0200)]
bhyve.8: Improve framebuffer backends description

- Use appropriate mdoc macros
- Document that tcp= is a synonym to rfb= (tcp is used in the examples,
  but never mentioned)
- Clarify the IP address specification

MFC after: 2 weeks

3 years agobhyve.8: Clean up virtio console device backends description
Mateusz Piotrowski [Sun, 18 Apr 2021 22:23:26 +0000 (00:23 +0200)]
bhyve.8: Clean up virtio console device backends description

MFC after: 2 weeks

3 years agobhyve.8: Clean up TTY, boot ROM, and pass-through descriptions
Mateusz Piotrowski [Sun, 18 Apr 2021 22:09:22 +0000 (00:09 +0200)]
bhyve.8: Clean up TTY, boot ROM, and pass-through descriptions

MFC after: 2 weeks

3 years agobhyve.8: Clean up 9P device backends section
Mateusz Piotrowski [Sun, 18 Apr 2021 21:52:48 +0000 (23:52 +0200)]
bhyve.8: Clean up 9P device backends section

MFC after: 2 weeks

3 years agobhyve.8: Clean up SCSI device backends section
Mateusz Piotrowski [Sun, 18 Apr 2021 21:49:18 +0000 (23:49 +0200)]
bhyve.8: Clean up SCSI device backends section

MFC after: 2 weeks

3 years agobhyve.8: Clean up block storage device backends description
Mateusz Piotrowski [Sun, 18 Apr 2021 21:39:53 +0000 (23:39 +0200)]
bhyve.8: Clean up block storage device backends description

MFC after: 2 weeks

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