usb: support SSP and SSPx2 xHCI
Only the default PSI IDs are supported, other controllers fall back to
USB 3.0. Record the speed IDs the controller has: the root hub BOS
lists those, and a link without one uses the closest lower ID.
Per xHCI 6.2.2, take the parent hub slot ID and port number of SS and
SSP devices from the closest higher-rank hub.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52347
usb: Add support for SSP and SSPx2 hubs
An SSP hub reports its sublink speeds in the BOS descriptor, and
Extended Port Status tells which one each port uses. Read it based on
bcdUSB, since the ports of a hub can be faster than its upstream link.
Without it, the ports are treated as SuperSpeed.
Read the speed again in usbd_req_re_enumerate(), since a link can come
back at another speed.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57204
usb: Implement usbd_req_get_bos_descriptor helper
Get the header or the complete BOS descriptor of SS+ devices.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57202
usb: Add get_ext_port_status helper function
usbd_req_get_ext_port_status() wraps the Get Extended Port Status
request.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57201
usb: Add usbd_bos_foreach helper
Iterate the capabilities of a BOS descriptor.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57199
usb: Add SSPlus device capability descriptor
Add the SuperSpeedPlus USB Device Capability descriptor and its field
macros.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57203
usb: Add extended port status struct
Extended Port Status reports the speed and lane count of SS and SSP
links.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57200
usb: support SSP/SSPx2 devices in all-speed consumers
Handle the new speeds wherever USB_SPEED_SUPER was checked. Most
consumers treat them as SS.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57198
usbdump: Support SSP and SSPx2 speed display
Add the SuperSpeedPlus speed names.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57197
libusb: Add SSP and SSPx2 enum support
Report the new kernel speeds as LIBUSB20_SPEED_SUPER_PLUS.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57195
usb: Add SSP and SSPx2 speed and move USB_*_MAX into enum
Add the USB 3.1 and 3.2 speeds and revisions. The speeds are in USB
3.2 rank order, so they can be compared directly.
Also, move USB_*_MAX into the enums.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57194
usbconfig: Add SSPx2 support
libusb has one speed for all SSP links, so print "SUPER+ (>=10Gbps)".
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57196
ufshci: fix the WLUN peripheral lookup timeout
The timeout in ufshci_sim_find_periph() is uint64_t, making the
comparison of timeout - ticks with zero always false. If the requested
peripheral does not become available, the lookup can wait indefinitely.
Use an sbintime_t deadline based on sbinuptime() and mstosbt(), and
compare the current uptime directly with the deadline. Preserve the
successful lookup path and existing timeout cleanup.
On an HP 15-fd0118ca with Intel N150 and Samsung UFS 3.1 storage, a
kernel built from stable/15 revision 84aa3cb3204d with this change
logged the missing-WLUN timeout, attached da0 and mounted root in two
boot trials.
Signed-off-by: Denis Lemire <denis at lemire.name>
Reviewed by: jaeyoon
Fixes: 31407551c3d4 ("ufshci: Add a check for WLUN during driver initialization")
MFC after: 3 days
[3 lines not shown]
pkg: Enable FreeBSD-base by default
Enable the FreeBSD-base repository in all of the /etc/pkg/FreeBSD.conf
variants, and remove code from various install paths which enabled the
repository via /usr/local/etc/pkg/repos/FreeBSD.conf.
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D60946
release: No distribution sets by default
Remove the "NODISTSETS" option and add a "DISTSETS" option. This
option will remain, disabled by default, for the duration of the
16.x branch but will be removed in 17.0.
With hat: re
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D60945
GCE: Copy /usr/{src,ports} directly
Distribution sets are going away, so we can't extract those into GCE
images for all-source-code-included compliance purposes.
Differential Revision: https://reviews.freebsd.org/D60944
iavf: Handle queue disable during reset recovery
Some PFs reject a redundant DISABLE_QUEUES request after queues have
already stopped. The historical driver retried the request but
continued. The mailbox recovery change instead treated this NACK as a
transport failure, tore down the Admin Queue without a VF reset, and
could not recover the interface during API rediscovery.
Track a PF's pre-reset warning separately from an observed reset and
from exclusive ownership of polled AdminQ replies. RESET_IMPENDING
leaves asynchronous AdminQ processing available so a concurrent stop
can consume its DISABLE_QUEUES reply. VC_POLLING protects VERSION and
GET_VF_RESOURCES rediscovery without blocking that reply. Record
completed resets so subsequent stop/init operations do not issue a
redundant queue-disable request.
If queue disable is not confirmed, wait for an observed reset or request
a VF reset and wait for completion. Give queue shutdown a separate
60-second monotonic deadline to accommodate slow PF reset recovery.
[21 lines not shown]
nfscl: Do not delay recovery for a stale ClientID
When a CREATE_SESSION with the extant ClientID failed with
NFS4ERR_STALE_CLIENTID within nfsc_renew of the previous full recovery,
nfsrpc_setclient() returned EIO and the mount did no I/O until that window
expired (about 45s).
The server has discarded the ClientID, so waiting cannot help; RFC 8881
Section 8.4.2 requires a new ClientID (EXCHANGE_ID) and a state reclaim.
AWS EFS discards both the session and the ClientID of clients whose lease is
current whenever it resets a connection, which makes this path common there.
PR: 299221
Approved by: rmacklem@
Sponsored by: Netflix
nfsd: Fix handling of RPC messages too large to cache
The NFSv4.1/4.2 session negotiates a limit to the size
of an RPC reply message that can be cached for the session
slot.
This patch fixes the code so that it checks that limit and
does not cache replies larger than the limit, even if the
client requested that it be cached.
This patch is slightly different than what the author
submitted, but retains the check for reply cache size limit.
Reviewed by: rmacklem
MFC after: 1 month
ktls: Check the record type message holds its byte
sosend_generic() read the TLS record type past a TLS_SET_RECORD_TYPE
control message holding only a cmsghdr, and sent that stale byte.
Approved by: markj
Fixes: b2e60773c6b0 ("Add kernel-side support for in-kernel TLS.")
Sponsored by: Netflix
libthr: Remove deadcode in join_common
The while loop previous can only be break when ret == ETIMEDOUT. They
never produce EBUSY. Remove the deadcode here.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D60711
(cherry picked from commit a0e152973613e0d0d55257f4e1f614509b7ec4c9)
libthr: Fix LIBPTHREAD_QUEUE_FIFO range
LIBPTHREAD_QUEUE_FIFO is used in bitwise offset, we set the limit to
0~31 so that it won't cause undefined behavior. Also, create a new
helper function to do getenv++strtol directly and check the boundary of
the valid value.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D60487
(cherry picked from commit 5fb07bbcd5d5d9a865d9e7765fb93e9ba5edef1c)
linux: cap mount id to INT_MAX
linux stores mount id as a int32_t, using xor would make it becomes
negative in some cases. As a result, we cap the value to INT_MAX to
prevent getting a negative value from userspace.
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D59202
(cherry picked from commit 23626eb9e3d61928358c9c813aa5a17e797ba404)
hyperv: Fix single page invalidation path
A single page invalidation sets addr2 == 0. In the original code, it
falsely flush the whole address in non global pmap. However, the
kernel pmap are all PG_G, which means a single page flush will always be
staled and thus become invalid. As a result, we set parameter based on
their op in a new helper function instead of relying on args. This
affects only on AMD platform as Intel has their PTI implementation.
PR: 291577
Tested by: franco at opnsense.org
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D60380
(cherry picked from commit 5b1f1fd624352840cd9666447ff9cdebeaf910d4)
libthr: Fix some bugs in trylock
1. When contester > 2, a release causes kernel set CONTENTION bit but
with no owner. In this case, the userspace should be able to try the
lock instead of fall immediately. We copy this from trylock2.
2. A PI mutex should consult to kernel instead of decided by userspace
itself.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D60427
(cherry picked from commit de2c0f157a9cce0b763da9ae97ada870fa4d1824)
libthr: Do not rely on UB in counter
counter + 1 > 0 is a undefined behavior and nobody guarantee that it
will be honestly perform by the compiler that counter + 1 will always be
INT_MIN. We switch to INT_MAX check instead to provide a deterministic
result.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D60426
(cherry picked from commit 1d21e67e720a08992e81d626cff9d76524a81f22)