Add support for LOONGARCH
Signed-off-by: Xue Liu <liuxue@loongson.cn> (cherry picked from commit 4f97277029574b386291a8c9a87d479a147d179e)
This commit is contained in:
parent
9a6726d90d
commit
60127170d4
41
0017-barrier-LOONGARCH-memory-barriers.patch
Normal file
41
0017-barrier-LOONGARCH-memory-barriers.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From 2d686707df37b8752f31684db16b689637ba141d Mon Sep 17 00:00:00 2001
|
||||
From: Xue Liu <liuxue@loongson.cn>
|
||||
Date: Thu, 1 Dec 2022 18:37:21 +0800
|
||||
Subject: [PATCH 1/3] barrier: LOONGARCH memory barriers
|
||||
|
||||
Implement memory barrier for LOONGARCH platforms.
|
||||
|
||||
Change-Id: I44f5e63e6eb3f8bf98e965a22fb86f94e727061d
|
||||
Signed-off-by: Xue Liu <liuxue@loongson.cn>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16082
|
||||
Community-CI: Mellanox Build Bot
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
---
|
||||
include/spdk/barrier.h | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/include/spdk/barrier.h b/include/spdk/barrier.h
|
||||
index acae360..1ee7240 100644
|
||||
--- a/include/spdk/barrier.h
|
||||
+++ b/include/spdk/barrier.h
|
||||
@@ -97,6 +97,15 @@ extern "C" {
|
||||
#define _spdk_smp_mb() __asm volatile("lock addl $0, -128(%%esp); " ::: "memory");
|
||||
#endif
|
||||
|
||||
+#elif defined(__loongarch__)
|
||||
+
|
||||
+#define _spdk_rmb() __asm volatile("dbar 0" ::: "memory")
|
||||
+#define _spdk_wmb() __asm volatile("dbar 0" ::: "memory")
|
||||
+#define _spdk_mb() __asm volatile("dbar 0" ::: "memory")
|
||||
+#define _spdk_smp_rmb() __asm volatile("dbar 0" ::: "memory")
|
||||
+#define _spdk_smp_wmb() __asm volatile("dbar 0" ::: "memory")
|
||||
+#define _spdk_smp_mb() __asm volatile("dbar 0" ::: "memory")
|
||||
+
|
||||
#else
|
||||
|
||||
#define _spdk_rmb()
|
||||
--
|
||||
2.20.1
|
||||
|
||||
34
0018-nvme-pcie-add-memory-barrier-for-LOONGARCH.patch
Normal file
34
0018-nvme-pcie-add-memory-barrier-for-LOONGARCH.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From e9a94122b8704411b79157b25c4d07580246be6c Mon Sep 17 00:00:00 2001
|
||||
From: Xue Liu <liuxue@loongson.cn>
|
||||
Date: Thu, 1 Dec 2022 18:38:57 +0800
|
||||
Subject: [PATCH 2/3] nvme/pcie: add memory barrier for LOONGARCH
|
||||
|
||||
Add memory barrier for LOONGARCH in nvme_pcie_qpair_process_completions.
|
||||
|
||||
Signed-off-by: Xue Liu <liuxue@loongson.cn>
|
||||
Change-Id: Icc992ef612a00dd18ff33f70ab8f54e8c5d5c5b7
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16083
|
||||
Community-CI: Mellanox Build Bot
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
---
|
||||
lib/nvme/nvme_pcie_common.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/nvme/nvme_pcie_common.c b/lib/nvme/nvme_pcie_common.c
|
||||
index 0ef56cb..5fb6304 100644
|
||||
--- a/lib/nvme/nvme_pcie_common.c
|
||||
+++ b/lib/nvme/nvme_pcie_common.c
|
||||
@@ -801,7 +801,7 @@ nvme_pcie_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_
|
||||
__builtin_prefetch(&pqpair->tr[next_cpl->cid]);
|
||||
}
|
||||
|
||||
-#ifdef __PPC64__
|
||||
+#if defined(__PPC64__) || defined(__loongarch__)
|
||||
/*
|
||||
* This memory barrier prevents reordering of:
|
||||
* - load after store from/to tr
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
From d7484395ac0fd85c91365beb4af00c6e5ea39ee6 Mon Sep 17 00:00:00 2001
|
||||
From: Xue Liu <liuxue@loongson.cn>
|
||||
Date: Thu, 1 Dec 2022 18:39:44 +0800
|
||||
Subject: [PATCH 3/3] build: Specify the target build architecture for
|
||||
LOONGARCH.
|
||||
|
||||
More information about LoongArch:
|
||||
- https://loongson.github.io/LoongArch-Documentation/README-EN.html
|
||||
|
||||
Signed-off-by: Xue Liu <liuxue@loongson.cn>
|
||||
Change-Id: I24852e31b5fadef3578354da2d26252014330e83
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16084
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
---
|
||||
mk/spdk.common.mk | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk
|
||||
index 8569687..1326f83 100644
|
||||
--- a/mk/spdk.common.mk
|
||||
+++ b/mk/spdk.common.mk
|
||||
@@ -80,6 +80,9 @@ COMMON_CFLAGS += -mcpu=$(TARGET_ARCHITECTURE)
|
||||
else ifeq ($(TARGET_MACHINE),aarch64)
|
||||
COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
|
||||
COMMON_CFLAGS += -DPAGE_SIZE=$(shell getconf PAGESIZE)
|
||||
+else ifneq ($(filter loongarch%,$(TARGET_MACHINE)),)
|
||||
+COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
|
||||
+COMMON_CFLAGS += -DPAGE_SIZE=$(shell getconf PAGESIZE)
|
||||
else
|
||||
COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
|
||||
endif
|
||||
--
|
||||
2.20.1
|
||||
|
||||
10
spdk.spec
10
spdk.spec
@ -3,7 +3,7 @@
|
||||
|
||||
Name: spdk
|
||||
Version: 21.01.1
|
||||
Release: 6
|
||||
Release: 7
|
||||
Summary: Set of libraries and utilities for high performance user-mode storage
|
||||
License: BSD and MIT
|
||||
URL: http://spdk.io
|
||||
@ -24,6 +24,9 @@ Patch13: 0013-lib-vhost-Fix-compilation-with-dpdk-21.11.patch
|
||||
Patch14: 0014-mk-Fix-debug-build-error-on-ARM-ThunderX2-and-neoverse_N1_platform.patch
|
||||
Patch15: 0015-configure-add-gcc-version-check-for-ARM-Neoverse-N1_platform.patch
|
||||
Patch16: 0016-Enhance-security-for-share-library.patch
|
||||
Patch17: 0017-barrier-LOONGARCH-memory-barriers.patch
|
||||
Patch18: 0018-nvme-pcie-add-memory-barrier-for-LOONGARCH.patch
|
||||
Patch19: 0019-build-Specify-the-target-build-architecture-for-LOON.patch
|
||||
|
||||
%define package_version %{version}-%{release}
|
||||
|
||||
@ -38,7 +41,7 @@ Patch16: 0016-Enhance-security-for-share-library.patch
|
||||
%define use_python2 0
|
||||
%endif
|
||||
|
||||
ExclusiveArch: x86_64 aarch64
|
||||
ExclusiveArch: x86_64 aarch64 loongarch64
|
||||
|
||||
BuildRequires: gcc gcc-c++ make
|
||||
BuildRequires: dpdk-devel, numactl-devel, ncurses-devel
|
||||
@ -194,6 +197,9 @@ mv doc/output/html/ %{install_docdir}
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Jul 4 2023 Xue Liu <liuxue@loongson.cn> - 21.01.1-7
|
||||
- Add support for LOONGARCH.
|
||||
|
||||
* Sat Nov 5 2022 Weifeng Su <suweifeng1@huawei.com> - 21.01.1-6
|
||||
- Enable unittest
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user