Skip to content

Commit

Permalink
chore: add env variable to control max number of qpairs
Browse files Browse the repository at this point in the history
Added NVMF_TCP_MAX_QPAIRS_PER_CTRL (includes adminq) to control max number of qpairs per controller.

Why this may be useful? Example, if mayastor is configured with 2 cores but the hosts have 32 cores.
This may create an unbalanced configuration as mayastor will only use 2 IO qpairs to the replicas.

This is an initial approach that allows a user to easily configure how many qpairs the initiator
host may use.
  • Loading branch information
tiagolobocastro committed Feb 15, 2022
1 parent 2ffa931 commit f0ed436
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mayastor/src/bdev/nvmx/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ impl NvmeControllerIoChannel {

impl Drop for NvmeControllerIoChannel {
fn drop(&mut self) {
debug!("I/O channel {:p} dropped", self.0.as_ptr());
trace!("I/O channel {:p} dropped", self.0.as_ptr());
unsafe { spdk_put_io_channel(self.0.as_ptr()) }
}
}
5 changes: 4 additions & 1 deletion mayastor/src/subsys/config/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ impl Default for NvmfTcpTransportOpts {
in_capsule_data_size: 4096,
max_io_size: 131_072,
io_unit_size: 131_072,
max_qpairs_per_ctrl: 32,
max_qpairs_per_ctrl: try_from_env(
"NVMF_TCP_MAX_QPAIRS_PER_CTRL",
32,
),
num_shared_buf: try_from_env("NVMF_TCP_NUM_SHARED_BUF", 2048),
buf_cache_size: try_from_env("NVMF_TCP_BUF_CACHE_SIZE", 64),
dif_insert_or_strip: false,
Expand Down

0 comments on commit f0ed436

Please sign in to comment.