Skip to content

Commit 6184f01

Browse files
mayastor-borsdsharma-dc
andcommitted
Merge #1923
1923: refactor(spdk/upgrade): accomodate spdk 25.05 changes in Mayastor r=tiagolobocastro a=dsharma-dc Co-authored-by: Diwakar Sharma <[email protected]>
2 parents 0e3cd94 + 0cb64e1 commit 6184f01

File tree

15 files changed

+82
-33
lines changed

15 files changed

+82
-33
lines changed

.github/workflows/unit-int.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ jobs:
7979
run: |
8080
echo "TEST_START_DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
8181
nix-shell --run "./scripts/grpc-test.sh"
82+
83+
- name: Create JS Report
84+
if: always()
85+
run: |
8286
mkdir -p ci-report/js
8387
for file in *-xunit-report.xml; do
8488
echo "<testsuites>" > "ci-report/js/$file"

io-engine-tests/src/error_bdev.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ pub fn create_error_bdev(error_device: &str, backing_device: &str) {
1313

1414
unsafe {
1515
// this allows us to create a bdev without its name being a uri
16-
retval = create_aio_bdev(cname.as_ptr(), filename.as_ptr(), 512, false, false)
16+
retval = create_aio_bdev(
17+
cname.as_ptr(),
18+
filename.as_ptr(),
19+
512,
20+
false,
21+
false,
22+
std::ptr::null_mut(),
23+
)
1724
};
1825
assert_eq!(retval, 0);
1926

io-engine/src/bdev/aio.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,16 @@ impl CreateDestroy for Aio {
116116

117117
let cname = CString::new(self.get_name()).unwrap();
118118

119-
let errno =
120-
unsafe { create_aio_bdev(cname.as_ptr(), cname.as_ptr(), self.blk_size, false, false) };
119+
let errno = unsafe {
120+
create_aio_bdev(
121+
cname.as_ptr(),
122+
cname.as_ptr(),
123+
self.blk_size,
124+
false,
125+
false,
126+
std::ptr::null_mut(),
127+
)
128+
};
121129

122130
if errno != 0 {
123131
let err = BdevError::CreateBdevFailed {

io-engine/src/bdev/malloc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ impl CreateDestroy for Malloc {
203203
md_interleave: false,
204204
dif_type: SPDK_DIF_DISABLE,
205205
dif_is_head_of_md: false,
206+
dif_pi_format: 0,
206207
};
207208

208209
create_malloc_disk(&mut bdev, &opts)

io-engine/src/bdev/nexus/nexus_bdev.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,9 +1339,10 @@ impl<'n> BdevOps for Nexus<'n> {
13391339

13401340
fn io_type_supported(&self, io_type: IoType) -> bool {
13411341
match io_type {
1342+
IoType::NvmeAdmin => false,
13421343
// we always assume the device supports read/write commands
13431344
// allow NVMe Admin as it is needed for local replicas
1344-
IoType::Read | IoType::Write | IoType::NvmeAdmin => true,
1345+
IoType::Read | IoType::Write => true,
13451346
IoType::Flush | IoType::Reset | IoType::Unmap | IoType::WriteZeros => {
13461347
let supported = self.io_is_supported(io_type);
13471348
if !supported {

io-engine/src/bdev/null_bdev.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,16 @@ impl CreateDestroy for Null {
156156
let uuid = spdk_rs::Uuid::generate().into_raw();
157157

158158
let cname = self.name.clone().into_cstring();
159-
let opts = spdk_rs::libspdk::spdk_null_bdev_opts {
160-
name: cname.as_ptr(),
161-
uuid: &uuid,
159+
let opts = spdk_rs::libspdk::null_bdev_opts {
160+
name: cname.into_raw(),
161+
uuid,
162162
num_blocks: self.num_blocks,
163163
block_size: self.blk_size,
164164
physical_block_size: 0,
165165
md_size: 0,
166-
md_interleave: false,
167166
dif_type: spdk_rs::libspdk::SPDK_DIF_DISABLE,
168167
dif_is_head_of_md: false,
168+
dif_pi_format: 0,
169169
};
170170

171171
let errno = unsafe {

io-engine/src/bdev/nvme.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use url::Url;
1212
use spdk_rs::{
1313
bdevs::bdev_nvme_delete_async,
1414
ffihelper::copy_str_with_null,
15-
libspdk::{bdev_nvme_create, spdk_nvme_transport_id},
15+
libspdk::{spdk_bdev_nvme_create, spdk_nvme_transport_id},
1616
};
1717

1818
use crate::{
@@ -80,7 +80,7 @@ impl CreateDestroy for NVMe {
8080
let (sender, receiver) = oneshot::channel::<ErrnoResult<()>>();
8181

8282
let errno = unsafe {
83-
bdev_nvme_create(
83+
spdk_bdev_nvme_create(
8484
&mut context.trid,
8585
cname.as_ptr(),
8686
&mut context.names[0],
@@ -89,7 +89,6 @@ impl CreateDestroy for NVMe {
8989
cb_arg(sender),
9090
std::ptr::null_mut(),
9191
std::ptr::null_mut(),
92-
false,
9392
)
9493
};
9594

io-engine/src/bdev/nvmf.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use spdk_rs::{
1414
bdevs::bdev_nvme_delete_async,
1515
ffihelper::copy_str_with_null,
1616
libspdk::{
17-
bdev_nvme_create, spdk_nvme_transport_id, SPDK_NVME_IO_FLAGS_PRCHK_GUARD,
17+
spdk_bdev_nvme_create, spdk_nvme_transport_id, SPDK_NVME_IO_FLAGS_PRCHK_GUARD,
1818
SPDK_NVME_IO_FLAGS_PRCHK_REFTAG, SPDK_NVME_TRANSPORT_TCP, SPDK_NVMF_ADRFAM_IPV4,
1919
},
2020
};
@@ -150,7 +150,7 @@ impl CreateDestroy for Nvmf {
150150
let (sender, receiver) = oneshot::channel::<ErrnoResult<usize>>();
151151

152152
let errno = unsafe {
153-
bdev_nvme_create(
153+
spdk_bdev_nvme_create(
154154
&mut context.trid,
155155
cname.as_ptr(),
156156
&mut context.names[0],
@@ -159,7 +159,6 @@ impl CreateDestroy for Nvmf {
159159
cb_arg(sender),
160160
std::ptr::null_mut(), // context.prchk_flags,
161161
std::ptr::null_mut(),
162-
false,
163162
)
164163
};
165164

io-engine/src/bdev/nvmx/controller_inner.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,12 @@ impl NvmeController<'_> {
363363
// Check Controller Fatal Status for non-admin commands only to avoid
364364
// endless command resubmission in case of disconnected qpair.
365365
if !qpair.is_null()
366-
&& spdk_ctrlr.check_cfs()
366+
// Commenting out CFS check for now as it blocks when there is a total communication loss
367+
// to the controller, where admin commands time out as well.
368+
// We started taking this path of IO qpair timeout after upstream commit:
369+
// https://github.com/spdk/spdk/commit/8f9167af6f87b3c95cbc32798c47129e382e981f
370+
//&& spdk_ctrlr.check_cfs()
371+
&& timeout_action != DeviceTimeoutAction::Ignore
367372
&& timeout_action != DeviceTimeoutAction::HotRemove
368373
{
369374
error!(

io-engine/src/lvs/lvs_store.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use spdk_rs::libspdk::{
1515
spdk_bs_total_data_cluster_count, spdk_lvol, spdk_lvol_opts, spdk_lvol_opts_init,
1616
spdk_lvol_store, spdk_lvs_grow_live, vbdev_get_lvol_store_by_name,
1717
vbdev_get_lvol_store_by_uuid, vbdev_get_lvs_bdev_by_lvs, vbdev_lvol_create_with_opts,
18-
vbdev_lvs_create, vbdev_lvs_create_with_uuid, vbdev_lvs_destruct, vbdev_lvs_import,
18+
vbdev_lvs_create_ext, vbdev_lvs_create_with_uuid, vbdev_lvs_destruct, vbdev_lvs_import,
1919
vbdev_lvs_unload, LVOL_CLEAR_WITH_NONE, LVOL_CLEAR_WITH_UNMAP, LVS_CLEAR_WITH_NONE,
2020
};
2121
use url::Url;
@@ -517,11 +517,12 @@ impl Lvs {
517517
// acceptable.
518518
LVS_CLEAR_WITH_NONE,
519519
mdp_ratio,
520+
0,
520521
Some(Self::lvs_cb),
521522
cb_arg(sender),
522523
)
523524
} else {
524-
vbdev_lvs_create(
525+
vbdev_lvs_create_ext(
525526
bdev_name.as_ptr(),
526527
pool_name.as_ptr(),
527528
cluster_size,
@@ -533,6 +534,7 @@ impl Lvs {
533534
// acceptable.
534535
LVS_CLEAR_WITH_NONE,
535536
mdp_ratio,
537+
0,
536538
Some(Self::lvs_cb),
537539
cb_arg(sender),
538540
)

0 commit comments

Comments
 (0)