Skip to content

Commit

Permalink
Set config and enable dsa accel module offload. This feature is consi…
Browse files Browse the repository at this point in the history
…dered as experimental.

Signed-off-by: Alexander Indenbaum <[email protected]>
  • Loading branch information
Alexander Indenbaum committed Dec 16, 2024
1 parent bf83ae5 commit 399d88d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ SPDK_URL="https://spdk.io"

SPDK_PKGDEP_ARGS="--rbd"
# check spdk/configure --help
SPDK_CONFIGURE_ARGS="--with-rbd --disable-tests --disable-unit-tests --disable-examples --enable-debug"
SPDK_CONFIGURE_ARGS="--with-idxd --with-rbd --disable-tests --disable-unit-tests --disable-examples --enable-debug"
SPDK_TARGET_ARCH="x86-64-v2"
SPDK_MAKEFLAGS=
SPDK_CENTOS_BASE="https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/"
Expand Down
16 changes: 15 additions & 1 deletion control/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import spdk.rpc
import spdk.rpc.client as rpc_client
import spdk.rpc.nvmf as rpc_nvmf
import spdk.rpc.dsa as rpc_dsa

from .proto import gateway_pb2 as pb2
from .proto import gateway_pb2_grpc as pb2_grpc
Expand Down Expand Up @@ -475,7 +476,7 @@ def _start_spdk(self, omap_state):
self.logger.info(f"SPDK Socket: {self.spdk_rpc_socket_path}")
spdk_tgt_cmd_extra_args = self.config.get_with_default(
"spdk", "tgt_cmd_extra_args", "")
cmd = [spdk_tgt_path, "-u", "-r", self.spdk_rpc_socket_path]
cmd = [spdk_tgt_path, "--wait-for-rpc", "-u", "-r", self.spdk_rpc_socket_path]

# Add extra args from the conf file
if spdk_tgt_cmd_extra_args:
Expand Down Expand Up @@ -558,6 +559,9 @@ def _start_spdk(self, omap_state):
log_level=protocol_log_level,
conn_retries=conn_retries,
)
# Set config and enable dsa accel module offload.
self._probe_dsa()

except Exception:
self.logger.exception(f"Unable to initialize SPDK")
raise
Expand Down Expand Up @@ -653,6 +657,16 @@ def _stop_discovery(self):

self.discovery_pid = None

def _probe_dsa(self):
"""Initializes dsa accel module offload."""
try:
res = rpc_dsa.dsa_scan_accel_module(self.spdk_rpc_client)
spdk.rpc.framework_start_init(self.spdk_rpc_client)
except Exception:
self.logger.exception(f"Failed to probe dsa accel module offload")
raise
self.logger.debug(f"dsa_scan_accel_module: {res=}")

def _create_transport(self, trtype):
"""Initializes a transport type."""
args = {'trtype': trtype}
Expand Down

0 comments on commit 399d88d

Please sign in to comment.