From: Gil Bregman Date: Mon, 27 Jul 2026 14:08:35 +0000 (+0300) Subject: mgr/cephadm: Add CNC fields to NVMEoF spec file X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=622feb2a72b3a803436c5995dfe4fbff510ba3ad;p=ceph.git mgr/cephadm: Add CNC fields to NVMEoF spec file Fixes: https://tracker-origin.ceph.com/issues/78675 Signed-off-by: Gil Bregman --- diff --git a/src/pybind/mgr/cephadm/templates/services/nvmeof/ceph-nvmeof.conf.j2 b/src/pybind/mgr/cephadm/templates/services/nvmeof/ceph-nvmeof.conf.j2 index 78e32864b1ba..75f8820ba4ba 100644 --- a/src/pybind/mgr/cephadm/templates/services/nvmeof/ceph-nvmeof.conf.j2 +++ b/src/pybind/mgr/cephadm/templates/services/nvmeof/ceph-nvmeof.conf.j2 @@ -135,6 +135,10 @@ iobuf_options = {{ iobuf_options }} {% endif %} qos_timeslice_in_usecs = {{ spec.qos_timeslice_in_usecs }} notifications_interval = {{ spec.notifications_interval }} +cnc_enable = {{ spec.cnc_enable }} +cnc_rate_limiter_bytes = {{ spec.cnc_rate_limiter_bytes }} +cnc_chunk_blocks = {{ spec.cnc_chunk_blocks }} +cnc_parallel_chunks = {{ spec.cnc_parallel_chunks }} [monitor] timeout = {{ spec.monitor_timeout }} diff --git a/src/pybind/mgr/cephadm/tests/services/test_nvmeof.py b/src/pybind/mgr/cephadm/tests/services/test_nvmeof.py index efbce7cee660..0220956e3abe 100644 --- a/src/pybind/mgr/cephadm/tests/services/test_nvmeof.py +++ b/src/pybind/mgr/cephadm/tests/services/test_nvmeof.py @@ -200,6 +200,10 @@ rbd_with_crc32c = True tgt_cmd_extra_args = {tgt_cmd_extra_args} qos_timeslice_in_usecs = 0 notifications_interval = 60 +cnc_enable = True +cnc_rate_limiter_bytes = 100000000 +cnc_chunk_blocks = 512 +cnc_parallel_chunks = 8 [monitor] timeout = 1.0\n""" @@ -451,6 +455,10 @@ rbd_with_crc32c = True tgt_cmd_extra_args = {tgt_cmd_extra_args} qos_timeslice_in_usecs = 0 notifications_interval = 60 +cnc_enable = True +cnc_rate_limiter_bytes = 100000000 +cnc_chunk_blocks = 512 +cnc_parallel_chunks = 8 [monitor] timeout = 1.0 @@ -644,6 +652,10 @@ rbd_with_crc32c = True tgt_cmd_extra_args = {tgt_cmd_extra_args} qos_timeslice_in_usecs = 0 notifications_interval = 60 +cnc_enable = True +cnc_rate_limiter_bytes = 100000000 +cnc_chunk_blocks = 512 +cnc_parallel_chunks = 8 [monitor] timeout = 1.0 diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index b123b9ced8c6..9f40a773106f 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -1931,6 +1931,10 @@ class NvmeofServiceSpec(ServiceSpec): iobuf_options: Optional[Dict[str, int]] = None, qos_timeslice_in_usecs: Optional[int] = 0, notifications_interval: Optional[int] = 60, + cnc_enable: bool = True, + cnc_rate_limiter_bytes: Optional[int] = 100000000, + cnc_chunk_blocks: Optional[int] = 512, + cnc_parallel_chunks: Optional[int] = 8, discovery_addr: Optional[str] = None, discovery_addr_map: Optional[Dict[str, str]] = None, discovery_port: Optional[int] = None, @@ -2140,6 +2144,14 @@ class NvmeofServiceSpec(ServiceSpec): self.qos_timeslice_in_usecs = qos_timeslice_in_usecs #: ``notifications_interval`` read SPDK notifications interval, in seconds self.notifications_interval = notifications_interval + #: ``cnc_enable`` enable CNC feature in SPDK + self.cnc_enable = cnc_enable + #: ``cnc_rate_limiter_bytes`` CNC rate limiter in bytes + self.cnc_rate_limiter_bytes = cnc_rate_limiter_bytes + #: ``cnc_chunk_blocks`` CNC chunk blocks + self.cnc_chunk_blocks = cnc_chunk_blocks + #: ``cnc_parallel_chunks`` CNC parallel chunk + self.cnc_parallel_chunks = cnc_parallel_chunks #: ``discovery_addr`` address of the discovery service self.discovery_addr = discovery_addr #: ``discovery_addr_map`` per node address map of the discovery service @@ -2263,6 +2275,10 @@ class NvmeofServiceSpec(ServiceSpec): self.verify_spdk_ceph_connection_allocation() verify_non_negative_int(self.qos_timeslice_in_usecs, "QOS timeslice") verify_non_negative_int(self.notifications_interval, "SPDK notifications interval") + verify_boolean(self.cnc_enable, "Enable CNC") + verify_non_negative_int(self.cnc_rate_limiter_bytes, "CNC rate limiter") + verify_non_negative_int(self.cnc_chunk_blocks, "CNC chunk blocks") + verify_non_negative_int(self.cnc_parallel_chunks, "CNC parallel chunks") verify_non_negative_number(self.spdk_ping_interval_in_seconds, "SPDK ping interval") if (