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 63f9370
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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
13 changes: 13 additions & 0 deletions 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 @@ -568,6 +569,9 @@ def _start_spdk(self, omap_state):
for trtype in spdk_transports.split():
self._create_transport(trtype.lower())

# Set config and enable dsa accel module offload.
self._probe_dsa()

try:
return_version = spdk.rpc.spdk_get_version(self.spdk_rpc_client)
try:
Expand Down Expand Up @@ -653,6 +657,15 @@ 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)
except Exception:
self.logger.exception(f"Failed to probe dsa accel module offload: {res=}")
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 63f9370

Please sign in to comment.