aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
...
* e1000: use newly exposed RSS hash key API rather than ad-hoc hashingAndrew Gallatin2025-11-224-10/+0
| | | | | | Differential Revision: https://reviews.freebsd.org/D53097 Reviewed by: kbowling Sponsored by: Netflix
* ice: use newly exposed RSS hash key API rather than ad-hoc hashingAndrew Gallatin2025-11-221-24/+4
| | | | | Differential Revision: https://reviews.freebsd.org/D53096 Sponsored by: Netflix
* iavf: use newly exposed RSS hash key API rather than ad-hoc hashingAndrew Gallatin2025-11-222-12/+0
| | | | | Differential Revision: https://reviews.freebsd.org/D53095 Sponsored by: Netflix
* ixl: use newly exposed RSS hash key API rather than ad-hoc hashingAndrew Gallatin2025-11-222-15/+2
| | | | | Differential Revision: https://reviews.freebsd.org/D53094 Sponsored by: Netflix
* ixgbe: Use newly exposed RSS hash API rather than ad-hoc hashingAndrew Gallatin2025-11-221-17/+3
| | | | | | Differential Revision: https://reviews.freebsd.org/D53093 Reviewed by: kbowling Sponsored by: Netflix
* cxgbe: use newly exposed RSS hash key API rather than ad-hoc hashingAndrew Gallatin2025-11-221-13/+2
| | | | | | Differential Revision: https://reviews.freebsd.org/D53092 Reviewed by: np (outside of differential) Sponsored by: Netflix
* sound: Retire snd_mtx* wrappersChristos Margiolis2025-11-2134-556/+512
| | | | | | | | | | | | Do not create mutexes with snd_mtxcreate(). It doesn't provide any value, plus it first allocates the mutex with malloc(9). Allocate mutexes in the stack and use mtx_* functions directly instead of the snd_mtx* wrappers. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D53855
* sound: Merge chn_intr() with chn_intr_locked()Christos Margiolis2025-11-212-19/+2
| | | | | | | | | | | | There is no scenario where chn_intr() is called with the channel lock already held. No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D53854
* sound: Merge PCM_ALIVE() with PCM_REGISTERED()Christos Margiolis2025-11-212-3/+3
| | | | | | | | | PCM_ALIVE() is used only in pcm_unregister(), but it does not hurt to use PCM_REGISTERED(), which uses PCM_ALIVE() internally. In fact, it's more robust this way. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Clean up midi/ includesChristos Margiolis2025-11-212-23/+11
| | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53841
* sound: Simplify logic in dsp_io_ops()Christos Margiolis2025-11-211-22/+10
| | | | | | | | | | | | | | | | | | | | | | Use CHN_LOCK()/CHN_UNLOCK() directly, instead of dsp_lock_chans()/dsp_unlock_chans(). These functions are useful when we want to potentially lock both channels. Here we know which channel we are locking, so we can just lock it directly. This way we get rid of the prio variable as well. Related to runpid again, there is no reason to assign it when CHN_F_RUNNING is not set. channel->pid (as well as channel->comm) is always assigned in dsp_chn_alloc(). Get rid of runpid. I do not see how we can end up with channel->pid (td->td_proc->p_pid) not matching buf->uio_td->td_proc->p_pid. Also improve errno values. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D53736
* iwx: tag RX frames as A_MPDU RX; tag A-MSDU frames appropriatelyAdrian Chadd2025-11-211-30/+32
| | | | | | | | | | | | | | | | | | | | | | | * tag packets for 11n/11ac associated nodes with A_MPDU so they get passed into the reordering logic * tag A-MSDU frames with AMSDU and AMSDU_MORE so they don't get dropped due to duplicate sequence numbers. Note: I haven't yet elicited A-MSDU in A-MPDU to fully test this, but I do see the net80211 reordering logic kick in (which you can see via wlanstats -i wlan0 -o ampdu 1). I've checked with Johannes Berg at Intel (who maintains the linux iwlwifi stuff); he replied saying none of the firmware versions are doing AMPDU reorder offloading. Differential Revision: https://reviews.freebsd.org/D53781 Locally tested: * AX210, STA mode, > 200mbit bidirectional traffic testing on 5GHz VHT/40.
* e1000: Don't enable ASPM L1 without L0sKevin Bowling2025-11-211-1/+2
| | | | | | | | | | | Reporter noted packet loss with 82583. NVM is down level. The errata docs mention disabling this, which should be the firmware default, so I am not sure why we were enabling this bit. Linux and OpenBSD have the same issue, while NetBSD got it right. Reported by: Codin <codin@nagi.ftp.sh> Tested by: Codin <codin@nagi.ftp.sh> MFC after: 2 weeks
* e1000: Bump 82574/82583 PBA to 32KKevin Bowling2025-11-211-1/+5
| | | | | | | | | | | | | | | | | The reporter contacted me with packet loss and throughput fluctuations on a low power machine (Intel J1900) that got worse with the recent AIM algorithm in FreeBSD 14.2+. 32K RX PBA matches Linux default. Add a conditional path since we don't otherwise do a fixup for jumbo frames to retain space for two frames in Tx. With this change and an additional errata change, the throughput meets line rate for the reporter. Reported by: Codin <codin@nagi.ftp.sh> Tested by: Codin <codin@nagi.ftp.sh> MFC after: 2 weeks
* sound: Remove vchan_passthrough() and hw.snd.passthrough_verboseChristos Margiolis2025-11-202-23/+0
| | | | | | | Unused and confusing. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Fix KASSERT panics in chn_read() and chn_write()Christos Margiolis2025-11-201-48/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INVARIANTS kernels may trigger a KASSERT panic from sndbuf_acquire(), when fuzzing write(2) using stress2, because of a race in chn_write(). In the case of chn_write(), what sndbuf_acquire() does is extend the ready-to-read area of the buffer by a specified amount of bytes. The KASSERT in question makes sure the number of bytes we want to extend the ready area by, is less than or equal to the number of free bytes in the buffer. This makes sense, because we cannot extend the ready area to something larger than what is available (i.e., free) in the first place. What chn_write() currently does for every write is; calculate the appropriate write size, let's say X, unlock the channel, uiomove() X bytes to the channel's buffer, lock the channel, and call sndbuf_acquire() to extend the ready area by X bytes. The problem with this approach, however, is the following. Suppose an empty channel buffer with a length of 1024 bytes, and 2 threads, (A) and (B), where (B) is a higher-priority one. Suppose thread (A) wants to write 1024 bytes. It unlocks the channel and uiomove()s 1024 bytes to the channel buffer. At the same time, thread (B) picks up the lock, and because it is higher priority, it keeps dominating the lock for a few iterations. By the time thread (A) picks up the lock again, it tries to call sndbuf_acquire() with a size of 1024 bytes, which was calculated before it performed the uiomove(). In this case, there is a very high chance that the buffer will not be empty, that is, have a free area of 1024 bytes, as was the case when thread (A) started executing, and so the KASSERT will trigger a panic because the condition (bytes <= free) is not met. Another scenario that can trigger a panic is the following: suppose a buffer with a size of 4 bytes, and two threads: (A) and (B). In the first iteration, thread (A) wants to write 2 bytes, while the buffer is empty, BUT the pointer (sndbuf_getfreeptr()) is at the end (i.e., buf[3]). In the first iteration of the loop, because of the way we calculate t, we'll end up writing only 1 byte, so after sz -= t, sz will be 1, and so we'll need one more iteration in the inner loop, to write the remaining 1 byte. Now we're at the end of the first loop, thread (A) unlocks the channel, it has written 1 byte, it needs to write 1 more, and the buffer is left with 3 empty slots. Now thread (B) picks up the lock, and it wants to write 3 (or more) bytes. Eventually it writes the 3 bytes, and it leaves the buffer with 0 free slots. By the time thread (A) picks up the lock again, and continues with the second iteration of the inner loop, it will try to write the last byte, but sndbuf_acquire() will panic because there is no free space anymore. To fix this, get rid of the inner loop and calculate the write size on each iteration. Also, call sndbuf_acquire() before unlocking the channel. In the scenarios explained above, we'll end up entering the chn_sleep() case. Modify it as well, so that we do not kill the channel if we need to sleep more. Do the same for chn_read() to avoid possible similar panics from sndbuf_dispose(). Reported by: pho Tested by: christos, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: pho, kib Differential Revision: https://reviews.freebsd.org/D53666
* nvme: Include <sys/systm.h> explicitly for memmoveJohn Baldwin2025-11-201-0/+1
| | | | | | Reported by: andrew, rpokala Fixes: 8d2a50bb3805 ("nvme: Abstract out function to obtain a disk ident string from cdata") Sponsored by: Chelsio Communications
* dpaa2: Setup interface caps on attachDmitry Salychev2025-11-191-7/+45
| | | | | | | | | | | | | | | 39d4094173f9 ("epair: add support for checksum offloading") revealed that HW checksum offloading is not enabled when the dpaa2_ni driver is attached despite being declared and enabled on the dpni interface. I modified dpaa2_ni_setup_if_caps to take into account both IPv4 and IPv6 checksum offloading capabilities and added a call to re-configure interface capabilities on attach to fix it. Reviewed by: bz Fixes: 39d4094173f9 ("epair: add support for checksum offloading") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53436
* nvme_sim: signal namespace depatureWanpeng Qian2025-11-181-9/+19
| | | | | | | | Signal when the namespace is gone so we can tear down the disk when a nvme drive is removed. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D33032
* nvd: handle namespace changesWanpeng Qian2025-11-181-1/+44
| | | | | | | Signal the new media size when the namespace changes size. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D33032
* nvme: Notify namespace changes betterWanpeng Qian2025-11-183-6/+22
| | | | | | | | | | | | | When we get a namespace notification, we have to reconstrut the namespace to get the new identification data from the namespace. For each namespace in the AEN, we will reconstrict it before we call the notification. We also flag it as changed for the duration of the change callback (prior versions of the patch needed to keep track, but we no longer do, so this bit may be removed). Note when we've seen the namespace so we can notify when it goes away. Co-authored-by: imp Differential Revision: https://reviews.freebsd.org/D33032
* nvme: Fix backwards sense of error conditionWarner Losh2025-11-181-1/+1
| | | | | | | | | | b21e67875bf0c tested for the good condition, not the error condition, so we'd never do anything else in this function. This was causing certain logging not to happen, and also prevented forthcoming namespace size change code from working as well. Fixes: b21e67875bf0c Sponsored by: Netflix
* iichid: The IICHID spec defines the response to the RESET command as two ↵Poul-Henning Kamp2025-11-181-1/+6
| | | | | | | | | | | | | | bytes of zeros. Our recent changes to iichid.c has caused us to attempt to read a full REPORT instead, and at least one keyboard hangs solid when we do that. This patch changes us to be spec-compliant. Differential Revision: https://reviews.freebsd.org/D53803 MFC after: 1 day Approved by: re(ccperciva)
* dev/fdt: Add support for non-PCI MSI interruptsAndrew Turner2025-11-181-0/+134
| | | | | | | | | | | | Some non-PCI devices can send interrupts, e.g. the Arm SMMU or GICv5 Interrupt Wire Bridge. Add support for these by implementing pci_get_id and pci_alloc_msi and the MSI/MSI-X parts of the PCIB interface. Only the MSI parts of the PCI interface are added as that is all I am able to test. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D53330
* dev/ofw: Teach ofw_cpu to find the pcpu on arm64Andrew Turner2025-11-181-2/+26
| | | | | | | Use the midr value to ensure we find the correct PCPU pointer on arm64. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D53327
* nvmf: Add support for DIOCGIDENTJohn Baldwin2025-11-172-0/+6
| | | | | | | | This mirrors commit 6d0001d44490becdd20d627ce663c72a30b9aac3 but for nvmf(4). Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D53339
* nvme: Abstract out function to obtain a disk ident string from cdataJohn Baldwin2025-11-174-22/+21
| | | | | | | This will permit sharing the code with nvmf(4). Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D53338
* snd_hda: Patch Lenovo V15Christos Margiolis2025-11-172-1/+3
| | | | | | | PR: 290496 Tested by: adrian Sponsored by: The FreeBSD Foundation MFC after: 1 week
* igb(4): Fix VLAN support on VFsKrzysztof Galazka2025-11-171-14/+20
| | | | | | | | | | | | | | | | | Virtual Functions are considered untrusted and have no control over VLAN filtering configuration in HW. To allow using VLANs on VF intreface driver has to assume that VLAN HW Filtering is always enabled and pass requests for adding or removing VLAN tags to Physical Function driver using Mailbox API. Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com> Approved by: kbowling (mentor) Reviewed by: erj (previous version) Tested by: gowtham.kumar.ks_intel.com MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D53245
* tpm: crb: factor out idle/ready state transitionsKyle Evans2025-11-151-11/+50
| | | | | | | | | | | Some TPM implementations have a different start method that requires an additional notification for some state changes; for instance, the "Pluton" start method. Just factor these transitions out for now, and the coming commits will introduce points that the start method can hook in at. Reviewed by: obrien Differential Revision: https://reviews.freebsd.org/D53682
* cxgbe(4): Avoid racy access to requested_fec in sysctl_requested_fecNavdeep Parhar2025-11-141-6/+8
| | | | | | | | PR: 289121 Reported by: Qiu-ji Chen MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D52199
* iwx: clean up TX AMPDU session establishment and checkingAdrian Chadd2025-11-143-28/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Send a TX A-MPDU exchange successfully; we were allocating the A-MPDU TX queue but returning 0 to net80211 was telling it to not establish the TX A-MPDU session and none of the BA session tracking stuff would work. * Clean up the TX A-MPDU queue lookup in the transmit path - only QoS data frames are allowed, not qos null-data, cf/ack/etc frames; only send them if the A-MPDU session is established. * Tell net80211 that we've established the TX A-MPDU session once the firmware queue has been created. * Check to make sure we're not double (or more) creating TX AMDPU sessions - only allocate a qid if we're not doing A-MPDU yet. * Delete IWX_FLAG_A-MPDUTX - it's now being properly tracked! Locally tested: * AX210, STA mode - gets 50/50mbit on 2GHz HT20, and 100/100mbit on 5GHz VHT/40. Differential Revision: https://reviews.freebsd.org/D53725 Reviewed by: thj
* iwx: fix and clean up suspend/resume pathAdrian Chadd2025-11-141-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed a couple of things were happening: * during suspend, I'd get a timeout in the NIC lock path (which sets a bit on the NIC to say that the host wants to talk to it); * resume wouldn't come back - scan commands would fail, and you'd have to reinit the NIC again for it to work. The thing is: * the suspend path should already shut down the NIC by shutting down all the VAPs (and the last VAP should call ic_parent to bring it down), and * the resume path should already bring up the NIC by bringing up each VAP, and the first VAP to be brought up calls ic_parent to bring it up. So instead, I've shuffled around the code to just double check the hardware state is consistent /before/ ieee80211_suspend_all() and ieee80211_resume_all() is called. This both fixes the errant hardware timeout during suspend, and it fixes resume to work. Locally tested: * AX210, STA mode, both hardware ACPI suspend/resume and devctl suspend and devctl resume Differential Revision: https://reviews.freebsd.org/D53721 Reviewed by: thj
* iwx: clean up debugging around key add/set; comments on deleteAdrian Chadd2025-11-142-15/+26
| | | | | | | | | | * Add IWN_DEBUG_KEYMGMT as a debug flag * Convert DPRINTF(()) in key add/set to IWN_DPRINTF() * printf() -> net80211_vap_printf() * add braces around return value Differential Revision: https://reviews.freebsd.org/D53703 Reviewed by: thj
* mtw: convert to new net80211 crypto key APIAdrian Chadd2025-11-141-8/+16
| | | | | | | | | | * constify mtw_write_region_1()'s data field * convert to use ieee80211_crypto_get_*() * .. note that rx/tx mic data routines are explicitly being called, as this NIC is doing TKIP + MIC offload Differential Revision: https://reviews.freebsd.org/D53704 Reviewed by: bz
* rtwn: migrate to new ieee80211 key data accessorsAdrian Chadd2025-11-141-4/+12
| | | | | | | | | | | Migrate to the ieee80211_crypto_key_*() routines. Should be no functional change. Locally tested: * RTL8821AU, STA mode Differential Revision: https://reviews.freebsd.org/D52712
* cxgbe(4): Skip non-existent blocks in the interrupt handlerNavdeep Parhar2025-11-131-2/+8
| | | | | | Fixes: 7b80c8b7d8d9 cxgbe(4): Expanded interrupt handling for T7 MFC after: 1 week Sponsored by: Chelsio Communications
* mlx5: Fix compilation error when not building with KERN_TLSAndrew Gallatin2025-11-131-0/+2
| | | | | | Reported by: np Fixes: 9349214a2815 mlx5: Preallocate ktls tags asynchronously Sponsored by: Netflix
* drm2: update gone_in to 16 from 13David E. O'Brien2025-11-131-1/+1
|
* cxgbe(4): Expanded interrupt handling for T7Navdeep Parhar2025-11-135-299/+1214
| | | | | | | | | | | | | | | | | - Catch up with the new cause/perr registers. The high level approach is the same but the T7 has an extra top level INT_CAUSE concentrator and a PERR_CAUSE concentrator with a changed layout. - Add various flags to control the interrupt handlers' behavior. - Implement a t4_intr_clear that internally use the slow handler as an iterator over known cause/perr registers. This lets the driver clear all of the interrupt sources that it knows about. The firmware sets up the interrupt enables and clears the causes normally so this call should be redundant. MFC after: 1 week Sponsored by: Chelsio Communications
* sound: Retire SND_DIAGNOSTIC PCM locking macrosChristos Margiolis2025-11-131-103/+0
| | | | | | | | | | Disabled by default, but also redundant, since most of the errors they catch will be caught anyway by WITNESS and the locking subsystem. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D53735
* sound: Do not use double pointer in dsp_io_ops()Christos Margiolis2025-11-131-13/+13
| | | | | | | | | No reason to do so. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D53734
* sound: Remove unnecessary uio checks in dsp_io_ops()Christos Margiolis2025-11-131-7/+0
| | | | | | | | | uiomove_faultflag() takes care of that already. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D53733
* sound: Retire OLDPCM_IOCTLChristos Margiolis2025-11-131-15/+0
| | | | | | | | | | | It is defined by default, and there is no reason to have a switch for it. While here, also get rid of some unnecessary comments and ioctl definitions. No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Move mixer->modify_counter to more appropriate placeChristos Margiolis2025-11-131-5/+5
| | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Retire unused mixer functionsChristos Margiolis2025-11-132-47/+0
| | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Remove dead midi codeChristos Margiolis2025-11-131-123/+14
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* cxgbe(4): T7 related updates to shared codeNavdeep Parhar2025-11-134-112/+654
| | | | | | | | | | - Avoid some more registers with read side-effects during regdump. - mps_tcam_size is 3x the size of T6/T5. - Update rss_rd_row to work with T7. Obtained from: Chelsio Communications MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbe(4): Add support for QSFP-DD connector and 400G transceiversNavdeep Parhar2025-11-132-4/+18
| | | | | | | Tested with SR8 and DR4 transceivers. MFC after: 1 week Sponsored by: Chelsio Communications
* sound: Remove KOBJMETHOD_END re-definitionsChristos Margiolis2025-11-123-12/+0
| | | | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D53696