Skip to content

Commit

Permalink
libublk: examples/test: pass USER_COPY for null targets
Browse files Browse the repository at this point in the history
Null target won't touch the request io buffer, so no need to
let ublk driver handle the copy.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
  • Loading branch information
ming1 committed Oct 13, 2023
1 parent 7186877 commit b701832
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion examples/null_ll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit b701832

Please sign in to comment.