LCOV - code coverage report
Current view: top level - base_comm/resources/endpoints - urma_endpoint.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 2 0
Test Date: 2026-08-04 10:52:23 Functions: 0.0 % 1 0

            Line data    Source code
       1              : /**
       2              :  * Copyright (c) 2025 Huawei Technologies Co., Ltd.
       3              :  * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
       4              :  * CANN Open Software License Agreement Version 2.0 (the "License").
       5              :  * Please refer to the License for details. You may not use this file except in compliance with the License.
       6              :  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
       7              :  * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
       8              :  * See LICENSE in the root of the software repository for the full text of the License.
       9              :  */
      10              : #ifndef URMA_ENDPOINT_H
      11              : #define URMA_ENDPOINT_H
      12              : 
      13              : #include <memory>
      14              : #include <vector>
      15              : #include <string>
      16              : #include "endpoint.h"
      17              : #include "ccu_channel_ctx_pool.h"
      18              : #include "socket/socket.h"
      19              : #include "externalinput_pub.h"
      20              : #include "proc_reged_mem_mgr_cache.h"
      21              : #include <mutex>
      22              : 
      23              : namespace hcomm {
      24              : /**
      25              :  * @note 职责:Host CPU通信引擎+RoCE协议的通信设备Endpoint,管理通信设备上下文,以及设备上的注册内存。
      26              :  */
      27              : class UrmaEndpoint : public Endpoint {
      28              : public:
      29              :     explicit UrmaEndpoint(const EndpointDesc &endpointDesc);
      30              :     ~UrmaEndpoint() noexcept override;
      31              : 
      32              :     HcclResult Init() override;
      33              : 
      34              :     HcclResult ServerSocketListen(const uint32_t port) override;
      35              :     HcclResult ServerSocketStopListen(const uint32_t port) override;
      36              :     inline HcclResult ServerSocketStopListenImpl(const uint32_t port);
      37              :     HcclResult ServerSocketGetListenPort(uint32_t *port) override;
      38              : 
      39            0 :     std::shared_ptr<RegedMemMgr> GetRegedMemMgr() override {
      40            0 :         return regedMemMgr_;
      41              :     }
      42              : 
      43              :     CcuChannelCtxPool *GetCcuChannelCtxPool();
      44              : 
      45              :     HcclResult RegisterMemory(HcommMem mem, const char *memTag, void **memHandle) override;
      46              :     HcclResult UnregisterMemory(void* memHandle) override;
      47              :     HcclResult MemoryExport(void *memHandle, void **memDesc, uint32_t *memDescLen) override;
      48              :     HcclResult MemoryImport(const void *memDesc, uint32_t descLen, HcommMem *outMem) override;
      49              :     HcclResult MemoryUnimport(const void *memDesc, uint32_t descLen) override;
      50              :     HcclResult GetAllMemHandles(void **memHandles, uint32_t *memHandleNum) override;
      51              :     HcclResult GetAsyncEvents(uint32_t devPhyId, struct AsyncEvent events[], uint32_t &num) override;
      52              : 
      53              : private:
      54              :     std::mutex portMutex_;
      55              :     u32 dynamicPort_{HCCL_INVALID_PORT};
      56              :     std::unique_ptr<CcuChannelCtxPool> ccuChannelCtxPool_{nullptr};
      57              :     MemMgrCacheKey cacheKey_{};
      58              : };
      59              : }
      60              : 
      61              : #endif // URMA_ENDPOINT_H
        

Generated by: LCOV version 2.0-1