From b7018326cc7453a42468cccd557d62a6da8a5a62 Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Fri, 13 Oct 2023 01:42:00 +0000 Subject: [PATCH] libublk: examples/test: pass USER_COPY for null targets Null target won't touch the request io buffer, so no need to let ublk driver handle the copy. Signed-off-by: Ming Lei --- examples/null.rs | 1 + examples/null_ll.rs | 2 +- tests/basic.rs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/null.rs b/examples/null.rs index 1b4aead..3341985 100644 --- a/examples/null.rs +++ b/examples/null.rs @@ -13,6 +13,7 @@ fn null_add(dev_id: i32, comp_batch: bool) { .nr_queues(2_u32) .id(dev_id) .dev_flags(dflags | UBLK_DEV_F_ADD_DEV) + .ctrl_flags(libublk::sys::UBLK_F_USER_COPY) .build() .unwrap(); diff --git a/examples/null_ll.rs b/examples/null_ll.rs index e1d294f..5915ab7 100644 --- a/examples/null_ll.rs +++ b/examples/null_ll.rs @@ -41,7 +41,7 @@ fn test_add(dev_id: i32) { nr_queues, 64, 512 << 10, - 0, + libublk::sys::UBLK_F_USER_COPY as u64, UBLK_DEV_F_ADD_DEV | dflags, ) .unwrap(); diff --git a/tests/basic.rs b/tests/basic.rs index ec4876d..05073b2 100644 --- a/tests/basic.rs +++ b/tests/basic.rs @@ -13,6 +13,7 @@ mod tests { .depth(64_u32) .nr_queues(2_u32) .dev_flags(dev_flags) + .ctrl_flags(libublk::sys::UBLK_F_USER_COPY) .build() .unwrap();