Michael Tuexen [Thu, 10 Sep 2020 17:31:34 +0000 (17:31 +0000)]
MFC r351782:
Fix two TCP RACK issues:
* Convert the TCP delayed ACK timer from ms to ticks as required.
This fixes the timer on platforms with hz != 1000.
* Don't delay acknowledgements which report duplicate data using
DSACKs.
Michael Tuexen [Thu, 10 Sep 2020 17:29:20 +0000 (17:29 +0000)]
MFC r351328 (by rrs):
Fix an issue when TSO and Rack play together. Basically
an retransmission of the initial SYN (with data) would
cause us to strip the SYN and decrement/increase offset/len
which then caused us a -1 offset and a panic.
Michael Tuexen [Thu, 10 Sep 2020 17:26:16 +0000 (17:26 +0000)]
MFC r350973 (from rrs):
Place back in the dependency on HPTS via module depends versus
a fatal error in compiling. This was taken out by mistake
when I mis-merged from the 18q22p2 sources of rack in NF. Opps.
Michael Tuexen [Thu, 10 Sep 2020 17:12:42 +0000 (17:12 +0000)]
MFC r364754:
RFC 3465 defines a limit L used in TCP slow start for limiting the number
of acked bytes as described in Section 2.2 of that document.
This patch ensures that this limit is not also applied in congestion
avoidance. Applying this limit also in congestion avoidance can result in
using less bandwidth than allowed.
Michael Tuexen [Thu, 10 Sep 2020 16:59:54 +0000 (16:59 +0000)]
MFC r357100:
The server side of TCP fast open relies on the delayed ACK timer to allow
including user data in the SYN-ACK. When DSACK support was added in
r347382, an immediate ACK was sent even for the received SYN with
user data. This patch fixes that and allows again to send user data with
the SYN-ACK.
Michael Tuexen [Thu, 10 Sep 2020 16:47:08 +0000 (16:47 +0000)]
MFC r358023:
Don't use uninitialised stack memory if the sysctl variable
net.inet.tcp.hostcache.enable is set to 0.
The bug resulted in using possibly a too small MSS value or wrong
initial retransmission timer settings. Possibly the value used
for ssthresh was also wrong.
Michael Tuexen [Thu, 10 Sep 2020 13:15:17 +0000 (13:15 +0000)]
MFC r358621:
When using automatically generated flow labels and using TCP SYN
cookies, use the same flow label for the segments sent during the
handshake and after the handshake.
This fixes a bug by making sure that sc_flowlabel is always stored in
network byte order.
Michael Tuexen [Thu, 10 Sep 2020 12:54:46 +0000 (12:54 +0000)]
MFC r359926:
Improve the TCP blackhole detection. The principle is to reduce the
MSS in two steps and try each candidate two times. However, if two
candidates are the same (which is the case in TCP/IPv6), this candidate
was tested four times. This patch ensures that each candidate actually
reduced the MSS and is only tested 2 times. This reduces the time window
of missclassifying a temporary outage as an MTU issue.
Michael Tuexen [Thu, 10 Sep 2020 12:52:50 +0000 (12:52 +0000)]
MFC r359487:
Allow the TCP backhole detection to be disabled at all, enabled only
for IPv4, enabled only for IPv6, and enabled for IPv4 and IPv6.
The current blackhole detection might classify a temporary outage as
an MTU issue and reduces permanently the MSS. Since the consequences of
such a reduction due to a misclassification are much more drastically
for IPv4 than for IPv6, allow the administrator to enable it for IPv6 only.
Manually resolve conflict for BBR, which does not exist in stable/12
Michael Tuexen [Thu, 10 Sep 2020 12:49:16 +0000 (12:49 +0000)]
MFC 359422:
Be a bit more precisly in the description of the sysctl variable
net.inet.tcp.pmtud_blackhole_detection. Also remove three entries,
which are not sysctl variables but statistic counters for TCP.
Thanks to 0mp@ for suggesting an improvement.
Michael Tuexen [Thu, 10 Sep 2020 11:55:45 +0000 (11:55 +0000)]
MFC r361752:
We should never allow either the broadcast or IN_ADDR_ANY to be
connected to or sent to. This was fond when working with Michael
Tuexen and Skyzaller. Skyzaller seems to want to use either of
these two addresses to connect to at times. And it really is
an error to do so, so lets not allow that behavior.
MFC r363256:
(Re)-allow 0.0.0.0 to be used as an address in connect() for TCP
In r361752 an error handling was introduced for using 0.0.0.0 or
255.255.255.255 as the address in connect() for TCP, since both
addresses can't be used. However, the stack maps 0.0.0.0 implicitly
to a local address and at least two regressions were reported.
Therefore, re-allow the usage of 0.0.0.0.
While there, change the error indicated when using 255.255.255.255
from EAFNOSUPPORT to EACCES as mentioned in the man-page of connect().
Michael Tuexen [Thu, 10 Sep 2020 11:46:36 +0000 (11:46 +0000)]
MFC r364089:
Fix the following issues related to the TCP SYN-cache:
* Let the accepted TCP/IPv4 socket inherit the configured TTL and
TOS value.
* Let the accepted TCP/IPv6 socket inherit the configured Hop Limit.
* Use the configured Hop Limit and Traffic Class when sending
IPv6 packets.
Michael Tuexen [Thu, 10 Sep 2020 11:45:03 +0000 (11:45 +0000)]
MFC r364054:
Improve the ECN negotiation when the TCP SYN-cache is used by making
sure that
* ECN is disabled if the client sends an non-ECN-setup SYN segment.
* ECN is disabled is the ECN-setup SYN-ACK segment is retransmitted more
than net.inet.tcp.ecn.maxretries times.
Michael Tuexen [Thu, 10 Sep 2020 11:43:23 +0000 (11:43 +0000)]
MFC r361750:
Restrict enabling TCP-FASTOPEN to end-points in CLOSED or LISTEN state
Enabling TCP-FASTOPEN on an end-point which is in a state other than
CLOSED or LISTEN, is a bug in the application. So it should not work.
Also the TCP code does not (and needs not to) handle this.
While there, also simplify the setting of the TF_FASTOPEN flag.
Brooks Davis [Wed, 9 Sep 2020 23:11:55 +0000 (23:11 +0000)]
MFC r365284:
Always report ENOSYS in init
While rare, encountering an unimplemented system call early in init is
catastrophic and difficult to debug. Even after a SIGSYS handler is
registered, such configurations are problematic. As such, always report
such events for pid 1 (following kern.lognosys if non-zero).
These devices have non-pccard attachments. Warn for those as well. Both an and
wi don't do the modern cyrpto needed to use these cards on secure wifi networks.
an needs firmware from Cisco, which I don't think was ever produced. wi could
in theory do it with raw frames and on-host encryption, but nobody has written
that in the 15 years since WEP was cracked.
MFC After: 3 days
Noticed by: rgrimes
Differential Revision: https://reviews.freebsd.org/D26138
Add deprecation notice for apm bios, aka the apm(4) device. The apm(8)
command will remain, at least for a while, since ACPI emulates the apm
ioctl interface.
Discussed on: arch@
Relnotes: yes
MFC After: 3 days
Change the resume notification event from 'kern' to 'kernel'
We have both a system of 'kern' and of 'kernel'. Prefer the latter and
convert this notification to use 'kernel' instead of 'kern'. As a
transition period, continue to also generate the 'kern' notification
until sometime after FreeBSD 13 is branched.
Three typos:
Amiga is a proper noun
Condition is traditionally spelled starting with 'c'
Some, but not all, of the over/under-voltage instances were hyphenated.
Since they are all adverb phrases, they all need to be hyphenated.
Remove PC Card specific information. It's of little value these days and on
the way out after most of its drivers have been removed.
Use iwn instead of wi device.
Document that PC Card will likely be removed before 13.
This was discussed in arch@ a while ago. Most of the 16-bit drivers that it
relied on have been removed. There's only a few other drivers remaining that
support it, and those are very rare the days (even the once ubiquitious wi(1)
is now quite rare).
Indvidual drivers will be handled separately before pccard itself is removed.
getty appears to date from 3rd edition research unix. That's the oldest man page
on TUHS and its 'unix 1972' restoration effort has assembler sources that look
like simpler version of what's in the 5th edition.
Warner Losh [Wed, 9 Sep 2020 22:38:18 +0000 (22:38 +0000)]
MFC r362664, r362665:
r362664 | imp | 2020-06-26 16:05:23 -0600 (Fri, 26 Jun 2020) | 21 lines
Chroot(2) actually appeared in 7th Edition Unix. ...
r362665 | imp | 2020-06-26 16:23:15 -0600 (Fri, 26 Jun 2020) | 10 lines
Chroot(8) first appeared in 4.3-Reno, not in 4.4 in the BSD world,
but in System III in the AT&T world.
Examination of the TUHS archives shows this was present in 4.3-Reno
and System III.
The Quarter Century of Unix book said that 1BSD was released March 1979.
However, the 1BSD tape image that's on Kirk's historical unix collection has an
earlier date.
It was common practice, at the time, to create a new copy of the tape from the
master system when a new tape was to go out, so several different versions of
1BSD, etc were shipped from Berkerely. The date on the 1BSD tape in the Berkeley
archives on Kirk's DVD is dated in January 16 1979 on the label, and has dates
as late as Jan 29 (there's an UPDATE file that says this includes updates
through this date). Note this date as well.
Document all the sysctl values for the nda devices. Include some minimal
documentation on namespace support for nda devices. Fix a few typos
and formatting nits to apease igor.
2.11BSD was announced on March 14, 1991 in comp.bugs.2bsd by
Steven M. Schultz. The document has a 'revised January 1991'
date at the top.
Patch/1 in the official repo is dated March 31, 1991, and an identical copy of
it was posted to comp.bugs.2bsd on May 5, 1991. Patch 2 in 22 parts was likewise
posted May 18, 1991. This makes the Feb 1992 date too late. It's possible it's a
typo for Feb 1991 since that lines up with the announcement being 2 weeks
later. Without an extant copy of the 2.11 tape, however, it's hard to say for
sure. Go with the date we have the most independent, direct evidence for, which
is the announcement date.
Refine the history of uname. It appeared in 4.4BSD. It was not in v7 unix. It
was one of the additions in PWB, and appeared in System III and later commercial
versions of Unix. The different args to uname weren't aded until System III. Add
a quick note to note the late entry into the BSD fork of Unix since PWB
otherwise implies a pre-fork date.
Brooks Davis [Wed, 9 Sep 2020 21:57:55 +0000 (21:57 +0000)]
MFC r365279:
Remove risky compatability with old kernels
The badsys() handler for SIGSYS was added as a transtion aid for kernels
lacking sysctl() in 1993. It is unsafe and unsound so remove it rather
than running the risk of a privilege-dropping system call being silently
omitted.
This partially reverts SCCSID 6.12 (Berkeley) 03/03/93 "add code to
change the system security level".
John Baldwin [Tue, 8 Sep 2020 22:50:24 +0000 (22:50 +0000)]
MFC 359900: Export a sysctl count of RX FIFO overrun events.
uart(4) backends currently detect RX FIFO overrun errors and report
them to the uart(4) core layer. They are then reported to the generic
TTY layer which promptly ignores them. As a result, there is
currently no good way to determine if a uart is experiencing RX FIFO
overruns. One could add a generic per-tty counter, but there did not
appear to be a good way to export those. Instead, add a sysctl under
the uart(4) sysctl tree to export the count of overruns.
John Baldwin [Tue, 8 Sep 2020 22:19:06 +0000 (22:19 +0000)]
MFC 359899: Correct baud rate error calculation.
Shifting right by 1 is not the same as dividing by 2 for signed
values. In particular, dividing a signed value by 2 gives the integer
ceiling of the (e.g. -5 / 2 == -2) whereas shifting right by 1 always
gives the floor (-5 >> 1 == -3).
An embedded board with a 25 Mhz base clock results in an error of
-30.5% when used with a baud rate of 115200. Using division, this
truncates to -30% and is permitted. Using the shift, this fails and
is rejected causing TIOCSETA requests to fail with EINVAL and breaking
getty(8).
Using division gives the same error range for both over and under baud
rates and also makes the code match the behavior documented in the
existing comment about supporting boards with 25 Mhz clocks.
John Baldwin [Tue, 8 Sep 2020 20:51:19 +0000 (20:51 +0000)]
MFC 359465: Document EINTEGRITY errors for many system calls.
EINTEGRITY was previously documented as a UFS-specific error for
mount(2). This documents EINTEGRITY as a filesystem-independent error
that may be reported by the backing store of a filesystem.
While here, document EIO as a filesystem-independent error for both
mount(2) and posix_fadvise(2). EIO was previously only documented for
UFS for mount(2).
Revert r365471 as it is breaking with old gcc on various arches:
MFC r364753:
Add atomic and bswap functions to libcompiler_rt
There have been several mentions on our mailing lists about missing
atomic functions in our system libraries (e.g. __atomic_load_8 and
friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too.
To address this, add implementations for the functions from compiler-rt
to the system compiler support libraries, e.g. libcompiler_rt.a and and
libgcc_s.so.
This also needs a small fixup in compiler-rt's atomic.c, to ensure that
32-bit mips can build correctly.
Bump __FreeBSD_version to make it easier for port maintainers to detect
when these functions were added.
After r364753, there should be no need to suppress -Watomic-alignment
warnings anymore for compiler-rt's atomic.c. This occurred because the
IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this
caused the compiler to emit a runtime call to __atomic_is_lock_free(),
and that triggers the warning.
There have been several mentions on our mailing lists about missing
atomic functions in our system libraries (e.g. __atomic_load_8 and
friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too.
To address this, add implementations for the functions from compiler-rt
to the system compiler support libraries, e.g. libcompiler_rt.a and and
libgcc_s.so.
This also needs a small fixup in compiler-rt's atomic.c, to ensure that
32-bit mips can build correctly.
Bump __FreeBSD_version to make it easier for port maintainers to detect
when these functions were added.
After r364753, there should be no need to suppress -Watomic-alignment
warnings anymore for compiler-rt's atomic.c. This occurred because the
IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this
caused the compiler to emit a runtime call to __atomic_is_lock_free(),
and that triggers the warning.
John Baldwin [Tue, 8 Sep 2020 18:49:58 +0000 (18:49 +0000)]
Use kmod.opts.mk in sys/modules/tcp/Makefile to fix standalone builds.
This was included in the original commit to head that added use of
KERN_OPTS (r361638) but was left out of the MFC since kmod.opts.mk
hadn't been MFC'd at the time. It has since been merged.
This is a direct commit to stable/11 and stable/12.
John Baldwin [Tue, 8 Sep 2020 16:43:32 +0000 (16:43 +0000)]
MFC 354970: Add a kmod.opts.mk.
This Makefile sets KERN_OPTS. This permits kernel module Makefiles to
use KERN_OPTS to control the value of variables such as SRCS that are
used by bsd.kmod.mk for KERN_OPTS values that honor WITH/WITHOUT
options for standalone builds.
Instead of copying and pasting the same #ifdef expressions in
multiple places, define a type and a pair of macros in kmp_os.h, to
handle whether va_list is pointer-like or not:
* kmp_va_list is the type to use for __kmp_fork_call()
* kmp_va_deref() dereferences a va_list, if necessary
* kmp_va_addr_of() takes the address of a va_list, if necessary
Also add FreeBSD to the list of OSes that has a non pointer-like
va_list. This can now be easily extended to other OSes too.
Follow-up to r358851 (llvm-project 10.0.0-rc3 import), where I added
subdirectories for compiler-rt's internal fuzzer, profile and xray
headers, but forgot to add installing those headers themselves.
Revert r364939 and add a stable/12 approach for populating the ESP
make_esp_file is not available in stable/12 so r364939 broke VM-related targets.
Revert offending commit and use pre-r342283 approach to populate ESP partition.
After the clang/llvm version 11 import LLD_VERSION is no longer used
upstream so Version.inc now only defines LLD_VERSION_STRING.
This breaks the WANT_LINKER_VERSION magic and might lead to us building
more than needed (e.g., for croos-tools).
Change the awk script to parse LLD_VERSION_STRING instead of LLD_VERSION,
which not only unbreaks the current situation but should also be backwards
compatible as dim points out.
Merging this before r364284 will ensure that stable/12 won't break.
PR: 248818
Reviewed by: emaste, dim (seems right and the way to go)
r362736:
Configure rx_delay/tx_delay values for RK3399/RK3328 GMAC
For 1000Mb mode to work reliably TX/RX delays need to be configured
between the TX/RX clock and the respective signals on the PHY
to compensate for differing trace lengths on the PCB.
Reviewed by: manu
r364088:
Improve Rockchip's integration of if_dwc
- Do not rely on U-Boot for clocks configuration, enable and set frequencies
in the driver's attach method.
- Adjust MAC settings according to detected linespeed on RK3399 and RK3328.
- Add support for RMII PHY mode on RK3328.
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D26006
r360467 by mmel:
Fix style(9). Strip write only variables.
Not a functional change.
r362399 by mmel:
Use naming nomenclature used in DesignWare TRM.
Use naming nomenclature used in DesignWare TRM.
This driver was written by using Altera (now Intel) documentation for Arria
FPGA manual. Unfortunately this manual used very different (and in some cases
opposite naming) for registers and descriptor fields. Unfortunately,
this makes future expansion extremely hard.
Should not been functional change.
r362405 by mmel:
Finish renaming in if_dwc.
By using DWC TRM terminology, normal descriptor format should be named
extended and alternate descriptor format should be named normal.
Should not been functional change.
r362415 by mmel:
Improve if_dwc:
- refactorize packet receive path. Make sure that we don't leak mbufs
and/or that we don't create holes in RX descriptor ring
- slightly simplify handling with TX descriptors
Add glue driver for Altera SOCFPGA Ethernet MAC (EMAC) found in
Terasic DE10-Pro (an Intel Stratix 10 GX/SX FPGA Development Kit).
The Altera EMAC is an instance of Synopsys DesignWare Gigabit MAC.
This driver sets correct clock range for MDIO interface on Intel Stratix 10
platform.
This is required due to lack of support for clock manager device for
this platform that could tell us the clock frequency value for ethernet
clock domain.
Provide new KPI for network drivers to access lists of interface
addresses. The KPI doesn't reveal neither how addresses are stored,
how the access to them is synchronized, neither reveal struct ifaddr
and struct ifmaddr.
In Linux, ksize() gets the actual amount of memory allocated for a given
object. This commit adds malloc_usable_size() to FreeBSD KPI which does
the same. It also maps LinuxKPI ksize() to newly created function.
Marcin Wojtas [Sun, 6 Sep 2020 14:41:35 +0000 (14:41 +0000)]
MFC: Merge ENA v2.2.0 driver
r361530 Update ENA driver version to v2.2.0
r361529 Refactor ena_tx_map_mbuf() function
r361528 Fix double-free bug within ena_detach()
r361527 Allow disabling meta caching for ENA Tx path
r361526 Create ENA IO queues with optional backoff
r361525 Add sysctl node for ENA IO queues number adjustment
r361524 Fix assumptions about number of IO queues in the ENA
r361523 Rework ENA Tx buffer ring size reconfiguration
r361521 Rework ENA Rx queue size configuration
r361518 Improve indentation in ena_up() and ena_down()
r361517 Expose argument names for non static ENA driver functions
r361516 Use single global lock in the ENA driver
r361515 Add trigger reset function in the ENA driver
r361514 Provide ENA driver version in a sysctl node
r361513 Remove unused argument from static function in ena.c
r361512 Enable Tx drops reporting in the ENA driver
r361511 Adjust ENA driver to the new HAL
r358289 Rework and simplify Tx DMA mapping in ENA
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Marcin Wojtas [Sun, 6 Sep 2020 14:23:31 +0000 (14:23 +0000)]
MFC: ENA netmap support and bug fixes
r363638 Fix ENA build when integrated into kernel
r354242 Make valdiate_rx_req_id static inline because it uses other static
r354225 Update ENA version to v2.1.0
r354224 Add support for ENA NETMAP partial initialization
r354223 Add support for ENA NETMAP Tx
r354222 Add support for ENA NETMAP Rx
r354221 Introduce NETMAP support in ENA
r354220 Split Rx/Tx from initialization code in ENA driver
r354219 Fix ENA keep-alive timeout due to prolonged reset
r354218 Add WC support for arm64 in the ENA driver
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Marcin Wojtas [Sun, 6 Sep 2020 14:13:51 +0000 (14:13 +0000)]
MFC: Merge ENA v2.0.0 driver
r348416 Update ENA version to v2.0.0
r348414 Fix ENA manual issues
r348413 Improve ENA reset handling
r348412 Fix NULL pointer dereference in ena_up()
r348411 Unify new line characters in the ENA driver
r348410 Fix Tx offloads for fragmented pkt headers in ENA
r348409 Split ENA reset routine into restore and destroy stages
r348408 Use bitfield for storing global ENA device states
r348407 Fix error handling when ENA reset fails
r348406 Fill bdf field of the host_info structure in ENA
r348405 Add additional doorbells on ENA Tx path
r348404 Limit maximum size of Rx refill threshold in ENA
r348403 Add support for the LLQv2 and WC in ENA
r348402 Lock optimization in ENA
r348401 Add tuneable drbr ring size and hw queues depth for ENA
r348400 Fix error in validate_tx_req_id() in ENA
r348399 Change attach order to prevent crash upon failure in ENA
r348398 Change order of ifp release on ENA detach
r348397 Check for number of MSI-x upon partial allocation in ENA
r348396 Set error value when allocation of IO irq fails in ENA
r348395 Set vaddr and paddr as NULL when DMA alloc fails in ENA
r348394 Fix DMA synchronization in the ENA driver Tx and Rx paths
r348393 Check for missing MSI-x and Tx completions in ENA
r348392 Fill number of CPUs field on ENA host_info structure
r348391 Print ENA Tx error conditionally
r348390 Trigger reset in ENA if there are too many Rx descriptors
r348389 Remove RSS support in ENA
r348388 Add notification AENQ handler for ENA
r348387 Print information when ENA admin error occurs
r348386 Do not specify active media type in ENA
r348385 Adjust ENA driver to the new ena-com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Together, these three revisions improve the drm2 (aka legacy drm or
drm-legacy) drivers to point towards graphics/drm-kmod where relevant, and
to remove references to graphics/drm-legacy-kmd as that is being deprecated.
Since part of the drm2 drivers are still used on arm, arm is currently
excluded from the deprecation message.
Update the deprecation message in the drm1 (aka legacy drm or drm-legacy)
drivers to not point towards the drm-legacy-kmod port, as that is being
deprecated.
This is a direct commit to stable/12 since the drm1 code has been removed
from 13 already.