-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DAOS-17207 daos: upgrade to SPDK 24.09 #16013
base: master
Are you sure you want to change the base?
Changes from all commits
08c9a40
6cda205
d5bf1b4
5a8186a
651a8cd
d878b6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/** | ||
* (C) Copyright 2018-2024 Intel Corporation. | ||
* (C) Copyright 2025 Google LLC | ||
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause-Patent | ||
|
@@ -21,6 +22,7 @@ | |
#include <spdk/blob_bdev.h> | ||
#include <spdk/blob.h> | ||
#include <spdk/rpc.h> | ||
#include <spdk/file.h> | ||
#include <spdk/env_dpdk.h> | ||
#include "bio_internal.h" | ||
#include <daos_srv/smd.h> | ||
|
@@ -154,6 +156,7 @@ bio_spdk_env_init(void) | |
/* Only print error and more severe to stderr. */ | ||
spdk_log_set_print_level(SPDK_LOG_ERROR); | ||
|
||
opts.opts_size = sizeof(opts); | ||
spdk_env_opts_init(&opts); | ||
opts.name = "daos_engine"; | ||
opts.env_context = (char *)dpdk_cli_override_opts; | ||
|
@@ -484,10 +487,29 @@ common_init_cb(void *arg, int rc) | |
cp_arg->cca_rc = daos_errno2der(-rc); | ||
} | ||
|
||
struct subsystem_init_arg { | ||
struct common_cp_arg *cp_arg; | ||
void *json_data; | ||
size_t json_data_size; | ||
}; | ||
|
||
static void | ||
subsys_init_cb(int rc, void *arg) | ||
{ | ||
struct subsystem_init_arg *init_arg = arg; | ||
|
||
if (init_arg->json_data != NULL) { | ||
free(init_arg->json_data); | ||
init_arg->json_data = NULL; | ||
} | ||
|
||
if (rc) | ||
D_ERROR("subsystem init failed: %d\n", rc); | ||
|
||
init_arg->cp_arg->cca_rc = rc; | ||
common_init_cb(arg, rc); | ||
|
||
return; | ||
} | ||
|
||
static void | ||
|
@@ -1554,6 +1576,57 @@ bio_xsctxt_free(struct bio_xs_context *ctxt) | |
D_FREE(ctxt); | ||
} | ||
|
||
static void | ||
subsystem_init_cb(int rc, void *arg) | ||
{ | ||
struct subsystem_init_arg *init_arg; | ||
|
||
if (rc) { | ||
subsys_init_cb(rc, arg); | ||
return; | ||
} | ||
|
||
init_arg = arg; | ||
|
||
/* Set RUNTIME state and load config again for RUNTIME methods */ | ||
spdk_rpc_set_state(SPDK_RPC_RUNTIME); | ||
spdk_subsystem_load_config(init_arg->json_data, (ssize_t)init_arg->json_data_size, | ||
subsys_init_cb, init_arg, true); | ||
} | ||
|
||
static void | ||
load_config_cb(int rc, void *arg) | ||
{ | ||
if (rc) { | ||
subsys_init_cb(rc, arg); | ||
return; | ||
} | ||
|
||
/* init subsystem */ | ||
spdk_subsystem_init(subsystem_init_cb, arg); | ||
} | ||
|
||
static int | ||
bio_xsctxt_init_by_config(struct common_cp_arg *cp_arg) | ||
{ | ||
struct subsystem_init_arg init_arg; | ||
void *json_data; | ||
size_t json_data_size; | ||
|
||
json_data = spdk_posix_file_load_from_name(nvme_glb.bd_nvme_conf, &json_data_size); | ||
if (json_data == NULL) { | ||
D_ERROR("failed to load nvme conf %s\n", nvme_glb.bd_nvme_conf); | ||
return -DER_NOMEM; | ||
} | ||
|
||
init_arg.cp_arg = cp_arg; | ||
init_arg.json_data = json_data; | ||
init_arg.json_data_size = json_data_size; | ||
spdk_subsystem_load_config(json_data, (ssize_t)json_data_size, load_config_cb, &init_arg, | ||
true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if I follow this, can't we call spdk_subsystem_init() directly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, the RPC state has to be set to RUN_TIME, then you can run those aio_create cmd in the config jason file. So the first load_config() is to running those methods bdev_aio_create(), then set the RPC state as RUN_TIME explicitly, then do second load_config(). In the previous version(22.01), you can do that in a single API, but they remove that in the current version, which make the process a bit strange indeed. "subsystems": [ |
||
return 0; | ||
} | ||
|
||
int | ||
bio_xsctxt_alloc(struct bio_xs_context **pctxt, int tgt_id, bool self_polling) | ||
{ | ||
|
@@ -1617,13 +1690,14 @@ bio_xsctxt_alloc(struct bio_xs_context **pctxt, int tgt_id, bool self_polling) | |
|
||
/* Initialize all registered subsystems: bdev, vmd, copy. */ | ||
common_prep_arg(&cp_arg); | ||
spdk_subsystem_init_from_json_config(nvme_glb.bd_nvme_conf, | ||
SPDK_DEFAULT_RPC_ADDR, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will the same default RPC address be used with these changes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
subsys_init_cb, &cp_arg, | ||
true); | ||
rc = bio_xsctxt_init_by_config(&cp_arg); | ||
if (rc != 0) { | ||
D_ERROR("failed to load nvme conf %s\n", nvme_glb.bd_nvme_conf); | ||
goto out; | ||
} | ||
|
||
rc = xs_poll_completion(ctxt, &cp_arg.cca_inflights, 0); | ||
D_ASSERT(rc == 0); | ||
|
||
if (cp_arg.cca_rc != 0) { | ||
rc = cp_arg.cca_rc; | ||
D_ERROR("failed to init bdevs, rc:%d\n", rc); | ||
|
@@ -1648,7 +1722,7 @@ bio_xsctxt_alloc(struct bio_xs_context **pctxt, int tgt_id, bool self_polling) | |
if ((!nvme_glb.bd_rpc_srv_addr) || (strlen(nvme_glb.bd_rpc_srv_addr) == 0)) | ||
nvme_glb.bd_rpc_srv_addr = SPDK_DEFAULT_RPC_ADDR; | ||
|
||
rc = spdk_rpc_initialize(nvme_glb.bd_rpc_srv_addr); | ||
rc = spdk_rpc_initialize(nvme_glb.bd_rpc_srv_addr, NULL); | ||
if (rc != 0) { | ||
D_ERROR("failed to start SPDK JSON-RPC server at %s, "DF_RC"\n", | ||
nvme_glb.bd_rpc_srv_addr, DP_RC(daos_errno2der(-rc))); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ fused=v1.0.0 | |
pmdk=2.1.0 | ||
isal=v2.30.0 | ||
isal_crypto=v2.23.0 | ||
spdk=v22.01.2 | ||
spdk=v24.09 | ||
ofi=v1.22.0 | ||
mercury=v2.4.0 | ||
protobufc=v1.3.3 | ||
|
@@ -26,7 +26,6 @@ protobufc=https://github.com/protobuf-c/protobuf-c.git | |
ucx=https://github.com/openucx/ucx.git | ||
|
||
[patch_versions] | ||
spdk=https://github.com/spdk/spdk/commit/b0aba3fcd5aceceea530a702922153bc75664978.diff,https://github.com/spdk/spdk/commit/445a4c808badbad3942696ecf16fa60e8129a747.diff | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are we sure both of these commits are in v24.09? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, I checked. |
||
mercury=https://raw.githubusercontent.com/daos-stack/mercury/f3dc286fb40ec1a3a38a2e17c45497bc2aa6290d/na_ucx.patch,https://raw.githubusercontent.com/daos-stack/mercury/48df263212604336b2dbe0430dcab4482eb43437/na_ucx_ep_flush.patch | ||
pmdk=https://github.com/pmem/pmdk/commit/2abe15ac0b4eed894b6768cd82a3b0a7c4336284.diff | ||
argobots=https://github.com/pmodels/argobots/pull/397/commits/411e5b344642ebc82190fd8b125db512e5b449d1.diff,https://github.com/pmodels/argobots/commit/bb0c908abfac4bfe37852eee621930634183c6aa.diff |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,4 +64,5 @@ dnf --nodocs install \ | |
sudo \ | ||
valgrind-devel \ | ||
which \ | ||
ncurses-devel \ | ||
yasm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove perf and identify apps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perf and identify has been moved under app, since I remove --disable-apps, they should be included.