Commit graph

39765 commits

Author SHA1 Message Date
Hans Petter Selasky
6d8c6b24ee xhci(4): Always add and evaluate the slot context.
Because the maximum number of endpoint contexts is stored there.

Tested by:	ehaupt@
PR:		262882
Approved by:	re (gjb, early MFC)
Sponsored by:	NVIDIA Networking

(cherry picked from commit 09dd1adfa4)
2022-05-03 21:43:13 +02:00
Hans Petter Selasky
610528736f xhci(4): Only drop BULK and INTERRUPT endpoints to reset data toggle.
Only drop BULK and INTERRUPT endpoints, to reset the data toggle,
because for other endpoint types this is not critical.

While at it fix some whitespace.

Tested by:	ehaupt@
PR:		262882
Approved by:	re (gjb, early MFC)
Sponsored by:	NVIDIA Networking

(cherry picked from commit e276d28150)
2022-05-03 21:41:51 +02:00
Ed Maste
5e017a8474 teken: color #3 is yellow not brown - use TC_YELLOW as the name
The console escape code standard (ECMA-48) specifies color #3 (escape
code 33) as yellow.  A brown console color is an artifact of the VGA
palette, which replaces dim (but not bright) yellow with brown.

Reviewed by:	adrian, imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34531

(cherry picked from commit cf8880d52b)
2022-05-03 14:20:44 -04:00
John Baldwin
62acf8a36a cxgbe tom: Compile fix for disabled KTR trace.
Sponsored by:	Chelsio Communications

(cherry picked from commit bca6e339ac)
2022-04-29 16:10:58 -07:00
John Baldwin
3b29ee793e cxgbe tom: Use VM_PAGE_TO_PHYS().
Sponsored by:	Chelsio Communications

(cherry picked from commit 87b0e7711f)
2022-04-29 16:10:43 -07:00
John Baldwin
64d35ef56a cxgbe tom: Use be64toh instead of htobe64 to convert to host order.
This is a no-op but more accurately conveys intent.

Sponsored by:	Chelsio Communications

(cherry picked from commit 44e7472d0e)
2022-04-29 16:10:34 -07:00
John Baldwin
05da0093a6 cxgbe tom: Use vm_paddr_t for physical addresses in page pod routines.
Sponsored by:	Chelsio Communications

(cherry picked from commit de414339c9)
2022-04-29 16:10:27 -07:00
John Baldwin
04e7565968 cxgbe: Move page pods KTR traces under VERBOSE_TRACES.
(cherry picked from commit 2753997438)
2022-04-29 16:09:53 -07:00
John Baldwin
ca0ad465d1 cxgbei: Replace worker thread pools with per-connection kthreads.
Having a single pool of worker threads adds extra complexity and
overhead.  The software backend also uses per-connection kthreads.

Sponsored by:	Chelsio Communications

(cherry picked from commit 511b83b167)
2022-04-29 16:09:02 -07:00
John Baldwin
17c0d2d43a cxgbei: Dispatch sent PDUs to the NIC asynchronously.
Previously the driver was called to send PDUs to the NIC synchronously
from the icl_conn_pdu_queue_cb callback.  However, this performed a
fair bit of work while holding the icl connection lock.  Instead,
change the callback to add sent PDUs to a STAILQ and defer dispatching
of PDUs to the NIC to a helper thread similar to the scheme used in
the TCP iSCSI backend.

- Replace rx_flags int and the sole RXF_ACTIVE flag with a simple
  rx_active bool.

- Add a pool of transmit worker threads for cxgbei.

- Fix worker thread exit to depend on the wakeup in kthread_exit()
  to fix a race with module unload.

Reported by:	mav
Sponsored by:	Chelsio Communications

(cherry picked from commit fd8f61d6e9)
2022-04-29 16:08:35 -07:00
John Baldwin
05d87fdb32 cxgbei: Rework parsing of pre-offload PDUs.
sbcut() returns mbufs in reverse order so is not suitable for reading
data from the socket buffer.  Instead, check for already-received data
in the receive worker thread before passing offload PDUs up to the
iSCSI layer.  This uses soreceive() to read data from the socket and
is also to use M_WAITOK since it now runs from a worker thread instead
of an interrupt thread.

Also, fix decoding of the data segment length for pre-offload PDUs.

Reported by:	Jithesh Arakkan @ Chelsio
Fixes:		a8c4147edc cxgbei: Parse all PDUs received prior to enabling offload mode.
Sponsored by:	Chelsio Communications

(cherry picked from commit 74fea8eb4f)
2022-04-29 16:06:48 -07:00
John Baldwin
b08a08f24d cxgbei: Parse all PDUs received prior to enabling offload mode.
Previously this would only handle a single PDU that did not contain
any data.  This should now handle an arbitrary number of PDUs.

While here check for these PDUs in the T6-specific CPL_RX_ISCSI_CMP
handler in addition to CPL_RX_ISCSI_DDP.

Reported by:	Jithesh Arakkan @ Chelsio
Sponsored by:	Chelsio Communications

(cherry picked from commit a8c4147edc)
2022-04-29 16:03:49 -07:00
John Baldwin
12978b1c99 ccr: Use a software OCF session for requests which fallback to software.
Previously the driver duplicated code from cryptosoft.c to handle
certain edge case AES-CCM and AES-GCM requests.  However, this
approach has a few downsides:

1) It only uses "plain" software and not accelerated software since it
   uses enc_xform directly.

2) It performs the operation synchronously even though the caller
   believes it is invoking an async driver.  This was fine for the
   original use case of requests with only AAD and no payload that
   execute quickly, but is a bit more disingenuous for large requests
   which fall back due to exceeding the size of a firmware work
   request (e.g. due to large scatter/gather lists).

3) It has required several updates since ccr(4) was added to the tree.

Instead, allocate a software session for AES-CCM and AES-GCM sessions
and dispatch a cloned request asynchronusly to the software session.

Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33608

(cherry picked from commit e43cf698d9)
2022-04-29 15:50:29 -07:00
John Baldwin
745c280c89 cxgbei: Don't fail task setup if the socket is disconnected.
When the initiator is reconnecting to the target, the connection may
temporarily be marked disconnected or not have an associated socket.
New I/O requests received by the initiator in this state should not
fail with ECONNRESET as that results in an I/O error back to userland.
Instead, they need to still succeed so that CAM can queue the requests
and send them once the connection is re-established.

Setting up DDP for zero-copy receive requires a socket, so just punt
on using DDP for these transfers.

Reported by:	Jithesh Arakkan @ Chelsio
Sponsored by:	Chelsio Communications

(cherry picked from commit 752e211e64)
2022-04-29 14:18:22 -07:00
John Baldwin
fe0172025f ccr: Replace 'blkcipher' with just 'cipher'.
ccr(4) can handle requests for AES-CTR (a stream cipher), not just
block ciphers, so make the function and structure names more generic.

Sponsored by:	Chelsio Communications

(cherry picked from commit 762f1dcb1c)
2022-04-29 14:11:04 -07:00
John Baldwin
a41ff1661b crypto: Validate AES-GCM IV length in check_csp().
This centralizes the check for valid nonce lengths for AES-GCM.

While here, remove some duplicate checks for valid AES-GCM tag lengths
from ccp(4) and ccr(4).

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33194

(cherry picked from commit 6e17a2e00d)
2022-04-29 13:50:04 -07:00
Hans Petter Selasky
3644b92099 xhci(4): Ensure the so-called data toggle gets properly reset.
Use the drop and enable endpoint context commands to force a reset of
the data toggle for USB 2.0 and USB 3.0 after:
 - clear endpoint halt command (when the driver wishes).
 - set config command (when the kernel or user-space wants).
 - set alternate setting command (only affected endpoints).

Some XHCI HW implementations may not allow the endpoint reset command when
the endpoint context is not in the halted state.

Reported by:		Juniper and Gary Jennejohn
Sponsored by:		NVIDIA Networking

(cherry picked from commit cda31e7349)
2022-04-27 21:07:13 +02:00
J.R. Oldroyd
429adef619 e1000: Try auto-negotiation for fixed 100 or 10 configuration
Currently if an e1000 interface is set to a fixed media configuration,
for gigabit, it will participate in auto-negotiation as required by
IEEE 802.3-2018 Clause 37. However, if set to fixed media configuration
for 100 or 10, it does NOT participate in auto-negotiation.

By my reading of Clauses 28 and 37, while auto-negotiation is optional
for 100 and 10, it is not prohibited and is, in fact, "highly
recommended".

This patch enables auto-negotiation for fixed 100 and 10 media
configuration, in a similar manner to that already performed for 1000.
I.e., the patch enables advertising of just the manually configured
settings with the goal of allowing the remote end to match the manually
configured settings if it has them available.

To be clear, this patch does NOT allow an em(4) interface that has been
manually configured with specific media settings to respond to
auto-negotiation by then configuring different parameters to those that
were manually configured. The intent of this patch is to fully comply
with the requirements of Clause 37, but for 100 and 10.

The need for this has arisen on an em(4) link where the other end is
under a different administrative control and is set to full
auto-negotiation. Due to the cable length GigE is not working well. It
is desired to set the em(4) end to "media 100baseTX mediatype
full-duplex" which does work when both ends are configured that way.
Currently, because em(4) does not participate in autoneg for this
setting, the remote defaults to half-duplex - i.e., there's a duplex
mismatch and things don't work. With this patch, em(4) would inform the
remote that it has only 100baseTX full, the remote would match that and
it will work.

Approved by:	erj
Differential Revision:	https://reviews.freebsd.org/D34449

(cherry picked from commit 9ab4dfce8f)
2022-04-27 10:35:28 -07:00
Kevin Bowling
479ef11e78 e1000: Update mc filter before RCTL flags
Update mc filter array before changing RCTL flags as in 5a3eb6207a

Approved by:	grehan

(cherry picked from commit 07ede75161)
2022-04-27 10:35:12 -07:00
Kevin Bowling
c4661f71cb ixgbe: Update mc filter before FCTRL flags
Update mc filter array before changing FCTRL flags, similar to 5a3eb6207a

Approved by:	grehan

(cherry picked from commit 395cc55d89)
2022-04-27 10:34:50 -07:00
John F. Carr
972ea9cc57 hpet: Allow a MMIO window smaller than 1K
Some new AMD systems provide a HPET MMIO region smaller than the 1KB
specified, and a correspondingly small number of timers.  Handle this in
the HPET driver rather than requiring a 1KB window.  This allows the
HPET driver to attach on such systems.

PR:		262638
Reviewed by:	markj

(cherry picked from commit 964bf2f902)
2022-04-27 09:33:56 -04:00
Misho
e54505277c if_bnxt: Allow bnxt interfaces to use vlans
When VLAN HW filter is disabled, the NIC does not pass any vlan tagged
traffic. Setting these flags on the device allows vlan tagged traffic to
pass.

PR:		236983
Tested by:	pi
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34824

(cherry picked from commit 0c6a2fa33e)
2022-04-27 14:14:40 +01:00
Konstantin Belousov
6d23cd6674 syscons: silent 'set but unused' warning in some configurations
(cherry picked from commit d282bb42c3)
2022-04-27 03:26:04 +03:00
Kyle Evans
2f2eb7f118 psci: finish psci_present implementation
This was already declared in psci.h, but it was never defined/set.  Do
this now, so we can use it to decide if enable-method in /cpus FDT nodes
should be inspected later on.  While we're here, convert it to a
boolean.

Reviewed by:	andrew (slightly earlier version)

(cherry picked from commit 2218070b2c)
2022-04-24 19:06:23 -05:00
Gordon Bergling
a67ee9022f oce(4): Fix a typo in a sysctl description
- s/interupt/interrupt/

(cherry picked from commit 88cdccff3f)
2022-04-23 08:55:43 +02:00
Gordon Bergling
66fb0f33ff iicbus(4): Fix two typos in kernel error messages
- s/occured/occurred/

(cherry picked from commit 7fad3ed8e9)
2022-04-23 08:55:22 +02:00
Gordon Bergling
4a98047762 videomode: Fix a typo in an kernel message
- s/Seperate/Separate/

Obtained from:	NetBSD

(cherry picked from commit f45f90c5d6)
2022-04-22 09:28:10 +02:00
Tong Zhang
7a4790dc83 if_axgbe: properly release resource in error case
PR:		262899
Reviewed by:	markj

(cherry picked from commit 57f7a82fbb)
2022-04-20 10:14:39 -04:00
Mitchell Horne
d15267582d Remove 11.x ABI compat for kernel dump ioctls
This code was marked gone_in(13), so its time has passed.

The only consumer of this interface is dumpon(8). We do not maintain
strict backwards compatibility for this utility because a) it
can't/shouldn't be used from a jail or chroot and b) it is highly
specific interface unique to FreeBSD. The host's (presumably more
up-to-date) copy of dumpon(8) should be used to configure kernel dump
devices.

Reviewed by:	markj, emaste
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D34913

(cherry picked from commit 9c90bfcd31)
2022-04-18 11:51:40 -03:00
Ed Maste
3ec2816ad7 kbd: replace vestigial spl calls with Giant assertions
The keyboard driver was initially protected via spl* interrupt priority
calls but (as part of a comprehensive effort) migrated to use the Giant
lock (mutex).

The spl calls left behind became NOPs but they can be confusing as they
have no bearing on the actual mutual exclusion that is now present.

Remove them from kbd and add assertions that Giant is held.  markj notes
that there is conflation between the "bus topo" lock (which is Giant
under the hood) and Giant.  The assertions could either be addressed as
a small item along with bus topology locking work or they'll be removed
if kbd is decoupled from Giant.

PR:		206680
Reviewed by:	markj
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34645

(cherry picked from commit a0cd78bf2c)
2022-04-15 12:29:02 -04:00
Gordon Bergling
bcdea7f578 sym(4): Fix a typo in a source code comment
- s/explicitely/explicitly/

(cherry picked from commit 4e27f86733)
2022-04-14 08:17:03 +02:00
Gordon Bergling
0ebfaeaf4c al_eth: Remove a double word in a source code comment
- s/for for/for/

(cherry picked from commit 6a734168cb)
2022-04-14 08:16:39 +02:00
Gordon Bergling
c6e8fa2a75 usb: Remove some double words in source code comments
- s/for for/for/

(cherry picked from commit 74c6ca6fbf)
2022-04-14 08:15:51 +02:00
Gordon Bergling
c082302919 usb(4): Fix two typos in source code comments
- s/negotation/negotiation/

(cherry picked from commit c8c1c23a8c)
2022-04-14 08:15:24 +02:00
Gordon Bergling
8c4ba30ad3 qlnxe(4): Fix a typo in a source code comment
- s/mulitple/multiple/

(cherry picked from commit 78fc83f096)
2022-04-14 08:14:53 +02:00
Gordon Bergling
b8e4c893d2 mpt(4): Fix a typo in a source code comment
- s/proccessor/processor/

(cherry picked from commit a37c6fcc46)
2022-04-14 08:13:05 +02:00
Gordon Bergling
3d96164764 cxgbe(4): Fix a typo in a source code comment
- s/simultaniously/simultaneously/

(cherry picked from commit 8a1b8cf4be)
2022-04-14 08:12:50 +02:00
Gordon Bergling
386a4025b0 bhnd(4): Remove some double words in source code comments
- s/be be/be/
- s/is is/is/

(cherry picked from commit 060f5c02e9)
2022-04-14 08:12:37 +02:00
Gordon Bergling
ecc10e7be9 usb(4): Remove a double word in a source code comment
- s/for for/for/

(cherry picked from commit 2e09a4ac3b)
2022-04-14 08:12:05 +02:00
Gordon Bergling
72692ac18c nvme(4): Fix a typo in a source code comment
- s/is is/is/

(cherry picked from commit dfa01f4f98)
2022-04-14 08:11:16 +02:00
Gordon Bergling
49a2f75623 ips(4): Remove a double word in a few source code comments
- s/for for/for/

(cherry picked from commit bafe4cee3d)
2022-04-14 08:11:01 +02:00
Gordon Bergling
c2025adaea iwm(4): Remove a double word in a source code comment
- s/for for/for/

(cherry picked from commit 586023f10d)
2022-04-14 08:10:48 +02:00
Gordon Bergling
b138cb1300 sfxge(4): Remove some double words in source code comments
- s/is is/is/

(cherry picked from commit d96159bff8)
2022-04-14 08:10:18 +02:00
Gordon Bergling
5688715acf neta: Fix a typo in a source code comment
- s/maintance/maintenance/

(cherry picked from commit 19ae05aad3)
2022-04-14 08:09:34 +02:00
Gordon Bergling
b0f708e6a6 iscsi(4): Remove a double word in a source code comment
- s/for for/for/

(cherry picked from commit 10df4dc724)
2022-04-14 08:09:17 +02:00
Gordon Bergling
e5a76832b8 e1000: Fix a typos in source code comments
- s/negotation/negotiation/

(cherry picked from commit 237a666333)
2022-04-14 08:07:43 +02:00
Gordon Bergling
cdaa811889 sfxge(4): Remove a double word in a few source code comments
- s/for for/for/

(cherry picked from commit db739f1c19)
2022-04-14 08:07:28 +02:00
Gordon Bergling
dcc5066d86 bhnd(4): Remove a double word in a source code comment
- s/an an/an/

(cherry picked from commit 75e1650d7f)
2022-04-14 08:06:35 +02:00
Gordon Bergling
e5901f6cd3 random(3): Fix a typo in a source code comment
- s/psuedo/pseudo/

(cherry picked from commit 474df59def)
2022-04-14 08:06:21 +02:00
Gordon Bergling
46516b828b sound(4): Fix a typo in a source code comment
- s/Miscellanious/Miscellaneous/

(cherry picked from commit 35fbe62477)
2022-04-14 08:05:30 +02:00