Commit 804a47ea authored by Valerii Hlushkov's avatar Valerii Hlushkov Committed by Tomasz Zawadzki
Browse files

accel/cuda: add new accel module for NVidia GPU devices



Current version allows offloading of xor/copy/fill operations.
It may be used for acceleration of xor ops for raid5f, etc.
Other accel ops to be implemented in the module later:
- Compare, crc32c, dif/dix, etc.
Use configure --with-cuda to enable the module.

Change-Id: Ic2b05ef9d5cb17ed96de01ef82b8aa0d3e03b67d
Signed-off-by: default avatarValerii Hlushkov <valerii.hlushkov@datacore.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26614


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
parent 0989165a
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -445,6 +445,7 @@ Example response:
    "accel_error_inject_error",
    "ioat_scan_accel_module",
    "dsa_scan_accel_module",
    "cuda_scan_accel_module",
    "dpdk_cryptodev_scan_accel_module",
    "dpdk_cryptodev_set_driver",
    "dpdk_cryptodev_get_driver",
@@ -2250,6 +2251,36 @@ Example response:
}
~~~

### cuda_scan_accel_module {#rpc_cuda_scan_accel_module}

Enable cuda accel module offload.

#### Parameters

{{ cuda_scan_accel_module_params }}

#### Example

Example request:

~~~json
{
  "jsonrpc": "2.0",
  "method": "cuda_scan_accel_module",
  "id": 1
}
~~~

Example response:

~~~json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": true
}
~~~

### dpdk_cryptodev_scan_accel_module {#rpc_dpdk_cryptodev_scan_accel_module}

Enable dpdk_cryptodev accel offload
+4 −0
Original line number Diff line number Diff line
@@ -116,6 +116,10 @@ ifeq ($(CONFIG_RDMA_PROV),mlx5_dv)
DEPDIRS-accel_mlx5 := accel thread log mlx5 rdma_utils util
endif

ifeq ($(CONFIG_CUDA),y)
DEPDIRS-accel_cuda := accel thread log jsonrpc rpc
endif

# module/env_dpdk
DEPDIRS-env_dpdk_rpc := $(JSON_LIBS)

+4 −0
Original line number Diff line number Diff line
@@ -105,6 +105,10 @@ ifeq ($(CONFIG_RDMA_PROV),mlx5_dv)
ACCEL_MODULES_LIST += accel_mlx5
endif

ifeq ($(CONFIG_CUDA),y)
ACCEL_MODULES_LIST += accel_cuda
endif

SCHEDULER_MODULES_LIST = scheduler_dynamic
ifeq (y,$(DPDK_POWER))
SCHEDULER_MODULES_LIST += env_dpdk scheduler_dpdk_governor scheduler_gscheduler
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ DIRS-$(CONFIG_DPDK_COMPRESSDEV) += dpdk_compressdev
DIRS-$(CONFIG_IDXD) += dsa
DIRS-$(CONFIG_IDXD) += iaa
DIRS-$(CONFIG_CRYPTO) += dpdk_cryptodev
DIRS-$(CONFIG_CUDA) += cuda
ifeq ($(CONFIG_RDMA_PROV),mlx5_dv)
DIRS-y += mlx5
endif
+23 −0
Original line number Diff line number Diff line
#  SPDX-License-Identifier: BSD-3-Clause
#  Copyright (C) 2015 Intel Corporation.
#  Copyright (c) 2025 StarWind Software, Inc.
#  All rights reserved.
#

SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

SO_VER := 6
SO_MINOR := 0

LIBNAME = accel_cuda
C_SRCS = accel_cuda.c accel_cuda_rpc.c cuda_utils.c
CU_SRCS = accel_cuda_kern.cu

# pass options to nvcc
CUDA_ARCH = 70
#CU_CFLAGS = -keep

SPDK_MAP_FILE = $(SPDK_ROOT_DIR)/mk/spdk_blank.map

include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk
Loading