LCOV - code coverage report
Current view: top level - legacy/ascend910/platform/resource/transport/host - transport_ibverbs_pub.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 11.1 % 36 4
Test Date: 2026-08-04 10:52:23 Functions: 28.6 % 7 2

            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              : 
      11              : #ifndef LINK_IBV_EXP_PUB_H
      12              : #define LINK_IBV_EXP_PUB_H
      13              : 
      14              : #include <functional>
      15              : #include <mutex>
      16              : 
      17              : #include "../host/transport_net_pub.h"
      18              : #include "network/hccp_common.h"
      19              : #include "workflow_pub.h"
      20              : #include "private_types.h"
      21              : #include "adapter_hccp.h"
      22              : #include "universal_concurrent_map.h"
      23              : 
      24            0 : inline void CopyAiWQInfo(struct HcclAiRMAWQ& dest, const struct AiDataPlaneWq& source, DBMode dbMode, u32 sl)
      25              : {
      26            0 :     dest.wqn = source.wqn;
      27            0 :     dest.bufAddr = source.bufAddr;
      28            0 :     dest.wqeSize = source.wqebbSize;
      29            0 :     dest.depth = source.depth;
      30            0 :     dest.headAddr = source.headAddr;
      31            0 :     dest.tailAddr = source.tailAddr;
      32            0 :     dest.dbMode = dbMode;
      33            0 :     if (dbMode == DBMode::SW_DB) {
      34            0 :         dest.dbAddr = source.swdbAddr;
      35            0 :     } else if (dbMode == DBMode::HW_DB) {
      36            0 :         dest.dbAddr = source.dbReg;
      37              :     }
      38            0 :     dest.sl = sl;
      39            0 :     HCCL_INFO("CopyAiWQInfo: wqn[%u] bufAddr[%p] wqeSize[%u] depth[%u] headAddr[%p] tailAddr[%p] dbMode[%u]",
      40              :         dest.wqn, dest.bufAddr, dest.wqeSize, dest.depth, dest.headAddr, dest.tailAddr, dest.dbMode);
      41            0 :     return;
      42              : }
      43              :  
      44            0 : inline void CopyAiCQInfo(struct HcclAiRMACQ& dest, const AiDataPlaneCq& source, DBMode dbMode)
      45              : {
      46            0 :     dest.cqn = source.cqn;
      47            0 :     dest.bufAddr = source.bufAddr;
      48            0 :     dest.cqeSize = source.cqeSize;
      49            0 :     dest.depth = source.depth;
      50            0 :     dest.headAddr = source.headAddr;
      51            0 :     dest.tailAddr = source.tailAddr;
      52            0 :     dest.dbMode = dbMode;
      53            0 :     if (dbMode == DBMode::SW_DB) {
      54            0 :         dest.dbAddr = source.swdbAddr;
      55            0 :     } else if (dbMode == DBMode::HW_DB) {
      56            0 :         dest.dbAddr = source.dbReg;
      57              :     }
      58              : 
      59            0 :     HCCL_INFO("CopyAiCQInfo: cqn[%u] bufAddr[%p] cqeSize[%u] depth[%u] headAddr[%p] tailAddr[%p] dbMode[%u]",
      60              :         dest.cqn, dest.bufAddr, dest.cqeSize, dest.depth, dest.headAddr, dest.tailAddr, dest.dbMode);
      61            0 :     return;
      62              : }
      63              : namespace hccl {
      64              : // WQE payload类型, 区分 notify 模式与数据类型模式
      65              : enum class WqeType {
      66              :     WQE_TYPE_DATA,            // 发送数据类型的WQE
      67              :     WQE_TYPE_DATA_NOTIFY,     // 发送数据同步 Notify 的WQE
      68              :     WQE_TYPE_ACK_NOTIFY,      // 发送信息同步 Notify 的WQE
      69              :     WQE_TYPE_DATA_ACK_NOTIFY, // 发送数据接收确认 Notify 的WQE
      70              :     WQE_TYPE_DATA_WITH_NOTIFY, // 带有Notify信息的数据WQE
      71              :     WQE_TYPE_DATA_WITH_REDUCE, // 带有Reduce信息的数据WQE
      72              :     WQE_TYPE_READ_DATA,        // 读数据类型的WQE
      73              :     WQE_TYPE_RESEERVED
      74              : };
      75              : 
      76              : using WqeInfo = struct TagWqeInfo {
      77              :     struct SendWrlistDataExt wqeData{};
      78              :     u64 wqeType;
      79              :     u64 wqeDataOffset;
      80              :     u32 notifyId;
      81            1 :     TagWqeInfo() : wqeType(static_cast<u64>(WqeType::WQE_TYPE_DATA)), wqeDataOffset(0), notifyId(INVALID_UINT)
      82              :     {
      83            1 :         wqeData = {0};
      84            1 :     }
      85              : };
      86              : 
      87              : struct CombineQpHandle {
      88              :     QpHandle qpHandle = nullptr;
      89              :     u32 preWrOpcode = INVALID_UINT; // 记录这个qp内最后一次下发的wr的opcode
      90            0 :     CombineQpHandle() {};
      91            0 :     CombineQpHandle(QpHandle& qpHandle) : qpHandle(qpHandle) {};
      92              : };
      93              : 
      94              : struct CombineQpInfo {
      95              :     struct AiQpInfo aiQpInfo{};
      96              :     u32 preWrOpcode = INVALID_UINT; // 记录这个qp内最后一次下发的wr的opcode
      97           28 :     CombineQpInfo() {};
      98            0 :     CombineQpInfo(struct AiQpInfo& aiQpInfo) : aiQpInfo(aiQpInfo) {};
      99              : };
     100              : 
     101              : namespace {
     102              : constexpr u32 WAIT_US_COUNT = 1000;
     103              : constexpr s32 REG_VALID = 1;
     104              : // QP flag
     105              : constexpr s32 QP_FLAG_RC = 0; // flag: 0 = RC, 1= UD,其它预留
     106              : // QP mode
     107              : constexpr s32 NORMAL_QP_MODE = 0;  // 普通的QP模式,但时不用
     108              : constexpr s32 OFFLINE_QP_MODE = 1; // 下沉模式的QP
     109              : constexpr s32 OPBASE_QP_MODE = 2;  // 单算子模式的QP
     110              : constexpr s32 OFFLINE_QP_MODE_EXT = 3;  // 下沉模式(910B/910_93)QP
     111              : constexpr s32 OPBASE_QP_MODE_EXT = 4;  // 单算子模式(910B/910_93)的QP
     112              : 
     113              : // RDMA op type
     114              : constexpr s32 RDMA_OP_WRITE = 0;
     115              : constexpr s32 RDMA_OP_READ = 4;
     116              : constexpr u32 RDMA_SEND_WRLIST_MAX_COUNT = 10;
     117              : // RDMA multi QP
     118              : constexpr u32 RDMA_ADDR_ALIGNMENT = 128;
     119              : constexpr u32 RDMA_INVALID_QP_INDEX = 0xFFFF;
     120              : 
     121              : // RDMA Write With Reduce DataType and OpType
     122              : // reduceType: 0x0:int8 0x1:int16 0x2:int32 0x6:fp16 0x7:fp32 0x8:bf16
     123              : enum class RdmaReduceDataType : uint8_t {
     124              :     RDMA_REDUCE_DATA_INT8 = 0,
     125              :     RDMA_REDUCE_DATA_INT16 = 1,
     126              :     RDMA_REDUCE_DATA_INT32 = 2,
     127              :     RDMA_REDUCE_DATA_FP16 = 6,
     128              :     RDMA_REDUCE_DATA_FP32 = 7,
     129              :     RDMA_REDUCE_DATA_BF16 = 8,
     130              :     RDMA_REDUCE_DATA_INVALID = 255
     131              : };
     132              : // reduce_op: 0x0:max 0x1:min 0x2:sum
     133              : enum class RdmaReduceOpType : uint8_t {
     134              :     RDMA_REDUCE_OP_MAX = 0,
     135              :     RDMA_REDUCE_OP_MIN = 1,
     136              :     RDMA_REDUCE_OP_SUM = 2,
     137              :     RDMA_REDUCE_OP_INVALID = 255
     138              : };
     139              : 
     140              : constexpr uint8_t RDMA_REDUCE_DATA_TYPE_TABLE[HCCL_DATA_TYPE_RESERVED] = {
     141              :     static_cast<uint8_t>(RdmaReduceDataType::RDMA_REDUCE_DATA_INT8),
     142              :     static_cast<uint8_t>(RdmaReduceDataType::RDMA_REDUCE_DATA_INT16),
     143              :     static_cast<uint8_t>(RdmaReduceDataType::RDMA_REDUCE_DATA_INT32),
     144              :     static_cast<uint8_t>(RdmaReduceDataType::RDMA_REDUCE_DATA_FP16),
     145              :     static_cast<uint8_t>(RdmaReduceDataType::RDMA_REDUCE_DATA_FP32),
     146              :     static_cast<uint8_t>(RdmaReduceDataType::RDMA_REDUCE_DATA_INVALID),
     147              :     static_cast<uint8_t>(RdmaReduceDataType::RDMA_REDUCE_DATA_INVALID),
     148              :     static_cast<uint8_t>(RdmaReduceDataType::RDMA_REDUCE_DATA_INVALID),
     149              :     static_cast<uint8_t>(RdmaReduceDataType::RDMA_REDUCE_DATA_INVALID),
     150              :     static_cast<uint8_t>(RdmaReduceDataType::RDMA_REDUCE_DATA_INVALID),
     151              :     static_cast<uint8_t>(RdmaReduceDataType::RDMA_REDUCE_DATA_INVALID),
     152              :     static_cast<uint8_t>(RdmaReduceDataType::RDMA_REDUCE_DATA_BF16)
     153              : };
     154              : constexpr uint8_t RDMA_REDUCE_OP_TYPE_TABLE[HCCL_REDUCE_RESERVED] = {
     155              :     static_cast<uint8_t>(RdmaReduceOpType::RDMA_REDUCE_OP_SUM),
     156              :     static_cast<uint8_t>(RdmaReduceOpType::RDMA_REDUCE_OP_INVALID),
     157              :     static_cast<uint8_t>(RdmaReduceOpType::RDMA_REDUCE_OP_MAX),
     158              :     static_cast<uint8_t>(RdmaReduceOpType::RDMA_REDUCE_OP_MIN)
     159              : };
     160              : }
     161              : 
     162              : class TransportIbverbs : public TransportNet {
     163              : public:
     164              :     explicit TransportIbverbs(DispatcherPub *dispatcher,
     165              :                         const std::unique_ptr<NotifyPool> &notifyPool,
     166              :                         MachinePara &machinePara,
     167              :                         std::chrono::milliseconds timeout);
     168              :     ~TransportIbverbs() override;
     169              : 
     170              :     HcclResult Init() override;
     171              : 
     172              :     HcclResult DeInit() override;
     173              : 
     174              :     HcclResult Stop() override;
     175              :  
     176              :     HcclResult Resume() override;
     177              : 
     178              :     HcclResult TxAsync(UserMemType dstMemType, u64 dstOffset, const void *src, u64 len,
     179              :                                   Stream &stream) override;
     180              :     HcclResult TxAsync(std::vector<TxMemoryInfo>& txMems, Stream &stream) override;
     181              : 
     182              :     HcclResult RxAsync(UserMemType srcMemType, u64 srcOffset, void *dst, u64 len,
     183              :                                   Stream &stream) override;
     184              :     HcclResult RxAsync(std::vector<RxMemoryInfo>& rxMems, Stream &stream) override;
     185              : 
     186              :     HcclResult DataReceivedAck(Stream &stream) override;
     187              : 
     188              :     HcclResult TxAck(Stream &stream) override;
     189              :     HcclResult RxAck(Stream &stream) override;
     190              : 
     191              :     HcclResult TxDataSignal(Stream &stream) override;
     192              :     HcclResult RxDataSignal(Stream &stream) override;
     193              : 
     194              :     HcclResult TxWaitDone(Stream &stream) override;
     195              :     HcclResult TxWithReduce(UserMemType dstMemType, u64 dstOffset, const void *src, u64 len,
     196              :                               const HcclDataType datatype, HcclReduceOp redOp, Stream &stream) override;
     197              :     HcclResult TxWithReduce(const std::vector<TxMemoryInfo> &txWithReduceMems, const HcclDataType datatype,
     198              :         HcclReduceOp redOp, Stream &stream) override;
     199              :     bool IsSupportTransportWithReduce() override;
     200              :     HcclResult GetIndOpRemoteMemDetails(MemDetails** remoteMem, uint32_t *memNum, HcclMemType memType) override;
     201              :     HcclResult GetIndOpRemoteMem(HcclMem **remoteMem, uint32_t *memNum) override;
     202              :     HcclResult GetRemoteMem(UserMemType memType, void **remotePtr) override;
     203              :     HcclResult GetRemoteMemSize(UserMemType memType, u64 &size) override;
     204              : 
     205              :     HcclResult TxPrepare(Stream &stream) override;
     206              :     HcclResult RxPrepare(Stream &stream) override;
     207              : 
     208              :     HcclResult TxData(UserMemType dstMemType, u64 dstOffset, const void *src, u64 len,
     209              :                                   Stream &stream) override;
     210              :     HcclResult RxData(UserMemType srcMemType, u64 srcOffset, void *dst, u64 len,
     211              :                                   Stream &stream) override;
     212              : 
     213              :     HcclResult TxDone(Stream &stream) override;
     214              :     HcclResult RxDone(Stream &stream) override;
     215              : 
     216              :     HcclResult WriteAsync(struct Transport::Buffer &remoteBuf, struct Transport::Buffer &localBuf, Stream &stream);
     217              :     HcclResult WriteSync(struct Transport::Buffer &remoteBuf, struct Transport::Buffer &localBuf, Stream &stream);
     218              : 
     219              :     HcclResult WriteReduceAsync(struct Transport::Buffer &remoteBuf, struct Transport::Buffer &localBuf,
     220              :         const HcclDataType datatype, HcclReduceOp redOp, Stream &stream);
     221              : 
     222              :     HcclResult ReadAsync(struct Transport::Buffer &localBuf, struct Transport::Buffer &remoteBuf, Stream &stream);
     223              :     HcclResult ReadSync(struct Transport::Buffer &localBuf, struct Transport::Buffer &remoteBuf, Stream &stream);
     224              : 
     225              :     HcclResult PostReady(Stream &stream);
     226              :     HcclResult WaitReady(Stream &stream);
     227              : 
     228              :     HcclResult PostFin(Stream &stream);
     229              :     HcclResult WaitFin(Stream &stream);
     230              : 
     231              :     HcclResult PostFinAck(Stream &stream);
     232              :     HcclResult WaitFinAck(Stream &stream);
     233              : 
     234              :     HcclResult Post(u32 notifyIdx, Stream &stream) override;
     235              :     HcclResult Wait(u32 notifyIdx, Stream &stream, const u32 timeOut = NOTIFY_INVALID_WAIT_TIME) override;
     236              : 
     237              :     static HcclResult GetTransportErrorCqe(const HcclNetDevCtx netDevCtx,
     238              :         std::vector<std::pair<TransportBase*, CqeInfo>> &infos, u32 &num);
     239              :     HcclIpAddress& GetRemoteIp();
     240              :     HcclResult GetTransportId(u32 &id) override;
     241              : 
     242              :     HcclResult Fence() override;
     243              :     HcclResult ExchangeCapabilityHybrid();
     244              :     HcclResult GetDrainRemSrcMem(void* &remoteAddr, uint32_t &remoteKey, uint32_t &size) override;
     245              :     HcclResult Drain(Stream &stream) override;
     246              : protected:
     247              :     HcclResult GetRemoteAddr(MemType memType, u8*& exchangeDataPtr, u64& exchangeDataBlankSize);
     248              :     HcclResult GetIndOpRemoteAddr(u8*& exchangeDataPtr, u64& exchangeDataBlankSize);
     249              :     HcclResult GetRemoteNotifyAddr(u8*& exchangeDataPtr, u64& exchangeDataBlankSize, MemMsg& memMsg);
     250              :     HcclResult FillExchangeDataTotalSize() override;
     251              :     HcclResult ConstructExchangeForSend() override;
     252              :     HcclResult ParseReceivedExchangeData() override;
     253              : 
     254              :     HcclResult DestroyQP(QpHandle& qpHandle);
     255              :     HcclResult DestroyQP();
     256              :     HcclResult DeRegMR();
     257              :     void DeRegMRForQPhandles(MemMsg& memMsg);
     258              :     HcclResult DeRegOneMR(QpHandle& qpHandle, MemMsg& memMsg);
     259              :     // 初始化
     260              :     HcclResult GetNotifySize();
     261              :     s32 GetQpMode();
     262              :     bool UseMultiQp();
     263              :     HcclResult CreateQp(); // 创建QP
     264              :     HcclResult CreateSingleQp(s32 qpMode);  // 两个rank之间仅创建一个QP
     265              :     HcclResult CreateMultiQp(s32 qpMode, u32 qpsPerConnection);  // 两个rank之间创建多QP
     266              :     HcclResult ConnectSingleQp(std::function<bool()> needStop = []() { return false; });
     267              :     HcclResult ConnectMultiQp(u32 qpsPerConnection, std::function<bool()> needStop = []() { return false; });
     268              :     HcclResult ConnectQp();
     269              :     HcclResult InitQpConnect();
     270              :     HcclResult GetQpAttr();
     271              :     std::vector<u32> RdmaLengthSplit(u32 length, u32 splitNum);
     272              : 
     273              :     HcclResult TxSendDataAndNotifyWithMultiQP(std::vector<WqeInfo>& wqeInfoVec, u32 acturalMultiQpNum,
     274              :         Stream &stream, bool useOneDoorbell = false);
     275              : 
     276              :     HcclResult GetWqeDataOffsetAndNotifyId(WqeType wqeType, u64 &wqeDataOffset, u32 &notifyId);
     277              : 
     278              :     HcclResult SendWqeList(QpHandle qpHandle, u32 wqeNum, struct SendWrlistDataExt *wqelist,
     279              :         struct SendWrRsp *opRsp);
     280              :     bool IsSupportRdmaNotify();
     281              :     bool IsTemplateMode();
     282              :     void DestroySignal();
     283              :     HcclResult IsUseQpCreateWithAttrs(bool &isUseQpCreateWithAttrs, s32 qpMode);
     284              :     HcclResult GetNicHandle();
     285              :     u32 GetQpsPerConnection();
     286              :     virtual HcclResult TxSendWqe(void *dstMemPtr, const void *srcMemPtr, u64 srcMemSize, Stream &stream, WqeType wqeType);
     287              :     virtual HcclResult TxSendNotifyWqe(MemMsg& memMsg, const void *srcMemPtr, u64 srcMemSize, Stream &stream);
     288              :     virtual HcclResult RegUserMem(MemType memType, u8*& exchangeDataPtr, u64& exchangeDataBlankSize);
     289              :     virtual HcclResult RegCustomUserMem(u8*& exchangeDataPtr, u64& exchangeDataBlankSize);
     290              :     virtual HcclResult RegCustomUserMemWithMsg(void *addr, u64 size, MemMsg &memMsg, 
     291              :         u8 *&exchangeDataPtr, u64 &exchangeDataBlankSize);
     292              :     HcclResult CreateNotifyBuffer(std::shared_ptr<LocalIpcNotify> &localNotify, MemType notifyType,
     293              :         u8*& exchangeDataPtr, u64& exchangeDataBlankSize, NotifyLoadType notifyLoadType = NotifyLoadType::HOST_NOTIFY);
     294              :     HcclResult CreateNotifyVectorBuffer(std::vector<std::shared_ptr<LocalIpcNotify>>& notifyVector,
     295              :         u8*& exchangeDataPtr, u64& exchangeDataBlankSize);
     296              :     HcclResult CreateNotifyValueBuffer();
     297              :     HcclResult CreateOneQp(s32 qpMode, u32 qpsPerConnection, QpHandle &qpHandle, AiQpInfo &aiQpInfo,
     298              :         bool useAicpu = false, u32 udpSport = 0);
     299              :     HcclResult AddWqeList(void *dstMemPtr, const void *srcMemPtr, u64 srcMemSize, WqeType wqeType,
     300              :         WrAuxInfo &aux, std::vector<WqeInfo> &wqeInfoVec);
     301              :     virtual HcclResult GetMemInfo(UserMemType memType, void **dstMemPtr, u64 *dstMemSize);
     302              :     virtual HcclResult TxPayLoad(UserMemType dstMemType, u64 dstOffset, const void *src, u64 len,
     303              :         WqeType wqeType, WrAuxInfo &aux, std::vector<WqeInfo>& wqeInfoVec);
     304              :     virtual HcclResult TxSendDataAndNotifyWithSingleQP(std::vector<WqeInfo>& wqeInfoVec,
     305              :         Stream &stream, bool useOneDoorbell = false);
     306              :     virtual HcclResult TxSendDataAndNotify(std::vector<WqeInfo>& wqeInfoVec, Stream &stream, bool useOneDoorbell = false);
     307              :     virtual HcclResult TxWqeList(std::vector<WqeInfo> &wqeInfoVec, Stream &stream,
     308              :             std::vector<struct SendWrRsp> &opRspVec, u32 multiQpIndex = RDMA_INVALID_QP_INDEX);
     309              :     virtual HcclResult RdmaSendAsync(std::vector<WqeInfo> &wqeInfoVec, Stream &stream,
     310              :         bool useOneDoorbell = false, u32 multiQpIndex = RDMA_INVALID_QP_INDEX);
     311              :     HcclResult RdmaSendAsyncHostNIC(std::vector<WqeInfo> &wqeInfoVec, Stream &stream);
     312              :     virtual HcclResult RdmaSendAsync(struct SendWr &wr, Stream &stream, WqeType wqeType, u64 notifyOffset, u32 notifyId);
     313              :     HcclResult RdmaSendAsyncHostNIC(struct SendWrlistDataExt &wr, Stream &stream, WqeType wqeType, u64 notifyOffset);
     314              : 
     315              :     HcclResult GetLocalNotify(std::vector<HcclSignalInfo> &localNotify) override;
     316              :     HcclResult GetLocalRdmaNotify(std::vector<HcclSignalInfo> &rdmaNotify) override;
     317              :     HcclResult GetDrainLocalDataNotify(void* &localAddr, uint32_t& lkey, HcclSignalInfo &dataNotify) override; // 仅获取dataNotify
     318              :     HcclResult GetRemoteRdmaNotifyAddrKey(std::vector<AddrKey> &rdmaNotifyAddr) override;
     319              :     HcclResult GetLocalNotifyValueAddrKey(std::vector<AddrKey> &notifyValue) override;
     320              :     HcclResult GetRemoteMemKey(UserMemType memType, uint32_t *remoteMemKey) override;
     321              :     HcclResult GetLocalMemDetails(UserMemType memType, MemDetails &memDetails) override;
     322              :     HcclResult GetAiQpInfo(std::vector<HcclQpInfoV2> &aiQpInfo) override;
     323              :     HcclResult GetAiRMAQueueInfo(std::vector<HcclAiRMAQueueInfo> &aiRMAQueueInfo) override;
     324              :     HcclResult ConstructPayLoadWqe(void *dstMemPtr, const void *src, u64 len,
     325              :         WqeType wqeType, WrAuxInfo &aux, std::vector<WqeInfo>& wqeInfoVec, u32 txSendDataTimes);
     326              :     u32 GetActualQpNum(u32 maxLength);
     327              :     HcclResult WriteCommon(const void *remoteAddr, const void *localAddr, u64 length, Stream &stream,
     328              :         WqeType wqeType, struct WrAuxInfo &aux);
     329              : 
     330              :     virtual void ModifyAtomicWriteAfterReduce(u32 &preWrOpcode, u64 wqeType, u32 &opcode, u32 &immData);
     331              : 
     332              :     static std::array<DeviceMem, MAX_MODULE_DEVICE_NUM> notifyValueMem_;
     333              :     static std::array<std::mutex, MAX_MODULE_DEVICE_NUM> notifyValueMutex_;
     334              :     const u64 notifyValueSize_{LARGE_PAGE_MEMORY_MIN_SIZE}; // 避免申请小页内存。最小2*1024*1024
     335              :     static std::array<Referenced, MAX_MODULE_DEVICE_NUM> instanceRef_; // 实例计数,用于释放静态资源
     336              : 
     337              :     bool isHybridMode_ = false;           // 是否为混合模式:hostNic -- DeviceNic
     338              :     std::vector<CombineQpHandle> combineQpHandles_;
     339              :     std::vector<CombineQpHandle> multiCombineQpHandles_;
     340              : 
     341              :     CombineQpInfo combineAiQpInfo_{};
     342              :     std::vector<CombineQpInfo> combineAiQpInfos_;
     343              :     u32 qpsPerConnection_;
     344              :     u32 notifySize_;
     345              : 
     346              :     std::shared_ptr<LocalIpcNotify> ackNotify_;
     347              :     std::shared_ptr<LocalIpcNotify> dataAckNotify_;
     348              : 
     349              :     s32 access_;
     350              : 
     351              :     std::array<MemMsg, static_cast<u32>(MemType::MEM_TYPE_RESERVED)> memMsg_;
     352              :     std::array<MemMsg, static_cast<u32>(MemType::MEM_TYPE_RESERVED)> remoteMemMsg_;
     353              : 
     354              :     std::vector<MemMsg> userDeviceMemMsg_;
     355              :     std::vector<MemMsg> userHostMemMsg_;
     356              : 
     357              :     std::vector<MemMsg> remoteUserDeviceMemMsg_;
     358              :     std::vector<MemMsg> remoteUserHostMemMsg_;   
     359              :     std::unique_ptr<HcclMem[]> remoteMemsPtr_;
     360              :     u32 remoteMemsNum_;
     361              :     std::mutex remoteMemsMutex_;
     362              : 
     363              :     MemMsg remoteDataNotifyMsg_;
     364              :     std::shared_ptr<LocalIpcNotify> dataNotify_;
     365              : 
     366              :     std::vector<std::shared_ptr<LocalIpcNotify>> multiQpDataNotify_;
     367              :     std::vector<MemMsg> multiQpDataNotifyMemMsg_;
     368              :     std::vector<MemMsg> multiQpDataNotifyRemoteMemMsg_;
     369              : 
     370              :     std::vector<MemMsg> userRemoteNotifyMsg_;
     371              : 
     372              :     std::vector<std::vector<MemMsg>> userMultiQpRemoteNotifyMsg_;
     373              :     std::vector<std::vector<std::shared_ptr<LocalIpcNotify>>> userMultiQpLocalNotify_;
     374              : 
     375              :     HcclWorkflowMode workFlowMode_; // 工作模式
     376              :     u32 sqeCounter_;
     377              :     u32 currentQP_;
     378              : 
     379              :     std::vector<MrHandle> mrHandles_;
     380              :     RdmaHandle nicRdmaHandle_{nullptr};
     381              :     bool fence_{false};
     382              : 
     383              :     DevType localDeviceType{DevType::DEV_TYPE_COUNT};
     384              : 
     385              :     QPMode qpMode_{QPMode::INVALID}; // 是否为普通QP模式
     386              : 
     387              : private:
     388              :     static void ProcessCqeInfo(const s32 deviceId, const struct CqeErrInfo *infolist, const u32 cqeNum,
     389              :         std::vector<std::pair<TransportBase*, CqeInfo>> &infos);
     390              :     // bit[63:32] devicePhyId, bit[31:0] qpn
     391              :     static UniversalConcurrentMap<u64, TransportIbverbs*> g_qpn2IbversLinkMap_;
     392              :     static bool g_flag;
     393              :     static bool g_isSupCqeErrInfoListConfig;
     394              :     static u32 cqeErrQpn_;
     395              :     bool isCapture_{false};
     396              : };
     397              : }  // namespace hccl
     398              : 
     399              : #endif /* LINK_IBV_EXP_PUB_H */
        

Generated by: LCOV version 2.0-1