ZTS: create the fdomain pool in zpool_create_draid_005_pos
The random loop of zpool_create_draid_005_pos builds the device list
of each layout a second time with fdomain keywords, but then creates
the pool from the fgroup list again, so the fdomain form of those
layouts is never tested. Use the fdomain list.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #19708
zpool: reject empty dRAID failure groups and stray devices
construct_spec() counts the devices after each fgroup or fdomain
keyword and requires each group to hold as many as the previous one.
It misses two cases: devices listed before the first keyword, which
are counted as children but belong to no group, and groups with no
devices, because a previous count of zero is also how it recognises
the first group. Both let through specifications in which the number
of devices is not the number of groups times the size of a group:
- "draid1 d1 d2 d3 d4 fgroup fgroup" is accepted as two groups of two
disks, although no disk was listed in a group;
- "draid1 d1 d2 d3 fdomain fdomain fdomain fdomain" makes
draid_config_by_type() compute zero failure groups and divide by
zero, and zpool is killed by SIGFPE;
- "draid2 fdomain fdomain <16 disks> fdomain <16 disks>" leaves the
last entries of the reordered child array uninitialized, and the
verify() around nvlist_add_nvlist_array() aborts zpool.
[13 lines not shown]
devel/py-zope.interface: fix with Python 3.13 and 3.14
Backport upstream change to make it work with python 3.13 and 3.14
PR: 299758
Reported by: Patrick Crandol <patrick at crandol.com>
[CIR] Remove 2 NYIs in CIRGenTypes.cpp (#238589)
While looking at NYIs I realized that incomplete and vla types don't
need to pay attention to CVR qualifiers, as classic codegen does not.
This just removes the two NYIs and adds tests here.
These qualifiers are ONLY valid in C and only on function parameters,
where they are entirely a SEMA feature, so there is nothing
codegen should have to do here.
AtomicExpand: Use RuntimeLibcallsInfo signatures for atomic libcalls
Take the function type and attributes of the emitted __atomic_* calls
from RuntimeLibcallsInfo instead of building them by hand.
This fixes missing extension attributes on the value operand and
result of the sized variants, which are unsigned integers of the
access size. On targets whose C ABI extends narrow integer arguments,
such as RISC-V and ARM, the callee could see unextended high bits. i8
and i16 values now get zeroext, and i32 values get signext on
RV64. Callers can also rely on the extended return value, which
removes redundant extensions after some calls.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[offload][amdgpu] Replace KLE test (#238800)
Temporarily set kernel_launch_environment_reduction.c to unsupported on
AMDGPU until https://github.com/llvm/llvm-project/issues/238409 is
resolved.
Add kernel_launch_environment_dyn_gprivate.c instead, which is also
stress-testing the KLE, but without accidentally stress-testing
concurrent memory transfers as well and, thus, not causing the GPU hang
on the buildbot that is described in the linked GitHub issue.
Claude assisted with this patch.
ena: Reinit RSS components during queue count change flow
The io_queues_nb sysctl is writable while the interface is down, and
setting it destroys the RSS components. When the interface is not UP
nothing reinitialises them, so the indirection table is left referencing
queues that no longer exist until the next ifconfig up.
Call ena_rss_configure() after the queue count changes when the
interface is down. When it is up, this happens through ena_up().
This can configure RSS twice if the interface is brought up afterwards,
costing three redundant admin commands. That is preferred over changing
ena_up(), which the reset path also uses.
Reviewed by: cperciva
Fixes: 56d41ad5fe9c ("Add sysctl node for ENA IO queues number adjustment")
MFC after: 3 days
Sponsored by: Amazon, Inc.
(cherry picked from commit 2a27dd0076c55789a43415559906f795fd10c2da)
ena: Set ENA_FLAG_RSS_ACTIVE only when RSS is really configured
If the device does not report support for the RSS indirection table,
ena_rss_init_default() destroys the RSS state and returns EOPNOTSUPP.
ena_rss_configure() treats EOPNOTSUPP as success and returns 0, and
ena_up_complete() sets ENA_FLAG_RSS_ACTIVE on any 0 return.
Reading dev.ena.N.rss.key at this point causes kernel panic.
Every current device reports the indirection table, so reaching this
needs a device that is broken or misreporting.
The SYSINIT removed by a6205766b300 called ena_rss_init_default()
directly, saw the EOPNOTSUPP and cleared the flag. Routing the decision
through ena_rss_configure(), which hides EOPNOTSUPP, lost that.
Move the flag set into ena_rss_configure(), which can see whether a
table exists, and clear it when tbl_log_size is 0.
Reviewed by: cperciva
[6 lines not shown]
ena: Update driver version to v2.8.5
New Features:
* Retrieve RSS indirection table size from device
Bug Fixes:
* Limit IO IRQ setup loop to active queues only
* Reinit RSS table on device restore when queue count shrinks
* Fix RSS not working after driver reload
* Fix NULL deref before NULL check in RSS sysctl
* Reinit RSS components during queue count change flow
Minor Changes:
* Fix ENA_MEM_FREE_COHERENT with an expression size argument
Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
(cherry picked from commit 5e66bf0df3104e212c1b24ff65284b6d1a694c59)
ena: Update driver version to v2.8.6
Bug Fixes:
* Revert "Reinit RSS components during queue count change flow"
* Fix RSS sysctl panic when the RSS table is destroyed
* Set ENA_FLAG_RSS_ACTIVE only when RSS is really configured
Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D61059
(cherry picked from commit 6c177745c58e526bcf7451ad2765df6c63f35f97)
ena: Fix RSS sysctl panic when the RSS table is destroyed
ena_set_io_queue_count() destroys the ena-com RSS state but left
ENA_FLAG_RSS_ACTIVE set. The RSS sysctl handlers gate on that flag, so
they ran against state that was gone.
This causes 2 types of issues:
1. Kernel panic when reading dev.ena.0.rss.key or writing to
dev.ena.0.rss.indir_table
2. Returning a stale cached RSS table when reading
dev.ena.0.rss.indir_table, or a bogus 1 when reading
dev.ena.0.rss.indir_table_size
ena_set_io_queue_count() is called in 2 cases:
1. The io_queues_nb sysctl.
2. Device restore when the device comes back with fewer MSI-X vectors
than before.
Clear ENA_FLAG_RSS_ACTIVE when the RSS table is destroyed. The handlers
[14 lines not shown]
Revert "ena: Reinit RSS components during queue count change flow"
This reverts commit 2a27dd0076c5.
Changing the IO queue count destroys the RSS table, and if this is done
while the device is down a new table is not rebuilt until the next
ena_up(). That leaves 2 problems in the meantime:
1. A stale copy of the destroyed table is still returned via sysctl.
2. Reading the destroyed key, or writing the table, panics.
That commit addressed 1 by creating a new RSS table, so that sysctl
returns a fresh default table with the new number of queues. It did not
set out to fix 2, but the rebuild hid it by accident.
The rebuilt table is the default round-robin one, wired to no queues and
unusable: a write still fails, because programming the device needs the
IO queues that only exist after ena_up(). ena_up() builds that same
table anyway.
[12 lines not shown]
ena: Fix NULL deref before NULL check in RSS sysctl
In ena_sysctl_rss_indir_table(), the code dereferenced
indir->sysctl_buf before checking whether indir itself is NULL.
Move the NULL check above the dereference so the early-return path
fires before any access through indir.
Reviewed by: cperciva
Fixes: 6d1ef2abd330 ("ena: Implement full RSS reconfiguration")
MFC after: 3 days
Sponsored by: Amazon, Inc.
(cherry picked from commit 462b6c50c7089e96c54cbd34378467f32fc709d4)
ena: Retrieve RSS table size from device
The current driver assumes a default RSS table size of 128 entries,
expecting the device's RSS table size to match this assumption.
This patch allows the driver to create RSS indirection table
with the size advertised by the device.
Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
(cherry picked from commit 3d1e732a43eda16f20dea3fe2671ce6fca8a03a6)
ena: Fix RSS not working after driver reload
When reloading the driver (kldunload/kldload),
ena_rss_init_default_deferred() is called before ena_attach()
completes. At this point, devclass_get_softc() returns NULL for all
devices because the adapter structs have not been populated yet. As a
result, ena_rss_init_default() is never called and ENA_FLAG_RSS_ACTIVE
is never set. Later, in ena_up_complete(), the code checks the flag,
finds it unset, and skips ena_rss_configure() entirely. RSS is never
initialized, and all traffic is directed to queue 0.
Remove the ENA_FLAG_RSS_ACTIVE gate in ena_up_complete() and always call
ena_rss_configure(), which initialises the table when tbl_log_size is
zero. The deferred SYSINIT is now redundant, so remove it.
Reviewed by: cperciva
Fixes: 9b8d05b8ac78 ("Add support for Amazon Elastic Network Adapter (ENA) NIC")
MFC after: 3 days
Sponsored by: Amazon, Inc.
[2 lines not shown]
ena: Limit IO IRQ setup loop to active queues only
The loop in ena_request_io_irq() iterated over adapter->msix_vecs,
which reflects the maximum number of MSI-X vectors allocated at
init time. When the number of IO queues is reduced at runtime via
the io_queues_nb sysctl, msix_vecs is not updated, causing the
driver to bind interrupts and log CPU affinity for queues that no
longer exist.
Replace the loop bound with ENA_IO_IRQ_IDX(adapter->num_io_queues)
to iterate only over the currently active IO queues.
Also replace the loop in ena_free_io_irq() the same.
Reviewed by: cperciva
Fixes: 56d41ad5fe9c ("Add sysctl node for ENA IO queues number adjustment")
MFC after: 3 days
Sponsored by: Amazon, Inc.
(cherry picked from commit 32c301922dc1e6f52bdd043046661ac1e2b462d8)
ena: Reinit RSS table on device restore when queue count shrinks
When ena_restore_device() is called after a reset, pci_alloc_msix()
may return fewer MSI-X vectors than requested, causing num_io_queues
to shrink. When this happens, the RSS indirection table retains
entries referencing queues that no longer exist, routing packets to
non-existent queues and causing connectivity loss.
Extract ena_set_io_queue_count() to pair the queue count update with
ena_com_rss_destroy(), ensuring the RSS table is always invalidated
when the queue count changes. Use it from both ena_update_io_rings()
and ena_restore_device().
Reviewed by: cperciva
Fixes: e2735b095b7e ("Fix assumptions about number of IO queues in the ENA")
MFC after: 3 days
Sponsored by: Amazon, Inc.
(cherry picked from commit 2d4d2ed3fef6acda9269f545f6703d6f32f2f0b7)