aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tools/cam: Start to add the testing tools for CAMWarner Losh6 hours2-0/+98
| | | | | | | | | | | | Create a directory for testing tools arond CAM. These are snippets of what will eventually be camio. At the moment, it was written using fbt traces. This is OK, but fragile, so they need to be re-written with the cam provider. cam_all_but_scsi.d is the first step. It shows how to do this with the new cam dtrace provider. Sponsored by: Netflix Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D54472
* dtrace: Add definitiosn for the cam dtrace providerWarner Losh6 hours2-1/+196
| | | | | | Sponsored by: Netflix Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D54471
* cam: When inq data isn't valid, pass NULLWarner Losh6 hours1-10/+8
| | | | | | | | | When the device isn't there, we don't have valid inq data. Pass NULL in this case. All the routines that receive this test against NULL already. Sponsored by: Netflix Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D54470
* cam: Add probes for xpt actionsWarner Losh6 hours3-1/+64
| | | | | | | | | | | | | | cam::xpt:action(union ccb *) cam::xpt:done((union ccb *) cam::xpt:async-cb(void *cbarg, uint32_t async_code, struct cam_path *path, void *async_arg); Called when xpt_action(), xpt_done*() and the xpt async callbacks are called. Sponsored by: Netflix Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D54469
* cam: Start adding dtrace provider 'cam'Warner Losh6 hours2-0/+19
| | | | | | | | | Start to provide robust tracing in cam now that clang has broken my fbt-based dtrace scripts a couple of times. Sponsored by: Netflix Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D54468
* loader: Only warn when we have neither FDT nor ACPIWarner Losh7 hours1-1/+2
| | | | | | Sponsored by: Netflix Reviewed by: adrian, andrew Differential Revision: https://reviews.freebsd.org/D54510
* loader.efi: Only use SPCR if enabled.Jarmo Jaakkola7 hours1-5/+9
SerialPort in the SPCR is zeroed when serial redirection is disabled, rather than the SPCR being omitted from the ACPI tables ony many systems. Check to see that SerialPort.Address is non-zero before using. FreeBSD would fail to boot on systems that could have a serial port redireciton, but don't have it enabled because the loader would create a bogus hw.uart.console. While one could unset this value to boot, you couldn't do that automatically very easily. Instead, don't even look at the SPCR table if the SerialPort is zero'd. PR: 292206 MFC After: 3 days Sponsored by: Netflix Co-authored-by: Warner Losh <imp@FreeBSD.org> Closes: https://github.com/freebsd/freebsd-src/pull/1948
* iflib: Drop tx lock when freeing mbufs using simple_transmitAndrew Gallatin17 hours2-36/+154
Freeing completed transmit mbufs can be time consuming (due to them being cold in cache, and due to ext free routines taking locks), especially when we batch tx completions. If we do this when holding the tx ring mutex, this can cause lock contention on the tx ring mutex when using iflib_simple_transmit. To resolve this, this patch opportunistically copies completed mbuf pointers into a new array (ifsd_m_defer) so they can be freed after dropping the transmit mutex. The ifsd_m_defer array is opportunistically used, and may be NULL. If its NULL, then we free mbufs in the old way. The ifsd_m_defer array is atomically nulled when a thread is using it, and atomically restored when the freeing thread is done with it. The use of atomics here avoids acquire/release of the tx lock to restore the array after freeing mbufs. Since we're no longer always freeing mbufs inline, peeking into them to see if a transmit used TSO or not will cause a useless cache miss, as nothing else in the mbuf is likely to be accessed soon. To avoid that cache miss, we encode a TSO or not TSO flag in the lower bits of the mbuf pointer stored in the ifsd_m array. Note that the IFLIB_NO_TSO flag exists primarily for sanity/debugging. iflib_completed_tx_reclaim() was refactored to break out iflib_txq_can_reclaim() and _iflib_completed_tx_reclaim() so the that the tx routine can call iflib_tx_credits_update() just once, rather than twice. Note that deferred mbuf freeing is not enabled by default, and can be enabled using the dev.$DEV.$UNIT.iflib.tx_defer_mfree sysctl. Differential Revision: https://reviews.freebsd.org/D54356 Sponsored by: Netflix Reviewed by: markj, kbowling, ziaee
* iflib: document new sysctlsAndrew Gallatin37 hours1-0/+10
Document the new tx related sysctls I've added to iflib in the last few months: tx_reclaim_ticks & tx_reclaim_thresh Sponsored by: Netflix Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D54564 MFC after: 3 days
* tcp: Unifidef use of rss software hash in syncacheAndrew Gallatin3 days1-3/+2
Ever since "d9c55b2e8cd6 rss: Enable portions of RSS globally.." exposed the RSS software hashing functions, it has been possible to use them without "ifdef RSS". Do so now in the syncache so as to get flowids recorded. Note that the use of the rss hash functions is conditional on IP versions, so we must ifdef INET to ensure rss_proto_software_hash_v4() is available. Fixes 73fe85e486d2 Sponsored by: Netflix Reviewed by: glebius, p.mousavizadeh_protonmail.com, nickbanks_netflix.com, tuexen Differential Revision: https://reviews.freebsd.org/D54534
* ixl: verify flowid is valid before setting rsstype & flowidAndrew Gallatin3 days1-3/+7
According to section 8.3.2.2.1 of the XL710 datasheet, FLTSTAT indicates if RSS hashing was used (or flow director or nothing) to arrive at the flowid it is reporting. We need to check this before reporting the flowid and setting the rss type. Not checking this allows invalid flowids (0s) to be reported for some TCP traffic (it seems to mostly impact incoming connections). This leads to the inp flowid being 0, and egress traffic being unbalanced (going to tx queue 0, and NIC 0 of an lacp bundle). Differential Revision: https://reviews.freebsd.org/D54442 Reviewed by: adrian, kbowling Sponsored by: Netflix MFC after: 2 weeks
* cam: Minor comment cleanupWarner Losh5 days1-7/+8
Some minor comment cleanup, add a comment about an unused value, etc. No functional change. Sponsored by: Netflix
* scsi: Make all da error messages greppableWarner Losh11 days1-49/+40
Don't split the error messages across lines. We used to do that ages ago, but have relaxed style(9) to encourage the opposite so all error messages can be grepped. This constantly slows me down when I'm helping others find issues, so start here by splitting according to normal style(9) rules with a relaxed line length of 90. Sponsored by: Netflix
* kernel: MK_REPRODUCIBLE_PATHS for full paths vs /usr/srcWarner Losh11 days7-4/+19
| | | | | | | | | | | | | | | | | | | | | | There are many environments that you do not want the paths to be canonicalized. For example, if I always build a product from a specific path in a jail that's dependent on the product version, I don't want that to be sanitized to /usr/src because when I have profiling tools run against multiple kernels, I can't do A/B testing and results processing if everything points to /usr/src (sadly, the profiling tools cannot remap back to the original like gdb can). Since we need both active at the same time, symbloic link fallbacks don't work. We do want the rest of the build to be reproducible, however. We'll get the same binaries if we rebuild later since we always rebuild with the same path. Turn them both on for maximum reproduction for environments where that cannot be guaranteed. Sponsored by: Netflix Input from: emaste, ivy Differential Revision: https://reviews.freebsd.org/D52959
* loader: Use C99 initializations for file_formatWarner Losh11 days15-39/+70
| | | | | | For greppability, use C99 initializers for the struct file_format. Sponsored by: Netflix
* loader: Fix powerpc64le by working around slof bug in qemu/slofWarner Losh11 days1-1/+1
Fix powerpc 64 little endian booting by adding some padding. Due to https://gitlab.com/slof/slof/-/blob/master/lib/libelf/elf32.c?ref_type=heads#L114 https://gitlab.com/slof/slof/-/blob/master/lib/libelf/elf32.c?ref_type=heads#L150 using <= instead of <, slof used to loop over the phdrs. It overruns by 1 and so on little endian it swizzles the first 32 bytes of .text. Work around this by adding 32 bytes of padding after the headers. We should fix this in slof, but it's in the just released QEMU 10.2, so we have to pad things here for now. Now powerpc64le + qemu works. MFC After: 3 days (maybe EN too) Reviewed by: adrian, jhibbits Sponsored by: Netflix
* Build acpi kernel modules on aarch64John Baldwin13 days2-2/+6
| | | | | | | | For now, the only kernel module built is acpi_ged.ko. Sponsored by: Netflix Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D54315
* sys/modules/acpi/Makefile: One line per subdirectoryJohn Baldwin13 days1-3/+15
| | | | | | | | This makes diffs that add or remove modules easier to read. Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D54314
* acpi: Statically initialize acpi_ioctl_hooksJohn Baldwin13 days1-11/+6
| | | | | | Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D54313
* acpi: Use M_WAITOK in acpi_register_ioctlJohn Baldwin13 days1-2/+1
| | | | | | | | | This function is only called from device attach routines which can sleep. Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D54312
* acpi: Reject duplicate handlers for ioctl commandsJohn Baldwin13 days1-1/+9
| | | | | | Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D54311
* acpi_apei: Remove the hest member from the softcJohn Baldwin13 days1-6/+5
| | | | | | | | | | This is only used during attach and freed after use, so just use a local variable in the attach routine instead to avoid leaving a dangling pointer around in the softc. Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D54310
* acpi: Free ivars in bus_child_deleted methodJohn Baldwin13 days1-0/+1
| | | | | | Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D54309
* acpidump: Extend the decoding of entries in the EINJ and ERST tablesJohn Baldwin13 days1-13/+193
- Decode the Action, Instruction, and Flags fields for these tables - Omit the Flags field if it is zero - Omit the Value field for instrunctions that do not use it Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D54308
* ktls: Capture initial tls seqno at time offload is initiatedAndrew Gallatin2025-12-212-3/+9
| | | | | | | | | | | Some drivers want the TLS seqno when offload starts. Capture this for them by adding a union for initial_seqno, sharing space with the TLS 1.0 next_seqno. Reviewed by: jhb Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D54275 MFC After: 1 month
* iflib: support for transmit side nic KTLS offloadAndrew Gallatin2025-12-212-14/+22
This change adds support to iflib for drivers that want to do transmit-side NIC ktls offload. This change does 2 things: 1) Extends the pkt info to include an optional mbuf pointer. This gives drivers the ability to find the start of a TLS record if they need to re-DMA part of the record to re-construct TLS state on the NIC. This mbuf pointer is only passed when CSUM_SND_TAG is present on the pkthdr. Note that I don't bother to inspect the send tag on purpose; this will only be present for TLS offloaded or paced connections 2) Allows the driver to specify how much ring padding is needed before the ring is considered to be full using the new isc_tx_pad field in if_softc_ctx. This re-uses a field that was marked spare in 2019 via d49e83eac3baf. Iflib initializes this to the previous value of 2 slots and allows the driver to override it. The TXQ_AVAIL() macro has been adjusted to subtract this padding, and uses of the macro have removed +2 from the other side of the comparison. To avoid potential cache misses from looking at the ifc_softc_ctx in TXQ_AVAIL(), the value is mirrored in the txq (in an alignment hole). Reviewed by: kbowling, kgalazka, sumit.saxena_broadcom.com, shurd Sponsored by: Netflix MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D54274
* lacp: Sort port map by interface indexAndrew Gallatin2025-12-151-1/+25
This makes it easier to reason about system topology, and to potentially map applications to NIC queues by (ab)using the mbuf flowid to select egress NIC and queue in a predictable fashion. Differential Revision: https://reviews.freebsd.org/D54053 Reviewed by: glebius, kbowling Sponsored by: Netflix
* cam: Also reduce timeout for wlun probingWarner Losh2025-12-121-1/+1
| | | | | | | | | | | wlun probing was added after my initial work on this and was overlooked in merging forward. Add the timeout here too, for the same reasons as for REPORT LUNS. This doesn't change the default. Fixes: 8ac7a3801c6a cam: Reduce overly long timeout values for initial device probing Sponsored by: Netflix Reviewed by: jaeyoon Differential Revision: https://reviews.freebsd.org/D54184
* cam: Reduce overly long timeout values for initial device probingWarner Losh2025-12-113-7/+66
Currently, we have very long timeouts for the initial probing commands. However, these are not appropriate for modern (post 2010) SCSI disks. Sandards since SPC3 state that these commands should not wait for media access. Since we retry them several times during the initial bus scan, these delays can delay the boot by minutes (5 minutes per errant disk in our expereince). These delays don't help and only hurt, so reduce the TESTUNITREADY, INQUIRY and MODESENSE commands (during the initial probe). Provide sysctl/tuneables to change the time for these and also the REPORTLUNS commands for people that might need to adjust them for devices that violate this belief but none-the-less work with longer timeouts. kern.cam.tur_timeout (default was 60s, now 1s) kern.cam.inquiry_timeout (default was 60s, now 1s) kern.cam.reportluns_timeout (default is 60s) kern.cam.modesense_timeout (default was 60s, now 1s) This can be partially merged: the sysctls can, but the new defaults likely shouldn't. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D52427
* nvme: Only attach to storage NVMe devicesWarner Losh2025-12-102-2/+9
| | | | | | Only attach CAM to the nvme storage devices. Sponsored by: Netflix
* nvme: remove now-redundant consumer interfaceWarner Losh2025-12-105-155/+0
| | | | | | | | Now that we've moved to newbus methods, we can delete this... Sponsored by: Netflix Reviewed by: dab Differential Revision: https://reviews.freebsd.org/D54095
* nvme: Notify failure with newbus callWarner Losh2025-12-103-16/+13
| | | | | | Sponsored by: Netflix Reviewed by: dab Differential Revision: https://reviews.freebsd.org/D51391
* nvme: Use new method to do async notificationsWarner Losh2025-12-103-25/+23
| | | | | | | | | Nothing uses these at the moment, but it would be useful to use in the future so convert this functionality to an newbus function dispatch. Sponsored by: Netflix Reviewed by: dab Differential Revision: https://reviews.freebsd.org/D51390
* nvd: Connect nvme_if methodsWarner Losh2025-12-106-157/+167
| | | | | | | | Conenct methods to manage namespaces explicitly to replace the old consumer interface. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51388
* nvme_sim: Connect to events broadcast with nvme_ifWarner Losh2025-12-102-61/+85
| | | | | | | | | Connect up the nvme_ns_* events. Copy code from old ways, as needed, and refactor a little. Sponsored by: Netflix Reviewed by: dab Differential Revision: https://reviews.freebsd.org/D51387
* nvd: Attach as a child of nvmeWarner Losh2025-12-101-37/+73
| | | | | | | | | | | Rather than registering as a consumer of the nvme controller, hook into the child device and use that. This is a small regression at the moment: we don't fail the device when that happens at runtime. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51385
* nvme_sim: Attach as a child of nvmeWarner Losh2025-12-101-53/+85
| | | | | | | | | | | | Rather than registering as a consumer of the nvme controller, hook into the child device and use that. This is a small regression at the moment: we don't fail the device when that happens at runtime, and we don't handle new namespaces when they arrive (though that feature is currently fragile). Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51384
* nvme: Add child device for each controllerWarner Losh2025-12-102-0/+10
| | | | | | | | | | | | Step 1 in the move from registering consumers for NVMe drives to newbus nvme drives: Add a child device and attach them for each controller that we initialize. Detach them when we detach the main device. Sponsored by: Netflix Reviewed by: dab Differential Revision: https://reviews.freebsd.org/D51383
* nvme: Nvme controller generated eventsWarner Losh2025-12-102-0/+56
Interface for the nvme driver notifying its children of different events: async notifications, namespace events and device failure. These aren't yet connected. Sponsored by: Netflix Reviewed by: dab Differential Revision: https://reviews.freebsd.org/D51386
* cam: decode and print direct accecss block device sense dataWarner Losh2025-12-102-2/+68
| | | | | | | A more efficient way to include multiple bits of data in a sense decriptor was defined in SBC4 in 2020. Decode and print it. Sponsored by: Netflix
* cam: Expand the parts of the sense buffer we reportWarner Losh2025-12-103-6/+212
| | | | | | Decode the descriptors we put into devd. Sponsored by: Netflix
* mpr: Partially revert 332096ebb638Warner Losh2025-12-102-32/+2
These were a doodle that escaped into my staging tree. Remove them. Sponsored by: Netflix
* kboot: Explicitly use host:/procWarner Losh2025-12-103-5/+42
When looking for the boot_params symbol we need to get the UEFI memory map, use host: prefix. The short-circuit we have for this only works when we have a filesystem. During the earliest parts of boot, we can sometimes not have this yet, so making this explicit allows these environments to function. It's always in the host path. Print better error messages, and add newlines in two palces. Sponsored by: Netflix
* splice: Fix leaks that can happen when initiating a spliceAndrew Gallatin2025-12-091-17/+27
- change the state to SPLICE_EXCEPTION to allow so_unsplice() to work to cleanup failed splices (fixes socket reference leak) - NULL out sp->dst when unsplicing from so_splice() before so2 has been been referenced. - Deal with a null sp->dst / so2 in so_unsplice - Fix asserts that talked about sp->state == SPLICE_INIT; that state is not possible here. Differential Revision: https://reviews.freebsd.org/D54157 Reviewed by: markj Sponsored by: Netflix Fixes: c0c5d01e5374 ("so_splice: Synchronize so_unsplice() with so_splice()") MFC after: 3 days
* nvme: Rename NVME_NS_ADDED to NVME_NS_ALIVE and _CHANGED to _DELTAWarner Losh2025-12-054-7/+7
| | | | | | | NVME_NS_ADDED will conflict with a later change, so change it here. Likewise NVME_NS_CHANGED. Sponsored by: Netflix
* nvme: Improve error message for invalid format valueWarner Losh2025-12-051-7/+5
Improve the wording of the invalid namespace value. Reword the comment and move a line of code to the block it logically belongs to. No functional changes intended. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51393
* tcp: retire do_newsack - always adhere to RFC6675 SACKRichard Scheffenegger2025-12-054-52/+6
Depreciation notice for net.inet.tcp.newsack is in 15.0. Remove this tunable for HEAD, streamlining the code slightly. Reviewed by: tuexen, cc, nickbanks_netflix.com, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D54072
* cam: set reladr in scsi_read_capacity_16Warner Losh2025-12-051-2/+2
The reladr field wasn't being set, so pmi and reladr args were nops. That's OK, because they are passed as 0 in the one place in the tree we use this. Sponsored by: Netflix
* nvme: Fix devd logging of SMART_ERRORWarner Losh2025-12-041-1/+5
Remove extra arg so that we have type=SMART_ERROR rather than an invalid message. Also log all aens. Sponsored by: Netflix
* armv7: Tweak some armv6 removalsWarner Losh2025-12-032-1/+2
| | | | | | Fixes: 42421307b115 (sys: remove armv6/6.1 support from debug monitor) Suggested by: jhb Sponsored by: Netflix