Commit Graph

38402 Commits

Author SHA1 Message Date
Alexander Motin
a6222dd789 Remove more legacy of parallel SCSI. 2020-11-24 22:43:27 +00:00
Jung-uk Kim
926ce35a7e Port rtsx(4) driver for Realtek SD card reader from OpenBSD.
This driver provides support for Realtek PCI SD card readers.  It attaches
mmc(4) bus on card insertion and detaches it on card removal.  It has been
tested with RTS5209, RTS5227, RTS5229, RTS522A, RTS525A and RTL8411B.  It
should also work with RTS5249, RTL8402 and RTL8411.

PR:			204521
Submitted by:		Henri Hennebert (hlh at restart dot be)
Reviewed by:		imp, jkim
Differential Revision:	https://reviews.freebsd.org/D26435
2020-11-24 21:28:44 +00:00
Alexander Motin
5bcbd98c8b Update RQSFLAG_* definitions. 2020-11-24 17:37:12 +00:00
Mark Johnston
938a9d7c4f ata(4): Release the ioport resource if device initialization fails
PR:		251346
Submitted by:	janm@transactionware.com
MFC after:	1 week
2020-11-24 17:13:08 +00:00
Alexander Motin
384d27e04d Remove concept of mbox_sleep_ok.
It was broken by design and unused for years due to conflicts between
different threads, fighting for the same set of mailbox registers, not
designed for multiple requests at a time.  So either request has to be
synchronous and spin under the lock, or it should be sent asynchronously
through the queues as Mailbox Command IOCB or some other way.

This removes any OS specifics from the wait code, so it can be inlined.
2020-11-24 15:32:25 +00:00
Alexander Motin
1553bf11b9 Remove unneeded locking around xpt_bus_[de]register().
MFC after:	2 weeks
2020-11-24 14:05:52 +00:00
Hans Petter Selasky
caf4397197 Remove erradic assert after SVN r367149 in mlx5en(4).
The ratelimit tags may be shared, especially for unlimited TLS
traffic, and then the refcount is allowed to be greater than one
when freeing the send tag.

MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-11-24 13:07:59 +00:00
Alexander Motin
0f99cb55ff Implement request queue overflow protection.
Before this change in case of request queue overflow driver just froze the
device queue for 100ms to retry after.  It was pretty bad for performance.
This change introduces SIM queue freezing when free space on the request
queue drops below 255 entries (worst case of maximum I/O size S/G list),
checking for a chance to release it on I/O completion.  If the queue still
get overflowed somehow, the old mechanism is still in place, just with
delay reduced to 10ms.

With the earlier queue length increase overflows should not happen often,
but it is still easily reachable on synthetic tests.
2020-11-24 04:16:49 +00:00
Michal Meloun
9138770728 Ensure that the buffer is in nvme_single_map() mapped to single segment.
Not a functional change.

MFC after:	1 week
2020-11-23 14:30:22 +00:00
Edward Tomasz Napierala
6f45fadf5a Make sbp(4) use xpt_alloc_ccb/xpt_free_ccb instead of malloc/free.
Reviewed by:	imp, mav
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26843
2020-11-23 13:05:11 +00:00
Edward Tomasz Napierala
cca5be248f Make tws(4) use xpt_alloc_ccb()/xpt_free_ccb() instead of malloc/free.
Reviewed by:	imp
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26841
2020-11-23 13:02:23 +00:00
Edward Tomasz Napierala
3bd46ad76d Don't check return from xpt_alloc_ccb() for being NULL; since it's not
the _nowait wariant, it cannot fail.

Suggested by:	mav
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
2020-11-23 12:59:56 +00:00
Edward Tomasz Napierala
2ef735f477 Make hptmv(4) use xpt_alloc_ccb/xpt_free_ccb instead of malloc/free.
Reviewed by:	imp, mav
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26842
2020-11-23 12:57:24 +00:00
Edward Tomasz Napierala
3df3c40de4 smartpqi: don't bzero the new ccb; xpt_alloc_ccb_nowait() already does that.
Reviewed by:	imp
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26838
2020-11-23 12:54:19 +00:00
Edward Tomasz Napierala
6feb84e8e7 arcmsr(4): don't bzero newly allocated ccb; xpt_alloc_ccb() already does that.
Reviewed by:	delphij, imp, ching2048@areca.com.tw
Tested by:	ching2048@areca.com.tw
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26840
2020-11-23 12:50:38 +00:00
Emmanuel Vadot
5e38d9e483 if_dwc: Correctly configure the DMA engine based on the fdt properties
Do not hardcode what we setup for the DMA engine configuration but
lookup the fdt properties and configuring accordingly.
Use a default value of 8 for the burst dma length for both TX and
RX, this is what we used for TX before.
2020-11-22 20:16:46 +00:00
Alexander Motin
3037002e33 Fix debug build after 367926. 2020-11-22 16:13:09 +00:00
Alexander Motin
cbf33b3654 Fix build after 367926.
Option ISP_TARGET_MODE is evil.
2020-11-22 05:42:52 +00:00
Alexander Motin
0b19f90a43 Make handlers and atpds overflows unlikely.
- Allocate 256 handlers more than payload commands for management purposes.
 - Increase maximum number of handlers from 8K to 16K by tuning the format.
 - Just to be safe limit the number of payload commands to 16K - 256.
 - Limit number of target exchanges in mixed mode to the number of atpds.
 - If we still somehow get out of atpds -- return BUSY, since we really are.
2020-11-22 04:29:55 +00:00
Alexander Motin
254c652b6d Do not parent all busdma tags to the payload tag.
There is not much to inherit any more, may create more problems than solve.
Instead parent them all directly to upstream.

While there, add missed payload tag and tune scratch tag destructions.
2020-11-22 04:10:13 +00:00
Alexander Motin
c515717a02 Remove remnants of execthrottle and maxalloc parameters.
The first was obsolete since 26xx, not used on 25xx and not needed on 24xx.
The second seems never worked on 24xx and up.
2020-11-22 02:51:30 +00:00
Navdeep Parhar
b3718e2d7e cxgbe(4): Catch up with in-flight netmap rx before destroying queues.
The netmap application using the driver is responsible for replenishing
the receive freelists and they may be totally depleted when the
application exits.  Packets in flight, if any, might block the pipeline
in case there aren't enough buffers left in the freelist.  Avoid this by
filling up the freelists with a driver allocated buffer.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-11-21 03:27:32 +00:00
Alexander Motin
9a201fad1d Unlucky change...
MFC after:	3 days
2020-11-21 00:53:31 +00:00
Alexander Motin
69df0af073 Fix stupid math mistake in r366922.
MFC after:	3 days
2020-11-21 00:51:39 +00:00
Alexander Motin
b8e2395ec5 Increase queue depths from 1024/256 to 8192/1024 IOCBs.
Qlogic chips store S/G lists in the same queue as requests themselves.  In
the worst case 1MB I/O may require up to 52 IOCBs, that means queue of 1024
IOCBs can store only 19 of such requests.  The increase reduces chances of
overflow, while we should be able to afford additional 512KB of RAM per HBA.
The Linux driver uses comparable numbers.

While there, decouple ATIO queue size from response queue size.  There is
no reason for them to be equal.
2020-11-20 19:36:34 +00:00
Alexander Motin
f6854a0cd5 Cleanup DMA handling.
- Make isp_start() to set all the IOCB fields aside of S/G list, removing
extra information from isp_send_cmd(), now only doing S/G lists and sending.
 - Turn DMA setup/free from being card and PCI-specific into OS-specific,
instead add new card-specific method for isp_send_cmd().  Previously this
function was a monster handling all the cards.
 - Remove double error code translation.
2020-11-20 18:02:04 +00:00
Konstantin Belousov
77602e977e Unlock channels when any of them are locked, when returning for non-busy state.
Reported and tested by:	"Wall, Stephen" <stephen.wall@redcom.com>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2020-11-20 14:02:43 +00:00
Emmanuel Vadot
98ea5a7b9a if_dwc: Add checksum offloading support 2020-11-20 11:31:25 +00:00
Emmanuel Vadot
2b4a66ed17 if_dwc: Add flow control support 2020-11-20 11:31:04 +00:00
Emmanuel Vadot
3bbd11ee51 if_dwc: Use if_ function where appropriate
No functional changes intended
2020-11-20 11:30:23 +00:00
Emmanuel Vadot
2a35d39179 if_dwc: Reorder functions and sort them by usage
No functional changes intended
2020-11-20 11:30:01 +00:00
Emmanuel Vadot
f88e0af64a if_dwc: dwc_get_hwaddr cannot fail, change return to void
No functional changes intended
2020-11-20 11:29:20 +00:00
Emmanuel Vadot
afd0c3c268 if_dwc: Add dwc_stop_dma and use it in dwc_stop_locked
No functional changes intended
2020-11-20 11:29:00 +00:00
Emmanuel Vadot
86c7bc68ed if_dwc: Use dwc_enable_mac in dwc_stop_locked
No functional changes intended
2020-11-20 11:28:06 +00:00
Emmanuel Vadot
f368f4b109 if_dwc: Add a function to enable/disable the mac tx/rx
No functional changes intended
2020-11-20 11:27:43 +00:00
Emmanuel Vadot
b0cc649b95 if_dwc: Use if_setdrvflagbits to notify that we are running
No functional changes intended
2020-11-20 11:27:08 +00:00
Emmanuel Vadot
158ce7ba0e if_dwc: Split init code into sub function
Be clear of what we enable or init.

No functional changes intended
2020-11-20 11:26:46 +00:00
Alexander Motin
dae0ba753c Fix r367857 build without ISP_TARGET_MODE. 2020-11-20 02:03:58 +00:00
Alexander Motin
1b760be482 Remove parallel SCSI and 1/2Gb FC support from isp(4).
This removes 288KB (36%) of the driver code and zillions of hacks and
workarounds, making single driver uniformly support several different
generations of hardware interfaces, not counting minor card variations.
After years of the hopeless fight, I don't think it worth to continue
support for hardware obsolete for 15-20 years.  Instead much cleaner
now code should allow to move forward toward better locking, multiple
queues and other cool features.

All the remaining Qlogic cards starting from 4Gb 24xx to 32Gb 27xx use
the same hardware/firmware interface with minor incremental improvements,
so it seems to be a good new starting point.  Except one PCI-X model all
all of them are PCIe and so still usable in modern systems.

Discussed with:	ken, scottl, jpaetzel, imp
Relnotes:	yes
2020-11-20 01:15:48 +00:00
Vladimir Kondratyev
b33ba83470 psm(4): Disable AUX multiplexer probing on all Lenovo laptops.
Rudimentary AUX multiplexing support was added to kernel to make possible
touchpad initialization on some HP EliteBook laptops with trackpoint.

Disable multiplexer probing on all Lenovo laptops now as they use touchpad
pass-through port rather than AUX multiplexer to connect trackpoint and
at least two model (X120e and X121e) is known for getting PS/2 AUX port
dysfunctional after switching back to hidden multiplexing mode.

AUX MUX probing can be reenabled with setting of hw.psm.mux_disabled loader
tunable to 0.

PR:		249987
Reported by:	jwb
MFC after:	2 weeks
2020-11-20 00:13:30 +00:00
Mark Johnston
431fb8abd7 vm_phys: Try to clean up NUMA KPIs
It can useful for code outside the VM system to look up the NUMA domain
of a page backing a virtual or physical address, specifically when
creating NUMA-aware data structures.  We have _vm_phys_domain() for
this, but the leading underscore implies that it's an internal function,
and vm_phys.h has dependencies on a number of other headers.

Rename vm_phys_domain() to vm_page_domain(), and _vm_phys_domain() to
vm_phys_domain().  Make the latter an inline function.

Add _vm_phys.h and define struct vm_phys_seg there so that it's easier
to use in other headers.  Include it from vm_page.h so that
vm_page_domain() can be defined there.

Include machine/vmparam.h from _vm_phys.h since it depends directly on
some constants defined there.

Reviewed by:	alc
Reviewed by:	dougm, kib (earlier versions)
Differential Revision:	https://reviews.freebsd.org/D27207
2020-11-19 03:59:21 +00:00
Li-Wen Hsu
ed0d16b017 ipheth(4): Fix for iOS 14
Fix USB tethering for iOS 14.

Inspired by:	https://github.com/libimobiledevice/libimobiledevice/issues/1038

PR:		249979
Reviewed by:	hselasky
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D27250
2020-11-18 19:35:30 +00:00
Marcin Wojtas
7dee315ed7 Update ENA driver version to v2.3.0
The v2.3.0 introduces new ena_com layer, ENI metrics updates and SPDX
license tags.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D27120
2020-11-18 15:25:38 +00:00
Marcin Wojtas
7d2e6f207e Rename descriptions of the supported ENA devices
Some of the PCI ID were described as ENA with LLQ support - it's not
fully accurate and because of that, their names were changed.

Instead of LLQ, use RSERV0 for the description of those devices.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D27119
2020-11-18 15:20:01 +00:00
Marcin Wojtas
f180142c76 Add ENI metrics for the ENA driver
The new HAL allows the driver to read extra ENI stats. Exact meaning of
each of them can be found in base/ena_defs/ena_admin_defs.h file and
structure ena_admin_eni_stats.

Those stats are being updated inside of the timer service, which is
executed every second.
ENI metrics are turned off by default. They can be enabled, using the
sysctl node: dev.ena.X.eni_metrics.update_delay
0 value in this node means that the update is turned off. Other values
determine how many seconds must pass, before ENI metrics will be
updated.

They can be acquired, using sysctl:

sysctl dev.ena.X.eni_metrics

Where X stands for the interface number.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision: https://reviews.freebsd.org/D27118
2020-11-18 15:17:55 +00:00
Marcin Wojtas
0835cc783b Add SPDX license tag to the ENA driver files
Refering to guide: https://wiki.freebsd.org/SPDX the SPDX tag should not
replace the standard license text, however it should be added over the
standard license text to make the automation easier.

Because of that, the old license was kept, but the SPDX tag was added
on top of every ENA driver file.

Submited by:    Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D27117
2020-11-18 15:07:34 +00:00
Marcin Wojtas
c74443892c Add Rx offsets support for the ENA driver
For the first descriptor in a chain the data may start at an offset.
It is optional feature of some devices, so the driver must ack that
it supports it.

The data pointer of the mbuf is simply shifted by the given value.

Submitted by:   Maciej Bielski <mba@semihalf.com>
Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D27116
2020-11-18 15:02:12 +00:00
Marcin Wojtas
9eb1615f33 Adjust ENA driver files to latest ena-com changes
* Use the new API of ena_trace_*
* Fix typo syndrom --> syndrome
* Remove validation of the Rx req ID (already performed in the ena-com)
* Remove usage of deprecated ENA_ASSERT macro

Submitted by:   Ido Segev <idose@amazon.com>
Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D27115
2020-11-18 14:59:22 +00:00
Marcin Wojtas
4f8f476e73 Fix completion descriptors alignment for the ENA
The latest generation hardware requires IO CQ (completion queue)
descriptors memory to be aligned to a 4K. It needs that feature for
the best performance.

Allocating unaligned descriptors will have a big performance impact as
the packet processing in a HW won't be optimized properly. For that
purpose adjust ena_dma_alloc() to support it.

It's a critical fix, especially for the arm64 EC2 instances.

Submitted by: Ido Segev <idose@amazon.com>
Obtained from: Amazon, Inc
MFC after: 1 week
Differential revision:  https://reviews.freebsd.org/D27114
2020-11-18 14:50:12 +00:00
Hans Petter Selasky
a2dd1caade Fix build of USB bootloader code by adding checks for _STANDALONE being defined.
Currently the USB bootloader code is not part of buildworld.

MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-11-18 13:22:22 +00:00