Commit graph

42178 commits

Author SHA1 Message Date
Wei Hu
33cd621105 mana: Fix TX CQE error handling
For an unknown TX CQE error type (probably from a newer hardware),
still free the mbuf, update the queue tail, etc., otherwise the
accounting will be wrong.

Also, TX errors can be triggered by injecting corrupted packets, so
replace the mana_err to mana_dbg logging.

Reported by:	NetApp
MFC after:	1 week
Sponsored by:	Microsoft

(cherry picked from commit 516b5059705b6b8bbba28821dbe05964c128f9a9)
2024-01-24 12:36:13 +00:00
Gordon Bergling
ae09f54c06 ciss(4): Fix a typo in a source code comment
- s/strucutre/structure/

(cherry picked from commit ced92d000a9435745ca2891734e6e37ab1c5e873)
2024-01-23 07:42:18 +01:00
Gordon Bergling
4aed20f637 usb: Fix two typos in source code comments
- s/bascially/basically/
- s/assistence/assistance/

(cherry picked from commit f5e3329a5a480aa1b2904106b2fdfd999439455b)
2024-01-23 07:42:03 +01:00
Gordon Bergling
788c5cebec vmware: Fix a typo in a source code comment
- s/withing/within/

(cherry picked from commit 623848af604116aa33bc8a66d2ac45b4cbaccfd8)
2024-01-23 07:41:49 +01:00
Gordon Bergling
c065e2673c atse(4): Fix a typo in a source code comment
- s/addresss/address/

(cherry picked from commit 2b1e4e5be3047411df5e4d5442aa7de6489a0309)
2024-01-23 07:40:48 +01:00
Warner Losh
e2b71e1490 mpi3mr: Minor tweak to task queue pausing
Use a while loop with cancel / drain to make sure that all tasks have
completed before proceeding to reset.

Suggested by:		jhb
Sponsored by:		Netflix

(cherry picked from commit 272a406042608da9bc3e67e41c6b7fc31d4166b8)
2024-01-19 12:16:50 -05:00
Warner Losh
344cdef0cc mpi3mr: Assume dma_hiaddr is BUS_SPACE_MAXADDR
No sense having a variable for this. So use BUS_SPACE_MAXADDR and remove
dma_hiaddr from softc.

Suggested by:		jhb
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D42808

(cherry picked from commit 1ec7c672bc2854a1efb1d50f189d4881163c16c6)
2024-01-19 12:16:50 -05:00
Warner Losh
ac7d9eaf06 mpi3mr: Replace can't happen DataLength == 0 with an assert
Replace the test for DataLength == 0 with an assert. It can't happen,
but an assert doesn't hurt. Emacs removed some trailing white space too.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D42807

(cherry picked from commit 2361a0056fc16b5e11df2aa948aaa633ac01d685)
2024-01-19 12:16:50 -05:00
Alexander Motin
23a5782dc0 mpi3mr: Use template for main busdma tag.
Use the simpler template code for the parent busdma tag for all I/O to
this card.

Reviewed by:		mav, jhb, imp
Differential Revision:	https://reviews.freebsd.org/D42607

(cherry picked from commit 489eee0d41dce317678adb0dae8d509a5f1d6d93)
2024-01-19 12:16:50 -05:00
Alexander Motin
2d84c6e894 mpi3mr: Make these bus_dmamap_load calls synchronous
These calls "should" all be synchrounous. There's no bouncing that's
needed for them (at least in the typical case that we have a sane card
that has more bits of dma addresses decoded than we have memory), so
there's no errors possible. Ensure these calls are really synchronous
with BUS_DMA_NOWAIT flags (which should never fail now that the
bus_dmamem_alloc() has succeeded).

Reviewed by:		mav, jhb, imp
Differential Revision:	https://reviews.freebsd.org/D42606

(cherry picked from commit 39a3e6a812ad9c089bd2c4935193f1b3c4c5c35a)
2024-01-19 12:16:50 -05:00
Alexander Motin
c8afd30bdb mpi3mr: Fix MAXPHYS usage
This usage is obsolete. Replace with maximum bus space size. maxphys
will sort itself out at higher levels.

Reviewed by:		mav, jhb, imp
Differential Revision:	https://reviews.freebsd.org/D42605

(cherry picked from commit 4e6d128bd823e5b5d0b058f918c7036978a0e8bf)
2024-01-19 12:16:50 -05:00
Warner Losh
835db41823 mpi3mr: Add firmware version
Publish the firmware version on the card like we do for mps/mpr.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D42588

(cherry picked from commit 28a274342ea0b0666b56704477d2d1c17564942e)
2024-01-19 12:16:50 -05:00
Warner Losh
3b4d16889b mpi3mr: Trivial trailing white space reduction
Sponsored by:		Netflix

(cherry picked from commit ee7c431c4991febefcd15f16caa0e2b17c73b7b6)
2024-01-19 12:16:50 -05:00
Warner Losh
c3b67deaf5 mpi3mr: Honor the dma mask from IOCFacts
The number of signficant bits that are decoded are returned in the flags
field of the IOCFacts structure from the device.  Rather than assume the
worst with a pessimal 32-bit maximum, look at this value and pass it
along to all the dma map creation requests.

A lof of those creations are repetitive and could just inherit from the
base tag if we moved to the templated interface.  This is called out as
desireable future work not done at this time.

In addition, due to a chicken and an egg problem, we have to allocate
some of the maps with a 32-bit loaddr.  These are the ones we need to
read iocfacts.  And they are fine to be so restricted: they are little
used after startup, and when they are used, bouncing is fine.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D42559

(cherry picked from commit 91d961356d03465635c4784fab48acdd1304e1e0)
2024-01-19 12:16:50 -05:00
Warner Losh
fda7cc79aa mpi3mr: Fix EINPROGRESS errors hanging the card
Move enqueueing of commands to bus_dmamap_load_ccb callback

Fix fundamental difference between FreeBSD and Linux. On Linux, your dma
load callback always happends before it returns, so drivers are written
to load the map, then submit to hardware. On FreeBSD, the callback may
be deferred and return EINPROGRESS. This means the callback is
responsible for queueing the request to the hardware is done after the
SGL list is created. Make a number of interrelated cahnages:

At the end of mpi3mr_prepare_sgls, add a call to mpi3mr_enqueue_request.

Split the hardware submission out from the end of mpi3mr_action_scsiio
and move it into a new routine mpi3mr_enqueue_request.

Move all error completion from the end of mpi3mr_action_scsiio to where
the error is detected. We cannot pass errors back from the
mpi3mr_enqueue_request to do this on a 'failed' mpi3mr in a centralized
place (since it has to be fire and forget).

Add comments about zero length SGLs never making it into
mpi3mr_prepare_sgls. Keep the code there for the moment, but we only set
cm->data to non-NULL when scsiio_req->DataLength is not zero. So the
datalength can't be zero and we can't send the zero SGLs.

Add commentts about other "impossible" tests in mpi3mr_prepare_sgls that
really should be simple asserts of some flavor.

Eliminate cm->error_code, since we can't pass data back from the
mpi3mr_prepare_sgl callback anymore.

In mpi3mr_map_request, call mpi3mr_enqueue_request for the no data case.
This seems to work even though we've not done the special zero length
handling that was in mpi3mr_prepare_sgls, giving further evidence to it
not actually being needed. This is needed for SCSI CDBs that have no
data to pass to the drive like TEST UNIT READY.

With this change, and the prior ones, we're now able to run with mpi3mr
on 128GB systems and very heavy disk load (so many buffers land > 4GB:
the driver instructs busdma to never use memory abouve 4GB, which may be
too conservative, but an issue for another time).

Sponsored by:		Netflix
Reviewed by:		sumit.saxena_broadcom.com, mav, jhb
Differential Revision:	https://reviews.freebsd.org/D42543

(cherry picked from commit 3208a189c1e2c4ef35daa432fe45629a043d7047)
2024-01-19 12:16:50 -05:00
Warner Losh
ac4f33d2cd mpi3mr: Cleaup setting of status in processing scsiio requests
More uniformly use mpi3mr_set_ccbstatus in mpi3mr_action_scsiio.  The
routine mostly used it, but also has setting of status by hand. In those
cases where we want to error out the request, use this routine.

As part of this, move setting CAM_SIM_QUEUED later in the function to
when we're sure it's been queued. Remove the places we clear it before
this.

Sponsored by:		Netflix
Reviewed by:		mav, jhb
Differential Revision:	https://reviews.freebsd.org/D42542

(cherry picked from commit cf8c23230aabd30aa9251975dbe705da559a2d02)
2024-01-19 12:16:49 -05:00
Warner Losh
c351a6ec91 mpi3mr: Only set callout_owned when we create a timeout
Since we assume there's a timeout to cancel when this is true, only set
it true when we set the timeout. Otherwise we may try to cancel a timeout
when there's been an error in submission.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D42541

(cherry picked from commit 1cfd01111eb6a28ca5043e928aa8e9099064177a)
2024-01-19 12:16:49 -05:00
Warner Losh
3c12997a1c mpi3mr: Minor style fix
Fold two lines to make this more readable.

Sponsored by:		Netflix
Reviewed by:		mav, jhb
Differential Revision:	https://reviews.freebsd.org/D42540

(cherry picked from commit e2b27df9eb324fa6e72e29d3185dcd6b390efa9d)
2024-01-19 12:16:49 -05:00
Warner Losh
54fa0d10f6 mpi3mr: Reduce the scope of the reset_mutext
Reduce the scope of reset_mutext to protect the msleep in the watch dog
thread as well as the MPI3MR_FLAGS_SHUTDOWN bit. Use it to protect the
wakeup in mpi3mr_detach so this thread can exit sooner when we're trying
to do an orderly shutdown. Optimize the flow to check the sleep and
other conditions before going to sleep.

It's an open question if this should protect sc->unrecoverable, and if
we should wakeup the watchdog thread when we set it. We might also want
to move too booleans for the three flags that we have now in
mpi3mr_flags. There are a number of U8s that should really be bools and
we might want to also group them together to pack softc better.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D42539

(cherry picked from commit 7c4913093a759adf2e4c7d65535aee04aadee4df)
2024-01-19 12:16:49 -05:00
Warner Losh
e82c6e941e mpi3mr: Remove unused fields in struct mpi3mr_cmd
All of these fields are either unused, or just initialized. Remove
them. This saves about 1MB of memory for the cards that I have which can
do 8k transactions at once.

Sponsored by:		Netflix
Reviewed by:		mav, jhb
Differential Revision:	https://reviews.freebsd.org/D42538

(cherry picked from commit a2b046620c54db977196128b3c53da2704b9fd20)
2024-01-19 12:16:49 -05:00
Warner Losh
0d2cce768c mpi3mr: Don't hold fwevt_lock over call to taskqueue_drain
Holding fwevt_lock when we call taskqueue_drain can lead to deadlock
because it's draining a queue needs fwevt_lock to do work, so that other
thread will try to take out the lock and block, making the thread never
finish and taskqueue_drain never complete. There's a witness
warning/error for this which was exposed when the lock was converted to
a MTX_DEF lock from a MTX_SPIN prior to committing to the FreeBSD tree.

The lock appears to be to protect against additional items being added
to the event list while we're doing a reset. Since the taskqueue is
blocked, items can get added to the list, but won't be processed during
the reset, but there is still a (likely small) race between the
taskqueue_drain and the taskqueue_block calls where an interrupt could
fire on another CPU, resulting in a task being enqueued and started
before the block can take effect. The only way to fix that race is to
turn off interrupt processing during a reset. So we replace a deadlock
with a smaller race.

Sponsored by:		Netflix
Reviewed by:		sumit.saxena_broadcom.com, mav, jhb
Differential Revision:	https://reviews.freebsd.org/D42537

(cherry picked from commit b411372b7d17ae7e5d6c944732d41b979bde2ac4)
2024-01-19 12:16:49 -05:00
Joerg Pulz
4f30677080 ispfw(4): Update and add firmware
Update 25xx firmware: version 8.8.207
Add 26xx firmware: version 8.8.231
Add 27xx firmware: version 9.12.0
Add 28xx firmware: version 9.12.1

Remove BUGS section from manpage as we now have firmware for
all supported controllers.

PR:		273263
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/877
Sponsored by:	Technical University of Munich

(cherry picked from commit b0c6b06836351b3908ba5b2a847c89c42d1a46c3)
2024-01-19 11:56:17 -05:00
Mark Johnston
16f4d8fc14 isp: Fix endianness conversion in isp_read_flash_data()
Reported by:	Jenkins
Fixes:	10ed63fc06cb ("isp(4): Rework firmware handling/loading")

(cherry picked from commit 91d2a093dfaccdf288db663b6e9d47539ea1c1bf)
2024-01-19 11:47:35 -05:00
Joerg Pulz
d095e86f05 isp(4): Rework firmware handling/loading
Correctly identify the active firmware in flash on adapters with
primary and secondary firmware region in flash.
Correctly identify the active NVRAM on adapters with primary
and secondary NVRAM region in flash.

Loading ispfw(4) moved from isp_pci_attach() to isp_reset().
Drop the reference to ispfw(4) after using it so one can kldunload(8) it.
New isp_load_ram() function to load either ispfw(4) or flash firmware
into RISC's RAM.
New functions to read data from flash. The old ones will be removed later.
A bunch of new helper functions to identify and validate active flash
regions for firmware, auxiliary and NVRAM.
Overhaul ISP_FW_* macros and make use of it when comparing firmware
versions. We can handle firmware versions up to 255.255.255.

Firmware load priority slightly changed:
For 27xx and newer adapters:
- load ispfw(4) firmware
- request (active) flash firmware information
- compare version numbers of ispfw(4) and flash firmware
- load firmware with highest version into RISC's RAM
- if loading ispfw(4) is disabled or failed - load firmware from flash
- if everything else fails use MBOX_LOAD_FLASH_FIRMWARE as fallback

For 26xx and older adapters nothing changed:
- load ispfw(4) firmware and load it into RISC's RAM
- if loading ispfw(4) is disabled or failed use MBOX_EXEC_FIRMWARE
- for 26xx a preceding MBOX_LOAD_FLASH_FIRMWARE is used

New read only sysctl(8)'s:
 dev.isp.N.fw_version_run: the firmware version actually running
 dev.isp.N.fw_version_ispfw: the firmware version provided by ispfw(4)
 dev.isp.N.fw_version_flash: the (active) firmware version in flash

While here:
  - firmware attribute handling/parsing reworked
    + renamed defines from ISP2400_FW_ATTR_* to ISP_FW_ATTR_*
    + changed values to match new handling/parsing
    + added some more attributes
  - enable FLT support on 26xx based adapters
  - log level adjustments
  - new function return status codes (some for now, some for later use)
  - some minor style changes

Tested and approved to work on real hardware with:
  - Qlogic ISP 2532 (QLogic QLE2560 8Gb FC Adapter)
  - Qlogic ISP 2031 (QLogic QLE2662 16Gbit 2Port FC Adapter)
  - Qlogic ISP 2722 (QLogic QLE2690 16Gb FC Adapter)
  - Qlogic ISP 2812 (QLogic QLE2772 32Gbit 2Port FC Adapter)

PR:		273263
Reviewed by:	mav
Pull Request:	https://github.com/freebsd/freebsd-src/pull/877
MFC after:	1 month
Sponsored by:	Technical University of Munich

(cherry picked from commit 10ed63fc06cb9902cc783ce8d0086c9aa97ed1e1)
2024-01-19 11:47:35 -05:00
Alexander Motin
265a52fe6c acpi_lid: Remove duplicate events
Remove extra acpi_UserNotify() call per event.  Filter duplicate
notifications received from ACPI without actual status change.

Without this on my Dell XPS 13 9310 I saw 4 devd events for either
open or close, now only one.

MFC after:	1 month

(cherry picked from commit 1a3ee6002f3e008e0bc29d04c976285434503e19)
2024-01-19 11:39:28 -05:00
Alexander Motin
17a6b07e08 iichid(4): Switch taskqueue to "fast"
While "fast" taskqueue may be more expensive due to spinlock use,
when used mainly for timeout tasks it allows to avoid extra context
switches to and from callout thread, that is even more expensive.

MFC after:	1 month

(cherry picked from commit 358453ce9bdd99eb69641b02f2d7e29cedecbe27)
2024-01-19 11:34:58 -05:00
Alexander Motin
799f2c8cb0 iichid(4): Unify two taskqueue tasks
taskqueue_enqueue_timeout(0) is equivalent to taskqueue_enqueue(),
so no need to create a separate periodic_task and event_task to run
exactly the same handler.

MFC after:	1 month

(cherry picked from commit a8f80c0c16c7fb38c46ddccd7e1b06dc46c407b1)
2024-01-19 11:34:58 -05:00
Alexander Motin
41af0b19e9 iichid(4): Restore/increase sampling rate
My previous commit by reducing precision reduced the sampling rate
from 60Hz to 40Hz on idle system.  Return it back to 60-80Hz range,
that should be good for mouse smoothness on 60Hz displays.

MFC after:	1 months

(cherry picked from commit 68e457df0268113646264883515412af4c8808cb)
2024-01-19 11:34:58 -05:00
Alexander Motin
354ccf64bf iicbb: Fix pause_sbt() arguments order
It should make pause interval less strict.

While there, add cpu_spinwait() into a tight spin wait loop to burn
less power and let other SMT thread work more.

MFC after:	1 month

(cherry picked from commit a74df3f96e3ea4cc632088be870d9b0b0198859c)
2024-01-19 11:34:58 -05:00
Alexander Motin
7033c3ddd6 iichid(4): Improve idle sampling hysteresis
In sampling mode some devices return same data indefinitely even if
there is nothing to report.  Previous idle hysteresis implementation
activated only when device returned no data, so some devices ended up
polled at fast rate all the time.  This new implementation compares
each new report with the previous, and, if they are identical, after
reaching threshold also drop sampling rate to slow.

On my Dell XPS 13 9310 with iichid(4) touchscreen and touchpad this
reduces idle power consumption by ~0.5W by reducing number of context
switches in the driver from ~4000 to ~700 per second when not touched.

MFC after:	1 month

(cherry picked from commit 8c86b981240324c1daaa387d4d3f8e3e53db3d2e)
2024-01-19 11:34:57 -05:00
Alexander Motin
60452092db ig4: Actively use FIFO thresholds
Before every wait for FIFO interrupt set how much data/space do we
want to see there.  Previous code was not using it for receive, as
result aggregating interrupts only within processing latency.  The
new code needs only one interrupt per transfer per FIFO length.

On my Dell XPS 13 9310 with iichid(4) touchscreen and touchpad this
reduces the interrupt rate per device down to 2 per sample or 16-20
per second when idle and 120-160 per second when actively touched.

MFC after:	1 month

(cherry picked from commit 13037eaabede7fb7fbc25f4e84b549c73f9acb3c)
2024-01-19 11:33:10 -05:00
Alexander Motin
512235a1d3 ig4: Fix FIFO depths detection
At least on my Tiger Lake-LP queue depth detection failed before the
ig4iic_set_config() call, resulting in no FIFO use.  Moving it after
solves the problem, getting proper 64 bytes size.

On my Dell XPS 13 9310 with iichid(4) touchscreen and touchpad this
by few times reduces context switch rate in the driver, and probably
also improves the I2C bus utilization.

MFC after:	1 month

(cherry picked from commit 9c9d7fdd9f0041783955c5f540ac55a900877c0c)
2024-01-19 11:33:10 -05:00
Alexander Motin
4eec3ce0d3 acpi_cpu: Reduce BUS_MASTER_RLD manipulations
Instead of setting and clearing BUS_MASTER_RLD register on every C3
state enter/exit, set it only once if the system supports C3 state
and we are going to "disable" bus master arbitration while in it.

This is what Linux does for the past 14 years, and for even more time
this register is not implemented in a relevant hardware.  Same time
since this is only a single bit in a bigger register, ACPI has to
do take a global lock and do read-modify-write for it, that is too
expensive, saved only by C3 not entered frequently, but enough to be
seen in idle system CPU profiles.

MFC after:	1 month

(cherry picked from commit 5bc10feacc9d81e3bba9d28734a85e996682b408)
2024-01-19 11:29:21 -05:00
John Baldwin
4b5f644088 x86: Support multiple PCI MCFG regions
In particular, this enables support for PCI config access for domains
(segments) other than 0.

Reported by:	cperciva
Tested by:	cperciva (m7i.metal-48xl AWS instance)
Reviewed by:	imp
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D42828

(cherry picked from commit f54a3890b1f419d4a9edc99000efef52b9071b8f)
2024-01-18 15:23:44 -08:00
John Baldwin
98b822fccd pci_cfgreg: Add a PCI domain argument to the low-level register API
This commit changes the API of pci_cfgreg(read|write) to add a domain
argument (referred to as a segment in ACPI parlance) (note that this
is not the same as a NUMA domain, but something PCI-specific).  This
does not yet enable access to domains other than 0, but updates the
API to support domains.

Places that use hard-coded bus/slot/function addresses have been
updated to hardcode a domain of 0.  A few places that have the PCI
domain (segment) available such as the acpi_pcib_acpi.c Host-PCI
bridge driver pass the PCI domain.

The hpt27xx(4) and hptnr(4) drivers fail to attach to a device not on
domain 0 since they provide APIs to their binary blobs that only
permit bus/slot/function addressing.

The x86 non-ACPI PCI bus drivers all hardcode a domain of 0 as they do
not support multiple domains.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D42827

(cherry picked from commit 1587a9db92c03c738bb3f0fc5874b43c961e7c99)
2024-01-18 14:44:51 -08:00
John Baldwin
9c50c9b776 sys: Use mbufq_empty instead of comparing mbufq_len against 0
Reviewed by:	bz, emaste
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43338

(cherry picked from commit 8cb9b68f5821e45c63ee08d8ee3029ca523ac174)
2024-01-18 14:37:29 -08:00
John Baldwin
8ae27e114b acpi: Only reserve resources enumerated via _CRS
In particular, don't reserve resources added by drivers via other
means (e.g. acpi_bus_alloc_gas which calls bus_alloc_resource
right after adding the resource).

The intention of reserved resources is to ensure that a resource range
that a bus driver knows is assigned to a device is reserved by the
system even if no driver is attached to the device.  This prevents
other "wildcard" resource requests from conflicting with these
resources.  For ACPI, the only resources the bus driver knows about
for unattached devices are the resources returned from _CRS.  All of
these resources are already reserved now via acpi_reserve_resources
called from acpi_probe_children.

As such, remove the logic from acpi_set_resource to try to reserve
resources when they are set.  This permits RF_SHAREABLE to work with
acpi_bus_alloc_gas without requiring hacks like the current one for
CPU device resources in acpi_set_resource.

Reported by:	gallatin (RF_SHAREABLE not working)
Diagnosed by:	jrtc27

(cherry picked from commit c6a488511ab1fbae8d16264b9e83c85024c9e1ce)
2024-01-18 14:33:09 -08:00
Marius Strobl
8595e76a9f uart(4): Honor hardware state of NS8250-class for tsw_busy
In 9750d9e5, I brought the equivalent of the TS_BUSY flag back in a
mostly hardware-agnostic way in order to fix tty_drain() and, thus,
TIOCDRAIN for UARTs with TX FIFOs. This proved to be sufficient for
fixing the regression reported. So in light of the release cycle of
FreeBSD 10.3, I decided that this change was be good enough for the
time being and opted to go with the smallest possible yet generic
(for all UARTs driven by uart(4)) solution addressing the problem at
hand.

However, at least for the NS8250-class the above isn't a complete
fix as these UARTs only trigger an interrupt when the TX FIFO became
empty. At this point, there still can be an outstanding character
left in the transmit shift register as indicated via the LSR. Thus,
this change adds the 3rd (besides the tty(4) and generic uart(4) bits)
part I had in my tree ever since, adding a uart_txbusy method to be
queried in addition for tsw_busy and hooking it up as appropriate
for the NS8250-class.

As it turns out, the exact equivalent of this 3rd part later on was
implemented for uftdi(4) in 9ad221a5.

While at it, explain the rational behind the deliberately missing
locking in uart_tty_busy() (also applying to the generic sc_txbusy
testing already present).

(cherry picked from commit 353e4c5a068d06b0d6dcfa9eb736ecb16e9eae45)
2024-01-18 21:14:46 +01:00
Marius Strobl
6d150c4c3f igb(4): Remove disconnected SYSCTL
The global hw.igb.rx_process_limit knob never was adhered to by the
in-tree version of this driver but similar functionality is available
via the device-specific dev.igb.N.iflib.rx_budget.

While at it, remove the - besides initialization of tx_process_limit -
unused {r,t}x_process_limit members.

(cherry picked from commit f221d35be7a5749e2a1246c81adc9c03c1dc545c)
2024-01-18 21:14:46 +01:00
Marius Strobl
c4e6ee658b e1000(4): Remove disconnected SYSCTL
The global hw.em.rx_process_limit knob has been replaced by the device-
specific dev.IF.N.iflib.rx_budget along with the conversion to iflib(4).

While at it, remove the - besides initialization of tx_process_limit -
unused {r,t}x_process_limit members.

(cherry picked from commit 0d6d28ce5650d1cd23dbe4bbac87fb103b3e2d3d)
2024-01-18 21:14:46 +01:00
Mark Johnston
b3ed2b8086 bnxt: Handle errors from copyout() in ioctl handlers
This is in preparation for annotating copyin() and related functions
with __result_use_check.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D43178

(cherry picked from commit 243e3ab3d34ada9da4f202f8cab90da2d6c49e5e)
2024-01-18 10:53:37 -05:00
Jiahao LI
fbc5e31c4f mii: Fix memory leak in micphy.
PR:		270040
MFC after:	1 week

(cherry picked from commit 9a622787244c4cda76d1509b0eae168bf4fd1952)
2024-01-15 19:26:02 +09:00
Teerayut Hiruntaraporn
4776a7f06e puc: Add support for Exar XR17V354 Quad PCI Express UART.
PR:		257207
MFC after:	1 week

(cherry picked from commit 5704277ae58b3498fbee2d041cd18d2444f5cf98)
2024-01-15 19:22:48 +09:00
Osama Abboud
9015208bff ena: Update driver version to v2.7.0
Features:
* Introduce customer and SRD metrics through sysctl
* Introduce spreading IRQs to CPUs capability using sysctl
* Upgrade ena-com to v2.7.0

Bug Fixes:
* Remove outdated APIs

Minor Changes:
* Introduce a shared stats sample interval for all stats

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 4e2688cc762d94b190029f0c5efab9c4bb5521be)
2024-01-14 21:18:11 +00:00
Osama Abboud
eb29118a2f ena: Update the license dating to 2023
Some of the files are using outdated linceses.
Update the license to be 2023.

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 246aa273244e91a30d70997a3be790a29f9eb29c)
2024-01-14 21:18:11 +00:00
Osama Abboud
9757b07f18 ena: Support srd metrics with sysctl
This commit introduces SRD metrics through sysctl.
The metrics can be queried using the following sysctl node:
sysctl dev.ena.<device index>.ena_srd_info

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 36d42c862f4a5643f6e2395e8d7b7e5c4580499a)
2024-01-14 21:18:11 +00:00
Osama Abboud
538f9ea8fa ena: Support customer metric with sysctl
This commit adds sysctl support for customer metrics.
Different customer metrics can be found in the following sysctl node:
sysctl dev.ena.<device index>.customer_metrics

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit f97993ad7b9c9e4787bd198d11f348c271af513e)
2024-01-14 21:18:11 +00:00
Osama Abboud
79c446badb ena: Introduce shared sample interval for all stats
Rename sample_interval node to stats_sample_interval and move
it up in the sysctl tree to make it clear that it's relevant for
all the stats and not only ENI metrics (Currently, sample interval node
is found under eni_metrics node).

Path to node:
dev.ena.<device_index>.stats_sample_interval

Once this parameter is set it will set the sample interval for all the
stats node including SRD/customer metrics.

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 5b925280d9a54eaefd85827bf6e84049aea8fa98)
2024-01-14 21:18:11 +00:00
Osama Abboud
9d773b0d5f ena: Remove CQ tail pointer update API
This commit removes the usage of this API from the freebsd driver since
the relevant functionality is not supported by the device.

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 2835752e075f2fa3edcb596df8306c570ec4cae6)
2024-01-14 21:18:10 +00:00
Osama Abboud
00916b6d29 ena: Update ena_com_update_intr_reg API usage
This commit fixes the usage of this function to be compatible with the
new API introduced by ena-com update to v2.7.0

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 72e34ebdd08854dc896f267b0461e241c4040241)
2024-01-14 21:18:10 +00:00