Commit Graph

40515 Commits

Author SHA1 Message Date
John Baldwin
517a8a715a hptiop: Store softc pointer in si_drv1 of cdev.
Rather than fetching the softc using the controller's unit number as
an index into the devclass.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34993
2022-04-21 10:29:13 -07:00
John Baldwin
5a03f17a9a acpi_tz: Lookup devclass by name when needed.
Cache the value in a local variable in the worker thread.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34992
2022-04-21 10:29:13 -07:00
John Baldwin
9066471175 acpi_isab: Check the unit in probe instead of using the devclass.
This is an alternate way to only attach to isab0 for the reasons
described in commit 852989bdbf.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34991
2022-04-21 10:29:13 -07:00
John Baldwin
33883cdce4 acpi_hpet: Use devclass_find to find devclass in identify.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34990
2022-04-21 10:29:13 -07:00
John Baldwin
97c076d237 acpi_ec: Use device_get_devclass to find devclass in probe.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34989
2022-04-21 10:29:13 -07:00
John Baldwin
e206dddcfe acpi_cpu: Use device_get_devclass to find devclass in attach.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34988
2022-04-21 10:29:13 -07:00
John Baldwin
3730d6aa8f acpi_apei: Use devclass_find to find devclass in identify.
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D34987
2022-04-21 10:29:13 -07:00
John Baldwin
5a84b710a9 acpi_acad: Use devclass_find to find the acpi_acad devclass.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34986
2022-04-21 10:29:13 -07:00
Hans Petter Selasky
cda31e7349 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
MFC after:		1 week
Sponsored by:		NVIDIA Networking
2022-04-21 17:01:13 +02:00
Misho
0c6a2fa33e 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
2022-04-21 09:31:51 +01:00
Konstantin Belousov
d282bb42c3 syscons: silent 'set but unused' warning in some configurations
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2022-04-21 01:55:12 +03:00
Doug Moore
11fced21cc dev/iommu: Include offset in maxaddr check.
If iommu_gas_match_one has to adjust for a boundary crossing, its
check against maxaddr includes 'offset' in its calculation, to ensure
that the allocated memory does not exceed the max address. However, if
there's no boundary crossing adjustment, then the maxaddr check
disregards 'offset'. Fix that.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D34978
2022-04-20 17:24:11 -05:00
Gordon Bergling
7fad3ed8e9 iicbus(4): Fix two typos in kernel error messages
- s/occured/occurred/

MFC after:3 days
2022-04-20 12:55:44 +02:00
Gordon Bergling
88cdccff3f oce(4): Fix a typo in a sysctl description
- s/interupt/interrupt/

MFC after:	3 days
2022-04-20 12:51:52 +02:00
John Baldwin
e8d1145d10 cxgbe: Remove unused devclass arguments to *DRIVER_MODULE().
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34964
2022-04-19 10:44:08 -07:00
Gordon Bergling
f45f90c5d6 videomode: Fix a typo in an kernel message
- s/Seperate/Separate/

Obtained from:	NetBSD
MFC after:	3 days
2022-04-19 17:09:52 +02:00
Mateusz Guzik
19447fc488 sfxge: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-19 12:45:57 +00:00
Mateusz Guzik
d37dca9ec9 cxgbe: plug a set-but-not-used var
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-19 12:45:56 +00:00
Mateusz Guzik
f2edc91557 uart: plug a set-but-not-used var
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-19 09:34:55 +00:00
Michael Tuexen
53236f905d if_vtnet: improve dumping a kernel
Disable software LRO during kernel dumping, because having it enabled
requires to be in a network epoch, which might or might not be the
case depending on the code path resulting in the panic.

Reviewed by:		markj
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D34787
2022-04-19 00:40:31 +02:00
John Baldwin
43d5661a9d cxgbei: Return limits for the specific adapter the socket is on.
Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34929
2022-04-18 12:53:33 -07:00
John Baldwin
7b02c1e8c6 iscsi: Fetch limits based on a socket rather than assuming global limits.
cxgbei needs the ability to return different limits based on the
connection (e.g. if the connection is over a T5 adapter or a T6
adapter as well as factoring in the MTU).

This change plumbs through the changes in the ioctls without changing
any of the backends.  The limits callback passed to icl_register now
accepts a second socket argument which holds the integer file
descriptor.  To support ABI compatiblity for old binaries, the
callback should return "global" values if the socket fd is zero.

The CTL_ISCSI_LIMITS argument used with CTL_ISCSI by ctld(8) now
accepts the socket fd in a field that was previously part of a
reserved spare field.  Old binaries zero this request which results in
passing a socket fd of 0 to the limits callback.

The ISCSIDREQUEST ioctl no longer returns limits.  Instead, iscsid(8)
invokes a new ISCSIDLIMITS ioctl after establishing the connection via
connect(2).  For ABI compat, if the old ISCSIDREQUEST is invoked, the
global limits are still fetched (with a socket fd of 0) and returned.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34928
2022-04-18 12:53:28 -07:00
John Baldwin
bc734377d9 qoriq_gpio_pin_setflags: Propagate error from qoriq_gpio_pin_configure.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D34854
2022-04-18 12:28:09 -07:00
John Baldwin
540ac338d5 uhid_snes: Remove USB_ST_TRANSFERRED handling for the status request.
The result of the request computed in new_status was never returned to
the caller leaving new_status as a set-but-unused variable.  Removing
new_status leaves sc->previous_status as a write-only variable.
Removing sc->previous_status leaves current_status as a write-only
variable, so it collapses down to removing the entire
USB_ST_TRANSFERRED case.

Arguably, all of the support for UHID_SNES_STATUS_DT_RD should be
removed as it doesn't return anything to the caller.  If the request
should be fixed instead then this commit should be reverted and
new_status should be returned to whoever submitted the request.

Differential Revision:	https://reviews.freebsd.org/D34840
2022-04-18 12:27:48 -07:00
Warner Losh
0fd4cd405b nvme: Use controller's page size instead of PAGE_SIZE to create qpair
When constructing qpair, use the controller's notion of page size rather
than the host's PAGE_SIZE. Currently, these are both 4k, but the arm 16k
page size support requires decoupling.

There's a "hidden" PAGE_SIZE in btoc, so we must change btoc(x) to
howmany(x, ctrlr->page_size) to properly count the number of pages (in
the drive's world view) are needed for various calculations.

With these changes, we the nvme driver operates at production level load
for both host 4k and host 16k page size.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D34873
2022-04-15 14:46:19 -06:00
Warner Losh
c5ed67dc90 nvme: Prefer nvme_printf to printf when reporting formatting error
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D34872
2022-04-15 14:46:19 -06:00
Warner Losh
3740a8db13 nvme: Further refinements in Host Memory Buffer Sizing
Host Memory Buffer units are a mix. For those in the identify structure,
the size is in 4kiB chunks. For specifying the buffer description,
though, they are in terms of the drive's MPS. Add comments to this
effect and change PAGE_SIZE to ctrlr->page_size where needed, as well as
correct a mistaken use of NVME_HPS_UNITS in 214df80a9c as pointed out
by rpokala@ after the commit. No functional change is intended, as
page_size is still 4k which matches all current hosts' PAGE_SIZE, but to
support 16k pages on arm, we need to differentiate these two cases.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D34871
2022-04-15 14:46:19 -06:00
Warner Losh
3086efe895 nvme: Remove NVME_MAX_XFER_SIZE, replace inline calculation
NVME_MAX_XFER_SIZE used to be a constant (back when MAXPHYS was a
constant) to denote the smaller of MAXPHYS or the largest PRP we could
encode with our prealloation scheme. However, it's no longer constant
since MAXPHYS varies at runtime. In addition, the actual maximum is now
based on the drive's currently in use page_size, which is also a runtime
expression. As such, remove the define and expand it inline in the one
place its used still in the tree.

Sponsored by:		Netflix
Reviewed by:		chuck
Differential Revision:	https://reviews.freebsd.org/D34870
2022-04-15 14:46:18 -06:00
Warner Losh
3a468f2010 nvme: Use saved mps when initializing drive
Make sure we set the MPS we cached (currently the drives minimum mps) in
CC (Controller Configuration) when reinitializing the drive. It must
match the page_size that we're going to use. Also retire less specific
NVME_PAGE_SHIFT since it's now unused.

Sponsored by:		Netflix
Reviewed by:		chuck
Differential Revision:	https://reviews.freebsd.org/D34869
2022-04-15 14:46:18 -06:00
Warner Losh
55412ef90a nvme: Rename min_page_size to page_size and save mps
The Memory Page Size sets the basic unit of operation for the drive. We
currently set this to the drive's minimum page size, but we could set it
to any page size the drive supports in the future. Replace min_page_size
(it's now unused for that purpose) with page_size to reflect this and
cache the MPS we want to use. Use NVME_MPS_SHIFT to compute page_size.

Sponsored by:		Netflix
Reviewed by:		chuck
Differential Revision:	https://reviews.freebsd.org/D34868
2022-04-15 14:46:18 -06:00
Warner Losh
6e3deec8ca nvme: Base maximum data transfer size directly on MPSMIN in cap_hi
Calculate the maxmimum transfer size based on the MPSMIN we have in our
cached copy of cap_hi rather than using min_page_size in the controller.

Sponsored by:		Netflix
Reviewed by:		chuck
Differential Revision:	https://reviews.freebsd.org/D34867
2022-04-15 14:46:18 -06:00
Warner Losh
a7218e7a6b nvme: Fix old intel alignment size
The intel raid stripe alignment parameter is based on CAP.MPSMIN, so use
that directly now that we have it available.

Sponsored by:		Netflix
Reviewed by:		chuck
Differential Revision:	https://reviews.freebsd.org/D34866
2022-04-15 14:46:18 -06:00
Warner Losh
e66c1b5185 nvme: Define NVME_MPS_SHIFT
The memory page size (MPS) is expressed in terms of a 2^(number + 12)
and other items in the system inherit this. Create a define rather than
sprinkling 12 everywehere.

Sponsored by:		Netflix
Reviewed by:		chuck
Differential Revision:	https://reviews.freebsd.org/D34865
2022-04-15 14:46:18 -06:00
Mitchell Horne
0a90043e63 Remove 12.x ABI compat for kernel dump ioctls
This code was marked gone_in(14), so it can now be removed.

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:	never
Differential Revision:	https://reviews.freebsd.org/D34914
2022-04-15 12:06:05 -03:00
Mitchell Horne
9c90bfcd31 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
2022-04-15 12:06:04 -03:00
Navdeep Parhar
db28d4a0cd cxgbe/t4_tom: Support for round-robin selection of offload queues.
A COP (Connection Offload Policy) rule can now specify that the tx
and/or rx queue for a new tid should be selected in a round-robin
manner. There is no change in default behavior.

Reviewed by:	jhb@
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34921
2022-04-14 15:49:58 -07:00
Navdeep Parhar
169e94c41e cxgbe(4): Add support for PPOD_EDRAM feature.
The driver queries the firmware to find out if it supports this feature
and enables it if it does. The firmware moves the iSCSI page pod region
to a lower address so that some of it is located in the faster on-chip
memory instead of external DDR.

Reviewed by:	jhb@
MFC after:	3 weeks
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34895
2022-04-14 15:43:32 -07:00
Navdeep Parhar
239170f292 cxgbe(4): Fix control flow issues reported by Coverity.
CID 1487932:  Control flow issues  (NESTING_INDENT_MISMATCH).
The macro on this line expands into multiple statements, only the first
of which is nested within the preceding parent while the rest are not.
9828                    ulp_region(RX_TLS_KEY);

Reported by:	Coverity (CID 1487932)
Fixes:	f88b31885c cxgbe(4): meminfo should get the TLS region's limits from the hardware.
MFC after:	3 days
Sponsored by:	Chelsio Communications
2022-04-14 00:17:36 -07:00
Gordon Bergling
7fa5cd3827 Revert "drm2: Fix a typo in a source code comment"
This reverts commit 5158cf0a38.
2022-04-14 09:01:29 +02:00
John Baldwin
dd636cb9d0 ad7417: Avoid an unused but set warning when compiled with NO_SYSCTL_DESCR.
Use a ternary operator for the description string passed to
SYSCTL_ADD_PROC instead of a helper variable.
2022-04-13 16:08:23 -07:00
John Baldwin
2257e87203 dpaa: Remove unused variables. 2022-04-13 16:08:23 -07:00
John Baldwin
695d3e52ea xdma: Inline variables with simple values used once in a KASSERT(). 2022-04-13 16:08:23 -07:00
John Baldwin
216536350a vnic: Use __diagused for variables only used in KASSERT(). 2022-04-13 16:08:23 -07:00
John Baldwin
718fe5ddfa ata-fsl: Remove unused variable. 2022-04-13 16:08:23 -07:00
John Baldwin
42278fc2e6 drm2: Remove unused variables. 2022-04-13 16:08:22 -07:00
John Baldwin
fcd0ea3a38 if_mvneta: Use __diagused for a variable only used in KASSERT(). 2022-04-13 16:08:22 -07:00
John Baldwin
e6fd5ca545 xdma pl330: Remove unused variables. 2022-04-13 16:08:22 -07:00
John Baldwin
0a4089c734 gpio tca6416: Remove unused variable. 2022-04-13 16:08:22 -07:00
John Baldwin
ead64e8454 flash: Remove unused variables. 2022-04-13 16:08:22 -07:00
John Baldwin
e19883539a hwpmc: Use __diagused for variables only used in KASSERT(). 2022-04-13 16:08:22 -07:00