Skip to content

[pull] master from linux-nvme:master#213

Merged
pull[bot] merged 16 commits into
zengqingfu1442:masterfrom
linux-nvme:master
May 13, 2026
Merged

[pull] master from linux-nvme:master#213
pull[bot] merged 16 commits into
zengqingfu1442:masterfrom
linux-nvme:master

Conversation

@pull

@pull pull Bot commented May 13, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

igaw and others added 16 commits May 13, 2026 13:41
When the MI feature is disabled, don't export the MI symbols.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
When the configuration disables MI support, do not depend on MI features
from the library. Disable these parts, the same treatment as fabrics.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
The table API automatically adjusts column width based on the width of
the value being printed. While table_print_XXX() already supports
unsigned, unsigned long, and long data types, the corresponding helper
table_get_value_width() does not account for these types.

Add support for unsigned, unsigned long, and long in table_get_value_
width() so that column width calculation is consistent with the
supported print helpers.

This will be used by the nvme top dashboard, where several statistics
are represented using these data types.

Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Link: https://patch.msgid.link/20260512201559.3057514-2-nilay@linux.ibm.com
Signed-off-by: Daniel Wagner <wagi@kernel.org>
table_print_centered() open-codes the logic to determine the width of a
table value, even though a helper already exists for this purpose.

Replace the open-coded width calculation with a call to
table_get_value_width() to avoid duplication and keep the behavior
consistent across the table helpers. Also, ensure that
table_get_value_width() returns -1 on failure so the caller could
then handle error as needed.

Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Link: https://patch.msgid.link/20260512201559.3057514-3-nilay@linux.ibm.com
Signed-off-by: Daniel Wagner <wagi@kernel.org>
The table_print_XXX() APIs do not currently support printing values of
type float or double.

Add support for float and double so that these data types can be used
with the table printing helpers. This will be later used for printing
nvme-top stat.

While at it, switch error reporting to nvme_show_error() for
consistency with the rest of the code.

Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Link: https://patch.msgid.link/20260512201559.3057514-4-nilay@linux.ibm.com
Signed-off-by: Daniel Wagner <wagi@kernel.org>
The table APIs currently print output only to stdout. However, callers
may need to direct output to other destinations such as stderr, a file,
or an in-memory buffer.

Add support for passing a FILE * stream so callers can choose where the
table output is written.

This will be used by the nvme top dashboard to control how statistics
are displayed.

Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Link: https://patch.msgid.link/20260512201559.3057514-5-nilay@linux.ibm.com
Signed-off-by: Daniel Wagner <wagi@kernel.org>
Add a sigaction handler for SIGWINCH so that nvme-top can detect
terminal window size changes.

This allows the dashboard layout to be adjusted and redrawn when the
terminal is resized. To avoid undefined behavior and async-signal-safety
the data type for nvme_sigwinch_received is defined as volatile
sig_atomic_t.

While we are at it, also update the data type of nvme_sigint_received
to volatile sig_atomic_t.

Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Link: https://patch.msgid.link/20260512201559.3057514-6-nilay@linux.ibm.com
Signed-off-by: Daniel Wagner <wagi@kernel.org>
Add a generic dashboard framework to support interactive, top-like
views. The framework renders data within a fixed-size window backed by
a larger buffer and provides event-driven APIs for updating the display.

Supported events:

- key input (ESC, Enter, 'q')
- escape sequences (up/down arrows)
- SIGWINCH for terminal resize handling
- periodic refresh via timeout
- kobject uevents (via netlink) to detect NVMe topology changes
  (subsystem, controller, namespace)
- reverse video highlighting for rows

Exported APIs:

- FILE *dashboard_init(struct dashboard_ctx **db_ctx, int interval)
  Initialize the dashboard context. Returns a FILE * stream used by the
  caller to write data for rendering. The returned context is used by
  all other dashboard APIs. The @interval is specified in seconds which
  represents the dashboard refresh interval.

- void dashboard_exit(struct dashboard_ctx *db_ctx)
  Tear down the dashboard and free all resources.

- int dashboard_draw_frame(struct dashboard_ctx *db_ctx, int scroll)
  Render the current frame. If @scroll is non-zero, adjust the view
  based on scrolling (up/down); otherwise render a new buffer.

- enum event_type dashboard_wait_for_event(struct dashboard_ctx *db_ctx)
  Wait for events such as key input, timeout, uevent, or SIGWINCH.
  Callers are expected to implement an event loop, and then based on
  returned event type take the action. For instance, if the returned
  event is timeout then caller shall update/refill the data store buffer
  and invoke dashboard_draw_frame() so that new/updated data could be
  rendered on dashboard . If the returned event type is up/down arrow
  keys then caller shall adjust the data start index in data store
  buffer and invoke dashboard_draw_frame() for rendering data. If the
  returned event type is key press 'ESC' or 'q' or kobject uevent then
  user shall take action as appropriate.

Reverse video helpers:

dashboard_{set,reset}_header_row_reverse()
dashboard_{set,reset}_footer_row_reverse()
dashboard_{set,reset}_data_row_reverse()

Additional getters/setters:

dashboard_get_interval()
dashboard_get_header_rows()
dashboard_set_header_rows()
dashboard_get_footer_rows()
dashboard_set_footer_rows()
dashboard_get_data_rows()
dashboard_get_data_start()
dashboard_set_data_start()
dashboard_get_frame_data_rows()

This framework is intended for use by nvme-top and similar tools that
require dynamic, event-driven terminal dashboards.

Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Link: https://patch.msgid.link/20260512201559.3057514-7-nilay@linux.ibm.com
Signed-off-by: Daniel Wagner <wagi@kernel.org>
Add a new "nvme top" CLI command that provides an interactive,
top-like dashboard for real-time monitoring of NVMe devices and
paths.

The dashboard presents continuously updated information about
NVMe fabrics/PCIe paths and devices, similar in spirit to tools
such as top or iotop. It helps administrators observe device
health, detect path degradation, identify multipath imbalances,
and catch transient failures.

The interface consists of two views:

* Subsystem list view
  Displays all NVMe subsystems present on the system. Users can
  navigate the list using arrow keys and select a subsystem for
  detailed inspection.

* Subsystem detail view
  Shows detailed statistics for the selected subsystem. When
  native multipath is enabled, this includes namespace head
  statistics, path statistics, path health, and controller
  summary. Without multipath, it displays namespace statistics
  and controller summary.

Users can switch between views using the ESC/return key, exit with
'q', and navigate using arrow keys.

This command builds on the generic dashboard framework to provide
a flexible and extensible real-time monitoring interface.

Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Link: https://patch.msgid.link/20260512201559.3057514-8-nilay@linux.ibm.com
Signed-off-by: Daniel Wagner <wagi@kernel.org>
The upload action failed to find the xml files. Since the kubevirt
action already uploads all the artifacts, use these instead.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
The eager ioctl probing with a dummy command causes the kernel to emit
log messages. In addition, probing is performed for every handle, which
becomes unnecessarily expensive when iterating over large setups with
many fabrics controllers.

Defer ioctl version probing until the first actual command submission.
Prefer the 64-bit ioctl opportunistically and fall back to the 32-bit
variant only when the kernel returns -ENOTTY.

When --no-ioctl-probing is specified, skip probing entirely and use the
32-bit ioctl directly.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Codecov reports incomplete coverage uploads because gcovr cannot read
the generated .gcda files due to insufficient permissions. In addition,
the source tree is not available when the codecov action runs, which
prevents proper coverage mapping.

Fix the CI setup by ensuring gcovr can access the coverage data and by
making the source tree available during the upload step.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
blktests nvme/033 with tr=loop fails because read_sys_node() reports
missing sysfs entries as errors.

Some setups legitimately do not provide these attributes, so treat
missing sysfs entries as optional and suppress the error messages.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Some errno values used in the code are only available on Linux.
Substitutes good equivalent errno value for unsupported values used
by nvme/util.c when converting status to errno.

Signed-off-by: Broc Going <bgoing@micron.com>
Propagate NVMe status codes directly instead of mapping them to errno
values. This avoids the use of the non-portable ENAVAIL and ensures
protocol-level errors are preserved in their native NVMe form.

Signed-off-by: Broc Going <bgoing@micron.com>
Introduce a new libnvme_fd_t type to abstract file descriptor
handling across different platforms.

Define platform-specific values for invalid and test file descriptors to
handle portability differences in a consistent way.

Signed-off-by: Broc Going <bgoing@micron.com>
Signed-off-by: Brandon Capener <bcapener@micron.com>
@pull pull Bot locked and limited conversation to collaborators May 13, 2026
@pull pull Bot added the ⤵️ pull label May 13, 2026
@pull pull Bot merged commit 8262f6d into zengqingfu1442:master May 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants