Skip to content

Commit 42bac97

Browse files
committed
mgr/cephadm/nvmeof: Add SPDK iobuf options field to NVMeOF configuration
Fixes https://tracker.ceph.com/issues/69554 Signed-off-by: Gil Bregman <[email protected]>
1 parent 0523e8e commit 42bac97

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/pybind/mgr/cephadm/services/nvmeof.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def prepare_create(self, daemon_spec: CephadmDaemonDeploySpec) -> CephadmDaemonD
4747

4848
# TODO: check if we can force jinja2 to generate dicts with double quotes instead of using json.dumps
4949
transport_tcp_options = json.dumps(spec.transport_tcp_options) if spec.transport_tcp_options else None
50+
iobuf_options = json.dumps(spec.iobuf_options) if spec.iobuf_options else None
5051
name = '{}.{}'.format(utils.name_to_config_section('nvmeof'), nvmeof_gw_id)
5152
rados_id = name[len('client.'):] if name.startswith('client.') else name
5253

@@ -67,6 +68,7 @@ def prepare_create(self, daemon_spec: CephadmDaemonDeploySpec) -> CephadmDaemonD
6768
'rpc_socket_dir': '/var/tmp/',
6869
'rpc_socket_name': 'spdk.sock',
6970
'transport_tcp_options': transport_tcp_options,
71+
'iobuf_options': iobuf_options,
7072
'rados_id': rados_id
7173
}
7274
gw_conf = self.mgr.template.render('services/nvmeof/ceph-nvmeof.conf.j2', context)

src/pybind/mgr/cephadm/templates/services/nvmeof/ceph-nvmeof.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ transport_tcp_options = {{ transport_tcp_options }}
8686
{% if spec.tgt_cmd_extra_args %}
8787
tgt_cmd_extra_args = {{ spec.tgt_cmd_extra_args }}
8888
{% endif %}
89+
{% if iobuf_options %}
90+
iobuf_options = {{ iobuf_options }}
91+
{% endif %}
8992

9093
[monitor]
9194
timeout = {{ spec.monitor_timeout }}

src/python-common/ceph/deployment/service_spec.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,7 @@ def __init__(self,
13841384
transport_tcp_options: Optional[Dict[str, int]] =
13851385
{"in_capsule_data_size": 8192, "max_io_qpairs_per_ctrlr": 7},
13861386
tgt_cmd_extra_args: Optional[str] = None,
1387+
iobuf_options: Optional[Dict[str, int]] = None,
13871388
discovery_addr: Optional[str] = None,
13881389
discovery_addr_map: Optional[Dict[str, str]] = None,
13891390
discovery_port: Optional[int] = None,
@@ -1520,6 +1521,8 @@ def __init__(self,
15201521
self.transport_tcp_options: Optional[Dict[str, int]] = transport_tcp_options
15211522
#: ``tgt_cmd_extra_args`` extra arguments for the nvmf_tgt process
15221523
self.tgt_cmd_extra_args = tgt_cmd_extra_args
1524+
#: List of extra arguments for SPDK iobuf in the form opt=value
1525+
self.iobuf_options: Optional[Dict[str, int]] = iobuf_options
15231526
#: ``discovery_addr`` address of the discovery service
15241527
self.discovery_addr = discovery_addr
15251528
#: ``discovery_addr_map`` per node address map of the discovery service

0 commit comments

Comments
 (0)