]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
nvmeof: create /dev/dsa if DSA acceleration is enabled and the device doesn't exist
authorAlexander Indenbaum <aindenba@redhat.com>
Thu, 31 Jul 2025 15:33:36 +0000 (18:33 +0300)
committerAlexander Indenbaum <aindenba@redhat.com>
Sun, 10 Aug 2025 02:35:10 +0000 (05:35 +0300)
Signed-off-by: Alexander Indenbaum <aindenba@redhat.com>
src/cephadm/cephadmlib/daemons/nvmeof.py
src/pybind/mgr/cephadm/tests/test_services.py
src/python-common/ceph/deployment/service_spec.py

index db337a2be9816254e5f3282fa30f6ee1ad9d03ce..761211087c82b5d8e400df860d7689eee4628e69 100644 (file)
@@ -202,6 +202,21 @@ class CephNvmeof(ContainerDaemonForm):
         # populate files from the config-json
         populate_files(data_dir, self.files, uid, gid)
 
+        # create /dev/dsa if DSA acceleration is enabled and the device doesn't exist
+        if (
+            'enable_dsa_acceleration' in self.files
+            and self.files['enable_dsa_acceleration'] == 'True'
+        ):
+            if not os.path.exists('/dev/dsa'):
+                try:
+                    # create a /dev/dsa as a directory to avoid podman start failure
+                    os.mkdir('/dev/dsa', mode=0o755)
+                    logger.info(
+                        'Created /dev/dsa directory, device file was not found'
+                    )
+                except Exception:
+                    logger.exception('Failed to create /dev/dsa')
+
     @staticmethod
     def configfs_mount_umount(data_dir, mount=True):
         # type: (str, bool) -> List[str]
index f7cd18b5398fba58c1bd8223c3639f7cdd5ffda2..6185907ab455a94d22eb674339fe348fd004760f 100644 (file)
@@ -433,7 +433,7 @@ protocol_log_level = WARNING
 conn_retries = 10
 transports = tcp
 transport_tcp_options = {{"in_capsule_data_size": 8192, "max_io_qpairs_per_ctrlr": 7}}
-enable_dsa_acceleration = True
+enable_dsa_acceleration = False
 tgt_cmd_extra_args = {tgt_cmd_extra_args}
 qos_timeslice_in_usecs = 0
 notifications_interval = 60
@@ -473,8 +473,7 @@ timeout = 1.0\n"""
                             "config": "",
                             "keyring": "[client.nvmeof.testpool.mygroup.test.qwert]\nkey = None\n",
                             "files": {
-                                "ceph-nvmeof.conf": nvmeof_gateway_conf,
-                                "enable_dsa_acceleration": "True"
+                                "ceph-nvmeof.conf": nvmeof_gateway_conf
                             }
                         }
                     }),
index ed38cbd5017ef3920534bd0423627f092c0eeb3b..d5dc60a72b86fdaf342c4f33f309a6fa0e4020c3 100644 (file)
@@ -1464,7 +1464,7 @@ class NvmeofServiceSpec(ServiceSpec):
                  transports: Optional[str] = 'tcp',
                  transport_tcp_options: Optional[Dict[str, int]] =
                  {"in_capsule_data_size": 8192, "max_io_qpairs_per_ctrlr": 7},
-                 enable_dsa_acceleration: bool = True,
+                 enable_dsa_acceleration: bool = False,
                  tgt_cmd_extra_args: Optional[str] = None,
                  iobuf_options: Optional[Dict[str, int]] = None,
                  qos_timeslice_in_usecs: Optional[int] = 0,