From ee1874e5ea614e7385f74b48f29f2fb00d22413e Mon Sep 17 00:00:00 2001 From: zhangshaoning Date: Tue, 25 Feb 2025 16:40:34 +0800 Subject: [PATCH] Add sw_64 support --- 0016-perftest-add-sw-support.patch | 34 ++++++++++++++++++++++++++++++ perftest.spec | 12 ++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 0016-perftest-add-sw-support.patch diff --git a/0016-perftest-add-sw-support.patch b/0016-perftest-add-sw-support.patch new file mode 100644 index 0000000..7e351e7 --- /dev/null +++ b/0016-perftest-add-sw-support.patch @@ -0,0 +1,34 @@ +From f3c8ce4a4b21f697eba0d6e6bb84dfe8b426539c Mon Sep 17 00:00:00 2001 +From: root +Date: Thu, 23 May 2024 17:53:52 +0800 +Subject: [PATCH] add sw support + +--- + src/get_clock.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/get_clock.h b/src/get_clock.h +index d308e23..6a37056 100644 +--- a/src/get_clock.h ++++ b/src/get_clock.h +@@ -114,6 +114,17 @@ static inline cycles_t get_cycles() + return perf_get_cycles(); + } + ++#elif defined(__sw_64__) ++ ++typedef unsigned long cycles_t; ++static inline cycles_t get_cycles() ++{ ++ cycles_t cval; ++ asm volatile("memb" : : : "memory"); ++ asm volatile("rtc %0" : "=r" (cval)); ++ return cval; ++} ++ + #elif defined(__loongarch64) + typedef unsigned long cycles_t; + static inline cycles_t get_cycles() +-- +2.33.0 + diff --git a/perftest.spec b/perftest.spec index a696767..891b889 100644 --- a/perftest.spec +++ b/perftest.spec @@ -1,6 +1,6 @@ Name: perftest Version: 4.5 -Release: 12 +Release: 13 License: GPLv2 or BSD Summary: RDMA Performance Testing Tools Url: https://github.com/linux-rdma/perftest @@ -21,10 +21,14 @@ Patch12: 0012-Perftest-Add-support-for-TD-lock-free-mode.patch Patch13: 0013-Perftest-Fix-TD-lock-free-mode-not-working-for-QP.patch Patch14: 0014-Perftest-Fix-failure-in-creating-cq-when-create-cq-e.patch Patch15: 0015-Perftest-modify-source_ip-to-bind_sounce_ip-to-fix-i.patch +Patch16: 0016-perftest-add-sw-support.patch BuildRequires: automake gcc libibverbs-devel >= 1.2.0 librdmacm-devel >= 1.0.21 libibumad-devel >= 1.3.10.2 BuildRequires: pciutils-devel libibverbs librdmacm libibumad BuildRequires: guile +%ifarch sw_64 +BuildRequires: rdma-core >= 50.0 +%endif Obsoletes: openib-perftest < 1.3 %description @@ -48,6 +52,12 @@ done %_bindir/* %changelog +* Tue Feb 25 2025 zhangshaoning - 4.5-13 +- Type: feature +- ID: NA +- SUG: NA +- DESC: Add sw_64 support + * Mon Jan 13 2025 Guofeng Yue - 4.5-12 - Type: bugfix - ID: NA -- Gitee