Commit graph

265451 commits

Author SHA1 Message Date
Rick Macklem
9ec7dbf46b nfscl: Add a Linux compatible "nconnect" mount option
Linux has had an "nconnect" NFS mount option for some time.
It specifies that N (up to 16) TCP connections are to created for a mount,
instead of just one TCP connection.

A discussion on freebsd-net@ indicated that this could improve
client<-->server network bandwidth, if either the client or server
have one of the following:
- multiple network ports aggregated to-gether with lagg/lacp.
- a fast NIC that is using multiple queues
It does result in using more IP port#s and might increase server
peak load for a client.

One difference from the Linux implementation is that this implementation
uses the first TCP connection for all RPCs composed of small messages
and uses the additional TCP connections for RPCs that normally have
large messages (Read/Readdir/Write).  The Linux implementation spreads
all RPCs across all TCP connections in a round robin fashion, whereas
this implementation spreads Read/Readdir/Write across the additional
TCP connections in a round robin fashion.

(cherry picked from commit 1e0a518d65)
2021-08-03 16:40:47 -07:00
Kevin Bowling
914e70b909 arm: Bump KSTACK_PAGES default to match i386/amd64
See 3f6867ef63 for additional context.

It is also needed for OpenZFS performance and stability.

Reviewed by:	ian (arm), imp
Differential Revision:	https://reviews.freebsd.org/D31244

(cherry picked from commit b684d812fc)
2021-08-03 15:51:14 -07:00
Konstantin Belousov
130f41810e linuxkpi: remove global atomic counter of the task allocations
(cherry picked from commit d96f55bc71)
2021-08-03 12:56:02 +03:00
Hans Petter Selasky
3a83634c0f Wait for all task_struct allocations to be returned before freeing the UMA zone in the LinuxKPI
(cherry picked from commit b764a42653)
2021-08-03 12:55:12 +03:00
Konstantin Belousov
6ba7789189 amd64: add pmap_alloc_page_below_4g()
(cherry picked from commit c8bae074d9)
2021-08-03 12:52:37 +03:00
Konstantin Belousov
5a84640fcf amd64 pti init: fix calculation of the kernel text start
(cherry picked from commit 34516d4ad1)
2021-08-03 12:52:37 +03:00
Konstantin Belousov
2c7315c09a amd64: do not touch low memory in AP startup unless we used legacy boot
(cherry picked from commit 2572376f7f)
2021-08-03 12:52:36 +03:00
Konstantin Belousov
17332276a6 amd64: do not touch low memory in AP startup unless we used legacy boot
(cherry picked from commit 48216088b1)
2021-08-03 12:52:36 +03:00
Konstantin Belousov
21049f0567 amd64: make efi_boot global
(cherry picked from commit 6a3821369f)
2021-08-03 12:52:36 +03:00
Konstantin Belousov
dfda6a71e7 /dev/pci: clarify meaning of writeable file descriptor
(cherry picked from commit 85ae35ef37)
2021-08-03 12:52:36 +03:00
Konstantin Belousov
fb29b54a91 Regen 2021-08-03 12:52:36 +03:00
Konstantin Belousov
2fb281fa02 Revert most of ce42e79310
to restore ABI compatibility for pre-10.x binaries.

It restores _umtx_lock() and _umtx_unlock() syscalls, and UMTX_OP_LOCK/
UMTX_OP_UNLOCK umtx_op(2) operations. UMUTEX_ERROR_CHECK flag is left
out for now, I do not think it makes a difference.

PR:	218571
Reviewed by:	brooks (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31220

(cherry picked from commit 9b6b793bd7)
2021-08-03 12:52:36 +03:00
Konstantin Belousov
7f5a4aff9b nullfs: provide custom null_rename bypass
(cherry picked from commit 4eaf9609fe)
2021-08-03 12:52:36 +03:00
Konstantin Belousov
5c52335fd1 null_rename: some style
(cherry picked from commit 26e72728ce)
2021-08-03 12:52:36 +03:00
Konstantin Belousov
2a56a5c2c2 fifofs: fifo vnode might be relocked before VOP_OPEN() is called
(cherry picked from commit 10db189649)
2021-08-03 12:52:36 +03:00
Konstantin Belousov
a3c7e571c0 null_lookup: restore dvp lock always, not only on success
(cherry picked from commit 4f21442e10)
2021-08-03 12:52:35 +03:00
Konstantin Belousov
0a4eb4d65c null_bypass(): prevent loosing the only reference to the lower vnode
(cherry picked from commit d5b078163e)
2021-08-03 12:52:35 +03:00
Konstantin Belousov
b5eaf00527 nullfs: provide custom null_advlock bypass
(cherry picked from commit 161e9a9736)
2021-08-03 12:52:35 +03:00
Konstantin Belousov
75e8553e79 null_bypass(): some style
(cherry picked from commit 7b7227c4a6)
2021-08-03 12:52:35 +03:00
Alexander Motin
814254f51b Remove opensolaris_atomic.S dependency.
This file is no longer there, so this broke static zfs build.

(cherry picked from commit e0229c5110)
2021-08-02 22:45:04 -04:00
Kevin Bowling
bb048438e7 igb: clean up igb_txrx comments
Reviewed by:	grehan
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D31227

(cherry picked from commit ff01d6343f)
2021-08-02 19:04:46 -07:00
Kevin Bowling
b91bb9b07f e1000: Add missing branch prediction
I missed this edit from the ixgbe review (D30074)

Reviewed by:	gallatin
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30073

(cherry picked from commit 9fd0cda92d)
2021-08-02 19:04:31 -07:00
Kevin Bowling
4ccafcfc86 e1000: Clean up igb_txrx
The intention here is to reduce differences between em, igb, igc, ixgbe.

The main functional change is logical simplification in igb_rx_checksum
and getting interface caps from scctx instead of the ifp.

Reviewed by:	gallatin, markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30073

(cherry picked from commit 41f0225714)
2021-08-02 19:04:05 -07:00
Mark Johnston
668a555de6 rip: Add missing minimum length validation in rip_output()
If the socket is configured such that the sender is expected to supply
the IP header, then we need to verify that it actually did so.

Reported by:	syzkaller+KMSAN
Reviewed by:	donner
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ba21825202)
2021-08-02 15:01:11 -04:00
Mark Johnston
225d3b0771 libvmmapi: Fix warnings and stop overridding WARNS
- Avoid shadowing the global optarg.
- Sprinkle __unused.
- Cast nitems() to int.
- Fix sign in vm_copy_setup().

Reviewed by:	grehan
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 45cd18ec73)
2021-08-02 15:01:02 -04:00
Alexander Motin
156b889469 mrsas(4): Report more correct maximum I/O size.
Subtract one SGE for the case of misaligned address.  Also take into
account maximum number of sectors reported by firmware, that gives
nicer 256KB limit instead of 276KB calculated from the SGE limit.

While there, remove number of I/O size checks, duplicating what is
already checked by CAM and busdma(9).

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

(cherry picked from commit fa3d57c256)
2021-08-02 11:56:10 -04:00
Kristof Provost
60c9798db7 net tests: basic test case for bpf(4)'s ability to set vlan pcp
Use dhclient with its 'vlan-pcp' option to set a VLAN PCP value and
verify that it actually gets set.

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

(cherry picked from commit 3e87f800f0)
2021-08-02 16:50:32 +02:00
Kristof Provost
c9ef3984a1 vlan: deduplicate bpf_setpcp() and pf_ieee8021q_setpcp()
These two fuctions were identical, so move them into the common
vlan_set_pcp() function, exposed in the if_vlan_var.h header.

Reviewed by:	donner
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31275

(cherry picked from commit 9ef8cd0b79)
2021-08-02 16:50:32 +02:00
Luiz Otavio O Souza
50ecd99be5 bpf: Add an ioctl to set the VLAN Priority on packets sent by bpf
This allows the use of VLAN PCP in dhclient, which is required for
certain ISPs (such as Orange.fr).

Reviewed by:	bcr (man page)
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31263

(cherry picked from commit 1e7fe2fbb9)
2021-08-02 16:50:32 +02:00
Kristof Provost
096cacc811 bridge tests: test linking bridges with a gif tunnel
Fairly basic test case for using gif(4)'s ability to tunnel Ethernet
traffic between bridges.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 4b765ab4cd)
2021-08-02 16:50:32 +02:00
Tom Jones
a77a6a049e inet6_option_space is deprecated, refer to inet6_opt_init instead
Reviewed by:	bz, hrs
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26273

(cherry picked from commit 0943200b13)
2021-08-02 13:58:51 +01:00
Richard Scheffenegger
e4ee2a39ad tcp: Add PRR cwnd reduction for non-SACK loss
This completes PRR cwnd reduction in all circumstances
for the base TCP stack (SACK loss recovery, ECN window reduction,
non-SACK loss recovery), preventing the arriving ACKs to
clock out new data at the old, too high rate. This
reduces the chance to induce additional losses while
recovering from loss (during congested network conditions).

For non-SACK loss recovery, each ACK is assumed to have
one MSS delivered. In order to prevent ACK-split attacks,
only one window worth of ACKs is considered to actually
have delivered new data.

MFC after: 6 weeks
Reviewed By: rrs, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29441

(cherry picked from commit 74d7fc8753)
2021-08-02 13:59:23 +02:00
Xin LI
f5536286db less: upgrade to v590.
(cherry picked from commit 30a1828c51)
(cherry picked from commit 4bcc6d14e2)
2021-08-02 01:28:42 -07:00
Dimitry Andric
af732203b8 Merge llvm-project 12.0.1 release and follow-up fixes
Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.

PR:		255570

(cherry picked from commit e8d8bef961)

Merge llvm-project 12.0.0 release

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release.

PR:		255570

(cherry picked from commit d409305fa3)

Disable strict-fp for powerpcspe, as it does not work properly yet

Merge commit 5c18d1136665 from llvm git (by Qiu Chaofan)

  [SPE] Disable strict-fp for SPE by default

  As discussed in PR50385, strict-fp on PowerPC SPE has not been
  handled well. This patch disables it by default for SPE.

  Reviewed By: nemanjai, vit9696, jhibbits

  Differential Revision: https://reviews.llvm.org/D103235

PR:		255570

(cherry picked from commit 715df83abc)

Apply upstream libc++ fix to allow building with devel/xxx-xtoolchain-gcc

Merge commit 52e9d80d5db2 from llvm git (by Jason Liu):

  [libc++] add `inline` for __open's definition in ifstream and ofstream

  Summary:

  When building with gcc on AIX, it seems that gcc does not like the
  `always_inline` without the `inline` keyword.
  So adding the inline keywords in for __open in ifstream and ofstream.
  That will also make it consistent with __open in basic_filebuf
  (it seems we added `inline` there before for gcc build as well).

  Differential Revision: https://reviews.llvm.org/D99422

PR:		255570

(cherry picked from commit d099db2546)

Undefine HAVE_(DE)REGISTER_FRAME in llvm's config.h on arm

Otherwise, the lli tool (enable by WITH_CLANG_EXTRAS) won't link on arm,
stating that __register_frame is undefined. This function is normally
provided by libunwind, but explicitly not for the ARM Exception ABI.

Reported by:	oh
PR:		255570

(cherry picked from commit f336b45e94)

Merge llvm-project 12.0.1 rc2

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.1-rc2-0-ge7dac564cd0e, a.k.a. 12.0.1 rc2.

PR:		255570

(cherry picked from commit 23408297fb)

Revert libunwind change to fix backtrace segfault on aarch64

Revert commit 22b615a96593 from llvm git (by Daniel Kiss):

  [libunwind] Support for leaf function unwinding.

  Unwinding leaf function is useful in cases when the backtrace finds a
  leaf function for example when it caused a signal.
  This patch also add the support for the DW_CFA_undefined because it marks
  the end of the frames.

  Ryan Prichard provided code for the tests.

  Reviewed By: #libunwind, mstorsjo

  Differential Revision: https://reviews.llvm.org/D83573

  Reland with limit the test to the x86_64-linux target.

Bisection has shown that this particular upstream commit causes programs
using backtrace(3) on aarch64 to segfault. This affects the lang/rust
port, for instance. Until we can upstream to fix this problem, revert
the commit for now.

Reported by:	mikael
PR:		256864

(cherry picked from commit 5866c369e4)

Merge llvm-project 12.0.1 release

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.1-0-gfed41342a82f, a.k.a. 12.0.1 release.

PR:		255570

(cherry picked from commit 4652422eb4)

compilert-rt: build out-of-line LSE atomics helpers for aarch64

Both clang >= 12 and gcc >= 10.1 now default to -moutline-atomics for
aarch64. This requires a bunch of helper functions in libcompiler_rt.a,
to avoid link errors like "undefined symbol: __aarch64_ldadd8_acq_rel".

(Note: of course you can use -mno-outline-atomics as a workaround too,
but this would negate the potential performance benefit of the faster
LSE instructions.)

Bump __FreeBSD_version so ports maintainers can easily detect this.

PR:		257392

(cherry picked from commit cc55ee8009)
2021-07-31 20:56:55 +02:00
Warner Losh
83dea422ac awk: remove proctab.c
proctab.c is a generated file and never should have been committed to
the tree. This file has been added and removed a couple of times, most
recently added by me in my 2019 updates.

Sponsored by:		Netflix

(cherry picked from commit 0c92d88c91)
2021-07-31 08:14:43 -06:00
Kristof Provost
adde304e53 pf: fix ABI breakage
The introduction of synproxy support changed the size of struct
pf_status, which in turn broke the userspace ABI.

Revert the relevant change. More work is needed on the synproxy code to
keep and expose the counters, but in the mean time this restores the
ABI.

PR:             257469
MFC after:      3 days
Sponsored by:   Modirum MDPay

(cherry picked from commit da8d8b22e6)
2021-07-31 10:12:20 +02:00
Kristof Provost
7408fb55f0 pf.conf.5: Document new 'match' keyword
Reviewed by:	bcr
Obtained from:	pfSense
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31117

(cherry picked from commit 0351b9875a)
2021-07-31 10:12:10 +02:00
Kristof Provost
c1bb4edaa0 pf tests: Test the match keyword
The new match keyword can currently only assign queues, so we can only
test it with ALTQ.
Set up a basic scenario where we use 'match' to assign ICMP traffic to a
slow queue, and confirm that it's really getting slowed down.

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

(cherry picked from commit d363ebc78c)
2021-07-31 10:12:02 +02:00
Kristof Provost
70d4a7a966 pf: match keyword support
Support the 'match' keyword.
Note that support is limited to adding queuing information, so without
ALTQ support in the kernel setting match rules is pointless.

For the avoidance of doubt: this is NOT full support for the match
keyword as found in OpenBSD's pf. That could potentially be built on top
of this, but this commit is NOT that.

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

(cherry picked from commit ef950daa35)
2021-07-31 10:12:02 +02:00
Kristof Provost
2400173b93 altq tests: Basic ALTQ test
Activate ALTQ_HFSC, crudely check if it really limits bandwidth as we'd expect.

Reviewed by:		donner@
Differential Revision:	https://reviews.freebsd.org/D28303

(cherry picked from commit 16b3833344)
2021-07-31 10:12:02 +02:00
Kristof Provost
5a1bc5f902 altq: Fix typo in features sysctl description
Reported by:	Jose Luis Duran

(cherry picked from commit 35dabb7b9c)
2021-07-31 10:12:01 +02:00
Kristof Provost
b0e7f371cd Add FEATURE sysctls for ALTQ disciplines
This will allow userspace to more easily figure out if ALTQ is built
into the kernel and what disciplines are supported.

Reviewed by:		donner@
Differential Revision:	https://reviews.freebsd.org/D28302

(cherry picked from commit e111d79806)
2021-07-31 10:12:01 +02:00
Warner Losh
b96680d9ca RELNOTES: add notes about awk updates
Direct commit to stable/13 to note user-visible changes in the awk
update.

Sponsored by:		Netflix
2021-07-30 17:04:53 -06:00
Jose Luis Duran
d2d322b012 Fix the pattern for changing PermitRootLogin
The previous pattern had the (harmless) side-effect of duplicating the
entry in the config file.

No functional change intended.

Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/510

(cherry picked from commit 73358cd2cf)
2021-07-30 17:02:13 -06:00
Yann Kerherve
2cbf9eff2d nanobsd: fix typo in NANO_WORLDDIR
Reviewed by:	imp
PR:		257299

(cherry picked from commit 5a9e5a5111)
2021-07-30 17:02:13 -06:00
Warner Losh
f4ed53c6f5 awk: Make -F '' and -v FS="" behave the same
IEEE Std 1003.1-2008 mandates that -F str be treated the same as -v
FS=str. For a null string, this was not the case. Since awk(1) documents
that a null string for FS has a specific behavior, make -F '' behave
consistently with -v FS="".

PR:			241441
Upstream issue:		https://github.com/onetrueawk/awk/issues/127
Upstream pull request:	https://github.com/onetrueawk/awk/pull/128
MFC After:		2 weeks
Sponsored by:		Netflix

(cherry picked from commit a2e3e11873)
2021-07-30 17:02:13 -06:00
Warner Losh
5193261c36 awk: Remove last markings we have on awk
We normally don't add $FreeBSD$ to contrib software. However, these
changes date back to the CVS era of source code management and have been
overlooked. Now that all these files are back to the same as the
upstream bsd-features branch, remove the FreeBSD specific changes, which
are now just $FreeBSD$ and the (FreeBSD) in the version string.

MFC After:		2 weeks
Sponsored by:		Netflix

(cherry picked from commit 5ab82b00cc)
2021-07-30 17:02:13 -06:00
Warner Losh
da30af61b5 awk: revert to upstream behavior for ranges for gawk compatibility
In 2005, FreeBSD changed one-true-awk to honor the locale's collating
order. This was billed as a temporary patch. It was also compatible with
the then-current behavior of gawk. That temporary patch has lasted 16
years now.

However, IEEE Std 1003.1-2008 changed the behaivor of ranges in regular
expressions outside of the "C" and "POSIX" locales to be undefined.

Starting in 2011, gawk 4.0 stopped using the locale for the range
regular expressions and used the traditional behavior only. The
maintainer had grown weary of answering why '[A-Z]' would sometimes
match lower-case expressions. The details about are explained here:
https://www.gnu.org/software/gawk/manual/html_node/Ranges-and-Locales.html

To restore compatibility with other implementaitons of awk, revert this
patch. FreeBSD is the odd-system out. It also has the nice side effect
of eliminating the last of our differences with upstream one-true-awk.

Reviewed by:		cy, rgrimes
MFC After:		2 weeks
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31114

(cherry picked from commit 628bd30ab5)
2021-07-30 17:02:12 -06:00
Warner Losh
ea4936b470 awk: Reduce diffs with upstream to almost nothing.
In the merge of 20210215, I left two merge conflicts #if 0'd by mistake
to check later rather than resolve them as part of the merge.  This code
turns out to be from the original one-true-awk import and not FreeBSD
specific, so remove them.

Remove a extra definition of HAT.

Remove a stylistic change that also appears to be a mismerge along the
way.

Remove FREEBSD-upgrade. Nobody has updated it since the original 2007
cvs import. It talks about old CVS branches that never made it into svn,
let alone git. New imports will follow the standard practices now, so
there's nothing left to document.

Move README to README.md and copy the README.md from upstream over.

This leaves just the $FreeBSD$ lines (which remain for the stable/12
merge) and the strcoll part of ru@'s r201989/d98dd8e5f94c as the only
diffs with upstream. FreeBSD also still has its own man page, which I
don't plan on changing. Once this commit is merged to stable/12, I plan
no further merges to stable/12. Sometime after that I'll remove the
$FreeBSD$ lines to reduce the diffs even more (though i want to make
sure plans won't change first). I also plan to talk to upstream about
this change...

MFC After:		2 weeks
Sponsored by:		Netflix

(cherry picked from commit f68a53dba9)
2021-07-30 17:02:12 -06:00
Warner Losh
a051259072 typo: becauce -> because
Noticed by:	Piotr P. Stefaniak
Sponsored by:	Netflix

(cherry picked from commit 2b720db8d4)
2021-07-30 17:02:07 -06:00