diff --git a/README.ch.md b/README.ch.md new file mode 100644 index 0000000000000000000000000000000000000000..3c13f0a5735fd6427424daa344462b55ed4bcbb6 --- /dev/null +++ b/README.ch.md @@ -0,0 +1,102 @@ +# UMDK +#### 一、UMDK介绍 +灵衢内存语义开发包(UMDK)是一套以内存语义为核心的分布式通信软件库。 +为数据中心网络、超节点内、服务器内的卡与卡之间提供高性能的通信接口,使能和释放灵衢总线的硬件能力。 +![UMDK组件图](./doc/images/UMDK_component_image.ch.png) + +#### 二、组件介绍 +1. URMA +UB通信基础库,提供了单边、双边、原子操作等远端内存操作方式,是应用之间通信的基础。 +提供两类接口,一是北向应用编程接口,为应用提供通信API,二是南向驱动编程接口,为驱动开发者提供接入UMDK的API。 + +2. URPC +统一远程过程调用,支持灵衢原生高性能主机间和设备间RPC通信,以及RPC加速。 + +3. ULOCK + 统一状态同步,支持灵衢原生高性能状态同步,包含分布式锁DLock等,加速数据库等分布式应用全局资源分配。 + +4. USOCK + UB通信生态构建,兼容标准Socket编程接口,使能TCP应用零修改提升网络通信性能。 + +#### 三、编译运行 +1. 编译环境要求 +- 编译环境:kernel 6.6 +- 同时你需要安装以下依赖包: + +```bash + yum install -y rpm-build + yum install -y make + yum install -y cmake + yum install -y gcc + yum install -y gcc-c++ + yum install -y glibc-devel + yum install -y openssl-devel + yum install -y glib2-devel + yum install -y libnl3-devel + yum install -y kernel-devel # ubcore is necessary from openEuler kernel +``` + +2. 编译指导 +- 您可以通过以下方式构建和安装umdk rpm包: + +```bash + mkdir -p /root/rpmbuild/SOURCES/ + tar -czf /root/rpmbuild/SOURCES/umdk-25.12.0.tar.gz --exclude=.git `ls -A` + rpmbuild -ba umdk.spec +``` + +- RPM 编译选项 +```bash + $ --with asan option, i.e. disable asan by default + $ --with test option, i.e. disable test by default + $ --with urma option, i.e. disable urma by default + $ --with urpc option, i.e. disable urpc by default + $ --with dlock option, i.e. disable dlock by default + $ --with ums option, i.e. disable ums by default + $ --define 'kernel_version 6.6.92' option, specify kernel version + $ --define 'rpm_release 0' option, specify release version +``` + +3. 部署指导 +- 运行时依赖请检查前置驱动已加载,如未加载请手动加载 +```bash +cd /lib/modules/$(uname -r)/kernel/drivers +insmod ub/ubfi/ubfi.ko.xz cluster=1 # 使用vf网卡时需要将cluster=1参数去除 +insmod iommu/ummu-core/ummu-core.ko.xz +cd /lib/modules/$(uname -r)/kernel/drivers/ub/hisi-ub/kernelspace +insmod ummu/drivers/ummu.ko.xz ipver=609 +insmod ubus/ubus.ko.xz ipver=609 cc_en=0 um_entry_size=1 +insmod ubus/vendor/hisi/hisi_ubus.ko.xz msg_wait=2000 fe_msg=1 um_entry_size1=0 cfg_entry_offset=512 +insmod ubase/ubase.ko.xz +insmod unic/unic.ko.xz tx_timeout_reset_bypass=1 +insmod cdma/cdma.ko.xz + +``` +- 安装rpm包 +```bash +rpm -ivh /root/rpmbuild/RPMS/*/umdk*.rpm +cp -f /usr/bin/urma_perftest /usr/local/bin/ +modprobe ubcore +modprobe uburma +cd /lib/modules/$(uname -r)/kernel/drivers +insmod ub/hisi-ub/kernelspace/udma/udma.ko.xz dfx_switch=1 ipver=609 fast_destroy_tp=0 jfc_arm_mode=2 +modprobe ubagg #如果需要使能多路径 +modprobe ums # 如果需要使能ums +``` +- 添加权限 +```bash +#如果没有权限,需要手动添加权限 +chmod -R 777 /usr/lib64/urma +chmod 777 /dev/ummu/tid +chmod 755 /usr/lib64/liburma* +``` + +#### 四、参与贡献 + +我们非常欢迎开发者提交贡献, 如果您发现了一个bug或者有一些想法想要交流,欢迎[发邮件到dev列表](https://openeuler.org/zh/community/mailing-list) 或者[提交一个issue](https://gitee.com/openeuler/umdk/issues) 。 + +#### 五、许可 + +代码使用的许可证详见[LICENSES](./LICENSES/README) + +doc目录下的文档使用许可证详见[LICENSE](./doc/LICENSE) \ No newline at end of file diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 69fa29ff36f60846882f05d87d26d32e8e1e7d6b..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# umdk - -#### Description -The Unified Memory Development Kit(UMDK) is a set of distributed communication software stack with memory semantics as the core. It aims to design a new-generation network architecture through software-hardware collaboration, subvert the traditional communication form, and build a computing native network centered on memory semantic interconnection. - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 5c65e690aca03a632b83fd3c56066b3147877e6a..fd0a0a8db5a8545b01d0d26eaaef63eac4abc62b 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,101 @@ -# umdk +# UMDK +#### 1. UMDK Introduction +Lingqu UnifiedBus Memory Development Kit (UMDK) is a distributed communication software library centered around memory semantics. It provides high-performance communication interfaces for data center networks, within super nodes, and between cards inside servers, enabling and unleashing the hardware capabilities of the Lingqu bus. +![UMDK Component Diagram](./doc/images/UMDK_component_image.png) -#### 介绍 -The Unified Memory Development Kit(UMDK) is a set of distributed communication software stack with memory semantics as the core. It aims to design a new-generation network architecture through software-hardware collaboration, subvert the traditional communication form, and build a computing native network centered on memory semantic interconnection. +#### 2. Component Introduction +1. URMA +The UB Communication Foundation Library provides remote memory operation methods such as unilateral, bilateral, and atomic operations, serving as the foundation for communication between applications. +It offers two types of interfaces: one is the northbound application programming interface, which provides communication APIs for applications, and the other is the southbound driver programming interface, which offers APIs for driver developers to access the UMDK. -#### 软件架构 -软件架构说明 +2. URPC + Unified Remote Procedure Call, supporting Lingqu-native high-performance RPC communication between hosts and devices, as well as RPC acceleration. +3. ULOCK + State unification synchronization, featuring native Lingqu high-performance state synchronization with distributed lock support, accelerates global resource allocation for distributed applications such as databases. -#### 安装教程 +4. USOCK + Building the UB communication ecosystem: Compatible with standard socket API, enabling TCP applications to enhance network communication performance with zero modifications. -1. xxxx -2. xxxx -3. xxxx +#### 3. Build and install +1. Build Environment Requirements +- Kernel version:kernel 6.6 +- You also need to install the following dependency packages: -#### 使用说明 +```bash + yum install -y rpm-build + yum install -y make + yum install -y cmake + yum install -y gcc + yum install -y gcc-c++ + yum install -y glibc-devel + yum install -y openssl-devel + yum install -y glib2-devel + yum install -y libnl3-devel + yum install -y kernel-devel # ubcore is necessary from openEuler kernel +``` -1. xxxx -2. xxxx -3. xxxx +2. Build Instructions +- You can build and install the UMDK RPM package using the following methods: -#### 参与贡献 +```bash + mkdir -p /root/rpmbuild/SOURCES/ + tar -czf /root/rpmbuild/SOURCES/umdk-25.12.0.tar.gz --exclude=.git `ls -A` + rpmbuild -ba umdk.spec +``` -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +- RPM build options +```bash + $ --with asan option, i.e. disable asan by default + $ --with test option, i.e. disable test by default + $ --with urma option, i.e. disable urma by default + $ --with urpc option, i.e. disable urpc by default + $ --with dlock option, i.e. disable dlock by default + $ --with ums option, i.e. disable ums by default + $ --define 'kernel_version 6.6.92' option, specify kernel version + $ --define 'rpm_release 0' option, specify release version +``` +3. Install Instructions +- Runtime Dependencies: Ensure that prerequisite drivers are loaded. If not, please load them manually +```bash +cd /lib/modules/$(uname -r)/kernel/drivers +insmod ub/ubfi/ubfi.ko.xz cluster=1 # When using a VF network device, it is necessary to remove the cluster=1 parameter. +insmod iommu/ummu-core/ummu-core.ko.xz +cd /lib/modules/$(uname -r)/kernel/drivers/ub/hisi-ub/kernelspace +insmod ummu/drivers/ummu.ko.xz ipver=609 +insmod ubus/ubus.ko.xz ipver=609 cc_en=0 um_entry_size=1 +insmod ubus/vendor/hisi/hisi_ubus.ko.xz msg_wait=2000 fe_msg=1 um_entry_size1=0 cfg_entry_offset=512 +insmod ubase/ubase.ko.xz +insmod unic/unic.ko.xz tx_timeout_reset_bypass=1 +insmod cdma/cdma.ko.xz -#### 特技 +``` +- Install the RPM package +```bash +rpm -ivh /root/rpmbuild/RPMS/*/umdk*.rpm +cp -f /usr/bin/urma_perftest /usr/local/bin/ +modprobe ubcore +modprobe uburma +cd /lib/modules/$(uname -r)/kernel/drivers +insmod ub/hisi-ub/kernelspace/udma/udma.ko.xz dfx_switch=1 ipver=609 fast_destroy_tp=0 jfc_arm_mode=2 +modprobe ubagg # If multi-path support is required +modprobe ums # if ums is required +``` +- Add permissions +```bash +# If you do not have the required permissions, you need to add them manually. +chmod -R 777 /usr/lib64/urma +chmod 777 /dev/ummu/tid +chmod 755 /usr/lib64/liburma* +``` -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +#### 4. Contributing + +We warmly welcome contributions from developers. If you have discovered a bug or would like to discuss ideas, please feel free to [send an email to the development mailing list](https://openeuler.org/zh/community/mailing-list) or [submit an issue](https://gitee.com/openeuler/umdk/issues) 。 + +#### 5. LICENSES + +The license for code, please refer to [LICENSES](./LICENSES/README) + +The license for documents in doc directory, please refer to [LICENSE](./doc/LICENSE) diff --git a/RELEASE-NOTES.ch.md b/RELEASE-NOTES.ch.md new file mode 100644 index 0000000000000000000000000000000000000000..c3e791415bd3de0fff902b241c6734faaa79187b --- /dev/null +++ b/RELEASE-NOTES.ch.md @@ -0,0 +1,68 @@ +Release Notes +=================== +Version +------------ +* v25.12.0 - 2025/12/30 +New Features +------------ +* URMA + * 聚合设备特性 + (1) jetty多路径模式:使用CTP传输通道,传输模式分为RM和RC模式。不支持本地回环传输。最大发送报文大小为4KB。 + RM模式有TAACK可靠保障,但无重传机制。 + RM模式可应用于热迁移与HCOM(自举建链公知 jetty)场景。 + + (2) jetty单路径模式:使用TP传输通道,传输模式为RC模式。支持本地回环传输。最大发送报文大小为64KB。 + RC模式可应用于URPC、dlock和HCOM(普通 jetty)场景。 + + (3) jfs/jfr 多路径模式:使用CTP传输通道,传输模式为RM模式。不支持本地回环传输。最大发送报文大小为4KB。 + RM模式有TAACK可靠保障,但无重传机制。 + +* URPC + * 超时机制 + 对请求/响应操作进行超时检测和控制,避免无限等待。 + * 禁用统计信息 + 关闭 URPC 统计功能,减少性能开销。在性能敏感或内存受限的场景下使用。 + * 连接保活机制 + 定期发送心跳,检测客户端与服务端的存活状态,避免死连接。 + * 获取函数信息 + 允许客户端获取服务端函数信息,便于动态发现与调用。 + * Channel多对一 + 一个客户端的多个Channel可共享同一个服务端的Channel。 + * UMQ消息队列 + 提供两种编程模型:1.消息入队/出队能力; 2.Post/Poll。 + * UMQ安全校验 + 支持开启报文基于Token安全校验能力。 + +* DLock + * 客户端管理 + DLock客户端进程可创建多个客户端实例,连接到DLock服务端。应用程序可以通过DLock提供的客户端管理API进行客户端库上下文初始化/反初始化、客户端实例注册/反注册等操作。 + * 服务端管理 + 应用程序可以通过DLock提供的服务端管理API进行服务端库上下文初始化/反初始化、Primary Server创建/销毁等操作。 + * 分布式锁管理 + 支持对原子锁、公平锁和读写锁的基本操作和批量操作,包括get_lock/release_lock/trylock/unlock/lock/lock_extend等基本分布式锁操作。 + * 分布式对象管理 + 支持分布式状态对象的创建、销毁、获取与释放等操作,支持对分布式状态对象的原子FAA/CAS操作、获取快照的操作。 + * 心跳检测 + DLock支持客户端和服务端之间的心跳检测。 + * 故障恢复 + DLock Primary Server故障后,支持创建一个新的Primary Server,从客户端恢复全局锁状态。 + * 安全传输 + DLock Client和DLock Server之间通信时,支持对传输内容进行加密保护。 + * DFX功能 + DLock提供日志打印以及异常统计信息查询的DFX功能。 + +* UMS + * Socket操作对接 + UMS向上兼容标准 Socket API,用户只需通过设置 socket 的协议族类型,即可基于UB网络使用标准socket API实现数据传输。 + * 设备发现 + 查找支持umdk的网络设备。 + * 链路管理 + 底层UB链路全声明生命管理,如创建、销毁等。 + * 连接管理 + UMS socket全生命周期管理,如创建、销毁等。 + * 数据收发 + 基于UMS socket实现数据的发送和接收。 + * DFX功能 + 提供DFX能力,支持链路中断检测、实时状态查看等能力。 + * ums_run透明替换工具 + 提供ums_run工具,支持用户在不修改应用代码的情况下使能UMS。 diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md new file mode 100644 index 0000000000000000000000000000000000000000..5e8a34795a0f0b2eeda007eca7b3f24bcea0b03c --- /dev/null +++ b/RELEASE-NOTES.md @@ -0,0 +1,74 @@ +Release Notes +=================== +Version +------------ +* v25.12.0 - 2025/12/30 + +New Features +------------ +* URMA + * Bonding Device Characteristics + (1) Jetty Multipath Mode: + 1. Uses CTP transmission channels with two modes: RM and RC. Local loopback transmission is not supported. + 2. Maximum message size: 4KB. + 3. RM Mode: Provides TAACK reliability guarantee but lacks retransmission mechanisms. Applicable to hot migration and HCOM scenarios (self-establishing jetty links). + + (2) Jetty Single-Path Mode: + 1. Uses TP transmission channels with RC mode only. Supports local loopback transmission. + 2. Maximum message size: 64KB. + 3. RC Mode: Applicable to URPC, dlock, and HCOM (standard jetty) scenarios. + + (3) JFS/JFR Multipath Mode: + 1. Uses CTP transmission channels with RM mode only. Local loopback transmission is not supported. + 2. Maximum message size: 4KB. + 3. RM Mode: Provides TAACK reliability guarantee but lacks retransmission mechanisms. + +* URPC + * Timeout Mechanism + Performs timeout detection and control on request/response operations to avoid infinite waiting. + * Disable Statistics + Turns off URPC statistics to reduce performance overhead. Used in performance-sensitive or memory-constrained scenarios. + * Connection Keep-Alive Mechanism + Sends heartbeats periodically to check the liveness of the client and server, preventing dead connections. + * Retrieve Function Information + Allows clients to obtain server-side function information for easier dynamic discovery and invocation. + * Channel Many-to-One + Multiple channels from a single client can share the same server channel. + * UMQ Message Queue + Provides two programming models: 1. Message enqueue/dequeue capability; 2. Post/Poll. + * UMQ Security Verification + Supports enabling token-based security verification for messages. + +* DLock + * Client Management + The DLock client process can create multiple client instances to connect to the DLock server. Applications can use the client management APIs provided by DLock to perform operations such as initializing/deinitializing the client library context and registering/deregistering client instances. + * Server Management + Applications can use the server management APIs provided by DLock to perform operations such as initializing/deinitializing the server library context and creating/destroying the Primary Server. + * Distributed Lock Management + Supports basic and batch operations for atomic locks, fair locks and read-write locks, including fundamental distributed lock operations such as get_lock, release_lock, trylock, unlock, lock, and lock_extend, and etc. + * Distributed Object Management + Supports operations such as creating, destroying, getting and releasing distributed objects. Also supports atomic FAA/CAS operations on distributed objects and snapshot retrieval. + * Heartbeat Detection + DLock supports heartbeat detection between client and server. + * Failure Recovery + In the event of a DLock Primary Server failure, a new Primary Server can be created to restore the global lock state from the clients. + * Secure Transmission + Communication between DLock Client and DLock Server supports encryption for content protection. + * DFX Functionality + DLock provides DFX features such as log printing and querying of exception statistics. + +* UMS + * Compatible with standard socket APIs + UMS maintains compatibility with standard Socket APIs. Users can seamlessly utilize standard socket APIs over the UB network simply by setting the protocol family type of the socket. + * Device Discovery + Find network devices supporting UMDK + * Link Management + Full lifecycle management of underlay UB links, including creation and destruction. + * Connection Management + Full lifecycle management of UMS socket, including creation and destruction. + * Data Transmission and Reception + Data sending and receiving based on UMS sockets. + * DFX Capability + Provides DFX capabilities, including link interruption detection and real-time status monitoring of UMS socket. + * Transparent Replacement Tool:ums_run + Provides the ums_run tool, enabling users to activate UMS without modifying application code. \ No newline at end of file diff --git a/umdk-25.12.0.tar.gz b/umdk-25.12.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..135de063b762ae8b41a655dfdf2b3ca0cc50856e Binary files /dev/null and b/umdk-25.12.0.tar.gz differ diff --git a/umdk-urma-1.3.0.tar.gz b/umdk-urma-1.3.0.tar.gz deleted file mode 100644 index 9bb99cecce0d97de48c7c76a8ff229614e89329d..0000000000000000000000000000000000000000 Binary files a/umdk-urma-1.3.0.tar.gz and /dev/null differ diff --git a/umdk-urma.spec b/umdk-urma.spec deleted file mode 100644 index ed72314eb831e7738ecd2ad1d3385d7a9a51861d..0000000000000000000000000000000000000000 --- a/umdk-urma.spec +++ /dev/null @@ -1,156 +0,0 @@ -# add --with transport_service_disable option, i.e. enable TPS by default -%bcond_with transport_service_disable - -%if %{defined kernel_version} - %define kernel_build_path /lib/modules/%{kernel_version}/build -%else - %define kernel_version %(uname -r) - %define kernel_build_path /lib/modules/%{kernel_version}/build -%endif -%define kernel_requires_version %(echo %{kernel_version} | awk -F"." 'OFS="."{$NF="";print}' | sed 's/\.$//g') - -%if %{undefined rpm_version} - %define rpm_version 1.3.0 -%endif - -%if %{undefined rpm_release} - %define rpm_release B003 -%endif - -Name : umdk-urma -Summary : Unified memory development kit -Version : %{rpm_version} -Release : %{rpm_release} -Group : nStack -License : Proprietary -Provides : Huawei Technologies Co., Ltd -Source0 : %{name}-%{version}.tar.gz -BuildRoot : %{_buildirootdir}/%{name}-%{version}-build -BuildArch : x86_64 aarch64 -ExclusiveArch : aarch64 -BuildRequires : rpm-build, make, cmake, gcc, gcc-c++, glibc-devel -BuildRequires : glib2-devel -Requires: glibc, glib2 -%if %{with asan} -Requires: libasan -%endif - -%description -A new system interconnect architecture - -%package lib -Summary: Basic URMA libraries of UMDK - -%description lib -This package contains basic URMA libraries of UMDK, such as liburma.so. - -%package devel -Summary: Include Files and Libraries mandatory for URMA -Requires: umdk-urma-lib = %{version} -AutoReqProv: on - -%description devel -This package contains all necessary include files and libraries needed -to develop applications that require the provided includes and -libraries. - -%package tools -Summary: tools of urma -Requires: umdk-urma-lib = %{version} -%description tools -tools of urma, contains urma_perftest, urma_admin. - -%if %{without transport_service_disable} -%package bin -Summary: binary file of urma -BuildRequires: gcc -Requires: glibc -%description bin -binary file of urma, contains tpsa_daemon. -%endif - -%prep -%setup -c -n %{name}-%{version} - -%build - cmake ./ -DCMAKE_INSTALL_PREFIX=/usr \ -%if %{with transport_service_disable} - -DTPS="disable" \ -%endif -%if %{defined kernel_version} - -DKERNEL_RELEASE=%{kernel_version} \ - -DKERNEL_PATH=%{kernel_build_path} \ -%endif - -make %{?_smp_mflags} - -%install -%{__rm} -rf %{buildroot} -make install DESTDIR=%{buildroot} - -%clean -%{__rm} -rf %{buildroot} - -%files lib -%defattr(-,root,root) - %{_libdir}/liburma.so - %{_libdir}/liburma.so.0 - %{_libdir}/liburma.so.0.0.1 - %{_libdir}/liburma_common.so - %{_libdir}/liburma_common.so.0 - %{_libdir}/liburma_common.so.0.0.1 - /etc/rsyslog.d/urma.conf - /etc/logrotate.d/urma - -%post lib -if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then - %{_bindir}/systemctl restart rsyslog >/dev/null 2>&1 -fi - -%files devel -%defattr(-,root,root) - %dir %{_includedir}/umdk - %dir %{_includedir}/umdk/common - %{_includedir}/umdk/urma_*.h - %{_includedir}/umdk/ub_errno.h - %{_includedir}/umdk/urma_provider.h - %{_includedir}/umdk/common/ub_*.h - %{_includedir}/umdk/common/urma_*.h - %{_includedir}/umdk/common/compiler.h - -%files tools -%defattr(-,root,root) - %{_bindir}/urma_perftest - %{_bindir}/urma_admin - /etc/rsyslog.d/urma_admin.conf - -%post tools -if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then - %{_bindir}/systemctl restart rsyslog >/dev/null 2>&1 -fi - -%if %{without transport_service_disable} -%files bin -%defattr(-,root,root) - %{_sbindir}/tpsa_daemon - /etc/rsyslog.d/tpsa.conf - /etc/logrotate.d/tpsa - %dir /etc/tpsa -%config(noreplace) /etc/tpsa/tpsa.ini -%post bin -if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then - %{_bindir}/systemctl restart rsyslog >/dev/null 2>&1 -fi -%endif - -%changelog -* Wed Oct 11 2023 Yizhen Fan - 1.3.0-B003 -- Type:bugfix -- DESC:change name of spec to umdk-urma - -* Wed Oct 11 2023 Yizhen Fan - 1.3.0-B002 -- Type:bugfix -- DESC:change name of spec to umdk; change arch that only support aarch64 - -* Tue Oct 10 2023 Yizhen Fan - 1.3.0-B001 -- Package init diff --git a/umdk.spec b/umdk.spec new file mode 100644 index 0000000000000000000000000000000000000000..9ae97026b93c9336f3235b7731581e473ab01a87 --- /dev/null +++ b/umdk.spec @@ -0,0 +1,495 @@ +# add --with asan option, i.e. disable asan by default +%bcond_with asan + +# add --with tsan option, i.e. disable tsan by default +%bcond_with tsan + +# add --with gcov option, i.e. disable gcov by default +%bcond_with gcov + +# add --with test option, i.e. disable test by default +%bcond_with test + +# add --with ubagg_disable option, i.e. enable ubagg by default +%bcond_with ubagg_disable + +# add --with release_enable option, i.e. disable release by default +%bcond_with release_enable + +# add --with urma option, i.e. disable urma by default +%bcond_with urma + +# add --with ums option, i.e. disable ums by default +%bcond_with ums + +# add --with urpc option, i.e. disable urpc by default +%bcond_with urpc + +# add --with dlock option, i.e. disable dlock by default +%bcond_with dlock + +%define build_all 1 + +%if %{with ums} || %{with urma} || %{with urpc} || %{with dlock} + %define build_all 0 +%endif + +%if %{defined kernel_version} + %define kernel_build_path /lib/modules/%{kernel_version}/build +%else + %define kernel_version %(uname -r) + %define kernel_build_path /lib/modules/%{kernel_version}/build +%endif +%define kernel_requires_version %(echo %{kernel_version} | awk -F"." 'OFS="."{$NF="";print}' | sed 's/\.$//g') + +%if %{undefined rpm_release} + %define rpm_release 0 +%endif + +Name : umdk +Summary : Unified memory development kit +Version : 25.12.0 +Release : %{rpm_release}%{?dist} +Group : umdk +License : Proprietary +Vendor : Huawei Technologies Co., Ltd +Source0 : %{name}-%{version}.tar.gz +BuildRoot : %{_buildirootdir}/%{name}-%{version}-build +buildArch : x86_64 aarch64 + +BuildRequires : rpm-build, make, cmake, gcc, gcc-c++, glibc-devel, openssl-devel, glib2-devel, libnl3-devel, kernel-devel, libummu-devel +Requires: glibc, glib2, libummu +%if %{with asan} +Requires: libasan +%endif +%if %{with tsan} +Requires: libtsan +%endif + +%description +A new system interconnect architecture + +%if %{build_all} || %{with urma} || %{with urpc} +%package urma-lib +Requires: libummu +Summary: Basic URMA libraries of UMDK + +%description urma-lib +This package contains basic URMA libraries of UMDK, such as liburma.so. + +%package urma-devel +Summary: Include Files and Libraries mandatory for URMA +AutoReqProv: on + +%description urma-devel +This package contains all necessary include files and libraries needed +to develop applications that require the provided includes and +libraries. + +%package urma-tools +Summary: tools of urma +Requires: umdk-urma-lib = %{version} +%description urma-tools +tools of urma, contains urma_perftest, urma_admin, ubagg_cli. + +%package urma-bin +Summary: binary file of urma +BuildRequires: gcc +Requires: glibc +%description urma-bin +binary file of urma + +%package urma-example +Summary: UMDK examples +Requires: umdk-urma-lib = %{version} +AutoReqProv: on +%description urma-example +This package contains all the executable examples of UMDK. + +%if %{with test} +%package urma-test +Summary: Include Libraries for URMA test +Requires: umdk-urma-lib = %{version} +AutoReqProv: on +%description urma-test +This package contains all necessary libraries needed +to develop applications based on urma_test. +%endif +%endif + +%if %{build_all} || %{with dlock} +%package dlock-lib +Summary: Library files of dlock +Requires: umdk-urma-lib = %{version} + +%description dlock-lib +This package contains the libdlock*.so files for the distributed lock feature. + +%package dlock-devel +Summary: Include development libraries and headers for dlock +Requires: umdk-dlock-lib = %{version} +AutoReqProv: on + +%description dlock-devel +This package contains all necessary include files and libraries needed +to develop applications based on dlock. + +%package dlock-example +Summary: Executable examples of dlock +Requires: umdk-dlock-lib = %{version} +AutoReqProv: on + +%description dlock-example +This package contains all the executable examples of dlock. + +%files dlock-example +%defattr(-,root,root) + %{_bindir}/dlock_primary_test + %{_bindir}/dlock_client_test + %{_bindir}/dlock_client_object_test +%endif + +%if %{build_all} || %{with urpc} +%package urpc-framework +Summary: URPC framework shared library +Requires: umdk-urma-lib +%description urpc-framework +This package contains the URPC framework shared libraries (e.g. liburpc.so). + +%package urpc-umq +Summary: URPC umq shared library +Requires: umdk-urma-lib +%description urpc-umq +This package contains the URPC umq shared libraries (e.g. libumq.so). + +%package urpc-framework-devel +Summary: URPC framework development headers +Requires: umdk-urpc-framework = %{version} +AutoReqProv: on +%description urpc-framework-devel +This package contains all necessary headers for URPC framework development. + +%package urpc-umq-devel +Summary: UMQ development headers +Requires: umdk-urpc-umq = %{version} +AutoReqProv: on +%description urpc-umq-devel +This package contains all necessary headers for UMQ development. + +%package urpc-framework-example +Summary: URPC framework example +Requires: umdk-urma-lib umdk-urpc-framework-devel = %{version} +AutoReqProv: on +%description urpc-framework-example +This package contains example for URPC framework. + +%package urpc-umq-example +Summary: UMQ example +Requires: umdk-urma-lib umdk-urpc-umq-devel = %{version} +AutoReqProv: on +%description urpc-umq-example +This package contains example for URPC umq. + +%package urpc-framework-tools +Summary: URPC framework tools +Requires: umdk-urma-lib umdk-urpc-framework-devel = %{version} +AutoReqProv: on +%description urpc-framework-tools +This package contains urpc_admin and related URPC framework tools. + +%package urpc-umq-tools +Summary: UMQ tools +Requires: umdk-urma-lib umdk-urpc-umq-devel = %{version} +AutoReqProv: on +%description urpc-umq-tools +This package contains umq_perftest and related UMQ tools. +%endif + +%if %{with ums} +%package ums +Summary: kmod file of ums +BuildRequires: glib2-devel, libnl3-devel +Requires: glib2, libnl3 +%description ums +kmod file of ums + +%package ums-tools +Summary: tools of ums +%description ums-tools +tools of ums, contains ums_run +%endif + +%if "%{build_all}" == "0" + %global debug_package %{nil} +%endif + +%prep +%setup -c -n %{name}-%{version} + +%build + cmake ./src/ -DCMAKE_INSTALL_PREFIX=/usr\ + -DBUILD_DATE=%{rpm_build_date} \ +%if %{with asan} + -DASAN="enable" \ +%endif +%if %{with tsan} + -DTSAN="enable" \ +%endif +%if %{with gcov} + -DCODE_COVERAGE="enable" \ +%endif +%if %{with release_enable} + -DRELEASE_ENABLE="enable" \ +%endif +%if %{with test} + -DURMA_TEST="enable" \ + -DRELEASE_ENABLE="disable" \ +%endif +%if %{defined kernel_version} + -DKERNEL_RELEASE=%{kernel_version} \ + -DKERNEL_PATH=%{kernel_build_path} \ +%endif +%if %{without ubagg_disable} + -DUB_AGG="enable" \ +%endif +%if %{with dfx_tool} + -DDFX_TOOL="enable" \ +%endif +%if %{build_all} + -DBUILD_ALL="enable" \ +%else + -DBUILD_ALL="disable" \ +%endif +%if %{build_all} || %{with urma} || %{with urpc} + -DBUILD_URMA="enable" \ +%else + -DBUILD_URMA="disable" \ +%endif +%if %{with ums} + -DBUILD_UMS="enable" \ +%endif +%if %{build_all} || %{with urpc} + -DBUILD_URPC="enable" \ +%else + -DBUILD_URPC="disable" \ +%endif +%if %{with dlock} + -DBUILD_DLOCK="enable" \ +%endif +%if %{without udma_stb64_disable} + -DUDMA_ST64B="enable" \ +%endif + +make %{?_smp_mflags} + +%install +%{__rm} -rf %{buildroot} +make install DESTDIR=%{buildroot} + +%if %{with gcov} + mkdir -p %{buildroot}/var/lib/umdk/gcov/%{name} + find %{_builddir} -name '*.gcno' -exec cp --parents {} %{buildroot}/var/lib/umdk/gcov/%{name} \; +%endif + +%clean +%{__rm} -rf %{buildroot} + +%if %{build_all} || %{with urma} || %{with urpc} +%files urma-lib +%defattr(-,root,root) + %{_libdir}/liburma.so.* + %{_libdir}/liburma_common.so.* + %{_libdir}/urma/liburma_ubagg.so.* + %{_libdir}/urma/liburma-udma.so + /etc/rsyslog.d/urma.conf + /etc/logrotate.d/urma + +%post urma-lib +if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then + %{_bindir}/systemctl restart rsyslog >/dev/null 2>&1 +fi + +%files urma-devel +%defattr(-,root,root) + %{_libdir}/liburma.so + %{_libdir}/liburma_common.so + %{_libdir}/urma/liburma_ubagg.so + %{_libdir}/urma/liburma-udma.so + %dir %{_includedir}/ub/umdk/urma + %dir %{_includedir}/ub/umdk/urma/udma + %{_includedir}/ub/umdk/urma/urma_*.h + %{_includedir}/ub/umdk/urma/uvs_api.h + %{_includedir}/ub/umdk/urma/udma/udma_u_ctl.h +%if %{with gcov} + %dir /var/lib/ub/umdk/urma/gcov/%{name} + /var/lib/ub/umdk/urma/gcov/%{name}/ +%endif + +%files urma-tools +%defattr(-,root,root) + %{_bindir}/urma_admin + /etc/rsyslog.d/urma_admin.conf + %{_bindir}/urma_perftest + %{_bindir}/ubagg_cli + +%post urma-tools +if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then + %{_bindir}/systemctl restart rsyslog >/dev/null 2>&1 +fi + +%files urma-bin +%defattr(-,root,root) + /etc/rsyslog.d/tpsa.conf + /etc/logrotate.d/tpsa + %{_libdir}/libtpsa.so + %{_libdir}/libtpsa.so.* +%post urma-bin +if [ -x %{_bindir}/systemctl ]; then + %{_bindir}/systemctl daemon-reload >/dev/null 2>&1 +fi +if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then + %{_bindir}/systemctl restart rsyslog >/dev/null 2>&1 +fi + +%files urma-example +%defattr(-,root,root) + %{_bindir}/urma_sample + %dir %{_docdir}/umdk-examples + %dir %{_docdir}/umdk-examples/urma_example + %{_docdir}/umdk-examples/urma_example/README.md +%endif + +%if %{build_all} || %{with urpc} +%files urpc-framework +%defattr(-,root,root) + %{_libdir}/liburpc_framework.so.* + /etc/rsyslog.d/urpc_framework.conf + /etc/logrotate.d/urpc_framework + +%files urpc-umq +%defattr(-,root,root) + %{_libdir}/libumq.so.* + %{_libdir}/libumq_buf.so.* + %{_libdir}/libumq_ub.so.* + %{_libdir}/libumq_ipc.so.* + /etc/rsyslog.d/umq.conf + /etc/logrotate.d/umq + +%files urpc-framework-devel +%defattr(-,root,root) + %{_libdir}/liburpc_framework.so + %dir %{_includedir}/ub + %dir %{_includedir}/ub/umdk + %dir %{_includedir}/ub/umdk/urpc + %{_includedir}/ub/umdk/urpc/urpc_framework_api.h + %{_includedir}/ub/umdk/urpc/urpc_framework_types.h + %{_includedir}/ub/umdk/urpc/urpc_framework_errno.h + +%files urpc-umq-devel +%defattr(-,root,root) + %{_libdir}/libumq.so + %{_libdir}/libumq_buf.so + %{_libdir}/libumq_ub.so + %{_libdir}/libumq_ipc.so + %dir %{_includedir}/ub + %dir %{_includedir}/ub/umdk + %dir %{_includedir}/ub/umdk/urpc + %dir %{_includedir}/ub/umdk/urpc/umq + %{_includedir}/ub/umdk/urpc/umq/umq_api.h + %{_includedir}/ub/umdk/urpc/umq/umq_errno.h + %{_includedir}/ub/umdk/urpc/umq/umq_pro_api.h + %{_includedir}/ub/umdk/urpc/umq/umq_pro_types.h + %{_includedir}/ub/umdk/urpc/umq/umq_types.h + +%files urpc-framework-example +%defattr(-,root,root) + %{_bindir}/urpc_framework_example + %dir %{_docdir}/umdk-examples/urpc_example/urpc_framework_example + +%files urpc-umq-example +%defattr(-,root,root) + %{_bindir}/umq_example + %dir %{_docdir}/umdk-examples/urpc_example/umq_example + +%files urpc-framework-tools +%defattr(-,root,root) + %{_bindir}/urpc_admin + %{_bindir}/urpc_framework_perftest + +%files urpc-umq-tools +%defattr(-,root,root) + %{_bindir}/umq_perftest +%endif + +%if %{build_all} || %{with dlock} +%files dlock-lib +%defattr(-,root,root) + %{_libdir}/libdlockm.so.* + %{_libdir}/libdlocks.so.* + %{_libdir}/libdlockc.so.* + +%files dlock-devel +%defattr(-,root,root) + %{_libdir}/libdlockm.so + %{_libdir}/libdlocks.so + %{_libdir}/libdlockc.so + %dir %{_includedir}/ub + %dir %{_includedir}/ub/umdk + %dir %{_includedir}/ub/umdk/ulock + %dir %{_includedir}/ub/umdk/ulock/dlock + %{_includedir}/ub/umdk/ulock/dlock/dlock_client_api.h + %{_includedir}/ub/umdk/ulock/dlock/dlock_types.h + %{_includedir}/ub/umdk/ulock/dlock/dlock_server_api.h +%endif + +%if %{with ums} +%files ums +%defattr(-,root,root) + %dir /lib/modules/%{kernel_version}/extra/ums/ + /lib/modules/%{kernel_version}/extra/ums/ums.ko + /etc/modules-load.d/ums.conf + +%post ums +if [ -d /lib/modules/$(uname -r)/kernel/net/smc ]; then + %{__rm} -rf /lib/modules/$(uname -r)/kernel/net/smc +fi +if [[ %{kernel_version} != $(uname -r) ]]; then + %dir /lib/modules/$(uname -r)/weak-updates/drivers/ums/ + echo "/lib/modules/%{kernel_version}/extra/ums/ums.ko" | /sbin/weak-modules --add-module --no-initramfs --verbose +fi + +echo "omit_drivers+=\" ums \"" > /etc/dracut.conf.d/ums.conf + +/sbin/depmod -a $(uname -r) + +%postun ums +if [ $1 -eq 0 ]; then + if [[ %{kernel_version} != $(uname -r) ]]; then + if [ -d /lib/modules/$(uname -r)/weak-updates/drivers ]; then + %{__rm} -rf /lib/modules/$(uname -r)/weak-updates/drivers/ums/ums.ko + %{__rm} -rf /lib/modules/$(uname -r)/weak-updates/drivers/ums/ + else + %{__rm} -rf /lib/modules/$(uname -r)/weak-updates/ums/ums.ko + %{__rm} -rf /lib/modules/$(uname -r)/weak-updates/ums/ + fi + fi +fi +/sbin/depmod -a $(uname -r) + +%files ums-tools +%defattr(-,root,root) + /usr/lib/libums-preload.so + /usr/bin/ums_run + +%post ums-tools + +%postun ums-tools +if [ $1 -eq 0 ]; then + [ -f /usr/lib/libums-preload.so ] && %{__rm} -f /usr/lib/libums-preload.so || : + [ -f /usr/bin/ums_run ] && %{__rm} -f /usr/bin/ums_run || : +fi +%endif + +%changelog +* Tue Dec 30 2025 umdk +-Initial UMDK-25.12.0 rpm spec file.