]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoMFC r362516:
Oleksandr Tymoshenko [Tue, 14 Jul 2020 05:24:07 +0000 (05:24 +0000)]
MFC r362516:

Fix crash in drill(1) when IP has two subsequent dots

Cherry-pick crash fix from the upstream repo

PR: 226575
Reported by: Goran Mekić <meka@tilda.center>
Obtained from: https://git.nlnetlabs.nl/ldns/commit/?id=98291475

3 years agoiovctl(8): Correct a typo in the manpage and correct the SYNOPSIS
Gordon Bergling [Mon, 13 Jul 2020 19:28:10 +0000 (19:28 +0000)]
iovctl(8): Correct a typo in the manpage and correct the SYNOPSIS

PR: 246831
Submitted by: Jose Luis Duran <jlduran at gmail dot com>
Reviewed by: bcr (mentor)
Approved by: bcr (mentor)

3 years agoMFC r358995 (by pkelsey): Fix iflib freelist state corruption
Alexander Motin [Mon, 13 Jul 2020 17:20:20 +0000 (17:20 +0000)]
MFC r358995 (by pkelsey): Fix iflib freelist state corruption

This fixes a bug in iflib freelist management that breaks the required
correspondence between freelist indexes and driver ring slots.

PR: 243126, 243392, 240628

3 years agoMFC r362970, r362971:
Mark Johnston [Mon, 13 Jul 2020 16:43:23 +0000 (16:43 +0000)]
MFC r362970, r362971:
Permit cpuset_(get|set)domain() in capability mode.

3 years agoMFC r362968:
Mark Johnston [Mon, 13 Jul 2020 16:42:30 +0000 (16:42 +0000)]
MFC r362968:
Allow accesses of the caller's CPU and domain sets in capability mode.

3 years agoMFC r362966:
Mark Johnston [Mon, 13 Jul 2020 16:41:58 +0000 (16:41 +0000)]
MFC r362966:
Lift cpuset Capsicum checks into a subroutine.

3 years agoMFC r362781 and r362794:
Hans Petter Selasky [Mon, 13 Jul 2020 15:40:55 +0000 (15:40 +0000)]
MFC r362781 and r362794:
Implement is_signed(), type_max() and type_min() function macros in the
LinuxKPI.

Sponsored by: Mellanox Technologies

3 years agoMFC r362829:
Hans Petter Selasky [Mon, 13 Jul 2020 15:36:57 +0000 (15:36 +0000)]
MFC r362829:
The "pid" field in the LinuxKPI task struct is typically set to the thread ID
and not the process ID. Make sure the linux_task_exiting() function uses tdfind()
to lookup the BSD procedure structure pointer by the "pid" field, and only
fallback to pfind() when no match is found! This makes linux_task_exiting()
in line with the rest of the code.

Differential Revision: https://reviews.freebsd.org/D25509
Submitted by: Greg V <greg@unrelenting.technology>
Sponsored by: Mellanox Technologies

3 years agoMFC r362953:
Hans Petter Selasky [Mon, 13 Jul 2020 15:33:06 +0000 (15:33 +0000)]
MFC r362953:
Infiniband clients must be attached and detached in a specific order in ibcore.

Currently the linking order of the infiniband, IB, modules decide in which
order the clients are attached and detached. For example one IB client may
use resources from another IB client. This can lead to a potential deadlock
at shutdown. For example if the ipoib is unregistered after the ib_multicast
client is detached, then if ipoib is using multicast addresses a deadlock may
happen, because ib_multicast will wait for all its resources to be freed before
returning from the remove method.

Fix this by using module_xxx_order() instead of module_xxx().

Differential Revision: https://reviews.freebsd.org/D23973
Sponsored by: Mellanox Technologies

3 years agoMFC r362946:
Hans Petter Selasky [Mon, 13 Jul 2020 15:28:06 +0000 (15:28 +0000)]
MFC r362946:
Fix include file order in io.h in the LinuxKPI.
Make sure sys/types.h is included before machine/vm.h.

PR: 247775
Submitted by: pkubaj@
Sponsored by: Mellanox Technologies

3 years agoMFC 362491:
Mateusz Piotrowski [Sun, 12 Jul 2020 19:39:17 +0000 (19:39 +0000)]
MFC 362491:

Improve the rcorder manual page

- Fix formatting issues such as:
  - Use Ql instead of Dq Li as Li is deprecated
  - Address some mandoc warnings
- Add arguments missing from the list of options (i.e., document "-k keep"
  instead of just "-k").
- Document that -k and -s can be specified multiple times
- Use sshd instead of named for the example in the BUGS section, as named
  is not in the base system. Also, use Nm instead of Xr there as it is not
  the sshd binary that is required to be running, but the service.
- Use Sy instead of Cm for KEYWORDS. Cm is reserved for command-line
  modifiers of the CLI.
- Add an EXAMPLES section
- Cross-reference service(8).

3 years agoMFC r340655
Thomas Munro [Sun, 12 Jul 2020 10:07:01 +0000 (10:07 +0000)]
MFC r340655
  pom: Fix fencepost bugs.

PR: 231705
Submitted by:   Andrew Gierth <andrew@tao11.riddles.org.uk>
Approved by: allanjude (mentor)

3 years agoMFC r344656
Thomas Munro [Sun, 12 Jul 2020 09:49:53 +0000 (09:49 +0000)]
MFC r344656
  truss: Add support for fsync(2) and fdatasync(2).

Approved by:    mjg (mentor)
Differential Revision:  https://reviews.freebsd.org/D19295

3 years agoMFC r362942: shutdown.8: Fix typo
Niclas Zeising [Sun, 12 Jul 2020 07:25:02 +0000 (07:25 +0000)]
MFC r362942: shutdown.8: Fix typo

Fix a typo in shutdown.8, use ',' instead of '.' when listing items.

3 years agoMFC r350162:
Ganbold Tsagaankhuu [Sat, 11 Jul 2020 16:38:46 +0000 (16:38 +0000)]
MFC r350162:

Add emmc support for Rockchip RK3399 SoC.
Tested on NanoPC-T4 board.

3 years agoMFC r362396
Allan Jude [Sat, 11 Jul 2020 15:57:46 +0000 (15:57 +0000)]
MFC r362396
  ZFS: Allow setting checksum=skein on boot pools

PR: 245889
Reported by: delphij
Sponsored by: Klara Inc.
Event: July 2020 Bugathon

3 years agoMFC r346369
Allan Jude [Sat, 11 Jul 2020 14:55:11 +0000 (14:55 +0000)]
MFC r346369
  Close filedescriptors when done with them.

MFC r362412
  fix -c flag to work with input on stdin

PR: 247295
Sponsored by: Klara Inc.
Event: July 2020 Bugathon

3 years agoMFC r363013:
Dimitry Andric [Sat, 11 Jul 2020 09:43:16 +0000 (09:43 +0000)]
MFC r363013:

Merge commit 065fc1eafe7c from llvm git (by Richard Smith):

  PR45521: Preserve the value kind when performing a standard
  conversion sequence on a glvalue expression.

  If the sequence is supposed to perform an lvalue-to-rvalue
  conversion, then one will be specified as the first conversion in the
  sequence. Otherwise, one should not be invented.

This should fix clang crashing with "can't implicitly cast lvalue to
rvalue with this cast kind", followed by "UNREACHABLE executed at
/usr/src/contrib/llvm-project/clang/lib/Sema/Sema.cpp:538!", when
building recent versions of Ceph, and the CPAN module SYBER/Date-5.2.0.

Reported by: Willem Jan Withagen <wjw@digiware.nl>, eserte12@yahoo.de
PR: 245530, 247812

3 years agoMFC r362622
Vincenzo Maffione [Fri, 10 Jul 2020 18:30:53 +0000 (18:30 +0000)]
MFC r362622

iflib: netmap: add support for partial ring openings

Reviewed by:    gallatin
Differential Revision:  https://reviews.freebsd.org/D25254

3 years agoMFC r362633, r362633
Vincenzo Maffione [Fri, 10 Jul 2020 18:19:04 +0000 (18:19 +0000)]
MFC r362633, r362633

iflib: netmap: add per-tx-queue netmap support

Reviewed by:    gallatin
Differential Revision:  https://reviews.freebsd.org/D25253

3 years agoMFC r362612
Pawel Biernacki [Thu, 9 Jul 2020 20:54:16 +0000 (20:54 +0000)]
MFC r362612

bhyve: allow for automatic destruction on power-off

3 years agoMFC of 362560
Kirk McKusick [Thu, 9 Jul 2020 19:11:57 +0000 (19:11 +0000)]
MFC of 362560

Correctly describe libufs library sbget() and sbput() return values.

3 years agoMFC r362738: sh/tests: Re-enable bin.sh.execution.functional_test.bg12.0
Jilles Tjoelker [Thu, 9 Jul 2020 17:43:25 +0000 (17:43 +0000)]
MFC r362738: sh/tests: Re-enable bin.sh.execution.functional_test.bg12.0

PR: 247559

3 years agoMFC r362737: sh/tests: Fix flaky execution/bg12.0
Jilles Tjoelker [Thu, 9 Jul 2020 17:42:31 +0000 (17:42 +0000)]
MFC r362737: sh/tests: Fix flaky execution/bg12.0

When job control is not enabled, the shell ignores SIGINT while waiting for
a foreground process unless that process exits on SIGINT. In this case, the
foreground process is sleep and it does not exit on SIGINT because the
signal is only sent to the shell. Depending on order of events, this could
cause the SIGINT to be unexpectedly ignored.

On lightly loaded bare metal, the chance of this happening tends to be less
than 0.01% but with higher loads and/or virtualization it becomes more
likely.

Starting the sleep in background and using the wait builtin ensures SIGINT
will not be ignored.

PR: 247559
Reported by: lwhsu

3 years agoMFC r362112
Andrew Gallatin [Thu, 9 Jul 2020 17:10:18 +0000 (17:10 +0000)]
MFC r362112
x86: Bump default msi/msix vector limit to 2048

3 years agoMFC r362979:
Brooks Davis [Thu, 9 Jul 2020 16:58:53 +0000 (16:58 +0000)]
MFC r362979:

Fix a -Wvoid-pointer-to-enum-cast warning missed in r359978.

This pattern is used in callbacks with void * data arguments and seems
both relatively uncommon and relatively harmless.  Silence the warning
by casting through uintptr_t.

This warning is on by default in Clang 11.

Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24425

3 years agoMFC r362497:
Mark Johnston [Thu, 9 Jul 2020 14:42:41 +0000 (14:42 +0000)]
MFC r362497:
Move the definition of SCTP's system_base_info into sctp_crc32.c.

3 years agoMFC r362614, r362618:
Mark Johnston [Thu, 9 Jul 2020 14:18:14 +0000 (14:18 +0000)]
MFC r362614, r362618:
Add SCTP_SUPPORT handling to config.mk.

3 years agoMFC r362619:
Mark Johnston [Thu, 9 Jul 2020 14:17:04 +0000 (14:17 +0000)]
MFC r362619:
ipfw: Support the literal IPv6 address syntax in the fwd command.

3 years agoMFC r362887:
Konstantin Belousov [Thu, 9 Jul 2020 10:54:00 +0000 (10:54 +0000)]
MFC r362887:
mlx5_core: remove unneccessary LFENCE instruction.

3 years agoMFC r362886:
Konstantin Belousov [Thu, 9 Jul 2020 10:52:02 +0000 (10:52 +0000)]
MFC r362886:
linuxkpi: improvements for linux_pid_task() and linux_get_pid_task().

3 years agoMFC r362885:
Konstantin Belousov [Thu, 9 Jul 2020 10:50:06 +0000 (10:50 +0000)]
MFC r362885:
Use tdfind() in pget().

3 years agoMFC r362824:
Ryan Moeller [Thu, 9 Jul 2020 09:33:32 +0000 (09:33 +0000)]
MFC r362824:

libifconfig: Add function to get bridge status

The new function operates similarly to ifconfig_lagg_get_lagg_status and
likewise is accompanied by a function to free the bridge status data structure.

I have included in this patch the relocation of some strings describing STP
parameters and the PV2ID macro from ifconfig into net/if_bridgevar.h as they
are useful for consumers of libifconfig.

Reviewed by:    kp, melifaro, mmacy
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D25460

3 years agoMFC r361798, r361800: vfs: default disallow read(2) of a directory
Kyle Evans [Wed, 8 Jul 2020 18:29:06 +0000 (18:29 +0000)]
MFC r361798, r361800: vfs: default disallow read(2) of a directory

This MFC is in accordance with the original MFC plan outlined in the commit
message for r361798, appearing in full (with exception to metadata) below.

To summarize: this MFC only merges back the sysctl with a default disallow
policy, as in head, to ensure we hit any issues quickly but in a fashion
that end users can easily revert. Interested parties can flip the
security.bsd.allow_read_dir sysctl back to 1 to fully honor the previous
behavior of allowing read(2) of any dir, filesystem permitting.

r361798:
vfs: add restrictions to read(2) of a directory [1/2]

Historically, we've allowed read() of a directory and some filesystems will
accommodate (e.g. ufs/ffs, msdosfs). From the history department staffed by
Warner: <<EOF

pdp-7 unix seemed to allow reading directories, but they were weird, special
things there so I'm unsure (my pdp-7 assembler sucks).

1st Edition's sources are lost, mostly. The kernel allows it. The
reconstructed sources from 2nd or 3rd edition read it though.

V6 to V7 changed the filesystem format, and should have been a warning, but
reading directories weren't materially changed.

4.1b BSD introduced readdir because of UFS. UFS broke all directory reading
programs in 1983. ls, du, find, etc all had to be rewritten. readdir() and
friends were introduced here.

SysVr3 picked up readdir() in 1987 for the AT&T fork of Unix. SysVr4 updated
all the directory reading programs in 1988 because different filesystem
types were introduced.

In the 90s, these interfaces became completely ubiquitous as PDP-11s running
V7 faded from view and all the folks that initially started on V7 upgraded
to SysV. Linux never supported this (though I've not done the software
archeology to check) because it has always had a pathological diversity of
filesystems.
EOF

Disallowing read(2) on a directory has the side-effect of masking
application bugs from relying on other implementation's behavior
(e.g. Linux) of rejecting these with EISDIR across the board, but allowing
it has been a vector for at least one stack disclosure bug in the past[0].

By POSIX, this is implementation-defined whether read() handles directories
or not. Popular implementations have chosen to reject them, and this seems
sensible: the data you're reading from a directory is not structured in some
unified way across filesystem implementations like with readdir(2), so it is
impossible for applications to portably rely on this.

With this patch, we will reject most read(2) of a dirfd with EISDIR. Users
that know what they're doing can conscientiously set
bsd.security.allow_read_dir=1 to allow read(2) of directories, as it has
proven useful for debugging or recovery. A future commit will further limit
the sysctl to allow only the system root to read(2) directories, to make it
at least relatively safe to leave on for longer periods of time.

While we're adding logic pertaining to directory vnodes to vn_io_fault, an
additional assertion has also been added to ensure that we're not reaching
vn_io_fault with any write request on a directory vnode. Such request would
be a logical error in the kernel, and must be debugged rather than allowing
it to potentially silently error out.

Commented out shell aliases have been placed in root's chsrc/shrc to promote
awareness that grep may become noisy after this change, depending on your
usage.

A tentative MFC plan has been put together to try and make it as trivial as
possible to identify issues and collect reports; note that this will be
strongly re-evaluated. Tentatively, I will MFC this knob with the default as
it is in HEAD to improve our odds of actually getting reports. The future
priv(9) to further restrict the sysctl WILL NOT BE MERGED BACK, so the knob
will be a faithful reversion on stable/12. We will go into the merge
acknowledging that the sysctl default may be flipped back to restore
historical behavior at *any* point if it's warranted.

[0] https://www.freebsd.org/security/advisories/FreeBSD-SA-19:10.ufs.asc

r361800:
RELNOTES and UPDATING: Document the new policy on read(2) of dirfd

These changes have been completely flushed as of r361799; note it.

PR: 246412
Relnotes: yes 100%

3 years agoMFC r346386, r347890, r347896, r349895:
Alexander Motin [Wed, 8 Jul 2020 17:59:00 +0000 (17:59 +0000)]
MFC r346386, r347890, r347896, r349895:
remove the 4GB boundary requirement on PCI DMA segments

3 years agoMFC r362948:
Konstantin Belousov [Wed, 8 Jul 2020 10:04:12 +0000 (10:04 +0000)]
MFC r362948:
Fix typo.

3 years agoMFC r362580: TCP: fix cubic RTO reaction.
Richard Scheffenegger [Wed, 8 Jul 2020 09:04:20 +0000 (09:04 +0000)]
MFC r362580: TCP: fix cubic RTO reaction.

Proper TCP Cubic operation requires the knowledge
of the maximum congestion window prior to the
last congestion event.

This restores and improves a bugfix previously added
by jtl@ but subsequently removed due to a revert.

Reported by: chengc_netapp.com
Reviewed by: chengc_netapp.com, tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor, blanket)
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D25133

3 years agoMFC r362577: TCP: make after-idle work for transactional sessions.
Richard Scheffenegger [Wed, 8 Jul 2020 09:00:05 +0000 (09:00 +0000)]
MFC r362577: TCP: make after-idle work for transactional sessions.

The use of t_rcvtime as proxy for the last transmission
fails for transactional IO, where the client requests
data before the server can respond with a bulk transfer.

Set aside a dedicated variable to actually track the last
locally sent segment going forward.

Reported by: rrs
Reviewed by: rrs, tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor, blanket)
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D25016

3 years agoMFC r362779: gre(4): Add a STANDARDS section
Gordon Bergling [Tue, 7 Jul 2020 18:37:06 +0000 (18:37 +0000)]
MFC r362779: gre(4): Add a STANDARDS section

Expand the mentioned RFC in the SEE ALSO section
and reference RFC1701 and RFC1702.

PR: 240250
Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D25504

3 years agoMFC r362539:
Li-Wen Hsu [Tue, 7 Jul 2020 06:04:21 +0000 (06:04 +0000)]
MFC r362539:

Mention CI system information in development(7)

Approved by: 0mp, bcr
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25340

3 years agoMFC r362788:
Mitchell Horne [Mon, 6 Jul 2020 15:00:28 +0000 (15:00 +0000)]
MFC r362788:

Fix printf(3) output of long doubles on RISC-V

PR: 242067

3 years agoMFC r362338:
Mark Johnston [Mon, 6 Jul 2020 14:00:20 +0000 (14:00 +0000)]
MFC r362338:
Add the SCTP_SUPPORT kernel option.

3 years agoMFC r362739:
Mark Johnston [Mon, 6 Jul 2020 13:54:44 +0000 (13:54 +0000)]
MFC r362739:
Remove some redundant assignments and computations.

3 years agoMFC r362496, r362592:
Mark Johnston [Mon, 6 Jul 2020 13:54:18 +0000 (13:54 +0000)]
MFC r362496, r362592:
acpi_ibm(4): Add support for putting fans in disengaged mode.

PR: 247306

3 years agoMFC 362676:
Mateusz Piotrowski [Mon, 6 Jul 2020 09:04:06 +0000 (09:04 +0000)]
MFC 362676:

Fix trailing-comma-related typos in the tree when the Xr macro is used

3 years agoMFC r362711:
Konstantin Belousov [Sun, 5 Jul 2020 06:50:22 +0000 (06:50 +0000)]
MFC r362711:
top: do not try to use sysctl machdep.smp_active.

3 years agoMFC r362502,r362503: network.subr, rc.conf: unobsolete gif_interfaces.
Eugene Grosbein [Sat, 4 Jul 2020 15:16:48 +0000 (15:16 +0000)]
MFC r362502,r362503: network.subr, rc.conf: unobsolete gif_interfaces.

There are cases when gif_interfaces cannot be replaced
with cloned_interfaces, such as tunnels with external IPv6 addresses
and internal IPv4 or vice versa. Such configuration requires
extra invocation of ifconfig(8) and supported with gif_interfaces only.

3 years agoMFC r362672:
Li-Wen Hsu [Sat, 4 Jul 2020 09:18:19 +0000 (09:18 +0000)]
MFC r362672:

rtwn: Add a USB ID for Buffalo WI-U2-433DHP

PR: 247573
Submitted by: HATANO Tomomi <hatanou@infolab.ne.jp>

3 years agoMFC r362706:
Konstantin Belousov [Sat, 4 Jul 2020 08:34:43 +0000 (08:34 +0000)]
MFC r362706:
amd64 pmap: explain ptepindex.

3 years agoMFC r362770:
Hiroki Sato [Sat, 4 Jul 2020 07:04:56 +0000 (07:04 +0000)]
MFC r362770:

Fix CTYPE for ja_JP.eucJP and ja_JP.SJIS.

PR: 163168

3 years agoMFC r362705 and r362707:
Piotr Pawel Stefaniak [Sat, 4 Jul 2020 06:34:55 +0000 (06:34 +0000)]
MFC r362705 and r362707:
ps(1): reuse keyword "cpu" to show CPU number
ps(1): don't try to handle non-SMP systems

3 years agoBump __FreeBSD_version after making liblzma to use libmd implementation
Xin LI [Sat, 4 Jul 2020 03:27:51 +0000 (03:27 +0000)]
Bump __FreeBSD_version after making liblzma to use libmd implementation
of SHA256.

3 years agoMFC r362452, r362478: liblzma: Make liblzma use libmd implementation of SHA256.
Xin LI [Sat, 4 Jul 2020 03:26:17 +0000 (03:26 +0000)]
MFC r362452, r362478: liblzma: Make liblzma use libmd implementation of SHA256.

3 years agoMFC r362611
Pawel Biernacki [Fri, 3 Jul 2020 11:44:43 +0000 (11:44 +0000)]
MFC r362611

man page of select(2) should mention pselect(2)

Reviewed by: bcr (manpages), kib, trasz
Approved by: kib (mentor)
MFC after: 7 days
Sponsored by: Mysterious Code Ltd.

3 years agoMFC r362642: Don't log normal login_getpwclass(3) result.
Xin LI [Fri, 3 Jul 2020 07:22:34 +0000 (07:22 +0000)]
MFC r362642: Don't log normal login_getpwclass(3) result.

3 years agoMFC r362379:
Tom Jones [Thu, 2 Jul 2020 18:40:22 +0000 (18:40 +0000)]
MFC r362379:

Fix typo in apic.4

Reviewed by:    bcr (manpages)
Approved by:    jtl (co-mentor)
Differential Revision:  https://reviews.freebsd.org/D2535

3 years agoMFC 362324:
Mateusz Piotrowski [Thu, 2 Jul 2020 16:16:01 +0000 (16:16 +0000)]
MFC 362324:

Clean up and improve manual page for fuser(1)

- Mention option's arguments in the list of options (so that now we mention
  "-N system" instead of just "-N").
- Stylize signals and other constants like O_APPEND with Dv.
- Sort options.
- Change indentation width for readability.
- Fix a couple of typos.
- Sort symbols list.
- Use Sy instead of Cm for symbols. They are not command modifiers.
- Use Ex -std in the EXIT STATUS section for consistency with other manual
  pages.
- Use Ql instead of Dq Li for inline code examples as Li has recently been
  deprecated by mdoc.

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

3 years agoMFC 362325:
Mateusz Piotrowski [Thu, 2 Jul 2020 16:12:52 +0000 (16:12 +0000)]
MFC 362325:

Fix the --guid flag description

3 years agoMFC 362321:
Mateusz Piotrowski [Thu, 2 Jul 2020 16:10:34 +0000 (16:10 +0000)]
MFC 362321:

Improve periodic(8) manual page presentation

- Update synopsis to present all available arguments.
- Consistently call the argument specifying an arbitrary directory a
  "directory".
- Do not put macros into -width argument to Bl. They do not expand there.
- Stylize command modifiers like "daily" with Cm instead of Pa. While
  technically periodic(8) operates on directories with such names, it is
  confusing from the perspective of the manual page reader as Pa and Ar are
  stylized the same way. Also, I cannot recall a single manual page where
  Pa would be used to describe the syntax of command-line arguments.

3 years agoMFC r362630: Fix few panics on NVMe's timing out initialization requests.
Alexander Motin [Thu, 2 Jul 2020 01:02:40 +0000 (01:02 +0000)]
MFC r362630: Fix few panics on NVMe's timing out initialization requests.

3 years agoMFC r349893:
Michael Tuexen [Wed, 1 Jul 2020 23:47:51 +0000 (23:47 +0000)]
MFC r349893:

This commit updates rack to what is basically being used at NF as
well as sets in some of the groundwork for committing BBR. The
hpts system is updated as well as some other needed utilities
for the entrance of BBR. This is actually part 1 of 3 more
needed commits which will finally complete with BBRv1 being
added as a new tcp stack.

Merge conflics were manually resolved.

Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D20834

3 years agoMFC r356796:
Michael Tuexen [Wed, 1 Jul 2020 22:31:37 +0000 (22:31 +0000)]
MFC r356796:
Remove debug code not needed anymore.

Submitted by: rscheff
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D23208

3 years agoMFC r356663:
Michael Tuexen [Wed, 1 Jul 2020 22:22:26 +0000 (22:22 +0000)]
MFC r356663:

Fix race when accepting TCP connections.

When expanding a SYN-cache entry to a socket/inp a two step approach was
taken:
1) The local address was filled in, then the inp was added to the hash
   table.
2) The remote address was filled in and the inp was relocated in the
   hash table.
Before the epoch changes, a write lock was held when this happens and
the code looking up entries was holding a corresponding read lock.
Since the read lock is gone away after the introduction of the
epochs, the half populated inp was found during lookup.
This resulted in processing TCP segments in the context of the wrong
TCP connection.
This patch changes the above procedure in a way that the inp is fully
populated before inserted into the hash table.

Thanks to Paul <devgs@ukr.net> for reporting the issue on the net@
mailing list and for testing the patch!

Reviewed by: rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D22971

3 years agoMFC r356660:
Michael Tuexen [Wed, 1 Jul 2020 22:00:35 +0000 (22:00 +0000)]
MFC r356660:
Fix division by zero issue.

Thanks to Stas Denisov for reporting the issue for the userland stack
and providing a fix.

3 years agoMFC r356378:
Michael Tuexen [Wed, 1 Jul 2020 21:59:18 +0000 (21:59 +0000)]
MFC r356378:
Don't mark the sendall iterator as being up if it could not be started.

3 years agoMFC r356377:
Michael Tuexen [Wed, 1 Jul 2020 21:57:40 +0000 (21:57 +0000)]
MFC r356377:
Return -1 consistently if an error occurs.

3 years agoMFC r356376:
Michael Tuexen [Wed, 1 Jul 2020 21:56:20 +0000 (21:56 +0000)]
MFC r356376:
Ensure that we don't miss a trigger for kicking off the SCTP iterator.

Reported by: nwhitehorn

3 years agoMFC r356357:
Michael Tuexen [Wed, 1 Jul 2020 21:54:39 +0000 (21:54 +0000)]
MFC r356357:

Make the message size limit used for SCTP_SENDALL configurable via
a sysctl variable instead of a compiled in constant.

This is based on a patch provided by nwhitehorn.

3 years agoMFC r356270:
Michael Tuexen [Wed, 1 Jul 2020 21:52:14 +0000 (21:52 +0000)]
MFC r356270:
Improve input validation of the spp_pathmtu field in the
SCTP_PEER_ADDR_PARAMS socket option. The code in the stack assumes
sane values for the MTU.

This issue was found by running an instance of syzkaller.

MFC r356271:
Remove empty line which was added in previous commit by accident.

3 years agoMFC r355272:
Michael Tuexen [Wed, 1 Jul 2020 21:48:17 +0000 (21:48 +0000)]
MFC r355272:
Make the TF_* flags easier readable by humans by adding leading zeroes
to make them aligned.

Submitted by: rscheff
Reviewed by: rgrimes, rrs, tuexen
Differential Revision: https://reviews.freebsd.org/D22428

3 years agoMFC r356227:
Michael Tuexen [Wed, 1 Jul 2020 21:42:52 +0000 (21:42 +0000)]
MFC r356227:
Add flags for upcoming patches related to improved ECN handling.
No functional change.

Submitted by: rscheff
Reviewed by: rgrimes, tuexen
Differential Revision: https://reviews.freebsd.org/D22429

3 years agoMFC r356226:
Michael Tuexen [Wed, 1 Jul 2020 21:40:27 +0000 (21:40 +0000)]
MFC r356226:
Clear the flag indicating that the last received packet was marked CE also
in the case where a packet not marked was received.

Submitted by: rscheff
Reviewed by: rgrimes, tuexen
Differential Revision: https://reviews.freebsd.org/D19143

3 years agoMFC r355931:
Michael Tuexen [Wed, 1 Jul 2020 21:37:32 +0000 (21:37 +0000)]
MFC r355931:
Improve input validation for some parameters having a too small
reported length.

Thanks to Natalie Silvanovich from Google for finding one of these
issues in the SCTP userland stack and reporting it.

3 years agoMFC r355268:
Michael Tuexen [Wed, 1 Jul 2020 20:45:26 +0000 (20:45 +0000)]
MFC r355268:
Add a description for the TCP sysctl variable rfc6675_pipe.
It was introduced by r290122, but no documentation was provided.
This is taken from https://reviews.freebsd.org/D21798, since it
is not related to the feature added there.

Submitted by: rscheff

3 years agoMFC r355266:
Michael Tuexen [Wed, 1 Jul 2020 20:41:23 +0000 (20:41 +0000)]
MFC r355266:
In order for the TCP Handshake to support ECN++, and further ECN-related
improvements, the ECN bits need to be exposed to the TCP SYNcache.
This change is a minimal modification to the function headers, without any
functional change intended.

Submitted by: rscheff
Reviewed by: rgrimes, rrs, tuexen
Differential Revision: https://reviews.freebsd.org/D22436

3 years agoMFC r355265:
Michael Tuexen [Wed, 1 Jul 2020 20:38:56 +0000 (20:38 +0000)]
MFC r355265:
When changing the MTU of an SCTP path, not only cancel all ongoing
RTT measurements, but also scheldule new ones for the future.

Submitted by: Julius Flohr
Differential Revision: https://reviews.freebsd.org/D22547

3 years agoMFC r355264:
Michael Tuexen [Wed, 1 Jul 2020 20:37:06 +0000 (20:37 +0000)]
MFC r355264:
Update the hostcache also for PTB messages received for SCTP/IPv6.
The corresponding code for SCTP/IPv4 was introduced in
https://svnweb.freebsd.org/base?view=revision&revision=317597

Submitted by: Julius Flohr
Differential Revision: https://reviews.freebsd.org/D22605

3 years agoMFC r355172:
Michael Tuexen [Wed, 1 Jul 2020 20:32:51 +0000 (20:32 +0000)]
MFC r355172:
Really ignore the SCTP association identifier on 1-to-1 style sockets
as requiresd by the socket API specification.
Thanks to Inaki Baz Castillo, who found this bug running the userland
stack with valgrind and reported the issue in
https://github.com/sctplab/usrsctp/issues/408

3 years agoMFC r355135: Plug two mbuf leaks during INIT-ACK handling.
Michael Tuexen [Wed, 1 Jul 2020 20:26:35 +0000 (20:26 +0000)]
MFC r355135: Plug two mbuf leaks during INIT-ACK handling.
One leak happens when there is not enough memory to allocate the
the resources for streams. The other leak happens if the are
unknown parameters in the received INIT-ACK chunk which require
reporting and the INIT-ACK requires sending an ABORT due to illegal
parameter combinations.
Hopefully this fixes
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19083

3 years agoMFC r354774:
Michael Tuexen [Wed, 1 Jul 2020 20:09:34 +0000 (20:09 +0000)]
MFC r354774:
Add boundary and overflow checks to the formulas used in the TCP CUBIC
congestion control module.

Submitted by: rscheff
Reviewed by: rgrimes
Differential Revision: https://reviews.freebsd.org/D19118

3 years agoMFC r354773: Improve TCP CUBIC specific after idle reaction.
Michael Tuexen [Wed, 1 Jul 2020 19:50:03 +0000 (19:50 +0000)]
MFC r354773: Improve TCP CUBIC specific after idle reaction.
The adjustments are inspired by the Linux stack, which has had a
functionally equivalent implementation for more than a decade now.

MFC r356224: Add curly braces missed in above change

Submitted by:           rscheff
Reviewed by:            Cheng Cui
Differential Revision:  https://reviews.freebsd.org/D18982

3 years agoMFC r362204
Vincenzo Maffione [Wed, 1 Jul 2020 19:42:23 +0000 (19:42 +0000)]
MFC r362204

if_vtnet: let vtnet_rx_vq_intr() and vtnet_rxq_tq_intr() share code

Since the two functions are similar, introduce a common function
(vtnet_rx_vq_process()) to share common code.
This also improves locking, by ensuring vrxs_rescheduled is accessed
under the RXQ lock, and taskqueue_enqueue() is not called under the
lock (therefore avoiding a spurious duplicate lock warning).

Reported by:    jrtc27

3 years agoMFC r353482: Add missing include which breaks builds without VIMAGE.
Michael Tuexen [Wed, 1 Jul 2020 19:41:10 +0000 (19:41 +0000)]
MFC r353482: Add missing include which breaks builds without VIMAGE.

3 years agoMFC r354772: Implement a TCP CUBIC-specific after idle reaction.
Michael Tuexen [Wed, 1 Jul 2020 19:23:15 +0000 (19:23 +0000)]
MFC r354772: Implement a TCP CUBIC-specific after idle reaction.
This patch addresses a very common case of frequent application stalls,
where TCP runs idle and looses the state of the network.

Submitted by: rscheff
Reviewed by: Cheng Cui
Differential Revision: https://reviews.freebsd.org/D18954

3 years agoMFC r353518: Separate out SCTP related dtrace code.
Michael Tuexen [Wed, 1 Jul 2020 18:10:37 +0000 (18:10 +0000)]
MFC r353518: Separate out SCTP related dtrace code.

This is based on work done by markj.

3 years agoMFC r353488: Rename sctp_dtrace_declare.h to sctp_kdtrace.h
Michael Tuexen [Wed, 1 Jul 2020 18:08:59 +0000 (18:08 +0000)]
MFC r353488: Rename sctp_dtrace_declare.h to sctp_kdtrace.h

3 years agoMFC r353480: Use event handler in SCTP
Michael Tuexen [Wed, 1 Jul 2020 18:03:38 +0000 (18:03 +0000)]
MFC r353480: Use event handler in SCTP

Use an event handler to notify the SCTP about IP address changes
instead of calling an SCTP specific function from the IP code.
This is a requirement of supporting SCTP as a kernel loadable module.
This patch was developed by markj@, I tweaked a bit the SCTP related
code.

Submitted by: markj

3 years agoMFC r350588: SCTP related cleanup
Michael Tuexen [Wed, 1 Jul 2020 17:40:11 +0000 (17:40 +0000)]
MFC r350588: SCTP related cleanup

Improve consistency. No functional change.

3 years agoMFC r362258, r362279: file 5.39
Xin LI [Wed, 1 Jul 2020 16:18:35 +0000 (16:18 +0000)]
MFC r362258, r362279: file 5.39

Relnotes: yes

3 years agoMFC r362789 (by gallatin):
Mark Johnston [Wed, 1 Jul 2020 15:27:34 +0000 (15:27 +0000)]
MFC r362789 (by gallatin):
Fix a panic when unloading firmware

3 years agoMFC r362585:
Mark Johnston [Wed, 1 Jul 2020 15:02:56 +0000 (15:02 +0000)]
MFC r362585:
ipfw(4): make O_IPVER/ipversion match IPv4 or 6, not just IPv4.

3 years agoMFC r362582:
Mark Johnston [Wed, 1 Jul 2020 15:00:03 +0000 (15:00 +0000)]
MFC r362582:
ipfw(8): In fill_ip6(), use a single statement for both "me" and "me6".

3 years agoMFC r362006: Prevent TCP Cubic to abruptly increase cwnd after app-limited
Richard Scheffenegger [Wed, 1 Jul 2020 09:35:33 +0000 (09:35 +0000)]
MFC r362006: Prevent TCP Cubic to abruptly increase cwnd after app-limited

Cubic calculates the new cwnd based on absolute time
elapsed since the start of an epoch. A cubic epoch is
started on congestion events, or once the congestion
avoidance phase is started, after slow-start has
completed.

When a sender is application limited for an extended
amount of time and subsequently a larger volume of data
becomes ready for sending, Cubic recalculates cwnd
with a lingering cubic epoch. This recalculation
of the cwnd can induce a massive increase in cwnd,
causing a burst of data to be sent at line rate by
the sender.

This adds a flag to reset the cubic epoch once a
session transitions from app-limited to cwnd-limited
to prevent the above effect.

Reviewed by: chengc_netapp.com, tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor)
MFC after: 3 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D25065

3 years agoMFC r361987: Prevent TCP Cubic to abruptly increase cwnd after slow-start
Richard Scheffenegger [Wed, 1 Jul 2020 09:32:17 +0000 (09:32 +0000)]
MFC r361987: Prevent TCP Cubic to abruptly increase cwnd after slow-start

Introducing flags to track the initial Wmax dragging and exit
from slow-start in TCP Cubic. This prevents sudden jumps in the
caluclated cwnd by cubic, especially when the flow is application
limited during slow start (cwnd can not grow as fast as expected).
The downside is that cubic may remain slightly longer in the
concave region before starting the convex region beyond Wmax again.

Reviewed by: chengc_netapp.com, tuexen (mentor)
Approved by: tuexen (mentor), rgrimes (mentor, blanket)
MFC after: 3 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D23655

3 years agoMFC r361806: Add O_DIRECT flag to DD for cache bypass
Richard Scheffenegger [Wed, 1 Jul 2020 09:28:00 +0000 (09:28 +0000)]
MFC r361806: Add O_DIRECT flag to DD for cache bypass

FreeBSD DD utility has not had support for the O_DIRECT flag, which
is useful to bypass local caching, e.g. for unconditionally issuing
NFS IO requests during testing.

Reviewed by: rgrimes (mentor)
Approved by: rgrimes (blanket)
MFC after: 3 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D25066

3 years agoMFC r362033:
Konstantin Belousov [Wed, 1 Jul 2020 01:12:23 +0000 (01:12 +0000)]
MFC r362033:
Remove double-calls to tc_get_timecount() to warm timecounters

3 years agoMFC r362553
Vincenzo Maffione [Tue, 30 Jun 2020 19:34:36 +0000 (19:34 +0000)]
MFC r362553

iflib: netmap: fix rsync index overrun

In the current iflib_netmap_rxsync, there is nothing that prevents
kring->nr_hwtail to overrun kring->nr_hwcur during the descriptor
import phase. This may cause errors in netmap applications, such as:

em1 RX0: fail 'head < kring->nr_hwcur || head > kring->nr_hwtail'
    h 795 c 795 t 282 rh 795 rc 795 rt 282 hc 282 ht 282

Reviewed by:    gallatin
Differential Revision:  https://reviews.freebsd.org/D25252

3 years agoMFC r362623:
Dimitry Andric [Tue, 30 Jun 2020 15:53:52 +0000 (15:53 +0000)]
MFC r362623:

Fix copy/paste mistake in kvm_getswapinfo(3)

It seems this manpage was copied from kvm_getloadavg(3), but the
DIAGNOSTICS section was not updated completely. Update the section with
correct information about a return value of -1.

3 years agoMFC 362684, 362675:
Mateusz Piotrowski [Tue, 30 Jun 2020 11:50:52 +0000 (11:50 +0000)]
MFC 362684, 362675:

ixl.4: Use a -bullet list instead of -item

Now the list looks like a list. Using -item only makes sense if the list is
meant to be a list of terms and definitions.

Fix a typo, use Lk for links and use HTTPS where applicable

3 years agoMFC 362538:
Mateusz Piotrowski [Tue, 30 Jun 2020 11:46:40 +0000 (11:46 +0000)]
MFC 362538:

Fix a typo and sort options