Skip to content

log: add force option to report data area 4 - #3968

Open
ikegami-t wants to merge 2 commits into
linux-nvme:masterfrom
ikegami-t:tele-da4-force
Open

log: add force option to report data area 4#3968
ikegami-t wants to merge 2 commits into
linux-nvme:masterfrom
ikegami-t:tele-da4-force

Conversation

@ikegami-t

Copy link
Copy Markdown
Contributor

Since the LPA: DA4S and ETDAS settings are not mandatory.

@ikegami-t

Copy link
Copy Markdown
Contributor Author

This related to the issue: #2879 and the PR: #2894 for the issue.

@ikegami-t

Copy link
Copy Markdown
Contributor Author

Note: I am thinking to add the feature FID: 16h (host behavior support) to set ETDAS cheking if supported the feature itself later.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new --force path inverts ETDAS error handling, causing ETDAS failures to be ignored in the default path while becoming fatal when --force is set.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a --force option to the log plugin’s telemetry log retrieval so users can request Telemetry Data Area 4 even when DA4S/ETDAS-related prerequisites are not indicated as supported/required by the device.

Changes:

  • Introduces a new --force CLI flag for telemetry log retrieval.
  • Allows Data Area 4 reporting to proceed when --force is set, even if LPA:DA4S is not set.
  • Adjusts ETDAS-setting error handling for the Data Area 4 path (currently introduces an inverted condition that needs correction).
File summaries
File Description
plugins/log/log-plugin.c Adds --force option and alters Data Area 4 support gating / ETDAS handling in telemetry log retrieval.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread plugins/log/log-plugin.c
Comment on lines 551 to 555
err = libnvme_set_etdas(hdl, &host_behavior_changed);
if (err) {
if (err && cfg.force) {
nvme_show_error("%s: Failed to set ETDAS bit", __func__);
return err;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right and sorry for the error then just fixed the code so please review again. Thank you.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I woulnd't catch it, that's pure AI :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes really helpful;-)

Since the LPA: DA4S and ETDAS settings are not mandatory.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
@ikegami-t

Copy link
Copy Markdown
Contributor Author

Just added to check if the feature FID: 16h (host behavior support) to set ETDAS supported.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new libnvme_status_is_invalid_field() helper can mis-handle non-NVMe status types (e.g., NVMe-MI encoded return values) and may incorrectly suppress real errors.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread libnvme/src/nvme/util.h
Comment on lines +193 to +201
static inline bool
libnvme_status_is_invalid_field(int status)
{
if (nvme_status_code_type(status) == NVME_SCT_GENERIC &&
nvme_status_code(status) == NVME_SC_INVALID_FIELD)
return true;

return false;
}

@ikegami-t ikegami-t Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just fixed as suggested. Thank you.

(Added)
Note: To make sure just asked to google AI mode also to review then confirmed as okay.

Invalid field returned if host behavior support feature not supported.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants