Skip to content

DAOS-18567 bio: Set SPDK/DPDK engine log level via env#17497

Open
tanabarr wants to merge 3 commits intomasterfrom
tanabarr/control-toggle-spdk-dbg2
Open

DAOS-18567 bio: Set SPDK/DPDK engine log level via env#17497
tanabarr wants to merge 3 commits intomasterfrom
tanabarr/control-toggle-spdk-dbg2

Conversation

@tanabarr
Copy link
Contributor

@tanabarr tanabarr commented Feb 3, 2026

Allow administrator to configure the engine process log levels for
SPDK and DPDK via environment variables DAOS_XPDK_LOG_LEVEL. SPDK
accepts 0-4 (ERR,WARN,NOTICE,INFO,DEBUG) and DPDK accepts 1-8.

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
@tanabarr tanabarr requested review from a team as code owners February 3, 2026 18:47
@tanabarr tanabarr self-assigned this Feb 3, 2026
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Ticket title is 'Set SPDK & DPDK log levels via engine environment variables'
Status is 'In Review'
https://daosio.atlassian.net/browse/DAOS-18567

@NiuYawei
Copy link
Contributor

NiuYawei commented Feb 4, 2026

@tanabarr is this for replacing #17488 ?

@daosbuild3
Copy link
Collaborator

@daosbuild3
Copy link
Collaborator

Test stage Fault injection testing on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17497/1/execution/node/984/log

@daosbuild3
Copy link
Collaborator

@tanabarr
Copy link
Contributor Author

tanabarr commented Feb 4, 2026

@tanabarr is this for replacing #17488 ?

yes

…ggle-spdk-dbg2

Features: control
Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
DAOS_DPDK_LOG_DEFAULT);
dpdk_level = DAOS_DPDK_LOG_DEFAULT;
} else {
D_INFO("DPDK log level is %u\n", dpdk_level);
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: we could combine the "DPDK & SPDK log level" message into single D_INFO.

Copy link
Contributor

@knard38 knard38 left a comment

Choose a reason for hiding this comment

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

LGTM, just a minor non blocking remark.

/* Max SPDK log level */
#define DAOS_SPDK_LOG_MAX SPDK_LOG_DEBUG
/* Default DPDK log level: RTE_LOG_ERR */
#define DAOS_DPDK_LOG_DEFAULT 4
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: Could be nice to define it in a .h file to make it accessible in spdk_default.go and thus not call C.dpdk_cli_build_opts(4, 4) with hard coded parameter values

@daosbuild3
Copy link
Collaborator

Test stage Fault injection testing on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17497/3/execution/node/766/log

@daosbuild3
Copy link
Collaborator

Test stage Fault injection testing on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17497/4/execution/node/431/log

@daosbuild3
Copy link
Collaborator

Test stage Fault injection testing on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17497/5/execution/node/431/log

Copy link
Contributor

@kjacque kjacque left a comment

Choose a reason for hiding this comment

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

Comments are minor and could be addressed in a follow-on.

}

envCtx := C.dpdk_cli_override_opts
envCtx := C.dpdk_cli_build_opts(4, 4)
Copy link
Contributor

Choose a reason for hiding this comment

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

Magic numbers?

Comment on lines +171 to +172
* DPDK log level (1-8): 1=EMERG, 2=ALERT, 3=CRIT, 4=ERR, 5=WARNING,
* 6=NOTICE, 7=INFO, 8=DEBUG
Copy link
Contributor

Choose a reason for hiding this comment

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

If we can't include these from some dpdk header file, it would be better to define our own enum than to embed the meaning in a comment here.

* DPDK log level (1-8): 1=EMERG, 2=ALERT, 3=CRIT, 4=ERR, 5=WARNING,
* 6=NOTICE, 7=INFO, 8=DEBUG
*
* \param eal_level Log level for EAL facility (1-8)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a dumb question, but what does EAL stand for?

}

/* Build with custom EAL level, others at default */
ret = snprintf(dpdk_cli_opts_buffer, sizeof(dpdk_cli_opts_buffer),
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this function is only called during bio init, but it'd be good to note in the comments that it's not thread-safe.

Comment on lines +104 to +105
if (ret < 0 || ret >= sizeof(dpdk_cli_opts_buffer)) {
return NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should log an error here. If snprintf fails, it would be nice to know why.

…ggle-spdk-dbg2

Features: control
Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
@daosbuild3
Copy link
Collaborator

@daosbuild3
Copy link
Collaborator

Test stage Fault injection testing on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17497/6/execution/node/984/log

@daosbuild3
Copy link
Collaborator

@daosbuild3
Copy link
Collaborator

Test stage Fault injection testing on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17497/7/execution/node/446/log

@daosbuild3
Copy link
Collaborator

Test stage Fault injection testing on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17497/8/execution/node/445/log

@daosbuild3
Copy link
Collaborator

@daosbuild3
Copy link
Collaborator

Test stage Fault injection testing on EL 8.8 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17497/9/execution/node/445/log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants