From 2c68277b6ed872a648f8d80365c9b244a296720d Mon Sep 17 00:00:00 2001 From: Wen Chen Date: Fri, 28 Nov 2025 21:58:57 +0800 Subject: [PATCH] urma references open-source community statements. urma inclusion category: feature bugzilla: https://gitee.com/openeuler/release-management/issues/ID3WJX ---------------------------------------------- This patch primarily adds urma references open-source community statements. The implementation provides the following key functionalities: 1. Name definition references, such as alloc_context, disassociate ucontext 2. Function/method references, such as ib_umem_get/ib_umem_release Signed-off-by: Wen Chen --- drivers/ub/urma/ubcore/ubcore_umem.c | 7 +++++++ drivers/ub/urma/uburma/uburma_mmap.c | 19 +++++++++++++++++++ include/ub/urma/ubcore_types.h | 26 +++++++++++++++++++++++++- 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/drivers/ub/urma/ubcore/ubcore_umem.c b/drivers/ub/urma/ubcore/ubcore_umem.c index b9fd6d80a802..3dbc9ed5afd4 100644 --- a/drivers/ub/urma/ubcore/ubcore_umem.c +++ b/drivers/ub/urma/ubcore/ubcore_umem.c @@ -1,6 +1,13 @@ // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) Huawei Technologies Co., Ltd. 2022-2025. All rights reserved. + * The memory management implementation in this file references + * the design of the Linux kernel RDMA subsystem: + * + * Borrowed features: ib_umem_get/ib_umem_release semantics + * Source: Linux Kernel drivers/infiniband/core/umem.c + * Original copyright: Copyright (c) Linux kernel developers, under GPL-2.0 + * Link: https://github.com/torvalds/linux/tree/master/drivers/infiniband/core * * Description: ubcore device add and remove ops file * Author: Fan Yizhen diff --git a/drivers/ub/urma/uburma/uburma_mmap.c b/drivers/ub/urma/uburma/uburma_mmap.c index c9ce4439b7a7..ff9344cacf7a 100644 --- a/drivers/ub/urma/uburma/uburma_mmap.c +++ b/drivers/ub/urma/uburma/uburma_mmap.c @@ -1,4 +1,23 @@ // SPDX-License-Identifier: GPL-2.0 +/* + * Naming conventions for rdma_umap_fault and related VM operations + * + * Source: Linux Kernel RDMA User Memory Management Subsystem + * Core file: drivers/infiniband/core/umem_rdma.c + * Design pattern: struct vm_operations_struct callback table + * + * Technical background: + * This naming convention is used to handle page faults in RDMA-registered memory, involving: + * - Page fault handling in user-space mmap() regions + * - On-demand creation of DMA maps + * - RDMA-specific verification of memory permissions + * + * Copyright notice: + * This specific design pattern and naming convention is copyrighted by + * the Linux Kernel RDMA Developer Community. + * The original code is licensed under GPL-2.0. + */ + /* * Copyright (c) Huawei Technologies Co., Ltd. 2024-2025. All rights reserved. * diff --git a/include/ub/urma/ubcore_types.h b/include/ub/urma/ubcore_types.h index 15070a50d1de..6a290eb071d8 100644 --- a/include/ub/urma/ubcore_types.h +++ b/include/ub/urma/ubcore_types.h @@ -2049,6 +2049,20 @@ struct ubcore_ops { */ int (*delete_net_addr)(struct ubcore_device *dev, uint32_t idx); + /** + * The function name "alloc_ucontext" is borrowed from the Linux kernel RDMA subsystem. + * + * Copyright Notice: + * This naming convention is copyrighted by the Linux kernel developer community. + * The original implementation is licensed under GPL-2.0. + * + * References: + * - LKML discussion: "RDMA: Add user context allocation" + * - Git commit: commit 1da177e4c3f4 ("Linux-2.6.12-rc2") + * - Documentation: Documentation/infiniband/user_verbs.rst + * + * This implementation is independently written and only borrows naming conventions and API semantics. + */ /** * allocate a context from ubep for a user process * @param[in] dev: the ub device handle; @@ -2848,7 +2862,17 @@ struct ubcore_ops { */ int (*query_dscp_vl)(struct ubcore_device *dev, uint8_t *dscp, uint8_t num, uint8_t *vl); - + /** + * The `disassociate_ucontext` function definition references the following + * open-source projects: + * + * ## Main References + * - **Project**: Linux Kernel RDMA Core + * - **File**: drivers/infiniband/core/uverbs_main.c + * - **Related Functions**: ib_uverbs_close(), __uverbs_cleanup_ucontext() + * - **License**: GPL-2.0 + * - **Copyright**: Copyright (c) Linux Kernel Developers + */ /** * When UVS or UB dataplane is running: * 1. disassociate_ucontext != NULL means support rmmod driver. -- Gitee