]> git.apps.os.sepia.ceph.com Git - ceph.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)
committerDavid Galloway <david.galloway@ibm.com>
Mon, 8 Sep 2025 18:27:23 +0000 (14:27 -0400)
Tracker: https://tracker.ceph.com/issues/72508

Signed-off-by: Alexander Indenbaum <aindenba@redhat.com>
(cherry picked from commit 93ec459ab784b8a3818a9ca50d67f1e9f8a497b7)
(cherry picked from commit 4874792bc7748cfb944c255af45888f9e85777fa)

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 bf1bc5d7bd2ff2dee4a1532e81264a7218e7e07c..443ed5126e3cf29f95aef54444a215813c94162a 100644 (file)
@@ -432,7 +432,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
@@ -472,8 +472,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 ec401c7e8d83523256fc6a5f20a1ee5ee8bc599e..f3e4d05728168962b377e76637f0c5b778b20e81 100644 (file)
@@ -1433,7 +1433,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,