MFC r366206: Add DSCP support for network QoS to iscsi target.
In order to prioritize iSCSI traffic across a network,
DSCP can be used. In order not to rely on "ipfw setdscp"
or in-network reclassification, this adds the dscp value
directly to the portal group (where TCP sessions are accepted).
Allan Jude [Fri, 9 Oct 2020 23:02:09 +0000 (23:02 +0000)]
MFC r364787:
ZFS: whitelist zstd and encryption in the loader
Please note that neither zstd nor encryption is
supported by the loader at this instant. This
change makes it safe to use those features in
one's root pool, but not in one's root dataset.
Allan Jude [Fri, 9 Oct 2020 22:42:04 +0000 (22:42 +0000)]
MFC r364787:
ZFS: whitelist zstd and encryption in the loader
Please note that neither zstd nor encryption is
supported by the loader at this instant. This
change makes it safe to use those features in
one's root pool, but not in one's root dataset.
Warner Losh [Fri, 9 Oct 2020 21:01:53 +0000 (21:01 +0000)]
MFC: r366216 imp
Fix video on PCI heuristic
The video on PCI heuristic was broken. It was supposed to infer a
video device when the last element of the path was a PCI DEVICE PATH
node. However, the last node in the device path is an END node, so
this heuristic never fired.
This leads, among other things, to bhyve only producing output in the
serial connection once we leave the boot loader. This restores the
dual headed boot on bhyve + UEFI (as we did in 11.2), but will favor
serial in the absence of other config which may be a change from 11.2.
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D26572
MFC r366150: TCP: send full initial window when timestamps are in use
The fastpath in tcp_output tries to send out
full segments, and avoid sending partial segments by
comparing against the static t_maxseg variable.
That value does not consider tcp options like timestamps,
while the initial window calculation is using
the correct dynamic tcp_maxseg() function.
Due to this interaction, the last, full size segment
is considered too short and not sent out immediately.
Adjust ssthresh in after_idle to the maximum of
the prior ssthresh, or 3/4 of the prior cwnd. See
RFC2861 section 2 for an in depth explanation for
the rationale around this.
As newreno is the default "fall-through" reaction,
most tcp variants will benefit from this.
Kyle Evans [Thu, 8 Oct 2020 12:56:23 +0000 (12:56 +0000)]
MFC r366466: crunchgen: fix MK_AUTO_OBJ logic after r364166
r364166 converted echo -n `/bin/pwd` to a raw pwd invocation, leaving a
trailing newline at the end of path. This caused a later stat() of it to
erroneously fail and the fallback to MK_AUTO_OBJ=no logic proceeded as
unexpected.
Harry Schmalzbauer bissected the resulting build failure he experienced
(stable/12 host, -HEAD build) down to r365887. This change is mostly
unrelated, except it switches the build to bootstrapped crunchgen - clue!
I then bissected recent crunchgen changes going back a bit since we wouldn't
observe the failure immediately with -CURRENT in most configurations, which
landed me on r364166. After many intense head-scratching minutes and printf
debugging, I realized that the newline was the difference. This is where our
tale ends.
Navdeep Parhar [Mon, 5 Oct 2020 19:45:11 +0000 (19:45 +0000)]
MFC r366354:
cxgbe(4): validate largest_rx_cluster and safest_rx_cluster.
These tunables can only be set to a valid cluster size (2K, 4K, 9K, or
16K) as documented in the man page. Anything else could lead to a
panic on interface up.
Navdeep Parhar [Mon, 5 Oct 2020 19:22:28 +0000 (19:22 +0000)]
MFC r366247:
cxgbe(4): Avoid unnecessary work in the firmware during netmap tx.
Bind the netmap tx queues to a special '0xff' scheduling class which
makes the firmware skip some processing related to rate limiting on the
outgoing traffic. Future firmwares will do this automatically.
Navdeep Parhar [Mon, 5 Oct 2020 18:45:32 +0000 (18:45 +0000)]
MFC r366242:
cxgbe(4): fixes for netmap operation with only some queues active.
- Only active netmap receive queues should be in the RSS lookup table.
- The RSS table should be restored for NIC operation when the last
active netmap queue is switched off, not the first one.
- Support repeated netmap ON/OFF on a subset of the queues. This works
whether the the queues being enabled and disabled are the only ones
active or not. Some kring indexes have to be reset in the driver for
the second case.
This should fix 'fatal error: error in backend: Cannot select' errors if
assertions are disabled, or 'Assertion failed: (isVector() && "Invalid
vector type!"), function getVectorNumElements, file
/usr/src/contrib/llvm-project/llvm/include/llvm/CodeGen/ValueTypes.h,
line 276.', when building the audio/lsp-plugins-lv2 port.
Direct commit to stable/{11,12} since head has clang 11.0.0, which
already includes this fix.
Navdeep Parhar [Mon, 5 Oct 2020 09:03:17 +0000 (09:03 +0000)]
MFC r365993:
cxgbe(4): let the PF driver use VM work requests for transmit.
This allows the PF interfaces to communicate with the VF interfaces over
the internal switch in the ASIC. Fix the GL limits for VM work requests
while here.
Navdeep Parhar [Mon, 5 Oct 2020 08:51:03 +0000 (08:51 +0000)]
MFC r365871. This needs a couple other revisions which aren't in
stable/12 yet to actually work but is being committed out of order to
ease other cxgbe MFCs.
r365871:
cxgbe(4): add support for stateless offloads for VXLAN traffic.
Hardware assistance includes checksumming (tx and rx), TSO, and RSS on
the inner traffic in a VXLAN tunnel.
Navdeep Parhar [Mon, 5 Oct 2020 06:38:56 +0000 (06:38 +0000)]
MFC r365867:
mbuf checksum flags and fields to support tunneling protocols.
These are being added to support VXLAN but will work for GENEVE as well.
ENCAP_RSVD1 will likely become ENCAP_GENEVE in the future.
The size of struct mbuf does not change and that means this change can be MFC'd.
If size wasn't a constraint a cleaner way may have been to add inner_csum_flags
and inner_csum_data to go with csum_flags and csum_data.
Kyle Evans [Sun, 4 Oct 2020 19:59:12 +0000 (19:59 +0000)]
MFC r362421: raspberry pi 4: cpufreq support
The submitter notes that the bcm2835_cpufreq driver really just needs the
rpi4 compat string added to it; powerd subsequently works and the dev.cpu.0
sysctl values look sane and can be successfully manipulated.
Warner Losh [Sun, 4 Oct 2020 06:14:51 +0000 (06:14 +0000)]
MFC: r366229
For mulitcons boot, report it and which console is primary
Until we can do proper /etc/rc output on both consoles in multicons
boot (or all of them if we ever generalize), report when we are
booting multicons. Also report the primary console. This will be a big
hint why output stops after this line (though some slow USB discovery
still happens after mountroot / init starts).
Warner Losh [Sun, 4 Oct 2020 06:12:52 +0000 (06:12 +0000)]
MFC: r366228
Report the kernel console on the boot screen
Report what console the boot loader is telling the kernel to use:
o Dual (Serial Primary)
o Dual (Video Primary)
o Serial
o Video
and allow toggling between them.
Justin Hibbits [Sat, 3 Oct 2020 02:26:38 +0000 (02:26 +0000)]
MFC r366162,r366169,r366188
Fix compat32 on mips64:
* Elf32_Auxinfo is broken, using pointers in the union, which are 64-bits not
32.
* freebsd32_sysarch() doesn't update the 'user local' register when handling
MIPS_SET_TLS, leading to a NULL pointer dereference in the 32-bit
application.
Alan Somers [Thu, 1 Oct 2020 19:55:52 +0000 (19:55 +0000)]
zfs: fix "zfs receive" of interrupted stream without "-F" after r366180
The OpenZFS test suite revealed a regression with the changes made by
r366180 and r364974: "zfs recv" resuming and interrupted stream without -F
would refuse to run, complaining that "dataset exists".
Direct commit to stable/12 because head has moved to the OpenZFS code base.
Michael Tuexen [Thu, 1 Oct 2020 16:53:16 +0000 (16:53 +0000)]
MFC r366248:
Improve the input validation and processing of cookies.
This avoids setting the association in an inconsistent
state, which could result in a use-after-free situation.
This can be triggered by a malicious peer, if the peer
can modify the cookie without the local endpoint recognizing
it.
Thanks to Ned Williamson for reporting the issue.
Michael Tuexen [Thu, 1 Oct 2020 16:23:35 +0000 (16:23 +0000)]
MFC r366198:
Improve the handling of receiving unordered and unreliable user
messages using DATA chunks. Don't use fsn_included when not being
sure that it is set to an appropriate value. If the default is
used, which is -1, this can result in SCTP associaitons not
making any user visible progress.
Thanks to Yutaka Takeda for reporting this issue for the the
userland stack in https://github.com/pion/sctp/issues/138.
John Baldwin [Wed, 30 Sep 2020 18:09:50 +0000 (18:09 +0000)]
MFC 366175: Revert most of r360179.
I had failed to notice that sgsendccb() was using cam_periph_mapmem()
and thus was not passing down user pointers directly to drivers. In
practice this broke requests submitted from userland.
There are some tests available in the NetBSD test suite, but we don't
currently pass all of those; further investigation will go into that. For
now, just add a basic test as well as a test that copies from /dev/null to a
file.
The /dev/null test confirms that the file gets created if it's empty, then
that it truncates the file if it's non-empty. This matches some usage that
was previously employed in the build and was replaced in r366042 by a
simpler shell construct.
I will also plan on coming back to expand these in due time.
Note that this does not add any functionality as IFCAP_NOMAP doesn't
exist on 12. This is mainly an attempt to get t4_sge.c closer to what's
in head (to help with other MFCs).
r349533:
Add support for IFCAP_NOMAP to cxgbe(4).
Since cxgbe(4) uses sglist instead of bus_dma, this required updates
to the code that generates scatter/gather lists for packets. Also,
unmapped mbufs are always sent via DMA and never as immediate data in
the payload of a work request.
David Bright [Tue, 29 Sep 2020 16:38:56 +0000 (16:38 +0000)]
MFC r365948:
Honor the FWUG value of some drives in nvmecontrol
nvmecontrol tries to upload firmware in chunks as large as it thinks
the device permits. It fails to take into account the FWUG value used
by some drives to advertise the size and alignment limits for firmware
chunks.
- Use the firwmare update granularity value from the
identify-controller response to set the max transfer size.
- If the granularity is not reported or not restricted, fall back to
the previously existing logic that calculates the max transfer
size based on MDTS.
- Add firmware update granularity to the identify-controller output.
Rick Macklem [Tue, 29 Sep 2020 01:52:53 +0000 (01:52 +0000)]
MFC: r366189
Bjorn reported a problem where the Linux NFSv4.1 client is
using an open_to_lock_owner4 when that lock_owner4 has already
been created by a previous open_to_lock_owner4. This caused the NFS server
to reply NFSERR_INVAL.
For NFSv4.0, this is an error, although the updated NFSv4.0 RFC7530 notes
that the correct error reply is NFSERR_BADSEQID (RFC3530 did not specify
what error to return).
For NFSv4.1, it is not obvious whether or not this is allowed by RFC5661,
but the NFSv4.1 server can handle this case without error.
This patch changes the NFSv4.1 (and NFSv4.2) server to handle multiple
uses of the same lock_owner in open_to_lock_owner so that it now correctly
interoperates with the Linux NFS client.
It also changes the error returned for NFSv4.0 to be NFSERR_BADSEQID.
Thanks go to Bjorn for diagnosing this and testing the patch.
He also provided a program that I could use to reproduce the problem.
- Remove trailing whitespace
- Address igor and mandoc warnings
- Sort options
- Use macros consistently (e.g., Fl for flags, Dq for quoting, Bd for code
blocks)
- Add a history section
- Fix incorrect use of macros in various places
Ed Maste [Sun, 27 Sep 2020 22:48:43 +0000 (22:48 +0000)]
MFC r356615: src.opts.mk: force KERBEROS_SUPPORT off where KERBEROS forced off
Explicitly setting WITHOUT_KERBEROS implies WITHOUT_KERBEROS_SUPPORT,
but previously other cases that forced KERBEROS off (such as
WITHOUT_CRYPT) did not also set KERBEROS_SUPPORT off. Because the
_SUPPORT dependent options (KERBEROS/KERBEROS_SUPPORT) are processed
before other dependencies (CRYPT/KERBEROS) it's not easy to make this
happen automatically. Instead just explicitly set KERBEROS_SUPPORT
off where we set KERBEROS off.
Alan Somers [Sun, 27 Sep 2020 02:59:28 +0000 (02:59 +0000)]
MFC r366121:
fusefs: fix mmap'd writes in direct_io mode
If a FUSE server returns FOPEN_DIRECT_IO in response to FUSE_OPEN, that
instructs the kernel to bypass the page cache for that file. This feature
is also known by libfuse's name: "direct_io".
However, when accessing a file via mmap, there is no possible way to bypass
the cache completely. This change fixes a deadlock that would happen when
an mmap'd write tried to invalidate a portion of the cache, wrongly assuming
that a write couldn't possibly come from cache if direct_io were set.
Arguably, we could instead disable mmap for files with FOPEN_DIRECT_IO set.
But allowing it is less likely to cause user complaints, and is more in
keeping with the spirit of open(2), where O_DIRECT instructs the kernel to
"reduce", not "eliminate" cache effects.